Skip to content

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

Closed

Description

@Nullizer

https://url.spec.whatwg.org/#example-5434421b

A URL object can be used as base URL (while IDL requires a string as argument, a URL object stringifies to its href attribute value):
var url = new URL("🏳️‍🌈", new URL("https://pride.example/hello-world"))

Now it's only support DOMString as base parameter, need explicit call toString method on base to avoid compile error.
default
Related: microsoft/TypeScript#15246

Activity

  1. Nullizer commented on Nov 24, 2017

    @Nullizer
    ContributorAuthor

    I made a PR for this #332

  2. saschanaz commented on Nov 24, 2017

    @saschanaz
    Contributor

    Ideally we should support interfaces with stringifiers, not sure how.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions