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

Function testBounds

deps/v8/test/mjsunit/wasm/table-grow.js:32–41  ·  view source on GitHub ↗
(func, table)

Source from the content-addressed store, hash-verified

30}
31
32function testBounds(func, table) {
33 for (let i = 0; i < table.length; i++) {
34 assertEquals(0, func(i));
35 }
36 let l = table.length;
37 let oob = [l, l + 1, l + 2, l * 2, l * 3, l + 10000];
38 for (let i of oob) {
39 assertThrows(() => func(i));
40 }
41}
42
43function addMain(builder) {
44 builder.addImportedTable("imp", "table", 0, kMaxTableSize);

Callers 1

table-grow.jsFile · 0.85

Calls 3

funcFunction · 0.70
assertEqualsFunction · 0.50
assertThrowsFunction · 0.50

Tested by

no test coverage detected