@@ -10449,6 +10449,7 @@ Compressor.prototype.compress = function(node) {
|
||||
var def = name.definition();
|
||||
if (def.orig.length == 1 && fn.functions.has(name.name)) continue;
|
||||
var sym = make_node(AST_SymbolRef, name, name);
|
||||
def.assignments++;
|
||||
def.references.push(sym);
|
||||
expr_loop.push(make_node(AST_Assign, var_def, {
|
||||
operator: "=",
|
||||
@@ -13104,7 +13105,9 @@ Compressor.prototype.compress = function(node) {
|
||||
var sym = def.orig[0];
|
||||
if (sym instanceof AST_SymbolCatch) return;
|
||||
var ref = make_node(AST_SymbolRef, sym, flatten_var(sym));
|
||||
ref.definition().references.push(ref);
|
||||
def = ref.definition();
|
||||
def.assignments++;
|
||||
def.references.push(ref);
|
||||
body.push(make_node(AST_SimpleStatement, sym, {
|
||||
body: make_node(AST_Assign, sym, {
|
||||
operator: "=",
|
||||
|
||||
@@ -2029,7 +2029,9 @@ issue_5222: {
|
||||
expect: {
|
||||
do {
|
||||
a = void 0,
|
||||
[ a ] = [];
|
||||
a = {
|
||||
p: [ a ] = [],
|
||||
};
|
||||
} while (console.log("PASS"));
|
||||
var a;
|
||||
}
|
||||
|
||||
@@ -8014,3 +8014,35 @@ issue_5283: {
|
||||
}
|
||||
expect_stdout: "PASS"
|
||||
}
|
||||
|
||||
issue_5290: {
|
||||
options = {
|
||||
functions: true,
|
||||
inline: true,
|
||||
reduce_vars: true,
|
||||
side_effects: true,
|
||||
toplevel: true,
|
||||
unused: true,
|
||||
}
|
||||
input: {
|
||||
var a = 1;
|
||||
while (a--) new function(b) {
|
||||
switch (b) {
|
||||
case b.p:
|
||||
case console.log("PASS"):
|
||||
}
|
||||
}(function() {});
|
||||
}
|
||||
expect: {
|
||||
var a = 1;
|
||||
while (a--) {
|
||||
b = void 0;
|
||||
var b = function() {};
|
||||
switch (b) {
|
||||
case b.p:
|
||||
case console.log("PASS"):
|
||||
}
|
||||
}
|
||||
}
|
||||
expect_stdout: "PASS"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user