Skip to content

new URL() does not take URL object as base parameter #15246

Closed
@felixfbecker

Description

@felixfbecker

TypeScript Version: 2.3.0

Code

// A *self-contained* demonstration of the problem follows...
const base = new URL('http://foo.com')
new URL('bar.html', base) 

Expected behavior:
Should compile

Actual behavior:

[ts]
Argument of type 'URL' is not assignable to parameter of type 'string | undefined'.
  Type 'URL' is not assignable to type 'string'.

Reference: https://developer.mozilla.org/en-US/docs/Web/API/URL/URL

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions