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
SarahAnnTolsma
changed the title
Incorrectly captured this when destructuring Promise.all
Incorrectly captured this when destructuring async result
Feb 12, 2024
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Describe the bug
When destructuring the result of a call to
Promise.all()
, thethis
context is captured incorrectly. This results in a runtime error.Input code
Config
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.4.0&code=H4sIAAAAAAAAA7WOQQ6CMBBF95xilpAYDiDqGVy4MywGGLRJZUg7RY3h7kKRGnTjxr9oOv2vk0e3lo1AqdFaOJCV6BHBkNYVWpWA9t6UUGAVJ2vYG74oS5uOVbXz1MSO0SRQM8MWatSWsig0R%2F%2BeDw1eUcm8JUWt4wB5cDGNkbOy6fA7TlaLLg9Tkvlr789v8RPzT%2Bb%2FcAxqk5ZRHQq9vDz%2F1iqYNWHzaWZInGlAjKN5V%2F8EpDjXyrABAAA%3D&config=H4sIAAAAAAAAA1VPSQ7DIAy88wrkcw9tpV76hz4CUSciYhN2pKIofw%2BkkDY3exbPeBFSwkQannIpY1miSoTp2AtC2bP6FAQ4RySdTGS4dJapUoOyhDu0fhlglUbk6kK6X2%2BP5gAbAmF3NMwZb4b8n6mDiwmJzsIqVX60eE4ULRVceM872X6pfWuDcs0FPxH8lD3xuA6GXt3OaUaxbkujvRocAQAA
SWC Info output
No response
Expected behavior
Both the
good
andbad
functions should correctly capturethis
by using_this.foo()
in the call toPromise.all()
.Actual behavior
Only
good
is transpiling correctly, andbad
is usingthis.
, which will beundefined
at runtime due to the use of_async_to_generator
.Version
1.4.0
Additional context
This bug does not exist on 1.3.7
The text was updated successfully, but these errors were encountered: