[Webkit-unassigned] [Bug 30974] Web Inspector: Pretty print array-like objects

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Oct 31 10:06:35 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=30974





--- Comment #3 from Patrick Mueller <pmuellr at yahoo.com>  2009-10-31 10:06:34 PDT ---
I guess the question is, what kind of output do you get if you print an object
which happens to have a length property but is not actually an array?  Won't it
skip over all keys that aren't in the range 0..length?  Which is probably all
the keys?  Here's an example session, which shows the (potential) problem:

   > x = [1,2,3]
   [1, 2, 3] 
   > x.a = 4
   4
   > x
   [1, 2, 3]

woops, where's x.a printed???

Personally, it seems like it'd be more consistent to alway print arrays and
objects the same way; both are indexed collections, but one has a constrained
set of index values.  

Maybe instead we need to have different ways to print different representations
- different functions, or a "mode" switch, or something.

But I don't have much skin in the game here - I rarely print array-like things
in the console.  Objects, all the time, but for some reason, almost never
arrays.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list