Bug 1436575 - Clean up some of the autofix changes from no-compare-against-boolean-literal. r?standard8 draft
authorJared Wein <jwein@mozilla.com>
Thu, 08 Feb 2018 13:15:26 -0500
changeset 755654 1b823638c87b819c89e78a556c829556c9b45088
parent 755653 6be4407c9ea25b53844b3bae30be33d0edad18cb
child 755655 f511a41ddb6a4b18661cccf83e8de0d94188446f
push id99234
push userbmo:jaws@mozilla.com
push dateThu, 15 Feb 2018 17:00:17 +0000
reviewersstandard8
bugs1436575
milestone60.0a1
Bug 1436575 - Clean up some of the autofix changes from no-compare-against-boolean-literal. r?standard8 MozReview-Commit-ID: 7Q8YBxEzbHr
accessible/tests/mochitest/pivot.js
browser/base/content/test/plugins/browser_CTP_overlay_styles.js
browser/modules/WindowsJumpLists.jsm
--- a/accessible/tests/mochitest/pivot.js
+++ b/accessible/tests/mochitest/pivot.js
@@ -195,17 +195,17 @@ function setVCRangeInvoker(aDocAcc, aTex
  * @param aIdOrNameOrAcc   [in] id, accessible or accessible name to expect
  *                         virtual cursor to land on after performing move method.
  *                         false if no move is expected.
  * @param aIsFromUserInput [in] set user input flag when invoking method, and
  *                         expect it in the event.
  */
 function setVCPosInvoker(aDocAcc, aPivotMoveMethod, aRule, aIdOrNameOrAcc,
                          aIsFromUserInput) {
-  var expectMove = (!!aIdOrNameOrAcc);
+  var expectMove = !!aIdOrNameOrAcc;
   this.invoke = function virtualCursorChangedInvoker_invoke() {
     VCChangedChecker.
       storePreviousPosAndOffset(aDocAcc.virtualCursor);
     if (aPivotMoveMethod && aRule) {
       var moved = false;
       switch (aPivotMoveMethod) {
         case "moveFirst":
         case "moveLast":
@@ -255,17 +255,17 @@ function setVCPosInvoker(aDocAcc, aPivot
  * @param aIdOrNameOrAcc   [in] id, accessible or accessible name to expect
  *                         virtual cursor to land on after performing move method.
  *                         false if no move is expected.
  * @param aIsFromUserInput [in] set user input flag when invoking method, and
  *                         expect it in the event.
  */
 function setVCTextInvoker(aDocAcc, aPivotMoveMethod, aBoundary, aTextOffsets,
                           aIdOrNameOrAcc, aIsFromUserInput) {
-  var expectMove = (!!aIdOrNameOrAcc);
+  var expectMove = !!aIdOrNameOrAcc;
   this.invoke = function virtualCursorChangedInvoker_invoke() {
     VCChangedChecker.storePreviousPosAndOffset(aDocAcc.virtualCursor);
     SimpleTest.info(aDocAcc.virtualCursor.position);
     var moved = aDocAcc.virtualCursor[aPivotMoveMethod](aBoundary,
       aIsFromUserInput === undefined);
     SimpleTest.is(!!moved, !!expectMove,
                   "moved pivot by text with " + aPivotMoveMethod +
                   " to " + aIdOrNameOrAcc);
@@ -301,17 +301,17 @@ function setVCTextInvoker(aDocAcc, aPivo
  *                       point.
  * @param aRule          [in] traversal rule object
  * @param aIdOrNameOrAcc [in] id, accessible or accessible name to expect
  *                       virtual cursor to land on after performing move method.
  *                       false if no move is expected.
  */
 function moveVCCoordInvoker(aDocAcc, aX, aY, aIgnoreNoMatch,
                             aRule, aIdOrNameOrAcc) {
-  var expectMove = (!!aIdOrNameOrAcc);
+  var expectMove = !!aIdOrNameOrAcc;
   this.invoke = function virtualCursorChangedInvoker_invoke() {
     VCChangedChecker.
       storePreviousPosAndOffset(aDocAcc.virtualCursor);
     var moved = aDocAcc.virtualCursor.moveToPoint(aRule, aX, aY,
                                                   aIgnoreNoMatch);
     SimpleTest.ok((expectMove && moved) || (!expectMove && !moved),
                   "moved pivot");
   };
--- a/browser/base/content/test/plugins/browser_CTP_overlay_styles.js
+++ b/browser/base/content/test/plugins/browser_CTP_overlay_styles.js
@@ -75,17 +75,17 @@ add_task(async function() {
 
     for (let testcaseId of Object.keys(testcases)) {
       let plugin = doc.querySelector(`#${testcaseId} > object`);
       let overlay = doc.getAnonymousElementByAttribute(plugin, "anonid", "main");
       Assert.ok(overlay, `overlay exists in ${testcaseId}`);
 
       let expectations = testcases[testcaseId];
 
-      Assert.ok(!!overlay.classList.contains("visible"),
+      Assert.ok(overlay.classList.contains("visible"),
                 `The expected visibility is correct in ${testcaseId}`);
 
       Assert.ok(overlay.getAttribute("sizing") == expectations.sizing,
                 `The expected sizing is correct in ${testcaseId}`);
 
       Assert.ok(overlay.getAttribute("notext") == expectations.notext,
                 `The expected notext is correct in ${testcaseId}`);
     }
--- a/browser/modules/WindowsJumpLists.jsm
+++ b/browser/modules/WindowsJumpLists.jsm
@@ -515,17 +515,17 @@ this.WinTaskbarJumpList =
     // Add idle observer on the first notification so it doesn't hit startup.
     this._updateIdleObserver();
     Services.tm.idleDispatchToMainThread(() => { this.update(); });
   },
 
   observe: function WTBJL_observe(aSubject, aTopic, aData) {
     switch (aTopic) {
       case "nsPref:changed":
-        if (!!this._enabled && !_prefs.getBoolPref(PREF_TASKBAR_ENABLED))
+        if (this._enabled && !_prefs.getBoolPref(PREF_TASKBAR_ENABLED))
           this._deleteActiveJumpList();
         this._refreshPrefs();
         this._updateTimer();
         this._updateIdleObserver();
         Services.tm.idleDispatchToMainThread(() => { this.update(); });
       break;
 
       case "profile-before-change":