diff options
Diffstat (limited to 'testing/web-platform/mozilla/tests/html/semantics/scripting-1/the-script-element/support/evaluation-order-setup.mjs')
-rw-r--r-- | testing/web-platform/mozilla/tests/html/semantics/scripting-1/the-script-element/support/evaluation-order-setup.mjs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/testing/web-platform/mozilla/tests/html/semantics/scripting-1/the-script-element/support/evaluation-order-setup.mjs b/testing/web-platform/mozilla/tests/html/semantics/scripting-1/the-script-element/support/evaluation-order-setup.mjs new file mode 100644 index 0000000000..d3f22e9ee0 --- /dev/null +++ b/testing/web-platform/mozilla/tests/html/semantics/scripting-1/the-script-element/support/evaluation-order-setup.mjs @@ -0,0 +1,19 @@ +globalThis.setup({allow_uncaught_exception: true}); + +globalThis.log = []; + +globalThis.addEventListener("error", + event => globalThis.log.push("global-error", event.error.message)); +globalThis.addEventListener("onunhandledrejection", + event => globalThis.log.push('unhandled-promise-rejection')); +globalThis.addEventListener("load", + event => globalThis.log.push("global-load")); + +globalThis.unreachable = function() { + globalThis.log.push("unreachable"); +} + +globalThis.test_load = async_test("Test evaluation order of modules"); +globalThis.testDone = globalThis.test_load.step_func_done(() => { + assert_array_equals(globalThis.log, globalThis.expectedLog); +}); |