Node: this[searchParams].push is not a function

Created on 1 Feb 2017  Â·  3Comments  Â·  Source: nodejs/node

const url = new (require("url").URL)("http://domain/?var=");
console.log(url.searchParams);
url.search = "";  // critical step
console.log(url.searchParams);
url.searchParams.append("asdf", "asdf");
console.log(url.searchParams);
TypeError: this[searchParams].push is not a function
    at URLSearchParams.append (internal/url.js:737:24)
    at repl:1:148
    at ContextifyScript.Script.runInThisContext (vm.js:23:33)
    at REPLServer.defaultEval (repl.js:340:29)
    at bound (domain.js:280:14)
    at REPLServer.runBound [as eval] (domain.js:293:12)
    at REPLServer.onLine (repl.js:537:10)
    at emitOne (events.js:101:20)
    at REPLServer.emit (events.js:189:7)
    at REPLServer.Interface._onLine (readline.js:238:10)

This is a regression introduced in Node v7.5, as v7.4 doesn't have this issue.

confirmed-bug whatwg-url

Most helpful comment

@targos, I went ahead and created #11105. Hope I didn't step on your toes or anything…

All 3 comments

Moved them around in the project because my mouse have gone carzy :/. Sorry

@targos, I went ahead and created #11105. Hope I didn't step on your toes or anything…

@TimothyGu no problem. Thanks for doing it!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Icemic picture Icemic  Â·  3Comments

akdor1154 picture akdor1154  Â·  3Comments

danielstaleiny picture danielstaleiny  Â·  3Comments

fanjunzhi picture fanjunzhi  Â·  3Comments

filipesilvaa picture filipesilvaa  Â·  3Comments