Bug 227944 - [JSC] super-Latin1 white space and line terminator after regular expression literal misinterpreted as flags
Summary: [JSC] super-Latin1 white space and line terminator after regular expression l...
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Safari 14
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
Keywords: InRadar
Depends on:
Reported: 2021-07-14 00:58 PDT by Richard Gibson
Modified: 2021-08-09 23:56 PDT (History)
10 users (show)

See Also:

Patch (8.10 KB, patch)
2021-08-09 03:09 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Gibson 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.

Comment 1 Radar WebKit Bug Importer 2021-07-21 00:59:26 PDT
Comment 2 Yusuke Suzuki 2021-08-09 03:09:16 PDT
Created attachment 435182 [details]
Comment 3 Alexey Shvayka 2021-08-09 22:49:06 PDT
Comment on attachment 435182 [details]

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!
Comment 4 Yusuke Suzuki 2021-08-09 23:36:51 PDT
Comment on attachment 435182 [details]

Thank you!
Comment 5 EWS 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].