Bug 158505

Summary: ES6 Change: Unify handling of RegExp CharacterClassEscapes \w and \W and Word Asserts \b and \B
Product: WebKit Reporter: Michael Saboff <msaboff>
Component: JavaScriptCoreAssignee: Michael Saboff <msaboff>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, keith_miller, mark.lam, mathias, saam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch ggaren: review+

Michael Saboff
Reported 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
Attachments
Patch (11.67 KB, patch)
2016-06-07 18:08 PDT, Michael Saboff
ggaren: review+
Radar WebKit Bug Importer
Comment 1 2016-06-07 17:38:23 PDT
Michael Saboff
Comment 2 2016-06-07 18:08:48 PDT
Geoffrey Garen
Comment 3 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.
Michael Saboff
Comment 4 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.
Michael Saboff
Comment 5 2016-06-24 17:15:52 PDT
*** Bug 159055 has been marked as a duplicate of this bug. ***
Mathias Bynens
Comment 6 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
Michael Saboff
Comment 7 2016-06-27 10:39:14 PDT
Michael Saboff
Comment 8 2016-08-03 13:51:19 PDT
*** Bug 160523 has been marked as a duplicate of this bug. ***
Alexey Shvayka
Comment 9 2020-08-30 03:28:08 PDT
*** Bug 160523 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.