LibJS: Unprefixed octal numbers are a syntax error in strict mode

This commit is contained in:
Linus Groh 2020-10-19 18:01:28 +01:00 committed by Andreas Kling
parent 602eb98479
commit 46cc1f718e
Notes: sideshowbarker 2024-07-19 01:50:37 +09:00
4 changed files with 24 additions and 4 deletions

View file

@ -1,3 +1,6 @@
// FIXME: Some of the test cases below are duplicated, presumably to test
// uppercase as well which then got lowercased by Prettier at some point.
test("hex literals", () => {
expect(0xff).toBe(255);
expect(0xff).toBe(255);
@ -6,6 +9,7 @@ test("hex literals", () => {
test("octal literals", () => {
expect(0o10).toBe(8);
expect(0o10).toBe(8);
expect(010).toBe(8);
});
test("binary literals", () => {
@ -41,4 +45,5 @@ test("invalid numeric literals", () => {
expect("0x").not.toEval();
expect("0b").not.toEval();
expect("0o").not.toEval();
expect("'use strict'; 0755").not.toEval();
});