fix corner case in merge_vars (#5609)
This commit is contained in:
@@ -1718,7 +1718,7 @@ issue_4540: {
|
||||
node_version: ">=6"
|
||||
}
|
||||
|
||||
issue_4548: {
|
||||
issue_4548_1: {
|
||||
options = {
|
||||
merge_vars: true,
|
||||
toplevel: true,
|
||||
@@ -1744,6 +1744,32 @@ issue_4548: {
|
||||
node_version: ">=6"
|
||||
}
|
||||
|
||||
issue_4548_2: {
|
||||
options = {
|
||||
merge_vars: true,
|
||||
toplevel: true,
|
||||
}
|
||||
input: {
|
||||
A = "foo";
|
||||
var a = A;
|
||||
var [ b = c = "bar" ] = [ console, console.log(a) ];
|
||||
console.log(c);
|
||||
var c;
|
||||
}
|
||||
expect: {
|
||||
A = "foo";
|
||||
var a = A;
|
||||
var [ b = c = "bar" ] = [ console, console.log(a) ];
|
||||
console.log(c);
|
||||
var c;
|
||||
}
|
||||
expect_stdout: [
|
||||
"foo",
|
||||
"undefined",
|
||||
]
|
||||
node_version: ">=6"
|
||||
}
|
||||
|
||||
issue_4588_1_unused: {
|
||||
options = {
|
||||
unused: true,
|
||||
|
||||
@@ -1902,8 +1902,8 @@ issue_4288: {
|
||||
console.log(typeof b);
|
||||
}()]: a,
|
||||
}) {
|
||||
var b = a;
|
||||
b++;
|
||||
var a = a;
|
||||
a++;
|
||||
}
|
||||
f(0);
|
||||
}
|
||||
@@ -2076,17 +2076,16 @@ issue_4312: {
|
||||
console.log(a);
|
||||
}
|
||||
expect: {
|
||||
var a;
|
||||
b = "PASS",
|
||||
c = "FAIL",
|
||||
[
|
||||
{
|
||||
[a = b]: d,
|
||||
[c = b]: d,
|
||||
},
|
||||
] = [ c && c ],
|
||||
void 0;
|
||||
var b, c, d;
|
||||
console.log(a);
|
||||
console.log(c);
|
||||
}
|
||||
expect_stdout: "PASS"
|
||||
node_version: ">=6"
|
||||
|
||||
Reference in New Issue
Block a user