Bug 207023

Summary: Unmatched ] or } brackets 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-01-30 17:18:28 PST
Test case:
  /]/u

Expected:
  SyntaxError thrown

Actual:
  RegExp instance

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

  Term[U, N] ::
    [~U] ExtendedAtom[?N]

  ExtendedAtom[N] ::
    ExtendedPatternCharacter

  ExtendedPatternCharacter ::
    SourceCharacter but not one of ^ $ \ . * + ? ( ) [ |

Test262:
  https://test262.report/browse/built-ins/RegExp/unicode_restricted_brackets.js
Comment 1 Alexey Shvayka 2020-01-30 17:24:33 PST
Created attachment 389309 [details]
Patch
Comment 2 WebKit Commit Bot 2020-01-31 09:58:53 PST
The commit-queue encountered the following flaky tests while processing attachment 389309 [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-01-31 09:59:32 PST
Comment on attachment 389309 [details]
Patch

Clearing flags on attachment: 389309

Committed r255505: <https://trac.webkit.org/changeset/255505>
Comment 4 WebKit Commit Bot 2020-01-31 09:59:34 PST
All reviewed patches have been landed.  Closing bug.
Comment 5 Radar WebKit Bug Importer 2020-01-31 10:00:19 PST
<rdar://problem/59065180>