requested changes
This commit is contained in:
parent
f8e3bab500
commit
1080d53f68
|
|
@ -151,11 +151,11 @@ function minify(files, options) {
|
||||||
toplevel = toplevel.wrap_commonjs(options.wrap);
|
toplevel = toplevel.wrap_commonjs(options.wrap);
|
||||||
}
|
}
|
||||||
if (timings) timings.rename = Date.now();
|
if (timings) timings.rename = Date.now();
|
||||||
if (options.rename) {
|
// disable rename on harmony due to expand_names bug in for-of loops
|
||||||
// disable rename on harmony due to expand_names bug in for-of loops
|
// https://github.com/mishoo/UglifyJS2/issues/2794
|
||||||
// https://github.com/mishoo/UglifyJS2/issues/2794
|
if (0 && options.rename) {
|
||||||
//toplevel.figure_out_scope(options.mangle);
|
toplevel.figure_out_scope(options.mangle);
|
||||||
//toplevel.expand_names(options.mangle);
|
toplevel.expand_names(options.mangle);
|
||||||
}
|
}
|
||||||
if (timings) timings.compress = Date.now();
|
if (timings) timings.compress = Date.now();
|
||||||
if (options.compress) toplevel = new Compressor(options.compress).compress(toplevel);
|
if (options.compress) toplevel = new Compressor(options.compress).compress(toplevel);
|
||||||
|
|
|
||||||
|
|
@ -766,6 +766,7 @@ function OutputStream(options) {
|
||||||
|| p instanceof AST_Arrow // x => (x, x)
|
|| p instanceof AST_Arrow // x => (x, x)
|
||||||
|| p instanceof AST_DefaultAssign // x => (x = (0, function(){}))
|
|| p instanceof AST_DefaultAssign // x => (x = (0, function(){}))
|
||||||
|| p instanceof AST_Expansion // [...(a, b)]
|
|| p instanceof AST_Expansion // [...(a, b)]
|
||||||
|
|| p instanceof AST_ForOf && this === p.object // for (e of (foo, bar)) {}
|
||||||
;
|
;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -1041,18 +1042,14 @@ function OutputStream(options) {
|
||||||
self._do_print_body(output);
|
self._do_print_body(output);
|
||||||
});
|
});
|
||||||
DEFPRINT(AST_ForIn, function(self, output){
|
DEFPRINT(AST_ForIn, function(self, output){
|
||||||
var is_for_of = self instanceof AST_ForOf;
|
|
||||||
var is_for_of_sequence = is_for_of && self.object instanceof AST_Sequence;
|
|
||||||
output.print("for");
|
output.print("for");
|
||||||
output.space();
|
output.space();
|
||||||
output.with_parens(function(){
|
output.with_parens(function(){
|
||||||
self.init.print(output);
|
self.init.print(output);
|
||||||
output.space();
|
output.space();
|
||||||
output.print(is_for_of ? "of" : "in");
|
output.print(self instanceof AST_ForOf ? "of" : "in");
|
||||||
output.space();
|
output.space();
|
||||||
if (is_for_of_sequence) output.print("(");
|
|
||||||
self.object.print(output);
|
self.object.print(output);
|
||||||
if (is_for_of_sequence) output.print(")");
|
|
||||||
});
|
});
|
||||||
output.space();
|
output.space();
|
||||||
self._do_print_body(output);
|
self._do_print_body(output);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user