Closed Bug 1330058 Opened 3 years ago Closed 3 years ago

fix eslint errors in toolkit/components/windowcreator/test/ and toolkit/components/windowwatcher/test/

Categories

(Toolkit :: General, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla53
Tracking Status
firefox53 --- fixed

People

(Reporter: myk, Assigned: myk)

References

Details

Attachments

(1 file, 1 obsolete file)

After moving embedding/ code to toolkit/ in bug 1309049, we should fix the eslint errors in toolkit/components/windowcreator/test/ and toolkit/components/windowwatcher/test/.
Comment on attachment 8826386 [details] [diff] [review]
re-enable eslint with obvious fixes to windowcreator/windowwatcher

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

::: toolkit/components/windowcreator/test/browser_bug1204626.js
@@ +15,5 @@
>                               .frameLoader
>                               .QueryInterface(Ci.nsIWebBrowserPersistable);
>      persistable.startPersistence(/* outer window ID: */ 0, {
>        onDocumentReady,
> +      onError: function onError(status) {

It was asking for named functions?
Attachment #8826386 - Flags: review?(dtownsend) → review+
(In reply to Dave Townsend [:mossop] from comment #2)
> It was asking for named functions?

Erm, no, sorry, it was asking for the method shorthand, per the 'object-shorthand' rule in toolkit/.eslintrc.js.

>> ./mach eslint
>/Users/myk/Projects/gecko/toolkit/components/windowcreator/test/browser_bug1204626.js
>  19:7   error  Expected method shorthand.           object-shorthand (eslint)
>  …
>  48:7   error  Expected method shorthand.           object-shorthand (eslint)
>  …
>  49:7   error  Expected method shorthand.           object-shorthand (eslint)
>  …
>  50:7   error  Expected method shorthand.           object-shorthand (eslint)
>  …
>  51:7   error  Expected method shorthand.           object-shorthand (eslint)
>  …
>/Users/myk/Projects/gecko/toolkit/components/windowcreator/test/test_bug449141.html
>  37:3  error  Expected method shorthand.    object-shorthand (eslint)
>  40:3  error  Expected method shorthand.    object-shorthand (eslint)

I misinterpreted that to mean it wanted named function expressions (even though I too was surprised by that).  Here's an updated patch that uses the method shorthand instead.
Attachment #8826386 - Attachment is obsolete: true
Attachment #8826415 - Flags: review?(dtownsend)
Comment on attachment 8826415 [details] [diff] [review]
reenable eslint using the method shorthand

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

That makes more sense
Attachment #8826415 - Flags: review?(dtownsend) → review+
Pushed by myk@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/0f37bb9f5af0
re-enable eslint for toolkit/components/windowcreator|windowwatcher, r=mossop
https://hg.mozilla.org/mozilla-central/rev/0f37bb9f5af0
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in before you can comment on or make changes to this bug.