Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Nullizer opened this issue Nov 24, 2017 · 2 comments
Closed

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

Nullizer opened this issue Nov 24, 2017 · 2 comments

Comments

@Nullizer
Copy link
Contributor

Nullizer commented Nov 24, 2017

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

@Nullizer
Copy link
Contributor Author

I made a PR for this #332

@saschanaz
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants