| <!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> |