Skip to content

url.toString() is '[object Object]' ?!! #8813

Closed
@gritzko

Description

@gritzko
$ node
> url = require('url')
{ parse: [Function: urlParse],
  resolve: [Function: urlResolve],
  resolveObject: [Function: urlResolveObject],
  format: [Function: urlFormat],
  Url: [Function: Url] }
> var a = url.parse('http://xxx');
undefined
> a
Url {
  protocol: 'http:',
  slashes: true,
  auth: null,
  host: 'xxx',
  port: null,
  hostname: 'xxx',
  hash: null,
  search: null,
  query: null,
  pathname: '/',
  path: '/',
  href: 'http://xxx/' }
> a.toString()
'[object Object]'

Outrageous!
Why isn't url.toString() defined the straight way?

$ node -v
v6.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    urlIssues and PRs related to the legacy built-in url module.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions