-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WebKit export of https://bugs.webkit.org/show_bug.cgi?id=273185
- Loading branch information
1 parent
f2cdcb7
commit cb39823
Showing
4 changed files
with
45 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script nonce="abc" src="/resources/testharness.js"></script> | ||
<script nonce="abc" src="/resources/testharnessreport.js"></script> | ||
<script nonce="abc" src="support/helper.sub.js"></script> | ||
<meta http-equiv="Content-Security-Policy" content="require-trusted-types-for 'script'"> | ||
</head> | ||
<body> | ||
<script> | ||
trustedTypes.createPolicy("default", {createScript: s => s.replace("1", "4")}); | ||
|
||
test(t => { | ||
assert_throws_js(EvalError, _ => eval('1+1')); | ||
}, "eval of string where default policy mutates value throws."); | ||
|
||
test(t => { | ||
assert_throws_js(EvalError, _ => eval?.('1+1')); | ||
}, "indirect eval of string where default policy mutates value throws."); | ||
|
||
test(t => { | ||
assert_throws_js(EvalError, _ => new Function('return 1+1')); | ||
}, "Function constructor with string where default policy mutates value throws."); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters