fix corner case in merge_vars (#4302)

fixes #4301
This commit is contained in:
Alex Lam S.L
2020-11-18 21:44:47 +00:00
committed by GitHub
parent fd6544b340
commit aecbabc587
2 changed files with 48 additions and 3 deletions

View File

@@ -1559,3 +1559,35 @@ issue_4298: {
expect_stdout: "PASS"
node_version: ">=6"
}
issue_4301: {
options = {
merge_vars: true,
}
input: {
try {
console.log(function() {
var a, b = console;
return {
[a = b]: a.p,
} = "foo";
}());
} catch (e) {
console.log("bar");
}
}
expect: {
try {
console.log(function() {
var a, b = console;
return {
[a = b]: a.p,
} = "foo";
}());
} catch (e) {
console.log("bar");
}
}
expect_stdout: true
node_version: ">=6"
}