mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1339559 - Enable no-mixed-operators ESLint rule r=kmag
MozReview-Commit-ID: LjuiizBh1OK --HG-- extra : rebase_source : 0423cca6e47ed593ec79d56c96a16f63628b15d1
This commit is contained in:
parent
8dd875bed5
commit
6ec248d32c
@ -86,7 +86,7 @@ add_task(function* testExecuteScript() {
|
||||
|
||||
// If we have the earliest valid states for each script, we're done.
|
||||
// Otherwise, try again.
|
||||
success = (states[0] == "loading" || DEBUG &&
|
||||
success = ((states[0] == "loading" || DEBUG) &&
|
||||
states[1] == "interactive" &&
|
||||
states[2] == "complete");
|
||||
}
|
||||
|
@ -167,6 +167,9 @@ module.exports = { // eslint-disable-line no-undef
|
||||
// No single if block inside an else block
|
||||
"no-lonely-if": "warn",
|
||||
|
||||
// No mixing different operators without parens
|
||||
"no-mixed-operators": ["error", {"groups": [["&&", "||"], ["==", "!=", "===", "!==", ">", ">=", "<", "<="], ["in", "instanceof"]]}],
|
||||
|
||||
// No mixing spaces and tabs in indent
|
||||
"no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
|
||||
|
||||
|
@ -234,7 +234,7 @@ class BaseContext {
|
||||
}
|
||||
let message, fileName;
|
||||
if (instanceOf(error, "Object") || error instanceof ExtensionError ||
|
||||
typeof error == "object" && this.principal.subsumes(Cu.getObjectPrincipal(error))) {
|
||||
(typeof error == "object" && this.principal.subsumes(Cu.getObjectPrincipal(error)))) {
|
||||
message = error.message;
|
||||
fileName = error.fileName;
|
||||
} else {
|
||||
|
@ -14,7 +14,7 @@ function runtimeApiFactory(context) {
|
||||
onMessageExternal: context.messenger.onMessageExternal("runtime.onMessageExternal"),
|
||||
|
||||
connect: function(extensionId, connectInfo) {
|
||||
let name = connectInfo !== null && connectInfo.name || "";
|
||||
let name = (connectInfo !== null && connectInfo.name) || "";
|
||||
extensionId = extensionId || extension.id;
|
||||
let recipient = {extensionId};
|
||||
|
||||
|
@ -85,7 +85,7 @@ function background() {
|
||||
let byteLength = parseInt(upload, 10);
|
||||
if (byteLength) {
|
||||
browser.test.assertTrue(!!requestBody.raw, `Binary upload ${details.url} #${details.requestId} ${upload} have a raw attribute`);
|
||||
browser.test.assertEq(byteLength, requestBody.raw && requestBody.raw.map(r => r.bytes && r.bytes.byteLength || 0).reduce((a, b) => a + b), `Binary upload size matches`);
|
||||
browser.test.assertEq(byteLength, requestBody.raw && requestBody.raw.map(r => r.bytes ? r.bytes.byteLength : 0).reduce((a, b) => a + b), `Binary upload size matches`);
|
||||
return;
|
||||
}
|
||||
if ("raw" in requestBody) {
|
||||
|
@ -121,7 +121,7 @@ class KintoServer {
|
||||
let body = JSON.parse(bodyStr);
|
||||
let defaults = body.defaults;
|
||||
for (let req of body.requests) {
|
||||
let headers = Object.assign({}, defaults && defaults.headers || {}, req.headers);
|
||||
let headers = Object.assign({}, (defaults && defaults.headers) || {}, req.headers);
|
||||
// FIXME: assert auth is "Bearer ...token..."
|
||||
this.posts.push(Object.assign({}, req, {headers}));
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ var RequestId = {
|
||||
},
|
||||
|
||||
get(channel) {
|
||||
return channel && getData(channel).requestId || this.create(channel);
|
||||
return (channel && getData(channel).requestId) || this.create(channel);
|
||||
},
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user