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

Function assertThrowsOrEquals

deps/v8/test/mjsunit/asm/global-imports.js:26–32  ·  view source on GitHub ↗
(result, fun)

Source from the content-addressed store, hash-verified

24function p(x) { return x * x; }
25
26function assertThrowsOrEquals(result, fun) {
27 if (result === throws) {
28 assertThrows(fun, TypeError);
29 } else {
30 assertEquals(result, fun(1, 2.3, 4.2));
31 }
32}
33
34function RunAsmJsTest(asm_source, imports, result, valid) {
35 var nonasm_source = asm_source.replace(new RegExp("use asm"), "");

Callers 1

RunAsmJsTestFunction · 0.85

Calls 3

assertThrowsFunction · 0.50
assertEqualsFunction · 0.50
funFunction · 0.50

Tested by

no test coverage detected