v10.9.0, v11.0.0-pre (master)Linux yoga 4.18.5-arch1-1-ARCH #1 SMP PREEMPT Fri Aug 24 12:48:58 UTC 2018 x86_64 GNU/LinuxDocumented (link):
const myURL = new URL('https://%CF%80.com/foo');
console.log(myURL.href);
// Prints https://xn--1xa.com/foo
console.log(myURL.origin);
// Prints https://蟺.com
Actual behavior:
> const myURL = new URL('https://%CF%80.com/foo');
> console.log(myURL.href);
https://xn--1xa.com/foo
> console.log(myURL.origin);
https://xn--1xa.com
The doc implies that .origin is not punicode-encoded in this scenario, but it in fact is punicode-encoded.
Yeah, this needs a documentation update. We changed the behavior a while ago to reflect a spec change.
@TimothyGu I can include a fix then, I have some minor fixes to url.md planned and this is how I spotted that inconsistency.
Most helpful comment
@TimothyGu I can include a fix then, I have some minor fixes to
url.mdplanned and this is how I spotted that inconsistency.