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
Given this expression yield* (0, async_iterator) SWC will remove the parentheses and turn it into yield* 0, async_iterator, probably in an effort to remove bytes.
However, the precedence makes that actually say (yield* 0), async_iterator which is wrong and causing issues.
This only happened by "doing a second pass" of SWC I guess?
So we built code to a library using parcel (parcel build with scope hoisting). Then we included that library in a project and built (parcel serve) it again and everything fell apart due to the aforementioned issue.
The text was updated successfully, but these errors were encountered:
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
Given this expression
yield* (0, async_iterator)
SWC will remove the parentheses and turn it intoyield* 0, async_iterator
, probably in an effort to remove bytes.However, the precedence makes that actually say
(yield* 0), async_iterator
which is wrong and causing issues.Input code
Config
Using parcel, I can share parcel config if needed. The issue is also reproducible on the REPL, please see attached link.
Playground link
https://play.swc.rs/?version=1.2.237&code=H4sIAAAAAAAAA23MwQrCMBCE4XueYo67RcTWY9B3CTGRwJIFGyOl9N2LEaIHb8PA%2F7l5yR7xmX1JmgdIqEFG4tUASwpyw2j7nL7zbM1mjPtXTz%2F1ADodOsotok9FjMsVq4n6gHu5VMhrngsqNHaoSe9fJRxF71SbsTGx3QGHOfQjuwAAAA%3D%3D&config=H4sIAAAAAAAAA02OsQ6DMAxEfwV5ZmgZOjB37UdYwUGpQoxsFxWh%2FHsTCmo3%2B3z3fBs81UG%2FwYyiJHXSNRm%2BoQdbZ1InYTZowbRIHqNSLotgUs8yVX%2BkEd16J8eCxgVh8qIWhlN4kOGAhn9xlJGsfCDtLt210COz0mFoYQop%2BLWyHU%2BzkOrvhGmMpzMX1sTDqwrbXndn3iD%2FGEcu6OMwfttRWvbM3qTgIaJac218EPL8bhYSDZwg5w%2Bx293IIgEAAA%3D%3D
Expected behavior
When exececuted, logs
to the console
Expected output code by SWC:
Actual behavior
When executed throws with:
Uncaught (in promise) TypeError: 0 is not iterable
Actual output code by SWC:
Version
1.2.237
Additional context
This only happened by "doing a second pass" of SWC I guess?
So we built code to a library using parcel (
parcel build
with scope hoisting). Then we included that library in a project and built (parcel serve
) it again and everything fell apart due to the aforementioned issue.The text was updated successfully, but these errors were encountered: