Closed evilpie closed 7 years ago
I'm won't have a chance to investigate fully until next week, but the reason the spec is currently using ToInteger and not ToIndex is deliberately to be compatible in behavior with other parts of the spec instead of confusingly incompatible. Whether that is right or not is probably a matter for the committee at this point. (I'll try to figure out what it is that it was supposed to be compatible with.)
It appears that the current proposal language is modeled on an older version of GetViewValue, which has since been changed to use ToIndex. I don't think there's any reason not to change the proposal to follow that change, as Tom says. Given the structure of the proposal text the only change should be in ValidateAtomicAccess, where steps 2-4 are replaced by a call to ToIndex and step 6 does not need to test for negative values.
@syg @bterlson, please weigh in on this issue ASAP.
Not fixed in ecma262.
I think we want to switch everything new to ToIndex instead of ToInteger. This affects at least ValidateAtomicAccess.