Bug 207114

Summary: \0 identity 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-03 07:22:22 PST
Test case:
  new RegExp("\\\0", "u")

Expected:
  SyntaxError thrown

Actual:
  RegExp instance

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

  IdentityEscape[U, N] ::
    [~U] SourceCharacterIdentityEscape[?N]

  SourceCharacterIdentityEscape[N] ::
    [~N] SourceCharacter but not c

  SourceCharacter ::
    any Unicode code point

Test262:
  https://test262.report/browse/built-ins/RegExp/unicode_restricted_identity_escape.js
Comment 1 Alexey Shvayka 2020-02-03 07:49:25 PST
Created attachment 389508 [details]
Patch
Comment 2 WebKit Commit Bot 2020-02-03 13:22:54 PST
The commit-queue encountered the following flaky tests while processing attachment 389508 [details]:

editing/spelling/spellcheck-async-remove-frame.html bug 158401 (authors: morrita@google.com, rniwa@webkit.org, and tony@chromium.org)
The commit-queue is continuing to process your patch.
Comment 3 WebKit Commit Bot 2020-02-03 13:23:24 PST
Comment on attachment 389508 [details]
Patch

Clearing flags on attachment: 389508

Committed r255584: <https://trac.webkit.org/changeset/255584>
Comment 4 WebKit Commit Bot 2020-02-03 13:23:26 PST
All reviewed patches have been landed.  Closing bug.
Comment 5 Radar WebKit Bug Importer 2020-02-03 13:24:19 PST
<rdar://problem/59122942>