Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Add support in named capture group identifiers for direct surrogate p…
…airs 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
- Loading branch information
Showing
12 changed files
with
131 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.