url: URLPattern.exec() does not preserve capture group declaration order
オープン
まだ誰も着手していません。
- 主要言語
- JavaScript
- スター
- 122k
- フォーク
- 37.3k
- 平均マージ
- 4日 2時間
- マージ済み PR(30日)
- 283
説明
Version
latest main branch
Platform
7.1.4-arch1-1
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
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず node:url の URLPattern.exec() を使って再現を実行し、結果の pathname.groups オブジェクトを調べます。名前付きグループがどのように挿入されるかを特定するため、URLPattern の実装とそのテストを追跡します;完了の条件は、グループが宣言順に現れ、名前によるアクセスも可能なままになっており、その例に対するリグレッションカバレッジがあることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript
- 領域
- api
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 68/100