summaryrefslogtreecommitdiff
path: root/ext/url/01_urlpattern.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/url/01_urlpattern.js')
-rw-r--r--ext/url/01_urlpattern.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/url/01_urlpattern.js b/ext/url/01_urlpattern.js
index 58a6d6bce..6e2756308 100644
--- a/ext/url/01_urlpattern.js
+++ b/ext/url/01_urlpattern.js
@@ -31,6 +31,7 @@ import * as webidl from "ext:deno_webidl/00_webidl.js";
import { createFilteredInspectProxy } from "ext:deno_console/01_console.js";
const _components = Symbol("components");
+const urlPatternSettings = { groupStringFallback: false };
/**
* @typedef Components
@@ -349,7 +350,11 @@ 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] ?? ""; // TODO(@crowlKats): remove fallback for 2.0
+ if (urlPatternSettings.groupStringFallback) {
+ groups[groupList[i]] = match[i + 1] ?? "";
+ } else {
+ groups[groupList[i]] = match[i + 1];
+ }
}
break;
}
@@ -422,4 +427,4 @@ webidl.converters.URLPatternOptions = webidl
},
]);
-export { URLPattern };
+export { URLPattern, urlPatternSettings };