MCPcopy
hub / github.com/javascript-obfuscator/javascript-obfuscator / set

Function set

test/fixtures/compile-performance.js:27356–27364  ·  view source on GitHub ↗
(view, bytes, index, conversion, value, isLittleEndian)

Source from the content-addressed store, hash-verified

27354 return isLittleEndian ? pack : pack.reverse();
27355 };
27356 var set = function(view, bytes, index, conversion, value, isLittleEndian){
27357 var numIndex = +index
27358 , intIndex = toInteger(numIndex);
27359 if(numIndex != intIndex || intIndex < 0 || intIndex + bytes > view[$LENGTH])throw RangeError(WRONG_INDEX);
27360 var store = view[$BUFFER]._b
27361 , start = intIndex + view[$OFFSET]
27362 , pack = conversion(+value);
27363 for(var i = 0; i < bytes; i++)store[start + i] = pack[isLittleEndian ? i : bytes - i - 1];
27364 };
27365
27366 var validateArrayBufferArguments = function(that, length){
27367 anInstance(that, $ArrayBuffer, ARRAY_BUFFER);

Callers 1

Calls 2

isObjectFunction · 0.85
hasFunction · 0.50

Tested by

no test coverage detected