@@ -1974,6 +1974,7 @@ merge(Compressor.prototype, {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function foldable(expr) {
|
function foldable(expr) {
|
||||||
|
if (expr instanceof AST_Assign && expr.right.single_use) return;
|
||||||
var lhs_ids = Object.create(null);
|
var lhs_ids = Object.create(null);
|
||||||
var marker = new TreeWalker(function(node) {
|
var marker = new TreeWalker(function(node) {
|
||||||
if (node instanceof AST_SymbolRef) lhs_ids[node.definition().id] = true;
|
if (node instanceof AST_SymbolRef) lhs_ids[node.definition().id] = true;
|
||||||
|
|||||||
@@ -8556,3 +8556,24 @@ issue_4070: {
|
|||||||
}
|
}
|
||||||
expect_stdout: "NaN"
|
expect_stdout: "NaN"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_4242: {
|
||||||
|
options = {
|
||||||
|
collapse_vars: true,
|
||||||
|
conditionals: true,
|
||||||
|
reduce_vars: true,
|
||||||
|
unused: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
console.log(function() {
|
||||||
|
if (console)
|
||||||
|
var a = function(){}, b = (!1 === console || a)();
|
||||||
|
}());
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
console.log(function() {
|
||||||
|
console && (!1 === console || function(){})();
|
||||||
|
}());
|
||||||
|
}
|
||||||
|
expect_stdout: "undefined"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user