Bug 227944

Summary: [JSC] super-Latin1 white space and line terminator after regular expression literal misinterpreted as flags
Product: WebKit Reporter: Richard Gibson <richard.gibson>
Component: JavaScriptCoreAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: ashvayka, ews-watchlist, fpizlo, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: Safari 14   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Richard Gibson
Reported 2021-07-14 00:58:50 PDT
In the ECMAScript lexical grammar, regular expression literal flags [https://tc39.es/ecma262/#prod-RegularExpressionLiteral] are defined as a sequence of IdentifierPart, each of which is either an ASCII dollar sign, zero-width joiner or non-joiner, backslash-u escape sequence, or code point with the Unicode property “ID_Continue” [https://tc39.es/ecma262/#prod-IdentifierPart]. However, WhiteSpace and LineTerminator characters with code points above the Latin-1 Supplement block (none of which are matched by IdentifierPart) are incorrectly misinterpreted as flags rather than insignificant token separators. https://jsfiddle.net/w5dnrke2/1/
Attachments
Patch (8.10 KB, patch)
2021-08-09 03:09 PDT, Yusuke Suzuki
no flags
Radar WebKit Bug Importer
Comment 1 2021-07-21 00:59:26 PDT
Yusuke Suzuki
Comment 2 2021-08-09 03:09:16 PDT
Alexey Shvayka
Comment 3 2021-08-09 22:49:06 PDT
Comment on attachment 435182 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=435182&action=review > JSTests/test262/expectations.yaml:-1963 > -test/language/white-space/after-regular-expression-literal-em-quad.js: Nice progression!
Yusuke Suzuki
Comment 4 2021-08-09 23:36:51 PDT
Comment on attachment 435182 [details] Patch Thank you!
EWS
Comment 5 2021-08-09 23:56:26 PDT
Committed r280825 (240388@main): <https://commits.webkit.org/240388@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 435182 [details].
Note You need to log in before you can comment on or make changes to this bug.