enhance side_effects (#4727)
This commit is contained in:
@@ -2863,7 +2863,7 @@ lvalues_def: {
|
||||
expect: {
|
||||
var a = 0, b = 1;
|
||||
a = b++, b = +void 0;
|
||||
a && a[a++];
|
||||
a && a++;
|
||||
console.log(a, b);
|
||||
}
|
||||
expect_stdout: true
|
||||
@@ -5098,7 +5098,7 @@ issue_2878: {
|
||||
}
|
||||
b = f2();
|
||||
a = 1;
|
||||
b && b.b;
|
||||
b && b[console];
|
||||
f2();
|
||||
})();
|
||||
console.log(c);
|
||||
@@ -5111,7 +5111,7 @@ issue_2878: {
|
||||
}
|
||||
b = f2(),
|
||||
a = 1,
|
||||
b && b.b,
|
||||
b && console,
|
||||
f2();
|
||||
})(),
|
||||
console.log(c);
|
||||
@@ -6546,7 +6546,7 @@ issue_3520: {
|
||||
(function f() {
|
||||
c = 0;
|
||||
var i = void 0;
|
||||
var f = f && f[i];
|
||||
var f = f && f[console && i];
|
||||
})();
|
||||
a += b;
|
||||
c && b++;
|
||||
@@ -6560,7 +6560,7 @@ issue_3520: {
|
||||
for (var i = 2; --i >= 0;) {
|
||||
(function() {
|
||||
c = 0;
|
||||
var f = f && f[void 0];
|
||||
var f = f && f[console && void 0];
|
||||
})();
|
||||
a += b;
|
||||
c && b++;
|
||||
|
||||
@@ -463,15 +463,19 @@ drop_fargs: {
|
||||
var a = 1;
|
||||
!function(a_1) {
|
||||
a++;
|
||||
}(a++ + (a && a.var));
|
||||
}(a++ + (a && console.log(a)));
|
||||
console.log(a);
|
||||
}
|
||||
expect: {
|
||||
var a = 1;
|
||||
++a && a.var, a++;
|
||||
++a && console.log(a),
|
||||
a++;
|
||||
console.log(a);
|
||||
}
|
||||
expect_stdout: "3"
|
||||
expect_stdout: [
|
||||
"2",
|
||||
"3",
|
||||
]
|
||||
}
|
||||
|
||||
keep_fargs: {
|
||||
@@ -486,13 +490,17 @@ keep_fargs: {
|
||||
var a = 1;
|
||||
!function(a_1) {
|
||||
a++;
|
||||
}(a++ + (a && a.var));
|
||||
}(a++ + (a && console.log(a)));
|
||||
console.log(a);
|
||||
}
|
||||
expect: {
|
||||
var a = 1;
|
||||
++a && a.var, a++;
|
||||
++a && console.log(a),
|
||||
a++;
|
||||
console.log(a);
|
||||
}
|
||||
expect_stdout: "3"
|
||||
expect_stdout: [
|
||||
"2",
|
||||
"3",
|
||||
]
|
||||
}
|
||||
|
||||
@@ -2723,7 +2723,7 @@ issue_4135: {
|
||||
var c = function() {
|
||||
var d = 0;
|
||||
function f() {
|
||||
d && d.p;
|
||||
d && d[console];
|
||||
}
|
||||
f();
|
||||
this;
|
||||
@@ -2735,7 +2735,7 @@ issue_4135: {
|
||||
0;
|
||||
a++;
|
||||
if (!a)
|
||||
c = (a++, c = 0, void (c && c.p));
|
||||
c = (a++, c = 0, void (c && console));
|
||||
var c;
|
||||
console.log(a, -1, c);
|
||||
}
|
||||
|
||||
@@ -2554,7 +2554,7 @@ side_effects_assign: {
|
||||
console.log(a);
|
||||
}
|
||||
expect: {
|
||||
var a = typeof void (a && a.in);
|
||||
var a = "undefined";
|
||||
console.log(a);
|
||||
}
|
||||
expect_stdout: "undefined"
|
||||
@@ -2595,9 +2595,7 @@ pure_getters_2: {
|
||||
var a;
|
||||
var a = a && a.b;
|
||||
}
|
||||
expect: {
|
||||
var a = a && a.b;
|
||||
}
|
||||
expect: {}
|
||||
}
|
||||
|
||||
pure_getters_3: {
|
||||
|
||||
@@ -745,12 +745,12 @@ issue_2062: {
|
||||
}
|
||||
input: {
|
||||
var a = 1;
|
||||
if ([ a || a++ + a--, a++ + a--, a && a.var ]);
|
||||
if ([ a || a++ + a--, a++ + a--, a && a[console] ]);
|
||||
console.log(a);
|
||||
}
|
||||
expect: {
|
||||
var a = 1;
|
||||
a || (a++, a--), a++, --a && a.var;
|
||||
a || (a++, a--), a++, --a && console;
|
||||
console.log(a);
|
||||
}
|
||||
expect_stdout: "1"
|
||||
@@ -1088,7 +1088,7 @@ issue_3490_1: {
|
||||
if ({
|
||||
3: function() {
|
||||
var a;
|
||||
return (a && a.p) < this;
|
||||
return (a && a[console]) < this;
|
||||
}(),
|
||||
}) c = "PASS";
|
||||
if (b) while ("" == typeof d);
|
||||
@@ -1098,7 +1098,7 @@ issue_3490_1: {
|
||||
var b = 42, c = "FAIL";
|
||||
if (function() {
|
||||
var a;
|
||||
a && a.p;
|
||||
a && console;
|
||||
}(), c = "PASS", b) while ("" == typeof d);
|
||||
console.log(c, b);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user