Changeset 255505 in webkit
- Timestamp:
- Jan 31, 2020 9:59:26 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r255452 r255505 1 2020-01-31 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 Unmatched ] or } brackets should be syntax errors in Unicode patterns only 4 https://bugs.webkit.org/show_bug.cgi?id=207023 5 6 Reviewed by Darin Adler. 7 8 * test262/expectations.yaml: Mark 2 test cases as passing. 9 1 10 2020-01-30 Alexey Shvayka <shvaikalesh@gmail.com> 2 11 -
trunk/JSTests/test262/expectations.yaml
r255452 r255505 1574 1574 default: 'Test262Error: cross-realm RegExp.prototype Expected a TypeError to be thrown but no exception was thrown at all' 1575 1575 strict mode: 'Test262Error: cross-realm RegExp.prototype Expected a TypeError to be thrown but no exception was thrown at all' 1576 test/built-ins/RegExp/unicode_restricted_brackets.js:1577 default: 'Test262Error: RegExp("]", "u"): Expected a SyntaxError to be thrown but no exception was thrown at all'1578 strict mode: 'Test262Error: RegExp("]", "u"): Expected a SyntaxError to be thrown but no exception was thrown at all'1579 1576 test/built-ins/RegExp/unicode_restricted_identity_escape.js: 1580 1577 default: "Test262Error: Invalid IdentityEscape in AtomEscape: '\\" -
trunk/LayoutTests/ChangeLog
r255504 r255505 1 2020-01-31 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 Unmatched ] or } brackets should be syntax errors in Unicode patterns only 4 https://bugs.webkit.org/show_bug.cgi?id=207023 5 6 Reviewed by Darin Adler. 7 8 * js/regexp-unicode-expected.txt: 9 * js/script-tests/regexp-unicode.js: 10 1 11 2020-01-31 Antoine Quint <graouts@apple.com> 2 12 -
trunk/LayoutTests/js/regexp-unicode-expected.txt
r255452 r255505 168 168 PASS /{/u threw exception SyntaxError: Invalid regular expression: incomplete {} quantifier for Unicode pattern. 169 169 PASS /[a-\d]/u threw exception SyntaxError: Invalid regular expression: invalid range in character class for Unicode pattern. 170 PASS /]/u threw exception SyntaxError: Invalid regular expression: unmatched ] or } bracket for Unicode pattern. 170 171 PASS r = new RegExp("\\-", "u") threw exception SyntaxError: Invalid regular expression: invalid escaped character for Unicode pattern. 171 172 PASS r = new RegExp("\\a", "u") threw exception SyntaxError: Invalid regular expression: invalid escaped character for Unicode pattern. -
trunk/LayoutTests/js/script-tests/regexp-unicode.js
r255452 r255505 233 233 shouldThrow('/{/u', '"SyntaxError: Invalid regular expression: incomplete {} quantifier for Unicode pattern"'); 234 234 shouldThrow('/[a-\\d]/u', '"SyntaxError: Invalid regular expression: invalid range in character class for Unicode pattern"'); 235 shouldThrow('/]/u', '"SyntaxError: Invalid regular expression: unmatched ] or } bracket for Unicode pattern"'); 235 236 236 237 var invalidEscapeException = "SyntaxError: Invalid regular expression: invalid escaped character for Unicode pattern"; -
trunk/Source/JavaScriptCore/ChangeLog
r255491 r255505 1 2020-01-31 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 Unmatched ] or } brackets should be syntax errors in Unicode patterns only 4 https://bugs.webkit.org/show_bug.cgi?id=207023 5 6 Reviewed by Darin Adler. 7 8 This change adds SyntaxError for Unicode patterns, aligning JSC with 9 V8 and SpiderMonkey. 10 11 Grammar: https://tc39.es/ecma262/#prod-annexB-Term 12 (/u flag precludes the use of ExtendedAtom and thus ExtendedPatternCharacter) 13 14 * yarr/YarrErrorCode.cpp: 15 (JSC::Yarr::errorMessage): 16 (JSC::Yarr::errorToThrow): 17 * yarr/YarrErrorCode.h: 18 * yarr/YarrParser.h: 19 (JSC::Yarr::Parser::parseTokens): 20 1 21 2020-01-31 Don Olmstead <don.olmstead@sony.com> 2 22 -
trunk/Source/JavaScriptCore/yarr/YarrErrorCode.cpp
r255452 r255505 43 43 REGEXP_ERROR_PREFIX "incomplete {} quantifier for Unicode pattern", // QuantifierIncomplete 44 44 REGEXP_ERROR_PREFIX "missing )", // MissingParentheses 45 REGEXP_ERROR_PREFIX "unmatched ] or } bracket for Unicode pattern", // BracketUnmatched 45 46 REGEXP_ERROR_PREFIX "unmatched parentheses", // ParenthesesUnmatched 46 47 REGEXP_ERROR_PREFIX "unrecognized character after (?", // ParenthesesTypeInvalid … … 75 76 case ErrorCode::QuantifierIncomplete: 76 77 case ErrorCode::MissingParentheses: 78 case ErrorCode::BracketUnmatched: 77 79 case ErrorCode::ParenthesesUnmatched: 78 80 case ErrorCode::ParenthesesTypeInvalid: -
trunk/Source/JavaScriptCore/yarr/YarrErrorCode.h
r255452 r255505 42 42 QuantifierIncomplete, 43 43 MissingParentheses, 44 BracketUnmatched, 44 45 ParenthesesUnmatched, 45 46 ParenthesesTypeInvalid, -
trunk/Source/JavaScriptCore/yarr/YarrParser.h
r255452 r255505 772 772 case '[': 773 773 parseCharacterClass(); 774 lastTokenWasAnAtom = true; 775 break; 776 777 case ']': 778 case '}': 779 if (m_isUnicode) { 780 m_errorCode = ErrorCode::BracketUnmatched; 781 break; 782 } 783 784 m_delegate.atomPatternCharacter(consume()); 774 785 lastTokenWasAnAtom = true; 775 786 break;
Note: See TracChangeset
for help on using the changeset viewer.