[webkit-changes] [WebKit/WebKit] 84d5c4: [JSC] /\p{Number}--]/v; should be a syntax error

Michael Saboff noreply at github.com
Wed May 17 13:53:14 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 84d5c4d59cd78da69b05e179fb87ae4efad04440
      https://github.com/WebKit/WebKit/commit/84d5c4d59cd78da69b05e179fb87ae4efad04440
  Author: Michael Saboff <msaboff at apple.com>
  Date:   2023-05-17 (Wed, 17 May 2023)

  Changed paths:
    M JSTests/stress/regexp-vflag-property-of-strings.js
    M Source/JavaScriptCore/yarr/YarrParser.h

  Log Message:
  -----------
  [JSC] /\p{Number}--]/v; should be a syntax error
https://bugs.webkit.org/show_bug.cgi?id=256903
rdar://109400589

Reviewed by Yusuke Suzuki.

Added a new AfterSetOperator state to ClassSetParserDelegate to signify when an explicit set
operation was parsed.  Then made it an error if the ClassSetParserDelegate ends in that
dangling operator without a RH operand state.

Added several new test cases.
Also changed two syntax error test cases looking for "unmatched ] or } bracket for Unicode pattern"
as this change detects the dangling operator error before the unmatched ']' error.
Added two new test cases to catch the "unmatched ]" syntax error that those prior tests were
looking for.

* JSTests/stress/regexp-vflag-property-of-strings.js:
* Source/JavaScriptCore/yarr/YarrParser.h:
(JSC::Yarr::Parser::ClassSetParserDelegate::setSubtractOp):
(JSC::Yarr::Parser::ClassSetParserDelegate::setIntersectionOp):
(JSC::Yarr::Parser::ClassSetParserDelegate::canTakeSetOperand):
(JSC::Yarr::Parser::ClassSetParserDelegate::atomPatternCharacter):
(JSC::Yarr::Parser::ClassSetParserDelegate::atomBuiltInCharacterClass):
(JSC::Yarr::Parser::ClassSetParserDelegate::end):

Canonical link: https://commits.webkit.org/264175@main




More information about the webkit-changes mailing list