Bug 1557018 follow-up - Tidy a slight mess; rs=me
authorGeoff Lankow <geoff@darktrojan.net>
Tue, 11 Jun 2019 15:45:17 +1200
changeset 35821 c3a368a1bca2bcb20c7f92cfe5c82ea1d159bc96
parent 35820 fe5ced6a8398bb4438540773bcd19ecea67270d7
child 35822 f6d100d63838d747a56735854aecb78cc415acda
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersme
bugs1557018
Bug 1557018 follow-up - Tidy a slight mess; rs=me
mail/test/resources/mozmill/mozmill/extension/content/modules/elementslib.jsm
--- a/mail/test/resources/mozmill/mozmill/extension/content/modules/elementslib.jsm
+++ b/mail/test/resources/mozmill/mozmill/extension/content/modules/elementslib.jsm
@@ -407,24 +407,24 @@ Lookup.prototype.exists = function() {
 };
 Lookup.prototype.getNode = function() {
   var expSplit = smartSplit(this.expression).filter(e => e != "");
   expSplit.unshift(this._view.document);
   var _document = this._view.document;
   var nCases = {"id": _byID, "name": _byName, "attrib": _byAttrib, "index": _byIndex};
   var aCases = {"name": _anonByName, "attrib": _anonByAttrib, "index": _anonByIndex};
   var reduceLookup = function(parent, exp) {
-    // Handle case where only index is provided
-    var cases = nCases;
-
     // Handle custom elements shadow DOM
     if (exp == "shadow") {
       return parent.shadowRoot;
     }
 
+    // Handle case where only index is provided
+    var cases = nCases;
+
     // Handle ending index before any of the expression gets mangled
     if (exp.endsWith("]")) {
       var expIndex = JSON.parse(strings.vslice(exp, "[", "]"));
     }
     // Handle anon
     if (exp.startsWith("anon")) {
       exp = strings.vslice(exp, "(", ")");
       cases = aCases;