Closed Bug 1045333 Opened 10 years ago Closed 10 years ago

Refactor toolbox.toggleSplitConsole

Categories

(DevTools :: Console, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 34

People

(Reporter: bgrins, Assigned: bgrins)

References

Details

Attachments

(1 file, 2 obsolete files)

As mentioned in Comments 11-13 in bug 974550, we could simplify the code used inside of toolbox.open by refactoring the toggleSplitConsole function into openSplitConsole/closeSplitConsole/toggleSplitConsole
Priority: -- → P3
Attached patch split-console-refactor.patch (obsolete) — Splinter Review
What do you think?
Assignee: nobody → bgrinstead
Status: NEW → ASSIGNED
Attachment #8463956 - Flags: review?(jwalker)
Comment on attachment 8463956 [details] [diff] [review] split-console-refactor.patch Review of attachment 8463956 [details] [diff] [review]: ----------------------------------------------------------------- ::: browser/devtools/framework/toolbox.js @@ +227,5 @@ > get splitConsole() { > return this._splitConsole; > }, > > + set splitConsole(value) { Can't we inline this, or at the very least make it clear that it doesn't actually split the console? It's slightly less DRY to inline, but would be fewer lines overall! @@ +982,5 @@ > */ > + openSplitConsole: function() { > + this.splitConsole = true; > + this._refreshConsoleDisplay(); > + this.emit("split-console"); I know this is a change, but shouldn't we be doing this inside the then() below?
Attachment #8463956 - Flags: review?(jwalker) → review+
(In reply to Joe Walker [:jwalker] from comment #2) > Comment on attachment 8463956 [details] [diff] [review] > split-console-refactor.patch > > Review of attachment 8463956 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: browser/devtools/framework/toolbox.js > @@ +227,5 @@ > > get splitConsole() { > > return this._splitConsole; > > }, > > > > + set splitConsole(value) { > > Can't we inline this, or at the very least make it clear that it doesn't > actually split the console? It's slightly less DRY to inline, but would be > fewer lines overall! Yes, moving the functionality directly into openSplitConsole/closeSplitConsole. > @@ +982,5 @@ > > */ > > + openSplitConsole: function() { > > + this.splitConsole = true; > > + this._refreshConsoleDisplay(); > > + this.emit("split-console"); > > I know this is a change, but shouldn't we be doing this inside the then() > below? Yeah, makes sense.. this is only used for tests so pushed to try: https://tbpl.mozilla.org/?tree=Try&rev=3e19dc74f3a1
Attached patch split-console-refactor.patch (obsolete) — Splinter Review
Address comment 2
Attachment #8463956 - Attachment is obsolete: true
Attachment #8463977 - Flags: review+
Moved the emitted event back to after the call to refreshConsoleDisplay() for tests. Pushed to try: https://tbpl.mozilla.org/?tree=Try&rev=fa1cc76dd784
Attachment #8463977 - Attachment is obsolete: true
Attachment #8464165 - Flags: review+
Keywords: checkin-needed
Blocks: 996778
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 34
QA Whiteboard: [qa-]
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: