Bug report or feature request?
Bug report.
ES5 or ES6+ input?
ES5.
Uglify version (uglifyjs -V)
uglify-js 3.3.2
JavaScript input
function newObject() {
var object;
return object = {
method: function() {
return object;
}
};
}
The uglifyjs CLI command executed or minify() options used.
uglifyjs -c < index.js
JavaScript output or error produced.
function newObject(){var object;return{method:function(){return object}}}
As shown the generated compressed code is missing the assignment to object in the return statement, and thus object is always undefined and the code is broken.
@mbostock thanks for the detailed report - investigating.
Most helpful comment
@mbostock thanks for the detailed report - investigating.