Created
June 13, 2018 18:19
-
-
Save jennings/3214ab40ea609cef026a1d1082dbe64b to your computer and use it in GitHub Desktop.
UglifyJS reproduction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fn1() { | |
return function fn2(ARG1) { | |
return callApi({ foo: ARG1 }) | |
.then(handler); | |
function handler(response) { | |
const obj = { PROP: response }; | |
return (inlinedFunction(obj.PROP)) | |
.then(fn3()); | |
} | |
function fn3() { | |
return WRONG_VARIABLE_AFTER_MINIFICATION(ARG1) | |
} | |
} | |
function inlinedFunction(ARG1) { | |
return callApi(ARG1) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fn1() { | |
return function(ARG1) { | |
return callApi({ foo: ARG1 }).then(function(response) { | |
return ((ARG1 = response), callApi(ARG1)).then( | |
WRONG_VARIABLE_AFTER_MINIFICATION(ARG1) | |
); | |
var ARG1; | |
}); | |
}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "uglify-repro", | |
"version": "1.0.0", | |
"main": "index.js", | |
"author": "Stephen Jennings", | |
"license": "MIT", | |
"scripts": { | |
"build": "uglifyjs input.js -o output.js --compress && prettier --write output.js" | |
}, | |
"dependencies": { | |
"prettier": "^1.13.5", | |
"uglify-es": "^3.3.9" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment