summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/mozilla/tests/html/semantics/scripting-1/the-script-element/support/evaluation-order-setup.mjs
blob: d3f22e9ee0f0bb00f1404c44469f8fd2c57b1bf3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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);
});