Bug 27696 - Inspector: Console should show completions for the command line APIs
Summary: Inspector: Console should show completions for the command line APIs
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P3 Enhancement
Assignee: David Levin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-26 22:56 PDT by Keishi Hattori
Modified: 2009-07-29 01:09 PDT (History)
3 users (show)

See Also:


Attachments
Patch (2.49 KB, patch)
2009-07-26 22:58 PDT, Keishi Hattori
no flags Details | Formatted Diff | Diff
oops tabs (2.35 KB, patch)
2009-07-27 02:06 PDT, Keishi Hattori
no flags Details | Formatted Diff | Diff
Fixed sortedProperties (2.36 KB, patch)
2009-07-27 08:47 PDT, Keishi Hattori
no flags Details | Formatted Diff | Diff
Eliminated reduce (2.39 KB, patch)
2009-07-28 21:41 PDT, Keishi Hattori
no flags Details | Formatted Diff | Diff
Eliminated reduce (2.40 KB, patch)
2009-07-28 22:31 PDT, Keishi Hattori
timothy: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keishi Hattori 2009-07-26 22:56:30 PDT
Currently the completion candidates do not include command line APIs.
Comment 1 Keishi Hattori 2009-07-26 22:58:04 PDT
Created attachment 33520 [details]
Patch
Comment 2 Keishi Hattori 2009-07-27 02:06:27 PDT
Created attachment 33525 [details]
oops tabs
Comment 3 Joseph Pecoraro 2009-07-27 08:13:22 PDT
Sort function for Object.sortedProperties is used in ObjectPropertiesSections.  You should that parameter (sortFunc) back.  If sortFunc is not provided then the normal sort() is applied so it works out fine.

Also what about global functions/classes?  For example:
String, Date, toString, Number, ...
Comment 4 Keishi Hattori 2009-07-27 08:47:02 PDT
Created attachment 33549 [details]
Fixed sortedProperties

(In reply to comment #3)
> Sort function for Object.sortedProperties is used in ObjectPropertiesSections. 
> You should that parameter (sortFunc) back.  If sortFunc is not provided then
> the normal sort() is applied so it works out fine.

Sorry my mistake.

> Also what about global functions/classes?  For example:
> String, Date, toString, Number, ...

Great idea. My understanding is that those are specified are {DontEnum} so you need to keep a list of them. I think I'll file separate bug.
Comment 5 Timothy Hatcher 2009-07-28 20:50:04 PDT
Comment on attachment 33549 [details]
Fixed sortedProperties


> +            commandLineAPI = commandLineAPI.reduce(function(a, prop) {
> +                if (prop.charAt(0) !== "_")
> +                    a.push(prop);
> +                return a;
> +            }, []);

This is pretty fancy. I never really used/liked reduce or map. I think this would be easier to read as a simple for loop that only appends things to properties not starting with "_".

I bet it will be less code too!
Comment 6 Keishi Hattori 2009-07-28 21:41:44 PDT
Created attachment 33690 [details]
Eliminated reduce
Comment 7 Keishi Hattori 2009-07-28 22:31:10 PDT
Created attachment 33693 [details]
Eliminated reduce
Comment 8 David Levin 2009-07-29 00:30:20 PDT
Assign to levin for landing.
Comment 9 David Levin 2009-07-29 01:09:33 PDT
Committed as http://trac.webkit.org/changeset/46526