Closed
Bug 1783830
Opened 2 years ago
Closed 2 years ago
Negated character classes of RegExp with 'u' flag do not match correctly
Categories
(Core :: JavaScript Engine, defect, P2)
Tracking
()
RESOLVED
FIXED
106 Branch
Tracking | Status | |
---|---|---|
firefox106 | --- | fixed |
People
(Reporter: danny0838, Assigned: iain)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:103.0) Gecko/20100101 Firefox/103.0
Steps to reproduce:
/[^!]/u.exec('\u{1F4A9}'); // ["\u{1F4A9}"]
/^[^!]/u.exec('\u{1F4A9}'); // ["\u{1F4A9}"]
/[^!]$/u.exec('\u{1F4A9}'); // ["\u{1F4A9}"]
/![^!]/u.exec('!\u{1F4A9}'); // ["!\uD83D"] (expect ["!\u{1F4A9}"])
/[^!]!/u.exec('\u{1F4A9}!'); // ["\uDCA9!"] (expect ["\u{1F4A9}!"])
/![^!]/ui.exec('!\u{1F4A9}'); // ["\u{1F4A9}"]
/[^!]!/ui.exec('\u{1F4A9}!'); // ["\u{1F4A9}"]
Actual results:
When the 'u' flag is set for an RegExp, a negated character class sometimes does not match a whole surrogate pair.
Expected results:
When the 'u' flag is set for an RegExp, a negated character class should match a whole surrogate pair.
Comment 1•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::JavaScript Engine' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Assignee | ||
Comment 2•2 years ago
|
||
I believe this is our equivalent of this bug in upstream irregexp. I will be refreshing our import of irregexp to fix bug 1783555; I will double-check that the upstream fix also fixes this bug.
Updated•2 years ago
|
Updated•2 years ago
|
Blocks: sm-defects
Assignee | ||
Comment 3•2 years ago
|
||
Depends on D155915
Updated•2 years ago
|
Assignee: nobody → iireland
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by iireland@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/64bae64d363b Add testcase r=sfink
Comment 5•2 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
status-firefox106:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 106 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•