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

Function AsmModule

deps/v8/test/mjsunit/wasm/asm-wasm-imports.js:22–39  ·  view source on GitHub ↗
(stdlib, foreign, buffer)

Source from the content-addressed store, hash-verified

20
21function TestForeignFunctions() {
22 function AsmModule(stdlib, foreign, buffer) {
23 "use asm";
24
25 var setVal = foreign.setVal;
26 var getVal = foreign.getVal;
27
28 function caller(initial_value, new_value) {
29 initial_value = initial_value|0;
30 new_value = new_value|0;
31 if ((getVal()|0) == (initial_value|0)) {
32 setVal(new_value|0);
33 return getVal()|0;
34 }
35 return 0;
36 }
37
38 return {caller:caller};
39 }
40
41 function ffi(initial_val) {
42 var val = initial_val;

Callers 2

TestForeignFunctionsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected