mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 22:30:31 +00:00
LibJS: Fix parsing of invalid numeric literals
i.e. "1e" "0x" "0b" "0o" used to be parsed as valid literals. They now produce invalid tokens. Fixes #3716
This commit is contained in:
parent
3efd4c105f
commit
2c888b3c6e
Notes:
sideshowbarker
2024-07-19 01:51:31 +09:00
Author: https://github.com/sunverwerth
Commit: 2c888b3c6e
Pull-request: https://github.com/SerenityOS/serenity/pull/3789
Issue: https://github.com/SerenityOS/serenity/issues/3716
3 changed files with 63 additions and 14 deletions
|
@ -35,3 +35,10 @@ test("accessing properties of decimal numbers", () => {
|
|||
expect((1.1).foo).toBe("foo");
|
||||
expect((0.1).foo).toBe("foo");
|
||||
});
|
||||
|
||||
test("invalid numeric literals", () => {
|
||||
expect("1e").not.toEval();
|
||||
expect("0x").not.toEval();
|
||||
expect("0b").not.toEval();
|
||||
expect("0o").not.toEval();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue