blob: c39b8170dd7846f7d3e4515c6f0fee2cfd79bc71 [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 setTimeout");
window.jsTestIsAsync = true;
debug("Module is not executed yet.");
window.cocoa = 'Global Scope'
window.visibleAtATime = null;
</script>
<script type="module">
var cocoa = 'Module Scope';
window.visibleAtATime = cocoa;
shouldBeEqualToString("visibleAtATime", "Module Scope");
setTimeout(function () {
window.visibleAtATime = cocoa;
shouldBeEqualToString("visibleAtATime", "Module Scope");
setTimeout(`
window.visibleAtATime = cocoa;
shouldBeEqualToString("visibleAtATime", "Global Scope");
finishJSTest();
`, 0);
}, 0);
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>
</html>