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

Function testElementType

deps/v8/test/mjsunit/asm/atomics-sub.js:69–82  ·  view source on GitHub ↗
(taConstr, f, offset)

Source from the content-addressed store, hash-verified

67}
68
69function testElementType(taConstr, f, offset) {
70 clearArray();
71
72 var ta = new taConstr(sab, offset);
73 var name = Object.prototype.toString.call(ta);
74 ta[0] = 30;
75 assertEquals(30, f(0, 10), name);
76 assertEquals(20, ta[0]);
77 assertEquals(20, f(0, 10), name);
78 assertEquals(10, ta[0]);
79 // out of bounds
80 assertThrows(function() { f(-1, 0); });
81 assertThrows(function() { f(ta.length, 0); });
82}
83
84function testElement(m, offset) {
85 testElementType(Int8Array, m.subi8, offset);

Callers 1

testElementFunction · 0.70

Calls 5

clearArrayFunction · 0.70
fFunction · 0.70
assertEqualsFunction · 0.50
assertThrowsFunction · 0.50
callMethod · 0.45

Tested by

no test coverage detected