From e4956c0ce7fcc14c66ae73fb4f3d1cb41119728a Mon Sep 17 00:00:00 2001 From: Jared Wein Date: Thu, 12 Jan 2017 18:18:31 -0500 Subject: [PATCH] Bug 1330791 - Enable the no-unreachable rule for eslint in /services and fix the associated errors. r=markh MozReview-Commit-ID: e60hfjiUmS --HG-- extra : rebase_source : 5d6d804683d45c7e08bac19ffa7d04a56c298adb --- services/.eslintrc.js | 1 - services/fxaccounts/FxAccountsClient.jsm | 3 --- services/fxaccounts/FxAccountsPush.js | 3 --- services/fxaccounts/tests/xpcshell/test_client.js | 1 - 4 files changed, 8 deletions(-) diff --git a/services/.eslintrc.js b/services/.eslintrc.js index 350eb94fd66a..525d6352928a 100644 --- a/services/.eslintrc.js +++ b/services/.eslintrc.js @@ -17,6 +17,5 @@ module.exports = { "no-nested-ternary": "warn", "no-octal": "warn", "no-redeclare": "warn", - "no-unreachable": "warn", } }; diff --git a/services/fxaccounts/FxAccountsClient.jsm b/services/fxaccounts/FxAccountsClient.jsm index 0af6b5c885bb..9907560f21ac 100644 --- a/services/fxaccounts/FxAccountsClient.jsm +++ b/services/fxaccounts/FxAccountsClient.jsm @@ -343,14 +343,11 @@ this.FxAccountsClient.prototype = { switch (expectedError.errno) { case ERRNO_ACCOUNT_DOES_NOT_EXIST: return false; - break; case ERRNO_INCORRECT_PASSWORD: return true; - break; default: // not so expected, any more ... throw expectedError; - break; } } ); diff --git a/services/fxaccounts/FxAccountsPush.js b/services/fxaccounts/FxAccountsPush.js index c50bfb21dad1..c556a42e7ec2 100644 --- a/services/fxaccounts/FxAccountsPush.js +++ b/services/fxaccounts/FxAccountsPush.js @@ -135,7 +135,6 @@ FxAccountsPushService.prototype = { return this.unsubscribe().catch(err => { this.log.error("Error during unsubscribe", err); }); - break; default: break; } @@ -169,11 +168,9 @@ FxAccountsPushService.prototype = { break; case ON_DEVICE_DISCONNECTED_NOTIFICATION: return this.fxAccounts.handleDeviceDisconnection(payload.data.id); - break; case ON_PASSWORD_CHANGED_NOTIFICATION: case ON_PASSWORD_RESET_NOTIFICATION: return this._onPasswordChanged(); - break; case ON_COLLECTION_CHANGED_NOTIFICATION: Services.obs.notifyObservers(null, ON_COLLECTION_CHANGED_NOTIFICATION, payload.data.collections); default: diff --git a/services/fxaccounts/tests/xpcshell/test_client.js b/services/fxaccounts/tests/xpcshell/test_client.js index 61eba826183c..c1caf454d56c 100644 --- a/services/fxaccounts/tests/xpcshell/test_client.js +++ b/services/fxaccounts/tests/xpcshell/test_client.js @@ -618,7 +618,6 @@ add_task(function* test_accountExists() { default: throw new Error("Unexpected login from " + jsonBody.email); - break; } }, });