function ValidateIndex(index, length) {
  var numberIndex = TO_NUMBER(index);
  var accessIndex = TO_INTEGER(numberIndex);
  if (numberIndex !== accessIndex) {
    throw MakeRangeError(kInvalidAtomicAccessIndex);
  }
  if (accessIndex < 0 || accessIndex >= length) {
    throw MakeRangeError(kInvalidAtomicAccessIndex);
  }
  return accessIndex;
}
function ValidateIndex(index, length) {
  var numberIndex = TO_NUMBER(index);
  var accessIndex = TO_INTEGER(numberIndex);
  if (numberIndex !== accessIndex) {
    throw MakeRangeError(kInvalidAtomicAccessIndex);
  }
  if (accessIndex < 0 || accessIndex >= length) {
    throw MakeRangeError(kInvalidAtomicAccessIndex);
  }
  return accessIndex;
}
function ValidateIndex ( index , length ) { var numberIndex = TO_NUMBER ( index ) ; var accessIndex = TO_INTEGER ( numberIndex ) ; if ( numberIndex !== accessIndex ) { throw MakeRangeError ( kInvalidAtomicAccessIndex ) ; } if ( accessIndex < 0 || accessIndex >= length ) { throw MakeRangeError ( kInvalidAtomicAccessIndex ) ; } return accessIndex ; }
https://tc39.github.io/ecmascript_sharedmem/shmem.html#Atomics.ValidateAtomicAccess
https : // tc39 . github . io / ecmascript_sharedmem / shmem . html#Atomics . ValidateAtomicAccess