summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Tests/object-basic.js
diff options
context:
space:
mode:
authorMatthew Olsson <matthewcolsson@gmail.com>2020-05-28 14:42:20 -0700
committerAndreas Kling <kling@serenityos.org>2020-05-29 07:57:14 +0200
commit664085b71942e0eff0bc7f32ac5bec21c198d40c (patch)
treee6149c246758eab97ffe50eede694102794019fe /Libraries/LibJS/Tests/object-basic.js
parent3847d007271a58b33658f400d092e72e7e087db6 (diff)
downloadserenity-664085b71942e0eff0bc7f32ac5bec21c198d40c.zip
LibJS: Fix conditional expression precedence
This fixes the following from parsing incorrectly due to the comma that occurs after the conditional: let o = { foo: true ? 1 : 2, bar: 'baz', };
Diffstat (limited to 'Libraries/LibJS/Tests/object-basic.js')
-rw-r--r--Libraries/LibJS/Tests/object-basic.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/Libraries/LibJS/Tests/object-basic.js b/Libraries/LibJS/Tests/object-basic.js
index 2d02c9f453..beebed1f35 100644
--- a/Libraries/LibJS/Tests/object-basic.js
+++ b/Libraries/LibJS/Tests/object-basic.js
@@ -7,6 +7,7 @@ try {
1: 23,
foo,
bar: "baz",
+ qux: true ? 10 : 20,
"hello": "friends",
[1 + 2]: 42,
["I am a " + computed + " key"]: foo,
@@ -17,6 +18,7 @@ try {
assert(o["1"] === 23);
assert(o.foo === "bar");
assert(o["foo"] === "bar");
+ assert(o.qux === 10),
assert(o.hello === "friends");
assert(o["hello"] === "friends");
assert(o[3] === 42);