diff options
author | Andrew Johnston <apjohnsto@gmail.com> | 2022-09-11 04:10:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-11 08:40:06 +0530 |
commit | 6d8f6d5af09a5e78bed9bf04fa2e0970c0eb5a9f (patch) | |
tree | bf02d971735084436dec37c5264bf68698d2618d | |
parent | dee9f0acaf705eacc5cbda806b2ae3937eeaab0e (diff) |
perf(url): return early if url has no query string (#15856)
-rw-r--r-- | ext/url/00_url.js | 5 |
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 |