Skip to content

Commit f59c963

Browse files
anonrigruyadorno
authored andcommitted
url: conform to origin getter spec changes
PR-URL: #48319 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
1 parent cb92c4b commit f59c963

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/internal/url.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,9 @@ class URL {
731731
if (path.length > 0) {
732732
try {
733733
const out = new URL(path);
734-
if (out[context].scheme_type !== 1) {
734+
// Only return origin of scheme is `http` or `https`
735+
// Otherwise return a new opaque origin (null).
736+
if (out[context].scheme_type === 0 || out[context].scheme_type === 2) {
735737
return `${out.protocol}//${out.host}`;
736738
}
737739
} catch {

test/wpt/status/url.json

-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,5 @@
1515
},
1616
"javascript-urls.window.js": {
1717
"skip": "requires document.body reference"
18-
},
19-
"url-origin.any.js": {
20-
"skip": "implementation not up to date"
2118
}
2219
}

0 commit comments

Comments
 (0)