1
Fork 0
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:
Stephan Unverwerth 2020-10-18 15:32:50 +02:00 committed by Andreas Kling
parent 3efd4c105f
commit 2c888b3c6e
3 changed files with 63 additions and 14 deletions

View file

@ -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();
});