Bug 30486 - Web Inspector: Title of dir(["test", "test2"]) should be Array
Summary: Web Inspector: Title of dir(["test", "test2"]) should be Array
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Pavel Feldman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-17 14:35 PDT by Timothy Hatcher
Modified: 2009-10-18 16:18 PDT (History)
5 users (show)

See Also:


Attachments
patch (2.42 KB, patch)
2009-10-18 07:54 PDT, Pavel Feldman
no flags Details | Formatted Diff | Diff
same with "NodeList" as node list title. (2.58 KB, patch)
2009-10-18 08:13 PDT, Pavel Feldman
timothy: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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