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
NUglify version: 1.20.7 Reproduced in tiny console app in .NET 7.0
Describe the bug When using ?? in combination with || the necessary parentheses are removed in the minified code.
??
||
To Reproduce Uglify.Js("if ((a ?? b ?? c) || await d()) {}");
Uglify.Js("if ((a ?? b ?? c) || await d()) {}");
Minified output or stack trace Output code: a??b??c||await d() which results in the JavaScript exception Uncaught SyntaxError: Unexpected token '||'.
a??b??c||await d()
Uncaught SyntaxError: Unexpected token '||'
Expected output code (a??b??c)||await d() The parentheses around a??b??c cannot be removed.
(a??b??c)||await d()
The text was updated successfully, but these errors were encountered:
It's probably treating the operator precedence for ?? the same as ||.
You can easily change this, make a PR
Sorry, something went wrong.
No branches or pull requests
NUglify version: 1.20.7
Reproduced in tiny console app in .NET 7.0
Describe the bug
When using
??
in combination with||
the necessary parentheses are removed in the minified code.To Reproduce
Uglify.Js("if ((a ?? b ?? c) || await d()) {}");
Minified output or stack trace
Output code:
a??b??c||await d()
which results in the JavaScript exceptionUncaught SyntaxError: Unexpected token '||'
.Expected output code
(a??b??c)||await d()
The parentheses around a??b??c cannot be removed.
The text was updated successfully, but these errors were encountered: