mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 18:28:10 +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
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