Summary: | Inspector: Console should show completions for the command line APIs | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Keishi Hattori <keishi> | ||||||||||||
Component: | Web Inspector (Deprecated) | Assignee: | David Levin <levin> | ||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||
Severity: | Enhancement | CC: | joepeck, levin, mike | ||||||||||||
Priority: | P3 | ||||||||||||||
Version: | 528+ (Nightly build) | ||||||||||||||
Hardware: | PC | ||||||||||||||
OS: | OS X 10.5 | ||||||||||||||
Attachments: |
|
Description
Keishi Hattori
2009-07-26 22:56:30 PDT
Created attachment 33520 [details]
Patch
Created attachment 33525 [details]
oops tabs
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, ... 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 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! Created attachment 33690 [details]
Eliminated reduce
Created attachment 33693 [details]
Eliminated reduce
Assign to levin for landing. Committed as http://trac.webkit.org/changeset/46526 |