Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test active script propagation through Web IDL #24535

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// import()s in eval are resolved relative to the script, even when indirected through Web IDL callbacks
setTimeout(eval, 0, `import('../../imports-a.js?label=' + window.label).then(window.continueTest, window.errorTest)`);
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
const evaluators = [
"setTimeout",
"eval",
"setTimeout-eval",
"Function",
"reflected-inline-event-handlers",
"inline-event-handlers-UA-code"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
const evaluators = [
"setTimeout",
"eval",
"setTimeout-eval",
"Function",
"reflected-inline-event-handlers",
"inline-event-handlers-UA-code"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
const evaluators = {
setTimeout,
eval,
"setTimeout + eval"(x) {
setTimeout(eval, 0, x);
},
"the Function constructor"(x) {
Function(x)();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
const evaluators = {
setTimeout,
eval,
"setTimeout + eval"(x) {
setTimeout(eval, 0, x);
},
"the Function constructor"(x) {
Function(x)();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
"the Function constructor"(x) {
Function(x)();
},
"setTimeout + eval"(x) {
setTimeout(eval, 0, x);
},
"reflected inline event handlers"(x) {
dummyDiv.setAttribute("onclick", x);
dummyDiv.onclick();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
const evaluators = {
eval,
setTimeout,
"setTimeout + eval"(x) {
setTimeout(eval, 0, x);
},
"the Function constructor"(x) {
Function(x)();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@
return promise.then(assertSuccessful);
}, "indirect eval must inherit the nonce from the triggering script, thus execute");

promise_test(t => {
const promise = createTestPromise(t);

setTimeout(eval, 0, `import('../imports-a.js?label=direct eval').then(window.continueTest, window.errorTest)`);

return promise.then(assertSuccessful);
}, "setTimeout + eval must inherit the nonce from the triggering script, thus execute");

promise_test(t => {
const promise = createTestPromise(t);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@
return promise.then(assertSuccessful);
}, "indirect eval must inherit the nonce from the triggering script, thus execute");

promise_test(t => {
const promise = createTestPromise(t);

setTimeout(eval, 0, `import('../imports-a.js?label=direct eval').then(window.continueTest, window.errorTest)`);

return promise.then(assertSuccessful);
}, "setTimeout + eval must inherit the nonce from the triggering script, thus execute");

promise_test(t => {
const promise = createTestPromise(t);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>import() inside compiled strings inside a classic script</title>
<title>Compiling strings resulting from Promise resolution</title>
<link rel="help" href="https://github.com/whatwg/html/pull/3163">
<link rel="help" href="https://github.com/tc39/ecma262/issues/871#issuecomment-292493142">
<link rel="author" title="Domenic Denicola" href="mailto:[email protected]">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
const evaluators = {
eval: otherWindow.eval,
setTimeout: otherWindow.setTimeout,
"setTimeout + eval"(x) {
otherWindow.setTimeout(otherWIndow.eval, 0, x);
},
"the Function constructor"(x) {
otherWindow.Function(x)();
},
Expand Down