Bug 207091

Summary: Non-alphabetical \c escapes should be syntax errors in Unicode patterns only
Product: WebKit Reporter: Alexey Shvayka <ashvayka>
Component: JavaScriptCoreAssignee: Alexey Shvayka <ashvayka>
Status: RESOLVED FIXED    
Severity: Trivial CC: commit-queue, darin, ews-watchlist, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch none

Description Alexey Shvayka 2020-02-01 05:58:23 PST
Test case:
  /\c2/u

Expected:
  SyntaxError thrown

Actual:
  RegExp instance

ECMA262:
  https://tc39.es/ecma262/#prod-annexB-ClassEscape (/u flag precludes the use of ClassControlLetter)

  ClassEscape[U, N] ::
    [~U] c ClassControlLetter

  ClassControlLetter ::
    DecimalDigit
    _

Test262:
  https://test262.report/browse/built-ins/RegExp/unicode_restricted_identity_escape_c.js
  https://test262.report/browse/language/literals/regexp/u-invalid-class-escape.js
Comment 1 Alexey Shvayka 2020-02-01 06:08:50 PST
Created attachment 389459 [details]
Patch
Comment 2 WebKit Commit Bot 2020-02-01 16:20:10 PST
Comment on attachment 389459 [details]
Patch

Clearing flags on attachment: 389459

Committed r255544: <https://trac.webkit.org/changeset/255544>
Comment 3 WebKit Commit Bot 2020-02-01 16:20:11 PST
All reviewed patches have been landed.  Closing bug.
Comment 4 Radar WebKit Bug Importer 2020-02-01 16:21:19 PST
<rdar://problem/59090903>