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

Function testElementType

deps/v8/test/mjsunit/asm/atomics-exchange.js:72–83  ·  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 ta[0] = 0x7f;
78 assertEquals(0x7f, f(0, 0xf), name);
79 assertEquals(0xf, ta[0]);
80 // out of bounds
81 assertThrows(function() { f(-1, 0); });
82 assertThrows(function() { f(ta.length, 0); });
83}
84
85function testElement(m, offset) {
86 testElementType(Int8Array, m.exchangei8, 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