1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:38:10 +00:00
serenity/Userland/Libraries/LibJS
Timothy Flynn f1dd770a8a LibJS: Parse RegExp literals at AST creation time, not execution time
The spec requires that invalid RegExp literals must cause a Syntax Error
before the JavaScript is executed. See:
https://tc39.es/ecma262/#sec-patterns-static-semantics-early-errors

This is explicitly tested in the RegExp/property-escapes test262 tests.
For example, see unsupported-property-Line_Break.js:

    $DONOTEVALUATE();
    /\p{Line_Break}/u;

That RegExp literal is invalid because Line_Break is not a supported
Unicode property. $DONOTEVALUATE() just throws an exception when it is
executed. The test expects that this file will fail to be parsed.

Note that RegExp patterns can still be parsed at execution time by way
of "new RegExp(...)".
2021-07-30 21:26:31 +01:00
..
Bytecode LibJS: Implement RegExpCreate/RegExpInitialize closer to the spec 2021-07-23 23:06:57 +01:00
Heap LibJS: Use IntrusiveList for keeping track of WeakContainers 2021-07-21 20:17:55 +02:00
Runtime LibJS: Parse RegExp literals at AST creation time, not execution time 2021-07-30 21:26:31 +01:00
Tests LibJS: Parse RegExp literals at AST creation time, not execution time 2021-07-30 21:26:31 +01:00
AST.cpp LibJS: Parse RegExp literals at AST creation time, not execution time 2021-07-30 21:26:31 +01:00
AST.h LibJS: Parse RegExp literals at AST creation time, not execution time 2021-07-30 21:26:31 +01:00
CMakeLists.txt LibJS: Start implementing Temporal.PlainTime 2021-07-28 21:57:30 +01:00
Console.cpp LibJS: Rename CallFrame => ExecutionContext 2021-06-24 19:28:00 +02:00
Console.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Forward.h LibJS: Start implementing Temporal.PlainTime 2021-07-28 21:57:30 +01:00
Interpreter.cpp LibJS: Remove the non-standard put helper and replace it's usages 2021-07-06 14:20:30 +01:00
Interpreter.h LibJS: Drop "Record" suffix from all the *Environment record classes 2021-07-01 12:28:57 +02:00
Lexer.cpp LibJS: Implement parsing and evaluation for AssignmentPatterns 2021-07-11 21:41:54 +01:00
Lexer.h LibJS+LibCrypto: Allow '_' as a numeric literal separator :^) 2021-06-26 16:30:35 +02:00
MarkupGenerator.cpp LibJS: Remove the NativeProperty mechanism from LibJS 2021-07-07 21:47:22 +01:00
MarkupGenerator.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Parser.cpp LibJS: Parse RegExp literals at AST creation time, not execution time 2021-07-30 21:26:31 +01:00
Parser.h LibJS: Handle strict mode for functions more correctly 2021-07-20 23:45:28 +02:00
SourceRange.h LibJS: Implement parsing and evaluation for AssignmentPatterns 2021-07-11 21:41:54 +01:00
SyntaxHighlighter.cpp LibWeb+LibSyntax: Implement nested syntax highlighters 2021-06-07 14:45:49 +04:30
SyntaxHighlighter.h LibWeb+LibSyntax: Implement nested syntax highlighters 2021-06-07 14:45:49 +04:30
Token.cpp LibJS: Add TokenType::{Debugger,With} to Token::is_identifier_name() 2021-07-16 21:59:13 +01:00
Token.h LibJS: Implement parsing and evaluation for AssignmentPatterns 2021-07-11 21:41:54 +01:00