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

functions defined inside "if" statement are not correctly processed #3051

Closed
hubo1016 opened this issue Apr 4, 2018 · 1 comment
Closed

Comments

@hubo1016
Copy link

hubo1016 commented Apr 4, 2018

Bug report or feature request?

Bug

ES5 or ES6+ input?

ES5

Uglify version (uglifyjs -V)

uglify-js 3.3.13

JavaScript input

function test(a){
    if(a){
        function test2(x){
            return a + x;
        }
    }else{
        function test2(x){
            return x;
        }
    }
    return test2(1);
}

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

uglifyjs --compress -- ./test.js

JavaScript output or error produced.

function test(a){if(a);else;return 1}
@alexlamsl
Copy link
Collaborator

The example behaves correctly when run on JavaScript platforms, i.e. when not interpreted as ES6+

See #1666.

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

No branches or pull requests

2 participants