summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/streams/transferable/resources/create-wasm-module.js
blob: 37064af95c55c00e27d5f73b8fc3b0603ac63077 (plain)
1
2
3
4
5
6
7
8
9
10
11
// There aren't many cloneable types that will cause an error on
// deserialization. WASM modules have the property that it's an error to
// deserialize them cross-site, which works for our purposes.
async function createWasmModule() {
  // It doesn't matter what the module is, so we use one from another
  // test.
  const response =
        await fetch("/wasm/serialization/module/resources/incrementer.wasm");
  const ab = await response.arrayBuffer();
  return WebAssembly.compile(ab);
}