Implement CanonicalNumericIndexString and use it for typed arrays

NEW
Unassigned

Status

()

Core
JavaScript Engine
3 years ago
11 months ago

People

(Reporter: evilpie, Unassigned)

Tracking

(Blocks: 2 bugs)

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
ES6 imposes all sorts of stuff on array indexes in typed arrays. See for example [[HasProperty]]

If IsDetachedBuffer(buffer) is true, throw a TypeError exception.
If IsInteger(index) is false then return false
If index = −0, return false.

We have IsTypedArrayIndex, but that doesn't accept doubles, like CanonicalNumericIndexString

After this is implemented the MOP needs to be audited and corrected.
Assignee: nobody → winter2718
By my reading this should be a valid test case:

let a = new Int8Array([1]);
assertEq(Object.getOwnPropertyDescriptor(a, "-0"), a[-0]);
assertEq(Object.getOwnPropertyDescriptor(a, "0.0"), a[0.0]);
arg, two problems: * Object.getOwnPropertyDescriptor(a, x).value

and these test cases are not valid because of step 4. in  CanonicalNumericIndexString
Blocks: 1291857
No longer blocks: 694100
(Reporter)

Updated

a year ago
Blocks: 652780

Updated

11 months ago
Assignee: winter2718 → nobody
You need to log in before you can comment on or make changes to this bug.