Bug 207114 - \0 identity escapes should be syntax errors in Unicode patterns only
Summary: \0 identity 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-03 07:22 PST by Alexey Shvayka
Modified: 2020-02-03 13:24 PST (History)
9 users (show)

See Also:


Attachments
Patch (3.49 KB, patch)
2020-02-03 07:49 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-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>