Closed Bug 1316700 Opened 3 years ago Closed 3 years ago

make developer-toolbar eslint-clean

Categories

(DevTools :: Framework, defect, P3)

defect

Tracking

(firefox52 fixed)

RESOLVED FIXED
Firefox 52
Tracking Status
firefox52 --- fixed

People

(Reporter: tromey, Assigned: tromey)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

I happened to notice an eslint exclusion for developer-toolbar.js.
This bug is for converting it to be eslint-clean.
Most of the patch is obvious but I converted |show| to use Task.spawn in order
to avoid an eslint error about too many nested functions.
Comment on attachment 8809575 [details]
Bug 1316700 - make developer-toolbar.js eslint-clean;

https://reviewboard.mozilla.org/r/92124/#review92120

Thanks, looks like a great cleanup, especially with all the indentation cleanup!

::: devtools/client/shared/developer-toolbar.js:427
(Diff revision 1)
>      return this._showPromise;
>    }
>  
> +  this._showPromise = Task.spawn((function* () {
> -  // hide() is async, so ensure we don't need to wait for hide() to finish
> +    // hide() is async, so ensure we don't need to wait for hide() to finish
> -  var waitPromise = this._hidePromise || promise.resolve();
> +    yield this._hidePromise || promise.resolve();

Hmm, what's the precedence of `yield` vs. `||`?

Probably the following is easier to follow:

```
if (this._hidePromise) {
  yield this._hidePromise;
}
```
Attachment #8809575 - Flags: review?(jryans) → review+
Pushed by ttromey@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a9d5f467f78d
make developer-toolbar.js eslint-clean; r=jryans
https://hg.mozilla.org/mozilla-central/rev/a9d5f467f78d
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 52
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.