enhance reduce_vars (#3942)

This commit is contained in:
Alex Lam S.L
2020-06-01 13:55:23 +01:00
committed by GitHub
parent 06ba4e2ce8
commit b24eb22c6b
7 changed files with 260 additions and 192 deletions

View File

@@ -3001,8 +3001,6 @@ issue_2298: {
expect: {
!function() {
(function() {
var a = undefined;
var undefined = a++;
try {
!function(b) {
(void 0)[1] = "foo";
@@ -3836,20 +3834,19 @@ issue_2436_3: {
}(o));
}
expect: {
var o = {
a: 1,
b: 2,
};
console.log(function(c) {
o = {
({
a: 3,
b: 4,
};
});
return {
x: c.a,
y: c.b,
};
}(o));
}({
a: 1,
b: 2,
}));
}
expect_stdout: true
}
@@ -4071,16 +4068,15 @@ issue_2436_10: {
}(o).join(" "));
}
expect: {
var o = {
a: 1,
b: 2,
};
function f(n) {
o = { b: 3 };
({ b: 3 });
return n;
}
console.log([
(c = o).a,
(c = {
a: 1,
b: 2,
}).a,
f(c.b),
c.b,
].join(" "));