code: func valueToRangeIndex(indexValue Value, length int64, negativeIsZero bool) int64 {
  	index := indexValue.number().int64
  	if negativeIsZero {
  		if index < 0 {
  			index = 0
  		}
  		// minimum(index, length)
  		if index >= length {
  			index = length
  		}
  		return index
  	}
  
  	if index < 0 {
  		index += length
  		if index < 0 {
  			index = 0
  		}
  	} else {
  		if index > length {
  			index = length
  		}
  	}
  	return index
  }
docs: // A range index can be anything from 0 up to length. It is NOT safe to use as an index
  // to an array, but is useful for slicing and in some ECMA algorithms.