[Webkit-unassigned] [Bug 25724] Incorrect collection output for Javascript console evaluation

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 20 07:52:09 PDT 2009


------- Comment #3 from pmuellr at yahoo.com  2009-05-20 07:52 PDT -------
By collections, do you mean arrays.  As in arrays vs. objects that aren't
arrays?  It's already a bit difficult to make a determination, at least in
user-land JavaScript, whether an object is an array or not.

It's difficult to determine the best thing to actually display, in a general
sense.  What might be interesting to think of is to allow objects returned from
frameworks like jQuery to make a determination of how to display themselves.  I
really like the structured output in the console that Web Inspector applies,
but poking through the jQuery output, it's also clear that it's a bit too busy.
 What if jQuery objects added something like a "web_inspector_console_display"
function which, when invoked, rendered output relevant to the console.  Might
be a string, and then just printed, or maybe it would a DOM tree which would be
rendered inline.  You could then imagine that folks using jQuery would then be
able to further enhance that functionality in some way through new jQuery APIs. 

In terms of trying to make this browser agnostic, perhaps the relevant property
would be named "console_display_result".

There's some precedence here from the Smalltalk world; there, some
implementations supported specialized output for the debugger via a
debugPrintTo:aStream method, implemented on Object, whose implementation was
just "self printTo: aStream".  Classes could customize what was displayed in
debugger single-line views by overriding the method.

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

More information about the webkit-unassigned mailing list