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
merged 1 commit into from Jun 10, 2019

Conversation

2 participants
@justjavac
Copy link
Contributor

commented Jun 10, 2019

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

now

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

ry approved these changes Jun 10, 2019

Copy link
Collaborator

left a comment

LGTM

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

3 checks passed

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

@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.