Skip to content

this[searchParams].push is not a function #11101

@stevenvachon

Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with confirmed bugs.whatwg-urlIssues and PRs related to the WHATWG URL implementation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions