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

WHATWG URLSearchParams issue #9302

Closed
stevenvachon opened this issue Oct 26, 2016 · 1 comment
Closed

WHATWG URLSearchParams issue #9302

stevenvachon opened this issue Oct 26, 2016 · 1 comment
Labels
url Issues and PRs related to the legacy built-in url module.

Comments

@stevenvachon
Copy link

stevenvachon commented Oct 26, 2016

const URL = require("url").URL
const url = new URL("http://domain/?query1=value&query2=")
console.log( url.searchParams.get("query1") )  // undefined
url.searchParams.keys()
/*
TypeError: (intermediate value).searchParams.keys is not a function
    at [eval]:1:106
    at ContextifyScript.Script.runInThisContext (vm.js:25:33)
    at Object.exports.runInThisContext (vm.js:77:17)
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:573:32)
    at bootstrap_node.js:345:29
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
*/
@jasnell jasnell added the url Issues and PRs related to the legacy built-in url module. label Oct 26, 2016
@jasnell
Copy link
Member

jasnell commented Oct 26, 2016

I'll work on adding this over the next day or so unless you'd like to take a stab at a PR :-)

TimothyGu added a commit to TimothyGu/node that referenced this issue Nov 27, 2016
- Make URLSearchParams constructor spec-compliant
- Strip leading `?` in URL#search's setter
- Spec-compliant iterable interface
- More precise handling of update steps as mandated by the spec
- Add class strings to URLSearchParams objects and their prototype
- Make sure `this instanceof URLSearchParams` in methods

Also included are relevant tests from W3C's Web Platform Tests
(https://github.com/w3c/web-platform-tests/tree/master/url).

Fixes: nodejs#9302
Fishrock123 pushed a commit that referenced this issue Dec 13, 2016
- Make URLSearchParams constructor spec-compliant
- Strip leading `?` in URL#search's setter
- Spec-compliant iterable interface
- More precise handling of update steps as mandated by the spec
- Add class strings to URLSearchParams objects and their prototype
- Make sure `this instanceof URLSearchParams` in methods

Also included are relevant tests from W3C's Web Platform Tests
(https://github.com/w3c/web-platform-tests/tree/master/url).

Fixes: #9302
PR-URL: #9484
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
url Issues and PRs related to the legacy built-in url module.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants