Skip to content

Commit ffb2ef4

Browse files
watildeevanlucas
authored andcommitted
url: remove javascript URL special case
PR-URL: #12507 Fixes: #11485 Reviewed-By: James M Snell <[email protected]>
1 parent 5a27f63 commit ffb2ef4

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

lib/internal/url.js

-2
Original file line numberDiff line numberDiff line change
@@ -556,8 +556,6 @@ Object.defineProperties(URL.prototype, {
556556
const ctx = this[context];
557557
// toUSVString is not needed.
558558
hash = `${hash}`;
559-
if (this.protocol === 'javascript:')
560-
return;
561559
if (!hash) {
562560
ctx.fragment = null;
563561
ctx.flags &= ~binding.URL_FLAGS_HAS_FRAGMENT;

test/fixtures/url-setter-tests.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -1800,13 +1800,13 @@ module.exports =
18001800
"hash": "#%c3%89t%C3%A9"
18011801
}
18021802
},
1803-
// {
1804-
// "href": "javascript:alert(1)",
1805-
// "new_value": "castle",
1806-
// "expected": {
1807-
// "href": "javascript:alert(1)#castle",
1808-
// "hash": "#castle"
1809-
// }
1810-
// }
1803+
{
1804+
"href": "javascript:alert(1)",
1805+
"new_value": "castle",
1806+
"expected": {
1807+
"href": "javascript:alert(1)#castle",
1808+
"hash": "#castle"
1809+
}
1810+
}
18111811
]
18121812
}

0 commit comments

Comments
 (0)