Skip to content

Commit fafe651

Browse files
anonrigRafaelGSS
authored andcommitted
url: conform to origin getter spec changes
PR-URL: #48319 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
1 parent 764119b commit fafe651

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/internal/url.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,9 @@ class URL {
840840
if (path.length > 0) {
841841
try {
842842
const out = new URL(path);
843-
if (out.#context.scheme_type !== 1) {
843+
// Only return origin of scheme is `http` or `https`
844+
// Otherwise return a new opaque origin (null).
845+
if (out.#context.scheme_type === 0 || out.#context.scheme_type === 2) {
844846
return `${out.protocol}//${out.host}`;
845847
}
846848
} catch {

test/wpt/status/url.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,5 @@
1717
},
1818
"javascript-urls.window.js": {
1919
"skip": "requires document.body reference"
20-
},
21-
"url-origin.any.js": {
22-
"skip": "implementation not up to date"
2320
}
2421
}

0 commit comments

Comments
 (0)