Skip to content

url: WHATWG API .origin behavior does not match the documentation #22653

Closed
@ChALkeR

Description

@ChALkeR
  • Version: v10.9.0, v11.0.0-pre (master)
  • Platform: Linux yoga 4.18.5-arch1-1-ARCH #1 SMP PREEMPT Fri Aug 24 12:48:58 UTC 2018 x86_64 GNU/Linux
  • Subsystem: doc, url

Documented (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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.whatwg-urlIssues and PRs related to the WHATWG URL implementation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions