You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using esbuild to transform async/await into a promise+generator to support async zone support (we use a patched Promise.prototype.then to snapshot/restore the async zone). I'm passing --supported:async-await=false, which works correctly for regular async functions. But it transforms async generators into an incorrect result.
The __async helper is consuming the entire generator without yielding to the caller when it encounters a yield in the wrapped async generator. I later realized that setting --support:async-generator=false will actually throw an error at build time because downleveling is unsupported. I think transforming async generators when async-await=false is a bug, but ideally I'd like to see support for downleveling async generators.
This bug is due to you telling esbuild that async generator functions are supported natively but that async isn't supported natively, which is nonsensical. I can fix the bug to make this a build error so that esbuild no longer lets you do this.
I'm using esbuild to transform async/await into a promise+generator to support async zone support (we use a patched
Promise.prototype.then
to snapshot/restore the async zone). I'm passing--supported:async-await=false
, which works correctly for regular async functions. But it transforms async generators into an incorrect result.The
__async
helper is consuming the entire generator without yielding to the caller when it encounters ayield
in the wrapped async generator. I later realized that setting--support:async-generator=false
will actually throw an error at build time because downleveling is unsupported. I think transforming async generators whenasync-await=false
is a bug, but ideally I'd like to see support for downleveling async generators.The text was updated successfully, but these errors were encountered: