When minifying the following function
module.exports = function outer() {
var myFunction = function myFunction() {
myFunction();
};
myFunction();
};
with the following incantation
./node_modules/.bin/uglifyjs --compress '' file.js -o minified.js
Then the following warning will be emitted: WARN: Dropping unused variable myFunction
This is not correct, because the variable is used inside the recursive call. Furthermore, this will generate invalid code that references myFunction inside the function call and you will get an undefined variable error at runtime
We've confirmed that this broke in the most recent build (2.8.8)
When minifying the following function
with the following incantation
./node_modules/.bin/uglifyjs --compress '' file.js -o minified.jsThen the following warning will be emitted:
WARN: Dropping unused variable myFunctionThis is not correct, because the variable is used inside the recursive call. Furthermore, this will generate invalid code that references
myFunctioninside the function call and you will get an undefined variable error at runtimeWe've confirmed that this broke in the most recent build (2.8.8)