From 9bc7de9b135cf92c7c4f041ad7901e9c3ba12004 Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Thu, 22 Aug 2024 05:44:09 -0700 Subject: fix(urlpattern): fallback to empty string for undefined group values (#25151) This change was introduced in #24741, but due to the change in behaviour, we will revert it and re-introduce it in 2.0 --- ext/url/01_urlpattern.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/url/01_urlpattern.js b/ext/url/01_urlpattern.js index 0bba59cf0..58a6d6bce 100644 --- a/ext/url/01_urlpattern.js +++ b/ext/url/01_urlpattern.js @@ -349,7 +349,7 @@ class URLPattern { const groups = res.groups; for (let i = 0; i < groupList.length; ++i) { // TODO(lucacasonato): this is vulnerable to override mistake - groups[groupList[i]] = match[i + 1]; + groups[groupList[i]] = match[i + 1] ?? ""; // TODO(@crowlKats): remove fallback for 2.0 } break; } -- cgit v1.2.3