fix unsafe expansion of object literals (#2390)

This commit is contained in:
Alex Lam S.L
2017-10-22 15:00:36 +08:00
committed by GitHub
parent 516eaef50c
commit 5fd723f143
2 changed files with 24 additions and 6 deletions

View File

@@ -841,3 +841,22 @@ lhs_prop_2: {
"abc"[2] = "g";
}
}
literal_duplicate_key_side_effects: {
options = {
unsafe: true,
}
input: {
console.log({
a: "FAIL",
a: console.log ? "PASS" : "FAIL"
}.a);
}
expect: {
console.log({
a: "FAIL",
a: console.log ? "PASS" : "FAIL"
}.a);
}
expect_stdout: "PASS"
}