parent
a437a61518
commit
f0ca9cfbe6
|
|
@ -1761,6 +1761,11 @@ Compressor.prototype.compress = function(node) {
|
||||||
|
|
||||||
var identifier_atom = makePredicate("Infinity NaN undefined");
|
var identifier_atom = makePredicate("Infinity NaN undefined");
|
||||||
function is_lhs_read_only(lhs, compressor) {
|
function is_lhs_read_only(lhs, compressor) {
|
||||||
|
if (lhs instanceof AST_Assign) {
|
||||||
|
if (lhs.operator != "=") return true;
|
||||||
|
if (lhs.right.tail_node().is_constant()) return true;
|
||||||
|
return is_lhs_read_only(lhs.left, compressor);
|
||||||
|
}
|
||||||
if (lhs instanceof AST_Atom) return true;
|
if (lhs instanceof AST_Atom) return true;
|
||||||
if (lhs instanceof AST_ObjectIdentity) return true;
|
if (lhs instanceof AST_ObjectIdentity) return true;
|
||||||
if (lhs instanceof AST_PropAccess) {
|
if (lhs instanceof AST_PropAccess) {
|
||||||
|
|
|
||||||
|
|
@ -9864,7 +9864,8 @@ issue_5276: {
|
||||||
}
|
}
|
||||||
expect: {
|
expect: {
|
||||||
var a = A = "PASS";
|
var a = A = "PASS";
|
||||||
a.p = a.p + null - 42;
|
a.p += null;
|
||||||
|
a.p -= 42;
|
||||||
console.log(a);
|
console.log(a);
|
||||||
}
|
}
|
||||||
expect_stdout: "PASS"
|
expect_stdout: "PASS"
|
||||||
|
|
@ -10148,3 +10149,26 @@ issue_5719: {
|
||||||
}
|
}
|
||||||
expect_stdout: "PASS"
|
expect_stdout: "PASS"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_5779: {
|
||||||
|
options = {
|
||||||
|
collapse_vars: true,
|
||||||
|
evaluate: true,
|
||||||
|
pure_getters: "strict",
|
||||||
|
reduce_vars: true,
|
||||||
|
toplevel: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
var a = A = "foo";
|
||||||
|
a.p = 42;
|
||||||
|
if (a && !a.p)
|
||||||
|
console.log("PASS");
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
var a = A = "foo";
|
||||||
|
a.p = 42;
|
||||||
|
if (a, !a.p)
|
||||||
|
console.log("PASS");
|
||||||
|
}
|
||||||
|
expect_stdout: "PASS"
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user