Bug 207091 - Non-alphabetical \c escapes should be syntax errors in Unicode patterns only
Summary: Non-alphabetical \c escapes should be syntax errors in Unicode patterns only
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Trivial
Assignee: Alexey Shvayka
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-02-01 05:58 PST by Alexey Shvayka
Modified: 2020-02-01 16:21 PST (History)
9 users (show)

See Also:


Attachments
Patch (9.89 KB, patch)
2020-02-01 06:08 PST, Alexey Shvayka
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>