Skip to content

Commit

Permalink
Add value argument to URLSearchParams's has() and delete()
Browse files Browse the repository at this point in the history
Tests: ...

Fixes #335.
  • Loading branch information
annevk committed Jan 16, 2023
1 parent fdaa0e5 commit b3e1768
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions url.bs
Original file line number Diff line number Diff line change
Expand Up @@ -3361,10 +3361,10 @@ interface URLSearchParams {
constructor(optional (sequence<sequence<USVString>> or record<USVString, USVString> or USVString) init = "");

undefined append(USVString name, USVString value);
undefined delete(USVString name);
undefined delete(USVString name, optional USVString value);
USVString? get(USVString name);
sequence<USVString> getAll(USVString name);
boolean has(USVString name);
boolean has(USVString name, optional USVString value);
undefined set(USVString name, USVString value);

undefined sort();
Expand Down Expand Up @@ -3494,10 +3494,15 @@ method steps are:
<li><p><a for=URLSearchParams>Update</a> <a>this</a>.
</ol>

<p>The <dfn method for=URLSearchParams><code>delete(<var>name</var>)</code></dfn> method steps are:
<p>The <dfn method for=URLSearchParams><code>delete(<var>name</var>, <var>value</var>)</code></dfn>
method steps are:

<ol>
<li><p><a for=list>Remove</a> all <a for=/>tuples</a> whose name is <var>name</var> from
<li><p>If <var>value</var> is given, then <a for=list>remove</a> all <a for=/>tuples</a> whose name
is <var>name</var> and value is <var>value</var> from <a>this</a>'s
<a for=URLSearchParams>list</a>.

<li><p>Otherwise, <a for=list>remove</a> all <a for=/>tuples</a> whose name is <var>name</var> from
<a>this</a>'s <a for=URLSearchParams>list</a>.

<li><p><a for=URLSearchParams>Update</a> <a>this</a>.
Expand All @@ -3511,9 +3516,18 @@ return the value of the first <a for=/>tuple</a> whose name is <var>name</var> i
to return the values of all <a for=/>tuples</a> whose name is <var>name</var> in <a>this</a>'s
<a for=URLSearchParams>list</a>, in list order; otherwise the empty sequence.

<p>The <dfn method for=URLSearchParams><code>has(<var>name</var>)</code></dfn> method steps are to
return true if there is a <a for=/>tuple</a> whose name is <var>name</var> in <a>this</a>'s
<a for=URLSearchParams>list</a>; otherwise false.
<p>The <dfn method for=URLSearchParams><code>has(<var>name</var>, <var>value</var>)</code></dfn>
method steps are:

<ol>
<li><p>If <var>value</var> is given and there is a <a for=/>tuple</a> whose name is <var>name</var>
and value is <var>value</var> in <a>this</a>'s <a for=URLSearchParams>list</a>, then return true.

<li><p>If <var>value</var> is not given and there is a <a for=/>tuple</a> whose name is
<var>name</var> in <a>this</a>'s <a for=URLSearchParams>list</a>, then return true.

<li><p>Return false.
</ol>

<p>The <dfn method for=URLSearchParams><code>set(<var>name</var>, <var>value</var>)</code></dfn>
method steps are:
Expand Down Expand Up @@ -3611,6 +3625,7 @@ Bobby Holley,
Boris Zbarsky,
Brad Hill,
Brandon Ross,
Cailyn Hansen,
Chris Dumez,
Chris Rebert,
Corey Farwell,
Expand Down

0 comments on commit b3e1768

Please sign in to comment.