enhance reduce_vars (#5248)

This commit is contained in:
Alex Lam S.L
2021-12-31 23:53:47 +00:00
committed by GitHub
parent e7ce1051fe
commit 8d0422b6f3
4 changed files with 15 additions and 15 deletions

View File

@@ -2752,8 +2752,7 @@ issue_3944: {
}
expect: {
void function f() {
while (a = 0 == (a = void 0), console.log(a), void 0);
var a;
while (0 == void 0, console.log(false), void 0);
f;
}();
}

View File

@@ -3228,10 +3228,10 @@ issue_4653: {
f(a++ + (b = b), b |= console.log(a));
}
expect: {
var b = 1;
var b, a = 1;
(function(c, d) {
c || console.log(d);
})(+b + (b = void 0), b |= console.log(2));
})(+a + (b = b), b |= console.log(2));
}
expect_stdout: [
"2",

View File

@@ -905,7 +905,7 @@ use_before_var: {
}
expect: {
function f(){
console.log(void 0);
console.log(t);
var t = 1;
}
}
@@ -981,7 +981,7 @@ inner_var_for_1: {
expect: {
function f() {
var a = 1;
x(1, void 0, d);
x(1, b, d);
for (var b = 2, c = 3; x(1, 2, 3, d); x(1, 2, 3, d)) {
var d = 4, e = 5;
x(1, 2, 3, d, e);