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
Current Behavior
Using a spread operator on a Set as described in the MDN docs while setting "loose": true for @babel/preset-env transpiles to the following:
Expected behavior/code
I would expect some sort of conversion from Set to Array before calling concat, similar to the approach with loose mode disabled.
Possible Solution
With loose mode enabled it seems like the spread transform assumes all sets are transpiled to arrays. I don't think that's always the case though, depending on the browser's being targeted. I don't have a solution to propose, but hopefully these details can help.
Additional context/Screenshots
none
The text was updated successfully, but these errors were encountered:
Hey @joeporpeglia! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.
If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.
That is the expected behavior of loose, since the goal of loose is to simplify the assumptions that Babel makes about spec compliance. I would not recommend loose unless you've looked through all the plugins you're using to see if the limitations it imposes are actually something you'd want.
Bug Report
Current Behavior
Using a spread operator on a Set as described in the MDN docs while setting
"loose": true
for@babel/preset-env
transpiles to the following:Input Code
Expected behavior/code
I would expect some sort of conversion from
Set
toArray
before calling concat, similar to the approach withloose
mode disabled.Babel Configuration (.babelrc, package.json, cli command)
Environment
Possible Solution
With
loose
mode enabled it seems like the spread transform assumes all sets are transpiled to arrays. I don't think that's always the case though, depending on the browser's being targeted. I don't have a solution to propose, but hopefully these details can help.Additional context/Screenshots
none
The text was updated successfully, but these errors were encountered: