@@ -2579,6 +2579,8 @@ merge(Compressor.prototype, {
|
|||||||
}
|
}
|
||||||
if (node instanceof AST_Scope) return node;
|
if (node instanceof AST_Scope) return node;
|
||||||
if (!(node instanceof AST_Statement)) return node;
|
if (!(node instanceof AST_Statement)) return node;
|
||||||
|
}, function(node) {
|
||||||
|
if (node instanceof AST_For && is_empty(node.init)) node.init = null;
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -989,3 +989,37 @@ conditional_assignments_3: {
|
|||||||
}
|
}
|
||||||
expect_stdout: "PASS"
|
expect_stdout: "PASS"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_3856: {
|
||||||
|
options = {
|
||||||
|
booleans: true,
|
||||||
|
conditionals: true,
|
||||||
|
if_return: true,
|
||||||
|
join_vars: true,
|
||||||
|
sequences: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
console.log(function() {
|
||||||
|
(function() {
|
||||||
|
var a;
|
||||||
|
if (!a) {
|
||||||
|
a = 0;
|
||||||
|
for (var b; !console;);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (a) return 1;
|
||||||
|
})();
|
||||||
|
}());
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
console.log(function() {
|
||||||
|
(function() {
|
||||||
|
var a, b;
|
||||||
|
if (a) return !!a;
|
||||||
|
for (a = 0; !console;);
|
||||||
|
return 0;
|
||||||
|
})();
|
||||||
|
}());
|
||||||
|
}
|
||||||
|
expect_stdout: "undefined"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user