@@ -13340,6 +13340,7 @@ Compressor.prototype.compress = function(node) {
|
|||||||
def.single_use = false;
|
def.single_use = false;
|
||||||
if (!in_loop) return;
|
if (!in_loop) return;
|
||||||
if (def.references.length == def.replaced) return;
|
if (def.references.length == def.replaced) return;
|
||||||
|
if (def.orig.length == def.eliminated) return;
|
||||||
if (def.orig.length == 1 && fn.functions.has(name)) return;
|
if (def.orig.length == 1 && fn.functions.has(name)) return;
|
||||||
if (!all(def.orig, function(sym) {
|
if (!all(def.orig, function(sym) {
|
||||||
if (sym instanceof AST_SymbolConst) return false;
|
if (sym instanceof AST_SymbolConst) return false;
|
||||||
|
|||||||
@@ -8270,3 +8270,62 @@ issue_5366: {
|
|||||||
"baz",
|
"baz",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_5376_1: {
|
||||||
|
options = {
|
||||||
|
evaluate: true,
|
||||||
|
inline: true,
|
||||||
|
join_vars: true,
|
||||||
|
loops: true,
|
||||||
|
reduce_vars: true,
|
||||||
|
toplevel: true,
|
||||||
|
unused: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
"use strict";
|
||||||
|
var a;
|
||||||
|
for (;42;)
|
||||||
|
var b = function() {
|
||||||
|
var c;
|
||||||
|
throw new Error(c++);
|
||||||
|
}();
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
"use strict";
|
||||||
|
for (;;) {
|
||||||
|
42;
|
||||||
|
throw new Error(NaN);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
expect_stdout: Error("NaN")
|
||||||
|
}
|
||||||
|
|
||||||
|
issue_5376_2: {
|
||||||
|
options = {
|
||||||
|
evaluate: true,
|
||||||
|
inline: true,
|
||||||
|
join_vars: true,
|
||||||
|
loops: true,
|
||||||
|
side_effects: true,
|
||||||
|
toplevel: true,
|
||||||
|
unused: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
"use strict";
|
||||||
|
var a;
|
||||||
|
for (;42;)
|
||||||
|
var b = function() {
|
||||||
|
var c;
|
||||||
|
c++;
|
||||||
|
throw new Error("PASS");
|
||||||
|
}();
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
"use strict";
|
||||||
|
for (;;) {
|
||||||
|
0;
|
||||||
|
throw new Error("PASS");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
expect_stdout: Error("PASS")
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user