Closed Bug 1130392 Opened 10 years ago Closed 10 years ago

The list of numeric properties on an object in the debugger should always be sorted in incrementing order

Categories

(DevTools :: Debugger, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 967319

People

(Reporter: jaws, Unassigned)

References

(Blocks 1 open bug)

Details

+++ This bug was initially created as a clone of Bug #883702 +++

The debugger sorts properties in alphabetical ordering, but when it comes to numerical properties it sorts them in the following order:

0:
1:
10:
100:
101 through 108:
109:
11:
110:
etc.

It is treating those numbers as strings.
Mentor: jaws
Assignee: nobody → rtorruellas
Status: NEW → ASSIGNED
Simpler steps to reproduce:
In the console, type the following commands:
let a = {1: 1, 2: 2, 10:10};
a;

Notice how the console shows that the value of `a` is `Object { 1: 1, 2: 2, 10: 10 }`.
Click on the "Object" value.
The variables view that appears will show the properties in a vertical column, in the order of: 1, 10, 2.

To fix this bug, you will need to edit http://mxr.mozilla.org/mozilla-central/source/browser/devtools/shared/widgets/VariablesView.jsm?rev=0f7b2674c64a#1398 and http://mxr.mozilla.org/mozilla-central/source/browser/devtools/shared/widgets/VariablesView.jsm?rev=0f7b2674c64a#2235 to take a custom sorting function that will order properties that parse as numbers numerically (in increasing order), and properties that do not parse as numbers lexicographically.
Assignee: rtorruellas → bmax1337
This is a duplicate of bug 967319 (six digits!), but I will leave it up to you which way to dupe.
We can dupe to the older bug. Brandon, I'm going to close this bug and re-assign you to bug 967319 since it was filed first :)
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
Assignee: bmax1337 → nobody
Mentor: jaws
Product: Firefox → DevTools
Blocks: 1565711
Blocks: 1565713
No longer blocks: 1565711
No longer blocks: 1565713
You need to log in before you can comment on or make changes to this bug.