fix corner case in objects (#4381)

fixes #4380
This commit is contained in:
Alex Lam S.L
2020-12-15 13:23:55 +00:00
committed by GitHub
parent f579f1aa47
commit 549de028b6
2 changed files with 27 additions and 0 deletions

View File

@@ -387,3 +387,29 @@ issue_4269_5: {
expect_stdout: "PASS"
node_version: ">=4"
}
issue_4380: {
options = {
evaluate: true,
objects: true,
}
input: {
console.log({
get 0() {
return "FAIL 1";
},
0: "FAIL 2",
[0]: "PASS",
}[0]);
}
expect: {
console.log({
get 0() {
return "FAIL 1";
},
[0]: ("FAIL 2", "PASS"),
}[0]);
}
expect_stdout: "PASS"
node_version: ">=4"
}