1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:48:11 +00:00
serenity/Userland/Libraries/LibJS
Linus Groh 83c29bd8d7 LibJS: Don't assume match for each capture group in RegExp.prototype.exec()
This was not implementing the following part of the spec correctly:

    27. For each integer i such that i ≥ 1 and i ≤ n, do
        a. Let captureI be ith element of r's captures List.
        b. If captureI is undefined, let capturedValue be undefined.

Expecting a capture group match to exist for each of the RegExp's
capture groups would assert in Vector's operator[] if that's not the
case, for example:

    /(foo)(bar)?/.exec("foo")

Append undefined instead.

Fixes #5256.
2021-02-08 18:01:23 +01:00
..
Heap Everywhere: Hook up remaining debug macros to Debug.h. 2021-01-25 09:47:36 +01:00
Runtime LibJS: Don't assume match for each capture group in RegExp.prototype.exec() 2021-02-08 18:01:23 +01:00
Tests LibJS: Don't assume match for each capture group in RegExp.prototype.exec() 2021-02-08 18:01:23 +01:00
AST.cpp LibJS: Fix crash when printing error for missing class extends value prototype 2021-01-28 10:24:18 +01:00
AST.h LibJS: Replace ASTNode::class_name() with RTTI 2021-01-17 14:36:53 +01:00
CMakeLists.txt LibSyntax+LibGUI+LibJS: Move JS syntax highlighter to LibJS 2021-02-07 16:56:02 +01:00
Console.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Console.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Forward.h LibJS: Add JS::NativeFunction to the forwarding header 2021-01-18 12:18:29 +01:00
Interpreter.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Interpreter.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Lexer.cpp Everywhere: Hook up remaining debug macros to Debug.h. 2021-01-25 09:47:36 +01:00
Lexer.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
MarkupGenerator.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
MarkupGenerator.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Parser.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Parser.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
SourceRange.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
SyntaxHighlighter.cpp LibSyntax+LibGUI+LibJS: Move JS syntax highlighter to LibJS 2021-02-07 16:56:02 +01:00
SyntaxHighlighter.h LibSyntax+LibGUI+LibJS: Move JS syntax highlighter to LibJS 2021-02-07 16:56:02 +01:00
Token.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Token.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00