@@ -2862,10 +2862,10 @@ merge(Compressor.prototype, {
|
|||||||
case "+": return +v;
|
case "+": return +v;
|
||||||
case "++":
|
case "++":
|
||||||
case "--":
|
case "--":
|
||||||
if (e instanceof AST_SymbolRef) {
|
if (!(e instanceof AST_SymbolRef)) return this;
|
||||||
var refs = e.definition().references;
|
var refs = e.definition().references;
|
||||||
if (refs[refs.length - 1] === e) return v;
|
if (refs[refs.length - 1] !== e) return this;
|
||||||
}
|
return HOP(e, "_eval") ? +(this.operator[0] + 1) + +v : v;
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1838,3 +1838,24 @@ recursive_function_2: {
|
|||||||
}
|
}
|
||||||
expect_stdout: "120"
|
expect_stdout: "120"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_3558: {
|
||||||
|
options = {
|
||||||
|
evaluate: true,
|
||||||
|
reduce_vars: true,
|
||||||
|
toplevel: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
function f(a) {
|
||||||
|
return 1 + --a;
|
||||||
|
}
|
||||||
|
console.log(f(true), f(false));
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
function f(a) {
|
||||||
|
return 1 + --a;
|
||||||
|
}
|
||||||
|
console.log(1, 0);
|
||||||
|
}
|
||||||
|
expect_stdout: "1 0"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user