Bug 1251916 - Use standard JavaScript features in toolkit/components/passwordmgr to pass eslint checks: replace conditional catch statements. r=MattN

While it doesn't seem like this SpiderMonkey feature will go away soon, replacing it makes tooling easier and is suitable here because the unconditional catch js already used.


MozReview-Commit-ID: 3G3LxrW24HF

--HG--
extra : rebase_source : f8fb7451ed261c3482d0b3dc822086bc7dba05a0
This commit is contained in:
Sebastian Hengst 2016-02-28 14:11:30 -08:00
Родитель 3427f91e14
Коммит bf2bcbd4d8
2 изменённых файлов: 13 добавлений и 9 удалений

Просмотреть файл

@ -108,12 +108,14 @@ LoginManagerPromptFactory.prototype = {
ok = prompter.promptAuth(prompt.channel,
prompt.level,
prompt.authInfo);
} catch (e if (e instanceof Components.Exception) &&
e.result == Cr.NS_ERROR_NOT_AVAILABLE) {
self.log("_doAsyncPrompt:run bypassed, UI is not available in this context");
} catch (e) {
Components.utils.reportError("LoginManagerPrompter: " +
"_doAsyncPrompt:run: " + e + "\n");
if (e instanceof Components.Exception &&
e.result == Cr.NS_ERROR_NOT_AVAILABLE) {
self.log("_doAsyncPrompt:run bypassed, UI is not available in this context");
} else {
Components.utils.reportError("LoginManagerPrompter: " +
"_doAsyncPrompt:run: " + e + "\n");
}
}
delete self._asyncPrompts[hashKey];

Просмотреть файл

@ -1017,10 +1017,12 @@ LoginManagerStorage_mozStorage.prototype = {
} else if (version != DB_VERSION) {
this._dbMigrate(version);
}
} catch (e if e.result == Cr.NS_ERROR_FILE_CORRUPTED) {
// Database is corrupted, so we backup the database, then throw
// causing initialization to fail and a new db to be created next use
this._dbCleanup(true);
} catch (e) {
if (e.result == Cr.NS_ERROR_FILE_CORRUPTED) {
// Database is corrupted, so we backup the database, then throw
// causing initialization to fail and a new db to be created next use
this._dbCleanup(true);
}
throw e;
}