var left = this.left._eval(compressor, ignore_side_effects, cached, depth);
if (left === this.left) return this;
if (this.operator == (left ? "||" : "&&")) return left;
- var right = this.right._eval(compressor, ignore_side_effects, cached, depth);
+ var rhs_ignore_side_effects = ignore_side_effects && !(left && typeof left == "object");
+ var right = this.right._eval(compressor, rhs_ignore_side_effects, cached, depth);
if (right === this.right) return this;
var result;
switch (this.operator) {
}
expect_stdout: "NaN"
}
+
+issue_4077: {
+ options = {
+ evaluate: true,
+ unsafe: true,
+ }
+ input: {
+ console.log((a = []) - (a[0]++, 1) || "PASS");
+ }
+ expect: {
+ console.log((a = []) - (a[0]++, 1) || "PASS");
+ }
+ expect_stdout: "PASS"
+}