Closed Bug 1419730 Opened 7 years ago Closed 7 years ago

Javascript objects not expanded correctly in console if key is a number

Categories

(DevTools :: Console, defect)

57 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1371936

People

(Reporter: berlin.sebastian, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0
Build ID: 20171115095126

Steps to reproduce:

In Javascript:
1. Create an object containing a key that is a number and with any value.
2. Print the object to console with console.log().
3. Run script and in console, click the object representation, e.g. `Object { 11: "monkey" }`.

JSFiddle reproducing the bug: https://jsfiddle.net/Beppe/Ldo8p9mb/. I could reproduce this using a new profile.


Actual results:

No key/value is shown:
{…}
__proto__: Object { … }


Expected results:

Key/value is shown:
{…}
11: "monkey"
__proto__: Object { … }
Component: Untriaged → Developer Tools: Console
Hello sebastian, thanks for reporting !
This looks like Bug 1371936, which have been fixed a few days ago. I just checked in Nightly and the objects logged in the page do contain the numeric indices (by the way, do you know you can use `console.dir({11: "monkeys"})` to autoexpand objects ?). 

I will proceed and close this bug, but feel free to re-open it if you still see some weirdness with Nightly :)
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.