summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/wasm/jsapi/functions/helper.js
blob: 487791c69ad43043985e38ae7ea37d540695fde4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
function call_later(f) {
  const builder = new WasmModuleBuilder();
  const functionIndex = builder.addImport("module", "imported", kSig_v_v);
  builder.addStart(functionIndex);
  const buffer = builder.toBuffer();

  WebAssembly.instantiate(buffer, {
    "module": {
      "imported": f,
    }
  });
}