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 ac4ac01b1..aef2f2c50 100644 --- a/js/url_search_params.ts +++ b/js/url_search_params.ts @@ -27,11 +27,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. - if (tuple.length !== 2) { - const errMsg = - "Each query pair must be an iterable [name, value] tuple"; - throw new TypeError(errMsg); - } + requiredArguments( + "URLSearchParams.constructor tuple array argument", + tuple.length, + 2 + ); this.append(tuple[0], tuple[1]); } } else if (Object(init) === init) { |