Bug 209528

Summary: \b escapes inside character classes should be valid in Unicode patterns
Product: WebKit Reporter: Alexey Shvayka <ashvayka>
Component: JavaScriptCoreAssignee: Alexey Shvayka <ashvayka>
Status: RESOLVED FIXED    
Severity: Minor CC: darin, ews-watchlist, keith_miller, mark.lam, msaboff, ross.kirsling, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch none

Description Alexey Shvayka 2020-03-24 18:00:30 PDT
Test case:
  /[\b]/u.test("\u0008")

Expected:
  true

Actual:
  SyntaxError thrown

ECMA262:
  According to ClassEscape grammar (https://tc39.es/ecma262/#prod-ClassEscape), "b" comes before
  CharacterEscape :: IdentityEscape. Also, see the note in https://tc39.es/ecma262/#sec-classescape.

Test262:
  JSTests/test262/test/built-ins/RegExp/unicode_character_class_backspace_escape.js
Comment 1 Alexey Shvayka 2020-03-24 18:20:33 PDT
Created attachment 394453 [details]
Patch
Comment 2 Alexey Shvayka 2020-03-24 18:57:13 PDT
Comment on attachment 394453 [details]
Patch

Thank you for review, Darin.
I will fix LayoutTests/js/regexp-unicode.html before landing this.
Comment 3 Alexey Shvayka 2020-03-24 19:38:05 PDT
Created attachment 394461 [details]
Patch

Set reviewer and adjust regexp-unicode.html test.
Comment 4 EWS 2020-03-25 04:11:54 PDT
Committed r258976: <https://trac.webkit.org/changeset/258976>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 394461 [details].
Comment 5 Radar WebKit Bug Importer 2020-03-25 04:12:15 PDT
<rdar://problem/60867395>