Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Use ToIndex instead of ToInteger #160

Closed
evilpie opened this issue Dec 19, 2016 · 5 comments
Closed

Use ToIndex instead of ToInteger #160

evilpie opened this issue Dec 19, 2016 · 5 comments
Labels
Milestone

Comments

@evilpie
Copy link

evilpie commented Dec 19, 2016

I think we want to switch everything new to ToIndex instead of ToInteger. This affects at least ValidateAtomicAccess.

@lars-t-hansen
Copy link
Collaborator

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.)

@lars-t-hansen
Copy link
Collaborator

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.

@lars-t-hansen lars-t-hansen added this to the Stage 4 milestone Feb 9, 2017
@lars-t-hansen
Copy link
Collaborator

@syg @bterlson, please weigh in on this issue ASAP.

@lars-t-hansen
Copy link
Collaborator

Not fixed in ecma262.

@lars-t-hansen
Copy link
Collaborator

Moved to tc39/ecma262#807

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants