Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URLSearchParams: if pair does not contain exactly two items throw a TypeError #2488

merged 1 commit into from Jun 10, 2019


2 participants
Copy link

commented Jun 10, 2019

if pair does not contain exactly two items (such as 1 or 3), throw a TypeError.


new URLSearchParams([[1]])       // TypeError
new URLSearchParams([[1, 2]])    // Correctly
new URLSearchParams([[1,2, 3]])  // Correctly

Browser behavior

  • Firefox: TypeError: The expression cannot be converted to return the specified type.
  • Chrome: TypeError: Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements
  • Safari: TypeError: Type error

ry approved these changes Jun 10, 2019

Copy link

left a comment


@ry ry merged commit 5871d22 into denoland:master Jun 10, 2019

3 checks passed

Travis CI - Pull Request Build Passed
continuous-integration/appveyor/pr AppVeyor build succeeded
license/cla Contributor License Agreement is signed.

@justjavac justjavac deleted the justjavac:url-search-params-constructor branch Jun 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.