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

Function testElementType

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

Source from the content-addressed store, hash-verified

70}
71
72function testElementType(taConstr, f, offset) {
73 clearArray();
74
75 var ta = new taConstr(sab, offset);
76 var name = Object.prototype.toString.call(ta);
77 assertEquals(0, f(0, 0xf), name);
78 assertEquals(0xf, ta[0]);
79 assertEquals(0xf, f(0, 0x11), name);
80 assertEquals(0x1f, ta[0]);
81 // out of bounds
82 assertThrows(function() { f(-1, 0); });
83 assertThrows(function() { f(ta.length, 0); });
84}
85
86function testElement(m, offset) {
87 testElementType(Int8Array, m.ori8, 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