Skip to content

Commit

Permalink
url: update URLSearchParams directly from URL search setter
Browse files Browse the repository at this point in the history
  • Loading branch information
MattIPv4 committed Jan 19, 2024
1 parent 129a1a9 commit c2e8526
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/internal/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,12 @@ class URL {
}

set search(value) {
// URLSearchParams is used on demand, and stores the search if it's used.
if (this.#searchParams) {
setURLSearchParams(this.#searchParams, StringPrototypeToWellFormed(`${value}`));
return;
}

const href = bindingUrl.update(this.#context.href, updateActions.kSearch, StringPrototypeToWellFormed(`${value}`));
if (href) {
this.#updateContext(href);
Expand Down

0 comments on commit c2e8526

Please sign in to comment.