diff options
Diffstat (limited to 'js/url_search_params.ts')
-rw-r--r-- | js/url_search_params.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/js/url_search_params.ts b/js/url_search_params.ts index 1d9aa43b3..d9c4e59ab 100644 --- a/js/url_search_params.ts +++ b/js/url_search_params.ts @@ -280,11 +280,11 @@ export class URLSearchParams { // Overload: sequence<sequence<USVString>> for (const tuple of init) { // If pair does not contain exactly two items, then throw a TypeError. - requiredArguments( - "URLSearchParams.constructor tuple array argument", - tuple.length, - 2 - ); + if (tuple.length !== 2) { + throw new TypeError( + "URLSearchParams.constructor tuple array argument must only contain pair elements" + ); + } this.append(tuple[0], tuple[1]); } } |