haikuwebkit/LayoutTests/js/regress-158080-expected.txt

21 lines
1.5 KiB
Plaintext
Raw Permalink Normal View History

Regresion test for 158080. This test should pass and not crash.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Add support in named capture group identifiers for direct surrogate pairs https://bugs.webkit.org/show_bug.cgi?id=178174 Reviewed by Darin Adler and Michael Saboff. JSTests: * test262/expectations.yaml: Mark 2 test cases as passing. Source/JavaScriptCore: This change: a) Adds support for unescaped astral symbols in RegExp identifier names [1], aligning JSC with V8. b) Rewords InvalidUnicodeEscape error code to be used for \uXXXX escapes in Unicode patterns and named groups/references instead of InvalidIdentityEscape, matching error messages in V8 and SpiderMonkey. c) Adds hasError() checks after tryConsumeGroupName() so errors generated in tryConsumeIdentifierCharacter() would not get overriden. d) Removes code duplication by using tryConsumeUnicodeEscape() for parsing \u in parseEscape(); cleans up parsing \u{} escapes a bit, preferring ASSERTs over hasError() checks. [1]: https://tc39.es/ecma262/#prod-RegExpIdentifierName * yarr/YarrErrorCode.cpp: (JSC::Yarr::errorMessage): (JSC::Yarr::errorToThrow): * yarr/YarrErrorCode.h: * yarr/YarrParser.h: (JSC::Yarr::Parser::parseEscape): (JSC::Yarr::Parser::parseParenthesesBegin): (JSC::Yarr::Parser::tryConsumeUnicodeEscape): (JSC::Yarr::Parser::tryConsumeIdentifierCharacter): LayoutTests: Adjusted tests for error messages changes and added coverage for messages of syntax errors due to invalid \u escapes inside named groups/references. * js/regexp-named-capture-groups-expected.txt: * js/regexp-unicode-expected.txt: * js/regress-158080-expected.txt: * js/script-tests/regexp-named-capture-groups.js: * js/script-tests/regexp-unicode.js: Canonical link: https://commits.webkit.org/222707@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259262 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-31 01:27:10 +00:00
PASS let r = /\u{|abc/u threw exception SyntaxError: Invalid regular expression: invalid Unicode code point \u{} escape.
PASS let r = /\u{/u threw exception SyntaxError: Invalid regular expression: invalid Unicode code point \u{} escape.
PASS let r = /\u{1/u threw exception SyntaxError: Invalid regular expression: invalid Unicode code point \u{} escape.
PASS let r = /\u{12/u threw exception SyntaxError: Invalid regular expression: invalid Unicode code point \u{} escape.
PASS let r = /\u{123/u threw exception SyntaxError: Invalid regular expression: invalid Unicode code point \u{} escape.
PASS let r = /\u{1234/u threw exception SyntaxError: Invalid regular expression: invalid Unicode code point \u{} escape.
PASS let r = /\u{abcde/u threw exception SyntaxError: Invalid regular expression: invalid Unicode code point \u{} escape.
PASS let r = /\u{abcdef/u threw exception SyntaxError: Invalid regular expression: invalid Unicode code point \u{} escape.
PASS let r = /\u{1111111}/u threw exception SyntaxError: Invalid regular expression: invalid Unicode code point \u{} escape.
PASS let r = /\u{fedbca98}/u threw exception SyntaxError: Invalid regular expression: invalid Unicode code point \u{} escape.
PASS let r = /\u{1{123}}/u threw exception SyntaxError: Invalid regular expression: invalid Unicode code point \u{} escape.
PASS successfullyParsed is true
TEST COMPLETE