Bug 158505 - ES6 Change: Unify handling of RegExp CharacterClassEscapes \w and \W and Word Asserts \b and \B
Summary: ES6 Change: Unify handling of RegExp CharacterClassEscapes \w and \W and Word...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Michael Saboff
URL:
Keywords: InRadar
: 159055 160523 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-06-07 17:37 PDT by Michael Saboff
Modified: 2020-08-30 03:28 PDT (History)
6 users (show)

See Also:


Attachments
Patch (11.67 KB, patch)
2016-06-07 18:08 PDT, Michael Saboff
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Saboff 2016-06-07 17:37:39 PDT
At the May 2016 TC-39 meeting, it was agreed that we should make slight changes to the way CharacterClassEscapes \w and \W work with case insensitive unicode regular expressions.  As part of that change, it was agreed that the \b and \B Word Assertions would be aligned with \w and \W.

The resolution is to have the \w CharacterClass in a unicode, case insensitive RegExp (ui flags) includes lower case and upper case ASCII letters, digits 0 through 9, underscore (_), and the two Unicode characters Small Latin Sharp S (\u017f) and the Kelvin sign (\u212a).  The \W CharacterClass in a unicode, case insensitive RegExp includes all the characters not in the \w CharacterClass.  The \b and \B Word Assertions for unicode, case insensitive RegExp should track what is going on for \w & \W.

The discussion can be found at: https://github.com/tc39/ecma262/pull/525
Comment 1 Radar WebKit Bug Importer 2016-06-07 17:38:23 PDT
<rdar://problem/26687428>
Comment 2 Michael Saboff 2016-06-07 18:08:48 PDT
Created attachment 280755 [details]
Patch
Comment 3 Geoffrey Garen 2016-06-08 13:57:08 PDT
Comment on attachment 280755 [details]
Patch

r=me

Will this cause some apparent failures in the kangax or ECMA test suites? If so, I think we should hold off until the tests are updated.
Comment 4 Michael Saboff 2016-06-08 14:29:17 PDT
(In reply to comment #3)
> Comment on attachment 280755 [details]
> Patch
> 
> r=me
> 
> Will this cause some apparent failures in the kangax or ECMA test suites? If
> so, I think we should hold off until the tests are updated.

It does cause a kangax failure.  I fully expect that is also causes a test262 failure.

I'll hold off landing until the spec is updated as well as the tests.
Comment 5 Michael Saboff 2016-06-24 17:15:52 PDT
*** Bug 159055 has been marked as a duplicate of this bug. ***
Comment 6 Mathias Bynens 2016-06-25 02:44:11 PDT
https://github.com/tc39/ecma262/pull/525 was merged.

New expectations:

    /\w/iu.test('\u017F') // true
    /\w/iu.test('\u212A') // true
    /\W/iu.test('\u017F') // false
    /\W/iu.test('\u212A') // false
    /\W/iu.test('s')      // false
    /\W/iu.test('S')      // false
    /\W/iu.test('K')      // false
    /\W/iu.test('k')      // false
Comment 7 Michael Saboff 2016-06-27 10:39:14 PDT
Committed r202490: <http://trac.webkit.org/changeset/202490>
Comment 8 Michael Saboff 2016-08-03 13:51:19 PDT
*** Bug 160523 has been marked as a duplicate of this bug. ***
Comment 9 Alexey Shvayka 2020-08-30 03:28:08 PDT
*** Bug 160523 has been marked as a duplicate of this bug. ***