Closed Bug 1246895 Opened 4 years ago Closed 4 years ago
Atomic operations do not throw Range
Error for index -0
Spec here: https://tc39.github.io/ecmascript_sharedmem/shmem.html#Atomics.ValidateAtomicAccess Step 6 says that if the index value is -0 then we should throw a RangeError, but we do not. (This is in the interpreter, haven't checked the JIT yet.) Test case here: https://github.com/tc39/ecmascript_sharedmem/blob/master/test262/atomics-range.js
There is a bug in the shared memory spec here: ValidateAtomicAccess needs to more closely duplicate the logic of the ES6 spec with regard to how property names are interpreted. For example, it is only when the property name is a string that -0 results in out-of-bounds like behavior in ES6, and when the property name is a number it is converted to a string by ToString(), which converts -0 to "0". Ergo, using a string index "-0" should be an error, but using a number index that is -0 should not be an error. Filed bug: https://github.com/tc39/ecmascript_sharedmem/issues/62. Closing this bug until further notice.
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.