Bug 1376128 - Use consistent return types for accessibility.service; r=automatedtester

accessibility.service is allowed to return undefined, but we should
be explicit that this condition is allowed instead of relying on the
default value of the service variable assigned on the first line.

MozReview-Commit-ID: LrlnIba56v5

--HG--
extra : rebase_source : 1b66b6aa4393cb14b41bc67036d5d7296195be32
This commit is contained in:
Andreas Tolfsen 2017-06-28 11:09:40 -07:00
parent ef0966c800
commit 41af3d0aae

View File

@ -21,14 +21,12 @@ XPCOMUtils.defineLazyModuleGetter(
this, "clearInterval", "resource://gre/modules/Timer.jsm");
XPCOMUtils.defineLazyGetter(this, "service", () => {
let service;
try {
service = Cc["@mozilla.org/accessibilityService;1"].getService(
Ci.nsIAccessibilityService);
return Cc["@mozilla.org/accessibilityService;1"]
.getService(Ci.nsIAccessibilityService);
} catch (e) {
logger.warn("Accessibility module is not present");
} finally {
return service;
return undefined;
}
});