Fix unsafe "instanceof" negations

https://github.com/MoonchildProductions/Pale-Moon/pull/1173
This commit is contained in:
janekptacijarabaci 2018-05-02 06:57:57 +02:00 • committed by Roy Tam
commit b56d147095
17 changed files with 19 additions and 28 deletions

View file

@ -89,7 +89,7 @@ this.FxAccountsProfileClient.prototype = {
try {
return (yield this._rawRequest(path, method, token));
} catch (ex) {
if (!ex instanceof FxAccountsProfileClientError || ex.code != 401) {
if (!(ex instanceof FxAccountsProfileClientError) || ex.code != 401) {
throw ex;
}
// If this object was instantiated with a token then we don't refresh it.
@ -105,7 +105,7 @@ this.FxAccountsProfileClient.prototype = {
try {
return (yield this._rawRequest(path, method, token));
} catch (ex) {
if (!ex instanceof FxAccountsProfileClientError || ex.code != 401) {
if (!(ex instanceof FxAccountsProfileClientError) || ex.code != 401) {
throw ex;
}
log.info("Retry fetching the profile still returned a 401 - revoking our token and failing");

View file

@ -403,7 +403,7 @@ this.FxAccountsStorageManager.prototype = {
try {
yield this.secureStorage.set(this.cachedPlain.uid, toWriteSecure);
} catch (ex) {
if (!ex instanceof this.secureStorage.STORAGE_LOCKED) {
if (!(ex instanceof this.secureStorage.STORAGE_LOCKED)) {
throw ex;
}
// This shouldn't be possible as once it is unlocked it can't be