Closed Bug 1246895 Opened 9 years ago Closed 9 years ago

Atomic operations do not throw RangeError for index -0

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: lth, Assigned: lth)

References

(Blocks 1 open bug)

Details

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
Depends on: 1247275
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: 9 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.