mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibJS: Disallow '\8' and '\9' in strict mode due to being octal escapes
This commit is contained in:
parent
c57721cf83
commit
7624c3de0e
Notes:
sideshowbarker
2024-07-18 00:41:35 +09:00
Author: https://github.com/davidot
Commit: 7624c3de0e
Pull-request: https://github.com/SerenityOS/serenity/pull/11088
Issue: https://github.com/SerenityOS/serenity/issues/11078
Reviewed-by: https://github.com/IdanHo
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/linusg ✅
2 changed files with 13 additions and 0 deletions
|
@ -62,4 +62,11 @@ describe("octal escapes", () => {
|
|||
// Because of the non string statement in the middle strict mode is not enabled.
|
||||
expect("'\\123'; somethingElse; 'use strict'").toEval();
|
||||
});
|
||||
|
||||
test("invalid octal escapes fail in strict mode", () => {
|
||||
expect("'use strict'; '\\8'").not.toEval();
|
||||
expect("'use strict'; '\\800'").not.toEval();
|
||||
expect("'use strict'; '\\9'").not.toEval();
|
||||
expect("'use strict'; '\\912'").not.toEval();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue