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

Function testOp

deps/v8/test/mjsunit/harmony/atomics.js:146–159  ·  view source on GitHub ↗
(op, ia, index, expectedIndex, name)

Source from the content-addressed store, hash-verified

144 var si32a2 = new Int32Array(sab, 32);
145
146 var testOp = function(op, ia, index, expectedIndex, name) {
147 for (var i = 0; i < ia.length; ++i)
148 ia[i] = i * 2;
149
150 ia[expectedIndex] = 0;
151 var result = op(ia, index, 0, 0);
152 assertEquals(0, result, name);
153 assertEquals(0, ia[expectedIndex], name);
154
155 for (var i = 0; i < ia.length; ++i) {
156 if (i == expectedIndex) continue;
157 assertEquals(i * 2, ia[i], name);
158 }
159 };
160
161 // These values all map to index 0
162 [-0, 0, 0.0, null, false, NaN, {}, '0.2', 'hi', undefined].forEach(

Callers 1

atomics.jsFile · 0.85

Calls 4

MaybeIntToBigIntFunction · 0.85
opFunction · 0.50
assertEqualsFunction · 0.50
assertThrowsFunction · 0.50

Tested by

no test coverage detected