When looking at arrays in the scope pane their contents are sorted lexically rather than numerically. Would also be helpful to have length info presented early.
The array sorting was fixed in: https://bugs.webkit.org/show_bug.cgi?id=27329 However, listing the "length" doesn't currently happen. Is this still wanted?
I think we should show length, but not mixed with the number properties. But as a number next to the object name. We could/should do this for anythign with a length I think, so NodeLists, etc. So it would look like this: forBar: Array (2) 0: "def" 1: "abc" Or: myElement: HTMLDivElement childNodes: NodeList (2) 0: HTMLDivElement 1: HTMLDivElement ...
Do we show the name anymore? This would be straightforward, but with some tests I'm not sure the best place to put it: > a [5, 4, 3, 2, 3, 3, 3] Should it look something like: > a Length: 5 [5, 4, 3, 2, 3, 3, 3] or > a 5 Items [5, 4, 3, 2, 3, 3, 3] I'm just not sure the best way to put this in the UI, now that we don't explicitly state Array - however, we could do that.
For property lists we still show the name (Array), or we should. So my proposal would still stand: Array (2), etc. You are thinking of logging. I don't think we need to show the lenght when logging an array like you did. Only if you do: dir(a) would we show what I mention and what this bug is about.
Created attachment 48729 [details] Add lengths to the description of Arrays, NodeLists, and HTMLCollections in the Inspector property lists
(In reply to comment #5) > Created an attachment (id=48729) [details] > Add lengths to the description of Arrays, NodeLists, and HTMLCollections in the > Inspector property lists There arensome inspector layout tests that can test the console output (and output of console.dir). Does this break any tests/could this be tested?
Comment on attachment 48729 [details] Add lengths to the description of Arrays, NodeLists, and HTMLCollections in the Inspector property lists I need to make sure that the length doesn't get appended to the description in the console as well.
I think length in console would be useful.
Created attachment 48731 [details] Add lengths to the description of Arrays, NodeLists, and HTMLCollections in the Inspector property lists (and not in the console as well)
(In reply to comment #8) > I think length in console would be useful. Same format as in the properties list?
I guess we don't have a good place in the console to show it. Nevermind for now.
Comment on attachment 48731 [details] Add lengths to the description of Arrays, NodeLists, and HTMLCollections in the Inspector property lists (and not in the console as well) > diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog > + if (result.type == "array") Use ===. > + if (this.property.value.propertyLength !== undefined) Should be: typeof this.property.value.propertyLength !== "undefined"
Created attachment 48738 [details] Add lengths to the description of Arrays, NodeLists, and HTMLCollections in the Inspector property lists (Fixed issues cited in comments)
Thanks for the review! Committed in r54856: http://trac.webkit.org/changeset/54856