MCPcopy Index your code
hub / github.com/nodejs/node / createModule

Function createModule

deps/v8/test/inspector/debugger/wasm-scripts.js:19–29  ·  view source on GitHub ↗
(...customSections)

Source from the content-addressed store, hash-verified

17
18// Create module with given custom sections.
19function createModule(...customSections) {
20 var builder = new WasmModuleBuilder();
21 builder.addFunction('nopFunction', kSig_v_v).addBody([kExprNop]);
22 builder.addFunction('main', kSig_v_v)
23 .addBody([kExprBlock, kWasmVoid, kExprI32Const, 2, kExprDrop, kExprEnd])
24 .exportAs('main');
25 for (var { name, value } of customSections) {
26 builder.addCustomSection(name, value);
27 }
28 return builder.toArray();
29}
30
31function testFunction(bytes) {
32 // Compilation triggers registration of wasm scripts.

Callers 1

wasm-scripts.jsFile · 0.70

Calls 5

addFunctionMethod · 0.95
addCustomSectionMethod · 0.95
toArrayMethod · 0.95
addBodyMethod · 0.45
exportAsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…