Bug 1376128 - Fix inconsistent return type for hasHiddenAttribute; r?automatedtester draft
authorAndreas Tolfsen <ato@sny.no>
Wed, 28 Jun 2017 11:08:18 -0700
changeset 602389 ae99f3a08c532697a2ba01ca906e23db348443fe
parent 602388 8b38cf86cf87be43d0f18b78f987c248f2b6ee40
child 602390 c5d58911e82dd3ab8c959e241a0df2f70b5f98e8
push id66419
push userbmo:ato@sny.no
push dateThu, 29 Jun 2017 23:42:10 +0000
reviewersautomatedtester
bugs1376128
milestone56.0a1
Bug 1376128 - Fix inconsistent return type for hasHiddenAttribute; r?automatedtester Returning a value from a finally-block will mask any errors thrown in the try-block. MozReview-Commit-ID: JBouChGmXYo
testing/marionette/accessibility.js
--- a/testing/marionette/accessibility.js
+++ b/testing/marionette/accessibility.js
@@ -237,20 +237,19 @@ accessibility.Checks = class {
    * @return {boolean}
    *     True if the accessible object has a {@code hidden} attribute,
    *     false otherwise.
    */
   hasHiddenAttribute(accessible) {
     let hidden = false;
     try {
       hidden = accessible.attributes.getStringProperty("hidden");
-    } finally {
-      // if the property is missing, error will be thrown
-      return hidden && hidden === "true";
-    }
+    } catch (e) {}
+    // if the property is missing, error will be thrown
+    return hidden && hidden === "true";
   }
 
   /**
    * Verify if an accessible has a given state.
    * Test if an accessible has a given state.
    *
    * @param {nsIAccessible} accessible
    *     Accessible object to test.