Version
latest main branch
Platform
Subsystem
url
What steps will reproduce the bug?
const assert = require('node:assert');
const { URLPattern } = require('node:url');
const pattern = new URLPattern({
pathname: '/:one/:two/:three',
});
const result = pattern.exec('https://example.com/a/b/c');
console.log(Object.entries(result.pathname.groups));
How often does it reproduce? Is there a required condition?
Every
What is the expected behavior? Why is that the expected behavior?
[
['one', 'a'],
['two', 'b'],
['three', 'c'],
]
URLPattern.exec() may expose named capture groups in an order different from their declaration order.
The captured values remain accessible by name, but the incorrect property insertion order is observable through Object.keys(), Object.values(), Object.entries(), object spread, and JSON serialization.
What do you see instead?
[
['three', 'c'],
['two', 'b'],
['one', 'a'],
]
Additional information
No response
Version
latest main branch
Platform
Subsystem
url
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Every
What is the expected behavior? Why is that the expected behavior?
URLPattern.exec() may expose named capture groups in an order different from their declaration order.
The captured values remain accessible by name, but the incorrect property insertion order is observable through Object.keys(), Object.values(), Object.entries(), object spread, and JSON serialization.
What do you see instead?
Additional information
No response