We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently, the minifier removes parentheses enclosing an object and a template literal.
object
template literal
In this case, the minifier also removes parentheses within a try statement, causing a syntax error.
try
try { ( { 0 : 0 } ``); } catch {}
{ "jsc": { "parser": { "syntax": "ecmascript", "jsx": false }, "target": "es2022", "loose": false, "minify": { "compress": { "arguments": false, "arrows": true, "booleans": true, "booleans_as_integers": false, "collapse_vars": true, "comparisons": true, "computed_props": true, "conditionals": true, "dead_code": true, "directives": true, "drop_console": false, "drop_debugger": true, "evaluate": true, "expression": false, "hoist_funs": false, "hoist_props": true, "hoist_vars": false, "if_return": true, "join_vars": true, "keep_classnames": false, "keep_fargs": true, "keep_fnames": false, "keep_infinity": false, "loops": true, "negate_iife": true, "properties": true, "reduce_funcs": false, "reduce_vars": false, "side_effects": true, "switches": true, "typeofs": true, "unsafe": false, "unsafe_arrows": false, "unsafe_comps": false, "unsafe_Function": false, "unsafe_math": false, "unsafe_symbols": false, "unsafe_methods": false, "unsafe_proto": false, "unsafe_regexp": false, "unsafe_undefined": false, "unused": true, "const_to_let": true, "pristine_globals": true } } }, "module": { "type": "es6" }, "minify": false, "isModule": false }
https://play.swc.rs/?version=1.10.9&code=H4sIAAAAAAAAAyspqlSoVuBSAAINIMNAwQqIaxUSEjStFbhqFZITS5IzFKprAeLD84EnAAAA&config=H4sIAAAAAAAAA32UwZLaMAyG730KJuceOhx66AP0ts%2FgMbYczDpWxpJZMju8exUnsHRROAX06ZdsSdbnj92uO5Hr%2Fuw%2B5af8GW0hKPf%2FYqEps72IpQM3WHIljtz9vNETzSjYRNBM14V0bEsP3FS0%2F7Xfr4ouIRLcFKttiDmG6TGnw2EsQPRgE6uErANkpv%2F1Kyv4MQMu9dF%2BQExg8wtiLJmYGXooWmCHKdmRwJxtUaLMJ7UlEmopZlgZvBkLjirPPnLELDmfqQfrjUMPCooFHMczaDLJJbJMcj3lPg17ONS%2Bb33%2BpoazTdWykhMurSVyWiXqESOxCTVrJVzgRg0WuBb3uzIGU4Bryc%2B6E8a80ZN3AKlAskTZDqDFbR5B5mlLHV4qYw4ysjwpXOZbu2WGXopqYgxKZefKQOGodbOArw7myjrtOCveKB9FDwZCkFlRQtNHZHfUkvI0AgYFSH9t0KZqAeb%2BCjf4%2FCBe4L9yS9YHbPUYLB%2B3KU3DAdOLBAPwEf0LB2kF4zYusiUu4zav2YOMBnjVpVIDz0tAHgCjSW1fPs2GPA%2BJaPqEh681sTpc1%2B%2FjZ7a1LdwN6GvbAetun9u6bOTf3ZfTbfnez9tFerspl8V%2B%2FQdL7qcXKAYAAA%3D%3D
No response
try { ( { 0 : 0 } ``); // there should be parentheses } catch {}
try { { 0: 0 }``; } catch {}
1.10.9
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
Currently, the minifier removes parentheses enclosing an
object
and atemplate literal
.In this case, the minifier also removes parentheses within a
try
statement, causing a syntax error.Input code
Config
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.10.9&code=H4sIAAAAAAAAAyspqlSoVuBSAAINIMNAwQqIaxUSEjStFbhqFZITS5IzFKprAeLD84EnAAAA&config=H4sIAAAAAAAAA32UwZLaMAyG730KJuceOhx66AP0ts%2FgMbYczDpWxpJZMju8exUnsHRROAX06ZdsSdbnj92uO5Hr%2Fuw%2B5af8GW0hKPf%2FYqEps72IpQM3WHIljtz9vNETzSjYRNBM14V0bEsP3FS0%2F7Xfr4ouIRLcFKttiDmG6TGnw2EsQPRgE6uErANkpv%2F1Kyv4MQMu9dF%2BQExg8wtiLJmYGXooWmCHKdmRwJxtUaLMJ7UlEmopZlgZvBkLjirPPnLELDmfqQfrjUMPCooFHMczaDLJJbJMcj3lPg17ONS%2Bb33%2BpoazTdWykhMurSVyWiXqESOxCTVrJVzgRg0WuBb3uzIGU4Bryc%2B6E8a80ZN3AKlAskTZDqDFbR5B5mlLHV4qYw4ysjwpXOZbu2WGXopqYgxKZefKQOGodbOArw7myjrtOCveKB9FDwZCkFlRQtNHZHfUkvI0AgYFSH9t0KZqAeb%2BCjf4%2FCBe4L9yS9YHbPUYLB%2B3KU3DAdOLBAPwEf0LB2kF4zYusiUu4zav2YOMBnjVpVIDz0tAHgCjSW1fPs2GPA%2BJaPqEh681sTpc1%2B%2FjZ7a1LdwN6GvbAetun9u6bOTf3ZfTbfnez9tFerspl8V%2B%2FQdL7qcXKAYAAA%3D%3D
SWC Info output
No response
Expected behavior
Actual behavior
Version
1.10.9
Additional context
No response
The text was updated successfully, but these errors were encountered: