summaryrefslogtreecommitdiffstats
path: root/dom/fs/test/mochitest/worker/head.js
blob: 72e1869bde3176a84c5a0933dcdb2d0d49450f00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/**
 * Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/
 */

async function require_module(id) {
  if (!require_module.moduleLoader) {
    importScripts("/tests/dom/quota/test/modules/worker/ModuleLoader.js");

    const base = location.href;

    const depth = "../../../../../";

    importScripts("/tests/dom/quota/test/modules/worker/Assert.js");

    importScripts("/tests/dom/quota/test/modules/worker/Utils.js");

    require_module.moduleLoader = new globalThis.ModuleLoader(base, depth);
  }

  return require_module.moduleLoader.require(id);
}