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
--- 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.