What is the issue with the URL Pattern Standard?
The "create a component match result" algorithm (link) expects the "group name list" and "groups" to have the same length when reconstructing the name from the RegExp match results at step 5.1.
However, when the input pattern has any RegExp parts with named-capture groups, the correspondence becomes inaccurate and results in a very non-intuitive output. For example, new URLPattern({pathname: "/:foo((?<x>xxx))/:bar"}).exec({pathname: "/xxx/yyy"}) results in :bar matches to xxx, which is for the ?<x> RegExp group as the RegExpBuiltinExec output, not yyy.
The original firefox issue (found this behavior first): https://bugzilla.mozilla.org/show_bug.cgi?id=2020156
What is the issue with the URL Pattern Standard?
The "create a component match result" algorithm (link) expects the "group name list" and "groups" to have the same length when reconstructing the name from the RegExp match results at step 5.1.
However, when the input pattern has any RegExp parts with named-capture groups, the correspondence becomes inaccurate and results in a very non-intuitive output. For example,
new URLPattern({pathname: "/:foo((?<x>xxx))/:bar"}).exec({pathname: "/xxx/yyy"})results in:barmatches toxxx, which is for the?<x>RegExp group as theRegExpBuiltinExecoutput, notyyy.The original firefox issue (found this behavior first): https://bugzilla.mozilla.org/show_bug.cgi?id=2020156