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
When jsc.minify.compress.passes > 1 and jsx.minify.mangle.reserved includes a reserved name - SWC can produce code that semantically invalid with the same variable being definied multiple times.
Describe the bug
When
jsc.minify.compress.passes > 1
andjsx.minify.mangle.reserved
includes a reserved name - SWC can produce code that semantically invalid with the same variable being definied multiple times.Input code
Config
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.4.0&code=H4sIAAAAAAAAA0utKMgvKlFIK81LLsnMz1NIy8%2FXSM7PS9FUqOZSUMhJLVEoSi1OLSpLTVGwVTC0BoplpikgqVBAljcCyddygcRKSovyFKJhcjoKSYlFEF2x1ly1XFxw%2B%2BDi2OwzJmCfCZp9MCmQFQByNT4O2QAAAA%3D%3D&config=H4sIAAAAAAAAA1WOQQ6DIBBF956CzLqL1qRd9A49QdMFwdFgQMgMNhrj3YsoajeEeX%2F%2Bnz8VQkDLCp5iit84eEmMtM%2BR8NgFOUQCqKxkRdoHuGS15UWqpWFMaF4VCJIaDMnF5fV23xxgnGPMjo1Z3el6PN9UznpC5hNL3ZhxYeXG5r2GlV1j8H89BiB9sYr0fQyf7C3ym1LAuqo%2FJUAYPa71H3As5aZ7fdD8ys5APRbzD1wt6BJUAQAA
SWC Info output
No response
Expected behavior
SWC produces valid code
Actual behavior
SWC produces broken code:
Version
1.4.0
Additional context
Note: When targetting es5 the output uses
var
so it does not crash in a browser.For comparison the 1 pass code:
1 pass code with no reserved names:
2 pass code with no reserved names:
The text was updated successfully, but these errors were encountered: