blob: 1fd07af6d4083f20826d222b1fd240f77eccab30 [file] [log] [blame]
<!DOCTYPE HTML>
<html>
<head>
<script src="../../../resources/js-test-pre.js"></script>
</head>
<body>
<script>
description("Test relationship between module scope and setInterval");
window.jsTestIsAsync = true;
debug("Module is not executed yet.");
window.cocoa = 'Global Scope'
window.visibleAtATime = null;
window.token = null;
</script>
<script type="module">
var cocoa = 'Module Scope';
window.visibleAtATime = cocoa;
shouldBeEqualToString("visibleAtATime", "Module Scope");
token = setInterval(function () {
clearInterval(token);
window.visibleAtATime = cocoa;
shouldBeEqualToString("visibleAtATime", "Module Scope");
token = setInterval(`
clearInterval(token);
window.visibleAtATime = cocoa;
shouldBeEqualToString("visibleAtATime", "Global Scope");
finishJSTest();
`, 0);
}, 0);
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>
</html>