function AtomicsCompareExchangeJS(sta, index, oldValue, newValue) {
  CheckSharedIntegerTypedArray(sta);
  index = ValidateIndex(index, %_TypedArrayGetLength(sta));
  oldValue = TO_NUMBER(oldValue);
  newValue = TO_NUMBER(newValue);
  return %_AtomicsCompareExchange(sta, index, oldValue, newValue);
}
function AtomicsCompareExchangeJS(sta, index, oldValue, newValue) {
  CheckSharedIntegerTypedArray(sta);
  index = ValidateIndex(index, %_TypedArrayGetLength(sta));
  oldValue = TO_NUMBER(oldValue);
  newValue = TO_NUMBER(newValue);
  return %_AtomicsCompareExchange(sta, index, oldValue, newValue);
}
function AtomicsCompareExchangeJS ( sta , index , oldValue , newValue ) { CheckSharedIntegerTypedArray ( sta ) ; index = ValidateIndex ( index , % _TypedArrayGetLength ( sta ) ) ; oldValue = TO_NUMBER ( oldValue ) ; newValue = TO_NUMBER ( newValue ) ; return % _AtomicsCompareExchange ( sta , index , oldValue , newValue ) ; }
-------------------------------------------------------------------
-------------------------------------------------------------------