summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Johnston <apjohnsto@gmail.com>2022-09-11 04:10:06 +0100
committerGitHub <noreply@github.com>2022-09-11 08:40:06 +0530
commit6d8f6d5af09a5e78bed9bf04fa2e0970c0eb5a9f (patch)
treebf02d971735084436dec37c5264bf68698d2618d
parentdee9f0acaf705eacc5cbda806b2ae3937eeaab0e (diff)
perf(url): return early if url has no query string (#15856)
-rw-r--r--ext/url/00_url.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/url/00_url.js b/ext/url/00_url.js
index 659e6a37b..5479cb59c 100644
--- a/ext/url/00_url.js
+++ b/ext/url/00_url.js
@@ -92,6 +92,11 @@
{ prefix, context: "Argument 1" },
);
this[webidl.brand] = webidl.brand;
+ if (!init) {
+ // if there is no query string, return early
+ this[_list] = [];
+ return;
+ }
if (typeof init === "string") {
// Overload: USVString