Closed Bug 915874 Opened 11 years ago Closed 11 years ago

[toolbox] Clean up toolbox.js

Categories

(DevTools :: Framework, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 27

People

(Reporter: bbenvie, Assigned: bbenvie)

Details

Attachments

(1 file, 1 obsolete file)

There's some gratuitous inefficiencies as well as a lot of inter-mixing of arrow functions with normal.bind(this) ones and just some plain nutty stuff going in toolbox.js that's driving me bonkers. This bug is to fix it.
Attached patch bug-915875.patch (obsolete) — Splinter Review
Cleans up toolbox.js, also with a minor modification to gDevTools.jsm.

Let me know if you can't review this and I'll find someone else.

https://tbpl.mozilla.org/?tree=Try&rev=3ee9688f81ae
Attachment #804129 - Flags: review?(scrapmachines)
Comment on attachment 804129 [details] [diff] [review]
bug-915875.patch

Review of attachment 804129 [details] [diff] [review]:
-----------------------------------------------------------------

Too much OCD going around :)
You might wanna pass it through try again with the perma orange cause backed out.

::: browser/devtools/framework/toolbox.js
@@ +132,5 @@
>     * likely that we're going to want to get the panel that we've just made
>     * visible
>     */
> +  getCurrentPanel: function() {
> +    return this.getPanel(this.currentToolId);

You can directly do 

this._tools.get(this.currentToolId)

right ?

@@ +319,5 @@
>      }
>  
>      let sideEnabled = Services.prefs.getBoolPref(this._prefs.SIDE_ENABLED);
>  
> +    for (let type in Toolbox.HostType) {

let position of Toolbox.HostType ?
Attachment #804129 - Flags: review?(scrapmachines) → review+
Thanks for the review!

> ::: browser/devtools/framework/toolbox.js
> @@ +132,5 @@
> >     * likely that we're going to want to get the panel that we've just made
> >     * visible
> >     */
> > +  getCurrentPanel: function() {
> > +    return this.getPanel(this.currentToolId);
> 
> You can directly do 
> 
> this._tools.get(this.currentToolId)

Yeah I had that originally but changed it. However, I think you're right, better to do it directly rather than another level of indirection.

> >      }
> >  
> >      let sideEnabled = Services.prefs.getBoolPref(this._prefs.SIDE_ENABLED);
> >  
> > +    for (let type in Toolbox.HostType) {
> 
> let position of Toolbox.HostType ?

Can't use for-of on a plain object (they don't define "iterator".


https://tbpl.mozilla.org/?tree=Try&rev=9f2a90a48dcb
Trying this again, not getting failures when I test locally.

https://tbpl.mozilla.org/?tree=Try&rev=e47d67371900
Attached patch bug-915874.patchSplinter Review
Rebases. Let's do another try run just to make sure...

https://tbpl.mozilla.org/?tree=Try&rev=af1485fc7126
Attachment #804129 - Attachment is obsolete: true
Attachment #809356 - Flags: review+
This landed with the wrong bug number (bug 915875): https://hg.mozilla.org/mozilla-central/rev/ab4ffa5b2428
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 27
Whiteboard: [fixed-in-fx-team]
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: