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

Function testCallImport2

deps/v8/test/mjsunit/wasm/import-function.js:261–276  ·  view source on GitHub ↗
(foo, bar, expected)

Source from the content-addressed store, hash-verified

259
260
261function testCallImport2(foo, bar, expected) {
262 var builder = new WasmModuleBuilder();
263
264 builder.addImport("q", "foo", kSig_i_v);
265 builder.addImport("t", "bar", kSig_i_v);
266 builder.addFunction("main", kSig_i_v)
267 .addBody([
268 kExprCallFunction, 0, // --
269 kExprCallFunction, 1, // --
270 kExprI32Add, // --
271 ]) // --
272 .exportFunc();
273
274 var main = builder.instantiate({q: {foo: foo}, t: {bar: bar}}).exports.main;
275 assertEquals(expected, main());
276}
277
278testCallImport2(function() { return 33; }, function () { return 44; }, 77);
279

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…