Bug 1425244 - Enable ESLint rule no-cond-assign for accessible/tests/mochitest/. r?surkov draft
authorMark Banner <standard8@mozilla.com>
Mon, 11 Dec 2017 13:36:16 +0000
changeset 711860 326c098b0054fa2e12d536945268f8175da3b95a
parent 711859 dae226e9f64cbe94c086a0f4853ebe18792fbf4b
child 711861 4282e5f1038f07390b0adff9e7451220512eaa39
push id93179
push userbmo:standard8@mozilla.com
push dateThu, 14 Dec 2017 22:08:47 +0000
reviewerssurkov
bugs1425244
milestone59.0a1
Bug 1425244 - Enable ESLint rule no-cond-assign for accessible/tests/mochitest/. r?surkov MozReview-Commit-ID: 59yovY1BQ0p
accessible/tests/mochitest/.eslintrc.js
accessible/tests/mochitest/actions/test_link.html
accessible/tests/mochitest/name/markup.js
--- a/accessible/tests/mochitest/.eslintrc.js
+++ b/accessible/tests/mochitest/.eslintrc.js
@@ -6,17 +6,16 @@ module.exports = {
   ],
   "rules": {
     "mozilla/no-cpows-in-tests": "error",
     "mozilla/reject-importGlobalProperties": "error",
 
     // XXX These are rules that are enabled in the recommended configuration, but
     // disabled here due to failures when initially implemented. They should be
     // removed (and hence enabled) at some stage.
-    "no-cond-assign": "off",
     "no-lonely-if": "off",
     "no-nested-ternary": "off",
     "no-new-object": "off",
     "no-redeclare": "off",
     "no-shadow": "off",
     "no-undef": "off",
     "space-unary-ops": "off",
   }
--- a/accessible/tests/mochitest/actions/test_link.html
+++ b/accessible/tests/mochitest/actions/test_link.html
@@ -19,17 +19,17 @@
   <script type="application/javascript">
     function getAnchorTargetDocumentAcc() {
       var thisTabDocAcc = getTabDocAccessible();
       var thisDocTabPanelAcc = thisTabDocAcc.parent.parent;
       var tabPanelsAcc = thisDocTabPanelAcc.parent;
       var newDocTabPanelAcc = tabPanelsAcc.firstChild;
       var nextAcc = newDocTabPanelAcc;
 
-      while (nextAcc = nextAcc.nextSibling) {
+      while ((nextAcc = nextAcc.nextSibling)) {
         // Find the last accessible for a browser with about:mozilla loaded.
         if (nextAcc.firstChild.DOMNode.currentURI.spec == "about:mozilla") {
           newDocTabPanelAcc = nextAcc;
         }
       }
 
       return newDocTabPanelAcc.firstChild.firstChild;
     }
--- a/accessible/tests/mochitest/name/markup.js
+++ b/accessible/tests/mochitest/name/markup.js
@@ -347,17 +347,17 @@ function evaluateXPath(aNode, aExpr, aRe
     var node = aNode.ownerDocument == null ?
       aNode.documentElement : aNode.ownerDocument.documentElement;
     resolver = xpe.createNSResolver(node);
   }
 
   var result = xpe.evaluate(aExpr, aNode, resolver, 0, null);
   var found = [];
   var res;
-  while (res = result.iterateNext())
+  while ((res = result.iterateNext()))
     found.push(res);
 
   return found;
 }
 
 function htmlDocResolver(aPrefix) {
   var ns = {
     "html": "http://www.w3.org/1999/xhtml"