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

Function RunAsmJsTest

deps/v8/test/mjsunit/wasm/asm-wasm-literals.js:7–20  ·  view source on GitHub ↗
(asmfunc, expect)

Source from the content-addressed store, hash-verified

5// Flags: --validate-asm --allow-natives-syntax
6
7function RunAsmJsTest(asmfunc, expect) {
8 var asm_source = asmfunc.toString();
9 var nonasm_source = asm_source.replace(new RegExp("use asm"), "");
10 var stdlib = {Math: Math};
11
12 print("Testing " + asmfunc.name + " (js)...");
13 var js_module = eval("(" + nonasm_source + ")")(stdlib);
14 expect(js_module);
15
16 print("Testing " + asmfunc.name + " (asm.js)...");
17 var asm_module = asmfunc(stdlib);
18 assertTrue(%IsAsmWasmCode(asmfunc));
19 expect(asm_module);
20}
21
22function PositiveIntLiterals() {
23 "use asm";

Callers 1

Calls 5

expectFunction · 0.70
printFunction · 0.50
evalFunction · 0.50
assertTrueFunction · 0.50
toStringMethod · 0.45

Tested by

no test coverage detected