summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/url/00_url.js5
-rw-r--r--ext/url/lib.deno_url.d.ts8
-rw-r--r--tools/wpt/expectation.json1
3 files changed, 14 insertions, 0 deletions
diff --git a/ext/url/00_url.js b/ext/url/00_url.js
index 422a23930..c288225e3 100644
--- a/ext/url/00_url.js
+++ b/ext/url/00_url.js
@@ -302,6 +302,11 @@ class URLSearchParams {
webidl.assertBranded(this, URLSearchParamsPrototype);
return ops.op_url_stringify_search_params(this[_list]);
}
+
+ get size() {
+ webidl.assertBranded(this, URLSearchParamsPrototype);
+ return this[_list].length;
+ }
}
webidl.mixinPairIterable("URLSearchParams", URLSearchParams, _list, 0, 1);
diff --git a/ext/url/lib.deno_url.d.ts b/ext/url/lib.deno_url.d.ts
index 329f5bf55..0181c6fb3 100644
--- a/ext/url/lib.deno_url.d.ts
+++ b/ext/url/lib.deno_url.d.ts
@@ -150,6 +150,14 @@ declare class URLSearchParams {
* ```
*/
toString(): string;
+
+ /** Contains the number of search parameters
+ *
+ * ```ts
+ * searchParams.size
+ * ```
+ */
+ size: number;
}
/** The URL interface represents an object providing static methods used for
diff --git a/tools/wpt/expectation.json b/tools/wpt/expectation.json
index 52011ec1e..885354a45 100644
--- a/tools/wpt/expectation.json
+++ b/tools/wpt/expectation.json
@@ -2090,6 +2090,7 @@
"urlsearchparams-has.any.worker.html": true,
"urlsearchparams-set.any.html": true,
"urlsearchparams-set.any.worker.html": true,
+ "urlsearchparams-size.any.html": true,
"urlsearchparams-sort.any.html": true,
"urlsearchparams-sort.any.worker.html": true,
"urlsearchparams-stringifier.any.html": true,