Closed
Bug 1149736
Opened 10 years ago
Closed 8 years ago
GetTypedArrayIndex should use ToInteger, ToLength, or something similar to do conversions
Categories
(Core :: JavaScript: Standard Library, defect)
Core
JavaScript: Standard Library
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: Waldo, Assigned: mrrrgn)
References
(Blocks 2 open bugs)
Details
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).
Comment 1•10 years ago
|
||
Seems plausible. The spec is lagging here too, if I'm not mistaken.
Blocks: shared-array-buffer
Comment 2•9 years ago
|
||
GetSharedTypedArrayIndex is gone, but GetTypedArrayIndex has the same problem.
Blocks: es6
Summary: GetSharedTypedArrayIndex should use ToInteger, ToLength, or something similar to do conversions → GetTypedArrayIndex should use ToInteger, ToLength, or something similar to do conversions
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → winter2718
Updated•8 years ago
|
Blocks: es6typedarray
Comment 3•8 years ago
|
||
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: 8 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•