mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 20:07:30 +09:00
Fix unsafe "instanceof" negations
https://github.com/MoonchildProductions/Pale-Moon/pull/1173
This commit is contained in:
parent
a073130d31
commit
b56d147095
17 changed files with 19 additions and 28 deletions
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ WBORecord.prototype = {
|
|||
// Get thyself from your URI, then deserialize.
|
||||
// Set thine 'response' field.
|
||||
fetch: function fetch(resource) {
|
||||
if (!resource instanceof Resource) {
|
||||
if (!(resource instanceof Resource)) {
|
||||
throw new Error("First argument must be a Resource instance.");
|
||||
}
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ WBORecord.prototype = {
|
|||
},
|
||||
|
||||
upload: function upload(resource) {
|
||||
if (!resource instanceof Resource) {
|
||||
if (!(resource instanceof Resource)) {
|
||||
throw new Error("First argument must be a Resource instance.");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -455,7 +455,7 @@ Sync11Service.prototype = {
|
|||
this.clientsEngine = new ClientEngine(this);
|
||||
|
||||
for (let name of engines) {
|
||||
if (!name in ENGINE_MODULES) {
|
||||
if (!(name in ENGINE_MODULES)) {
|
||||
this._log.info("Do not know about engine: " + name);
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -978,7 +978,7 @@ function browserAdditions (controller) {
|
|||
}, "Timeout", timeout, aInterval);
|
||||
}
|
||||
catch (ex) {
|
||||
if (!ex instanceof errors.TimeoutError) {
|
||||
if (!(ex instanceof errors.TimeoutError)) {
|
||||
throw ex;
|
||||
}
|
||||
timed_out = true;
|
||||
|
|
|
|||
|
|
@ -659,7 +659,7 @@ Expect.prototype.waitFor = function Expect_waitFor(aCallback, aMessage, aTimeout
|
|||
Assert.prototype.waitFor.apply(this, arguments);
|
||||
}
|
||||
catch (ex) {
|
||||
if (!ex instanceof errors.AssertionError) {
|
||||
if (!(ex instanceof errors.AssertionError)) {
|
||||
throw ex;
|
||||
}
|
||||
message = ex.message;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue