WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
206768
Invalid ranges in character classes should be syntax errors in Unicode patterns only
https://bugs.webkit.org/show_bug.cgi?id=206768
Summary
Invalid ranges in character classes should be syntax errors in Unicode patter...
Alexey Shvayka
Reported
2020-01-24 13:41:24 PST
In ES5, grammar of CharacterRange was ambiguous, resulting in invalid ranges like /[\d-a]/ being allowed. As of ES2015, invalid ranges are SyntaxError in unicode patterns, yet still allowed in regular ones to avoid breaking the web. Test case: /[a-\d]/u Expected: SyntaxError thrown Actual: RegExp instance ECMA262:
https://tc39.es/ecma262/#sec-patterns-static-semantics-early-errors-annexb
Test262:
https://test262.report/browse/built-ins/RegExp/unicode_restricted_character_class_escape.js
test/built-ins/RegExp/property-escapes/character-class-range*.js test/language/literals/regexp/u-invalid-non-empty-class-ranges*.js
Attachments
Patch
(17.56 KB, patch)
2020-01-24 13:58 PST
,
Alexey Shvayka
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Alexey Shvayka
Comment 1
2020-01-24 13:58:46 PST
Created
attachment 388721
[details]
Patch
Darin Adler
Comment 2
2020-01-26 14:23:23 PST
Comment on
attachment 388721
[details]
Patch Seems like we keep saying “unicode” in error messages but it should be “Unicode”. It’s a propert noun not a common one.
WebKit Commit Bot
Comment 3
2020-01-26 15:28:18 PST
The commit-queue encountered the following flaky tests while processing
attachment 388721
[details]
: editing/spelling/spellcheck-attribute.html
bug 206178
(authors:
g.czajkowski@samsung.com
,
mark.lam@apple.com
, and
rniwa@webkit.org
) The commit-queue is continuing to process your patch.
WebKit Commit Bot
Comment 4
2020-01-26 15:28:49 PST
Comment on
attachment 388721
[details]
Patch Clearing flags on attachment: 388721 Committed
r255134
: <
https://trac.webkit.org/changeset/255134
>
WebKit Commit Bot
Comment 5
2020-01-26 15:28:50 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 6
2020-01-26 15:29:12 PST
<
rdar://problem/58905705
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug