Bug 186691
| Summary: | [[OwnPropertyKeys]] order with large integer index keys up to 2 ** 53 - 1 | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Leo Balter <leo> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED CONFIGURATION CHANGED | ||
| Severity: | Normal | CC: | ashvayka |
| Priority: | P2 | ||
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Leo Balter
From 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. An array index is an integer index whose numeric value i is in the range +0 ≤ i < 2**32-1.
https://github.com/tc39/test262/pull/1580
Current behavior is not taking values from 2 ** 32 and up as integer index.
```
var o1 = {
12345678900: true,
b: true,
1: true,
a: true,
[Number.MAX_SAFE_INTEGER]: true,
12345678901: true,
};
var result = Object.getOwnPropertyNames(o1);
result.forEach(k => console.log(k));
```
prints:
```
"1"
"12345678900"
"b"
"a"
"9007199254740991"
"12345678901"
```
It should print:
```
"1"
"12345678900"
"12345678901"
"9007199254740991"
"b"
"a"
```
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Alexey Shvayka
(In reply to Leo Balter from comment #0)
> https://github.com/tc39/test262/pull/1580
>
> Current behavior is not taking values from 2 ** 32 and up as integer index.
https://github.com/tc39/ecma262/pull/1242 replaced "integer index" with "array index", aligning the spec with web reality.
(In reply to Leo Balter from comment #0)
> "1"
> "12345678900"
> "b"
> "a"
> "9007199254740991"
> "12345678901"
is now printed by JSC, V8, and SpiderMonkey as per updated spec.