TypeScript Version: 3.6.3
Search Terms: helper rename
Code
// @target: es2015
declare function __awaiter(): void;
class C {
async func() {
}
}
Expected behavior:
Some sort of error is emitted (when the target requires the helper) notifying the user that the generated code will not work OR maybe the helper is emitted with an alternative name.
Actual behavior:
The emit declares an __awaiter function, but attempts to call __awaiter_1.
Playground Link: here
Related Issues:
Fix: Add more underscores 😅
Is there any news on this? I ran into a similar issue when an npm package I pulled in already had the helper __awaiter defined so calls changed to __awaiter_1 but no __awaiter_1 function ever got defined. Had to write a hack post-build script to set __awaiter_1 = __awaiter after compilation, would be great if this got fixed.
This looks to be a duplicate of #33269, which was fixed by #36541.
Most helpful comment
Fix: Add more underscores 😅