mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-04 02:08:53 +00:00
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', };
This commit is contained in:
parent
3847d00727
commit
664085b719
Notes:
sideshowbarker
2024-07-19 06:00:18 +09:00
Author: https://github.com/mattco98
Commit: 664085b719
Pull-request: https://github.com/SerenityOS/serenity/pull/2435
3 changed files with 6 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue