Closed Bug 1149736 Opened 5 years ago Closed 3 years ago
Typed Array Index should use To Integer, To Length, or something similar to do conversions
Particularly, using ValueToId and IsTypedArrayIndex is just not really right. Without checking, I'd presume doing it this way means that if I were to do Atomics.load(arr, Symbol.iterator); then I wouldn't get an error thrown trying to convert the index to a number. But ordinarily trying to convert a symbol to anything is expected to throw. This seems inconsistent with, e.g. new DataView(typedArray).getInt8(Symbol.iterator).
Seems plausible. The spec is lagging here too, if I'm not mistaken.
GetSharedTypedArrayIndex is gone, but GetTypedArrayIndex has the same problem.
Summary: GetSharedTypedArrayIndex should use ToInteger, ToLength, or something similar to do conversions → GetTypedArrayIndex should use ToInteger, ToLength, or something similar to do conversions
GetTypedArrayIndex now delegates to ToIntegerIndex, which appears to do the right thing, and if it should turn out that it does not the right thing at least we're doing things consistently. A big Thank You to whoever cleaned this up.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.