MCPcopy Create free account
hub / github.com/nodejs/node / createExport

Function createExport

deps/v8/test/mjsunit/wasm/export-identity.js:7–13  ·  view source on GitHub ↗
(fun)

Source from the content-addressed store, hash-verified

5d8.file.execute("test/mjsunit/wasm/wasm-module-builder.js");
6
7function createExport(fun) {
8 let builder = new WasmModuleBuilder();
9 let fun_index = builder.addImport("m", "fun", kSig_i_v)
10 builder.addExport("fun", fun_index);
11 let instance = builder.instantiate({ m: { fun: fun }});
12 return instance.exports.fun;
13}
14
15// Test that re-exporting a generic JavaScript function changes identity, as
16// the resulting export is an instance of {WebAssembly.Function} instead.

Callers 1

export-identity.jsFile · 0.70

Calls 3

addImportMethod · 0.95
addExportMethod · 0.95
instantiateMethod · 0.95

Tested by

no test coverage detected