mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 16:24:59 +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
3 changed files with 6 additions and 2 deletions
|
@ -6,6 +6,8 @@ try {
|
|||
assert(x === 1 ? true : false);
|
||||
assert((x ? x : 0) === x);
|
||||
assert(1 < 2 ? (true) : (false));
|
||||
assert((0 ? 1 : 1 ? 10 : 20) === 10);
|
||||
assert((0 ? 1 ? 1 : 10 : 20) === 20);
|
||||
|
||||
var o = {};
|
||||
o.f = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue