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

Function testImportName

deps/v8/test/mjsunit/wasm/import-function.js:281–292  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

279
280
281function testImportName(name) {
282 var builder = new WasmModuleBuilder();
283 builder.addImport("M", name, kSig_i_v);
284 builder.addFunction("main", kSig_i_v)
285 .addBody([
286 kExprCallFunction, 0
287 ])
288 .exportFunc();
289
290 let main = builder.instantiate({M: {[name]: () => 42}}).exports.main;
291 assertEquals(42, main());
292}
293
294testImportName('bla');
295testImportName('0');

Callers 1

import-function.jsFile · 0.85

Calls 7

addImportMethod · 0.95
addFunctionMethod · 0.95
instantiateMethod · 0.95
mainFunction · 0.70
assertEqualsFunction · 0.50
exportFuncMethod · 0.45
addBodyMethod · 0.45

Tested by

no test coverage detected