Bug 207023 - Unmatched ] or } brackets should be syntax errors in Unicode patterns only
Summary: Unmatched ] or } brackets 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-01-30 17:18 PST by Alexey Shvayka
Modified: 2020-01-31 10:00 PST (History)
9 users (show)

See Also:


Attachments
Patch (8.09 KB, patch)
2020-01-30 17:24 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-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>