Sort all integer indexed properties in [[OwnPropertyKeys]]

RESOLVED INVALID

Status

()

defect
P3
normal
RESOLVED INVALID
2 years ago
6 months ago

People

(Reporter: anba, Unassigned)

Tracking

(Blocks 1 bug)

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox58 affected)

Details

(Whiteboard: [js:correctness])

Per the spec all integer indexed properties should appear before string- and symbol-valued property keys.

```
var o = { a: 0, 4294967296: 0, 0: 0 };
print(Reflect.ownKeys(o));
```

Expected: Prints "0,4294967296,a"
Actual: Prints "0,a,4294967296"


https://tc39.github.io/ecma262/#sec-ordinaryownpropertykeys
9.1.11.1 OrdinaryOwnPropertyKeys ( O )

...
2. For each own property key P of O that is an integer index, in ascending numeric index order, do
  a. Add P as the last element of keys.
...


https://tc39.github.io/ecma262/#sec-object-type
> An integer index is a String-valued property key that is a canonical numeric
> String (see 7.1.16) and whose numeric value is either +0 or a positive
> integer ≤ 2^53-1.
Priority: -- → P3
Whiteboard: [js:correctness]
Blocks: test262
See also https://github.com/tc39/ecma262/pull/1242 for changing the spec to our current behavior.

No longer valid now that the spec PR has been merged.

Status: NEW → RESOLVED
Closed: 6 months ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.