Bug 30486

Summary: Web Inspector: Title of dir(["test", "test2"]) should be Array
Product: WebKit Reporter: Timothy Hatcher <timothy>
Component: Web Inspector (Deprecated)Assignee: Pavel Feldman <pfeldman>
Status: RESOLVED FIXED    
Severity: Normal CC: aroben, joepeck, pfeldman, rik, timothy
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
patch
none
same with "NodeList" as node list title. timothy: review+

Description Timothy Hatcher 2009-10-17 14:35:21 PDT
We use the toString value when printing the title of the expandable tree for arrays. But we don't do this for other objects (from what I can tell.)

dir(["test", "test1,test2"])

results in:

[test,test1,test2]

This shows the poor toString support for Arrays.

We should just say Array for the title.
Comment 1 Pavel Feldman 2009-10-18 07:54:00 PDT
Created attachment 41376 [details]
patch
Comment 2 Pavel Feldman 2009-10-18 08:13:46 PDT
Created attachment 41377 [details]
same with "NodeList" as node list title.
Comment 3 Timothy Hatcher 2009-10-18 09:08:35 PDT
Comment on attachment 41377 [details]
same with "NodeList" as node list title.

Yay. Tests!
Comment 4 Joseph Pecoraro 2009-10-18 09:14:14 PDT
In context:

>     case "object"
>     case "node":
>         return type2;
>     case "array":
>         return type2;

How about adding "array" to the fall-through cases above?
Comment 5 Timothy Hatcher 2009-10-18 09:15:46 PDT
(In reply to comment #4)
> In context:
> 
> >     case "object"
> >     case "node":
> >         return type2;
> >     case "array":
> >         return type2;
> 
> How about adding "array" to the fall-through cases above?

Good point, that would be better.
Comment 6 Pavel Feldman 2009-10-18 16:14:31 PDT
> How about adding "array" to the fall-through cases above?

Done.
Comment 7 Pavel Feldman 2009-10-18 16:18:05 PDT
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	LayoutTests/inspector/console-tests-expected.txt
	M	LayoutTests/inspector/console-tests.html
	M	WebCore/ChangeLog
	M	WebCore/inspector/front-end/InjectedScript.js
Committed r49758