Console display an number index object as an array

NEW
Unassigned

Status

()

Firefox
Developer Tools: Console
P3
normal
a year ago
a year ago

People

(Reporter: dindog, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

a year ago
>> foo={"1":{},"2":{}}
<< Object [ null, Object, Object ]

>> bar={"a":{},"b":{}}
<< Object { a: Object, b: Object }

Is it a bug or designed that way?
(Reporter)

Comment 1

a year ago
Note:
1. Reproduce the bug in Firefox 53 Nightly
2. A better self-explained example: 
 >> foo={"1":{},"2":{}, "34234234": 3}
 << Object [ null, Object, Object, null, null, null, null, null, null, null, 34234225 moreā€¦ ]
Component: JavaScript Engine → Developer Tools: Console
Product: Core → Firefox
(In reply to dindog from comment #0)
> >> foo={"1":{},"2":{}}
> << Object [ null, Object, Object ]
> 
> >> bar={"a":{},"b":{}}
> << Object { a: Object, b: Object }
> 
> Is it a bug or designed that way?

I think it's a wanted behavior (see Bug 1301794),
but in the code from comment 2, I can see it being a problem.
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.