code: 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;
  }
docs: https://tc39.github.io/ecmascript_sharedmem/shmem.html#Atomics.ValidateAtomicAccess