Bug 1322954 - Fix incorrect `instanceof` negations. r=markh

MozReview-Commit-ID: PgQmAu9hbQ

--HG--
extra : rebase_source : 376b83af517442cc05bc46ff7ca36e6ac46b06e2
This commit is contained in:
Kit Cambridge 2016-12-12 13:50:10 -08:00
Родитель e4d8f7fbe8
Коммит 8558928fe7
12 изменённых файлов: 16 добавлений и 16 удалений

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

@ -61,7 +61,7 @@ try {
try {
m = require(module);
if (!setupChild in m) {
if (!(setupChild in m)) {
dumpn(`ERROR: module '${module}' does not export '${setupChild}'`);
return false;
}

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

@ -1049,7 +1049,7 @@ var DebuggerServer = {
try {
m = require(module);
if (!setupParent in m) {
if (!(setupParent in m)) {
dumpn(`ERROR: module '${module}' does not export '${setupParent}'`);
return false;
}

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

@ -63,7 +63,7 @@ var InputWidgetHelper = {
},
hasInputWidget: function(aElement) {
if (!aElement instanceof HTMLInputElement)
if (!(aElement instanceof HTMLInputElement))
return false;
let type = aElement.getAttribute('type');

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

@ -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.");
}

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

@ -456,7 +456,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;

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

@ -838,7 +838,7 @@
* implementation.
*/
File.DirectoryIterator.Entry.toMsg = function toMsg(value) {
if (!value instanceof File.DirectoryIterator.Entry) {
if (!(value instanceof File.DirectoryIterator.Entry)) {
throw new TypeError("parameter of " +
"File.DirectoryIterator.Entry.toMsg must be a " +
"File.DirectoryIterator.Entry");
@ -905,7 +905,7 @@
* is asymmetric and returns an object with a different implementation.
*/
File.Info.toMsg = function toMsg(stat) {
if (!stat instanceof File.Info) {
if (!(stat instanceof File.Info)) {
throw new TypeError("parameter of File.Info.toMsg must be a File.Info");
}
let serialized = {};

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

@ -882,7 +882,7 @@
* implementation.
*/
File.DirectoryIterator.Entry.toMsg = function toMsg(value) {
if (!value instanceof File.DirectoryIterator.Entry) {
if (!(value instanceof File.DirectoryIterator.Entry)) {
throw new TypeError("parameter of " +
"File.DirectoryIterator.Entry.toMsg must be a " +
"File.DirectoryIterator.Entry");
@ -931,7 +931,7 @@
* is asymmetric and returns an object with a different implementation.
*/
File.Info.toMsg = function toMsg(stat) {
if (!stat instanceof File.Info) {
if (!(stat instanceof File.Info)) {
throw new TypeError("parameter of File.Info.toMsg must be a File.Info");
}
let serialized = {};

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

@ -995,7 +995,7 @@ function cloneStorageConnection(options) {
if (!source) {
throw new TypeError("connection not specified in clone options.");
}
if (!source instanceof Ci.mozIStorageAsyncConnection) {
if (!(source instanceof Ci.mozIStorageAsyncConnection)) {
throw new TypeError("Connection must be a valid Storage connection.");
}