Files
Kmake/test/fixtures/wpt/streams/transferable/resources/create-wasm-module.js
2026-05-26 23:36:42 -07:00

12 lines
493 B
JavaScript

// 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);
}