Skip to content
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

corner case with collapse_vars on undefined #2298

Closed
alexlamsl opened this issue Sep 3, 2017 · 2 comments · Fixed by #2299
Closed

corner case with collapse_vars on undefined #2298

alexlamsl opened this issue Sep 3, 2017 · 2 comments · Fixed by #2299
Labels

Comments

@alexlamsl
Copy link
Collaborator

alexlamsl commented Sep 3, 2017

Bug report or feature request?

Bug report

ES5 or ES6+ input?

ES5

Uglify version (uglifyjs -V)

uglify-js 3.0.28

JavaScript input

var c = 0;

!function() {
    function f7() {
        var Math_1_1 = undefined;
        var undefined = Math_1_1++;
        try {
            !function f8(bar_1) {
                bar_1[true] = "foo";
            }();
        } catch (e) {
            c = c + 1;
        }
    }
    f7();
}();

console.log(c);

The uglifyjs CLI command executed or minify() options used.

uglifyjs test.js -b bracketize -c

JavaScript output or error produced.

$ echo test.js | node
1

$ uglifyjs test.js -b bracketize -c | node
0
@alexlamsl alexlamsl added the bug label Sep 3, 2017
alexlamsl added a commit to alexlamsl/UglifyJS that referenced this issue Sep 3, 2017
Avoid collision with local variable `undefined` under certain corner cases.

fixes mishoo#2298
alexlamsl added a commit that referenced this issue Sep 3, 2017
Avoid collision with local variable `undefined` under certain corner cases.

fixes #2298
@kzc
Copy link
Contributor

kzc commented Sep 4, 2017

Good to see the fuzzer is still finding bugs.

@alexlamsl
Copy link
Collaborator Author

@kzc indeed - though I'll need to wait for next weekend before trying to make a release again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants