Open
Bug 1773135
Opened 2 years ago
Updated 1 year ago
[META] Duplicate named capture groups
Categories
(Core :: JavaScript Engine, enhancement, P3)
Core
JavaScript Engine
Tracking
()
NEW
People
(Reporter: yulia, Unassigned)
References
(Depends on 1 open bug, Blocks 1 open bug, )
Details
(Keywords: dev-doc-needed, meta, Whiteboard: [DocArea=JS])
This will likely be part of a future regex integration
Comment 1•2 years ago
|
||
Regexps with named captures always call into CreateRegExpMatchResult
, so the changes to make this happen are:
- Right now,
RegExpShared
represents named captures using a) a pre-allocated shape with the right property names, and b) an array with one element per named capture, indicating the index of the capture group with that name. For duplicate captures, we'll instead need an arbitrarily long list of indices per named capture. This happens in initializeNamedCaptures. - According to the discussion here, the order in which the properties are created is intended to be deterministic (rather than varying per invocation of the regexp), so we can continue using a pre-computed shape.
- In CreateRegExpMatchResult, we will have to use the new representation instead of the old one. Presumably this means iterating over the list of indices for a named capture until we find one that matched.
Reporter | ||
Updated•2 years ago
|
Reporter | ||
Updated•2 years ago
|
Summary: Implement Duplicate named capture groups → [META] Duplicate named capture groups
You need to log in
before you can comment on or make changes to this bug.
Description
•