-
-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
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
bug: possible side effect in optional param is ignored #880
Comments
Cool, thanks for reporting! |
Reduced example Complete CLI command or {
module: true,
}
function causeSideEffect(a = console.log('sideEffect')) {}
causeSideEffect();
Expected result console.log('sideEffect') |
Appreciate it! |
I'm working on this currently, it's going OK, but don't expect too much as I'm not very familiar with the code base. |
It seems pretty hard to me, after writing a test and trolling through the code. Side effects in default assignments have to be treated specially, but there's lots of places where arguments are just assumed (without calling any methods to find out) to have no side effects. |
Bug report or Feature request?
bug report
Version (complete output of
terser -V
or specific git commit)latest repl
Complete CLI command or
minify()
options usedterser
inputThe text was updated successfully, but these errors were encountered: