mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-02 01:08:48 +00:00
LibJS: Unprefixed octal numbers are a syntax error in strict mode
This commit is contained in:
parent
602eb98479
commit
46cc1f718e
Notes:
sideshowbarker
2024-07-19 01:50:37 +09:00
Author: https://github.com/linusg
Commit: 46cc1f718e
Pull-request: https://github.com/SerenityOS/serenity/pull/3800
4 changed files with 24 additions and 4 deletions
|
@ -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();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue