@@ -1000,11 +1000,7 @@ merge(Compressor.prototype, {
|
|||||||
arg.walk(tw);
|
arg.walk(tw);
|
||||||
if (arg instanceof AST_Spread) iife = false;
|
if (arg instanceof AST_Spread) iife = false;
|
||||||
});
|
});
|
||||||
if (iife) {
|
if (iife) exp.reduce_vars = reduce_iife;
|
||||||
exp.reduce_vars = reduce_iife;
|
|
||||||
} else {
|
|
||||||
exp.safe_ids = tw.safe_ids;
|
|
||||||
}
|
|
||||||
exp.walk(tw);
|
exp.walk(tw);
|
||||||
if (iife) delete exp.reduce_vars;
|
if (iife) delete exp.reduce_vars;
|
||||||
return true;
|
return true;
|
||||||
@@ -1299,9 +1295,7 @@ merge(Compressor.prototype, {
|
|||||||
node.expressions.forEach(function(exp) {
|
node.expressions.forEach(function(exp) {
|
||||||
exp.walk(tw);
|
exp.walk(tw);
|
||||||
});
|
});
|
||||||
tag.safe_ids = tw.safe_ids;
|
|
||||||
tag.walk(tw);
|
tag.walk(tw);
|
||||||
delete tag.reduce_vars;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
tag.walk(tw);
|
tag.walk(tw);
|
||||||
|
|||||||
@@ -6285,3 +6285,34 @@ issue_5036: {
|
|||||||
}
|
}
|
||||||
expect_stdout: "PASS"
|
expect_stdout: "PASS"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_5046: {
|
||||||
|
options = {
|
||||||
|
conditionals: true,
|
||||||
|
evaluate: true,
|
||||||
|
keep_fnames: true,
|
||||||
|
passes: 2,
|
||||||
|
reduce_vars: true,
|
||||||
|
side_effects: true,
|
||||||
|
toplevel: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
var a = 0;
|
||||||
|
if (a)
|
||||||
|
0();
|
||||||
|
else
|
||||||
|
(function f() {
|
||||||
|
f;
|
||||||
|
return a = "PASS";
|
||||||
|
})();
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
var a = 0;
|
||||||
|
(a ? 0 : function f() {
|
||||||
|
return a = "PASS";
|
||||||
|
})();
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect_stdout: "PASS"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user