fix corner case in objects (#5214)

fixes #5213
This commit is contained in:
Alex Lam S.L
2021-12-09 22:02:22 +00:00
committed by GitHub
parent 9e4c4c995c
commit 57a9519c3d
3 changed files with 43 additions and 11 deletions

View File

@@ -198,9 +198,9 @@ numeric_literal: {
expect_exact: [
'var obj = {',
' 0: 0,',
' 37: 4,',
' 42: 3,',
' "-0": 1,',
' 42: 3,',
' 37: 4,',
' o: 5,',
' 1e42: 8,',
' b: 7',
@@ -521,3 +521,25 @@ issue_4415: {
expect_stdout: "PASS"
node_version: ">=4"
}
issue_5213: {
options = {
objects: true,
}
input: {
var a = "FAIL";
console.log({
p: a = "PASS",
0: a,
p: null,
}[0]);
}
expect: {
var a = "FAIL";
console.log({
p: (a = "PASS", null),
0: a,
}[0]);
}
expect_stdout: "PASS"
}