mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 22:55:23 +00:00
LibJS: Don't treat '?.' followed by decimal digit as QuestionMarkPeriod
From the spec: https://tc39.es/ecma262/#sec-punctuators OptionalChainingPunctuator :: ?. [lookahead ∉ DecimalDigit] We were missing the lookahead and therefore incorrectly treating any '?.' as TokenType::QuestionMarkPeriod. Fixes #4409.
This commit is contained in:
committed by
Andreas Kling
parent
6e7edd6e77
commit
0974991d05
@@ -14,3 +14,7 @@ test("object values", () => {
|
||||
expect(o.f ? true : false).toBeTrue();
|
||||
expect(1 ? o.f : null).toBeTrue();
|
||||
});
|
||||
|
||||
test("issue #4409, '?.' followed by decimal digit", () => {
|
||||
expect("return false?.1:.2").toEvalTo(0.2);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user