Commit Graph
15 Commits
Author SHA1 Message Date
Piyush Yadav 20f5b0a283 url: align URLPatternInit dictionary conversion with WebIDL
Read URLPatternInit dictionary members in lexicographical order so
getters and proxy traps observe the access sequence required by WebIDL.
Use sparse dictionary template values so URLPatternResult inputs only
expose members present after WebIDL conversion.

Fixes: https://github.com/nodejs/node/issues/64780
Signed-off-by: piyushrajyadav <piyushyadavrajyadav@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65498
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-09-02 03:55:31 +00:00
Archkon b4bbb128fa url: create URLPattern result properties in WebIDL order
Reorder the URLPatternResult and URLPatternComponentResult dictionary
templates, together with their value arrays, to follow the
lexicographical member order required by WebIDL.

Signed-off-by: Archkon <180910180+Archkon@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/64733
Fixes: https://github.com/nodejs/node/issues/64732
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-07-28 11:23:11 +00:00
Filip Skokan 4e612c0865 url: align default argument handling for URLPattern with webidl
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/62719
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-04-17 12:38:50 +00:00
James M Snell ed71aeec0f src: use DictionaryTemplate more in URLPattern
PR-URL: https://github.com/nodejs/node/pull/59892
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2025-09-17 13:59:21 +00:00
James M Snell 8ec29f24fc src: use DictionaryTemplate for node_url_pattern
Improved API and better performance:

```
url/urlpattern-parse.js n=100000 ... ***  11.59 %  ±0.96% ±1.28% ±1.66%
url/urlpattern-parse.js n=100000 ... ***   9.28 %  ±0.94% ±1.25% ±1.63%
url/urlpattern-parse.js n=100000 ... ***   6.97 %  ±0.97% ±1.29% ±1.70%
url/urlpattern-parse.js n=100000 ... ***   7.56 %  ±0.92% ±1.22% ±1.59%
url/urlpattern-test.js n=100000  ... ***   2.84 %  ±1.50% ±2.00% ±2.61%
url/urlpattern-test.js n=100000  ... ***   4.13 %  ±2.14% ±2.84% ±3.70%
url/urlpattern-test.js n=100000  ... ***   4.76 %  ±1.43% ±1.91% ±2.49%
url/urlpattern-test.js n=100000  ... ***   4.44 %  ±1.26% ±1.68% ±2.19%
```

PR-URL: https://github.com/nodejs/node/pull/59802
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2025-09-10 05:34:54 +00:00
JonasBa 015cd20e02 src: cache urlpattern properties
PR-URL: https://github.com/nodejs/node/pull/57465
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2025-03-19 12:59:13 -04:00
jakecastelli 38390e5f28 url: fix constructor error message for URLPattern
PR-URL: https://github.com/nodejs/node/pull/57482
Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2025-03-17 10:39:42 +00:00
JonasBa d5ac3e3803 src: define urlpattern components using a macro
PR-URL: https://github.com/nodejs/node/pull/57452
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2025-03-16 02:00:13 +00:00
Yagiz Nizipli 72aa2ea841 deps: update ada to v3.2.1
PR-URL: https://github.com/nodejs/node/pull/57429
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-03-14 23:59:48 +00:00
Yagiz Nizipli 9e6a62f211 url: improve urlpattern regexp performance
PR-URL: https://github.com/nodejs/node/pull/57136
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2025-02-21 14:14:10 +00:00
Chengzhong Wu 316ac8c250 src: add memory retainer traits for external types
Add `MemoryRetainerTraits` to reveal external type memory info without
forcing them to inherit from `MemoryRetainer`.

PR-URL: https://github.com/nodejs/node/pull/56881
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2025-02-04 17:07:11 +00:00
James M Snell eb11adfc02 src,test: expand test coverage for urlpattern and fix error
PR-URL: https://github.com/nodejs/node/pull/56878
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2025-02-04 04:52:39 +00:00
James M Snell a091f4890e src: prevent URLPattern property accessors from crashing on invalid this
PR-URL: https://github.com/nodejs/node/pull/56877
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-02-04 03:34:31 +00:00
James M Snell 35d199f27b src: make multiple improvements to node_url_pattern
* remove USE from node_url_pattern to handle error correctly
* simplify if block in node_url_pattern
* improve error handling in node_url_pattern
* fix error propagation on URLPattern init
* use ToV8Value where more convenient in node_url_pattern
* simplify URLPatternInit::ToJsObject by reducing boilerplate

PR-URL: https://github.com/nodejs/node/pull/56871
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-02-03 13:54:20 -08:00
Yagiz NizipliandDaniel Lemire 43c593c428 url: add URLPattern implementation
Co-authored-by: Daniel Lemire <daniel@lemire.me>
PR-URL: https://github.com/nodejs/node/pull/56452
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2025-02-01 02:13:57 +00:00