Skip to content

Commit

Permalink
Remove leftover references to createURL and TrustedURL types
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewarlow committed Jul 17, 2024
1 parent 59497e6 commit afb7384
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@
assert_throws_js(TypeError, _ => {
p.createScriptURL(INPUTS.SCRIPTURL);
});
assert_throws_js(TypeError, _ => {
p.createURL(INPUTS.URL);
});
}, "createHTML defined - calling undefined callbacks throws");

//Script tests
Expand Down Expand Up @@ -145,9 +142,6 @@
assert_throws_js(TypeError, _ => {
p.createScriptURL(INPUTS.SCRIPTURL);
});
assert_throws_js(TypeError, _ => {
p.createURL(INPUTS.URL);
});
}, "createScript defined - calling undefined callbacks throws");


Expand Down Expand Up @@ -220,9 +214,6 @@
assert_throws_js(TypeError, _ => {
p.createScript(INPUTS.SCRIPT);
});
assert_throws_js(TypeError, _ => {
p.createURL(INPUTS.URL);
});
}, "createScriptURL defined - calling undefined callbacks throws");

test(t => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// Non-allowed names test
test(t => {
assert_throws_js(TypeError, _ => {
window.trustedTypes.createPolicy('SomeOtherName', { createURL: s => s } );
window.trustedTypes.createPolicy('SomeOtherName', { createHTML: s => s } );
});
}, "Non-allowed name policy creation throws.");
</script>
4 changes: 2 additions & 2 deletions trusted-types/block-string-assignment-to-Document-write.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</head>
<body>
<script>
// TrustedURL assignments do not throw.
// TrustedHTML assignments do not throw.
let p = createHTML_policy(window, 1);
test(t => {
document.body.innerText = '';
Expand All @@ -26,7 +26,7 @@
assert_equals(document.body.innerText, "abcdefghijkl");
}, "document.write with multiple trusted arguments.");

// TrustedURL assignments do not throw. (Now for writeln.)
// TrustedHTML assignments do not throw. (Now for writeln.)
test(t => {
document.body.innerText = '';
let html = p.createHTML(INPUTS.HTML);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
const a_policy = {
createHTML: id,
createScriptURL: id,
createURL: id,
createScript: id,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
const a_policy = {
createHTML: id,
createScriptURL: id,
createURL: id,
createScript: id,
};

Expand Down
1 change: 0 additions & 1 deletion trusted-types/trusted-types-eval-reporting.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
const a_policy = {
createHTML: id,
createScriptURL: id,
createURL: id,
createScript: id,
};
const scriptyPolicy = trustedTypes.createPolicy('allowEval', a_policy);
Expand Down

0 comments on commit afb7384

Please sign in to comment.