mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 14:25:52 +00:00
Bug 1328805 - Enable the no-cond-assign rule for eslint and fix the six resulting errors mostly by wrapping the assignment with parentheses to explicitly state that the assignment is intentional with exception for advanced.js where assignment was not intended. r=mossop
MozReview-Commit-ID: EZytfzGoMLR --HG-- extra : rebase_source : 6d64988ba720f172c188214c1ffbef87d093c79c
This commit is contained in:
parent
f598aa2509
commit
a937f60d4f
@ -228,7 +228,7 @@ var gAdvancedPane = {
|
||||
* sync its new value to the gfx.direct2d.disabled pref too.
|
||||
*/
|
||||
updateHardwareAcceleration() {
|
||||
if (AppConstants.platform = "win") {
|
||||
if (AppConstants.platform == "win") {
|
||||
var fromPref = document.getElementById("layers.acceleration.disabled");
|
||||
var toPref = document.getElementById("gfx.direct2d.disabled");
|
||||
toPref.value = fromPref.value;
|
||||
|
@ -60,6 +60,9 @@ module.exports = {
|
||||
// Use [] instead of Array()
|
||||
// "no-array-constructor": "error",
|
||||
|
||||
// Disallow assignment operators in conditional statements
|
||||
"no-cond-assign": "error",
|
||||
|
||||
// Disallow the use of debugger
|
||||
"no-debugger": "error",
|
||||
|
||||
|
@ -1016,7 +1016,7 @@ var SubprocessMonitor = {
|
||||
// We first iterate the table to check if summaries exist for rowPids,
|
||||
// if yes, update them and delete the pid's summary or else hide the row
|
||||
// for recycling it. Start at row 1 instead of 0 (to skip the header row).
|
||||
for (let i = 1, row; row = resultTable.rows[i]; i++) {
|
||||
for (let i = 1, row; (row = resultTable.rows[i]); i++) {
|
||||
let rowPid = row.dataset.pid;
|
||||
let summary = summaries[rowPid];
|
||||
if (summary) {
|
||||
|
@ -341,7 +341,7 @@ function dbOK(expectedRows) {
|
||||
},
|
||||
handleResult(results) {
|
||||
let row = null;
|
||||
while (row = results.getNextRow()) {
|
||||
while ((row = results.getNextRow())) {
|
||||
actualRows.push(cols.map(c => row.getResultByName(c)));
|
||||
}
|
||||
},
|
||||
|
@ -84,8 +84,7 @@ HierarchicalClustering.prototype = {
|
||||
}
|
||||
|
||||
// merge the next two closest clusters until none of them are close enough
|
||||
let next = null, i = 0;
|
||||
for (; next = this.closestClusters(clusters, distances, neighbors); i++) {
|
||||
for (let next = null, i = 0; (next = this.closestClusters(clusters, distances, neighbors)); i++) {
|
||||
if (snapshotCallback && (i % snapshotGap) == 0) {
|
||||
snapshotCallback(clusters);
|
||||
}
|
||||
|
@ -457,8 +457,8 @@ var snapshotFormatters = {
|
||||
let contents;
|
||||
if (entry.message.length > 0 && entry.message[0] == "#") {
|
||||
// This is a failure ID. See nsIGfxInfo.idl.
|
||||
let m;
|
||||
if (m = /#BLOCKLIST_FEATURE_FAILURE_BUG_(\d+)/.exec(entry.message)) {
|
||||
let m = /#BLOCKLIST_FEATURE_FAILURE_BUG_(\d+)/.exec(entry.message);
|
||||
if (m) {
|
||||
let bugSpan = $.new("span");
|
||||
bugSpan.textContent = strings.GetStringFromName("blocklistedBug") + "; ";
|
||||
|
||||
|
@ -72,7 +72,7 @@ function getFileSize(aFile) {
|
||||
let size = 0;
|
||||
let entries = aFile.directoryEntries.QueryInterface(AM_Ci.nsIDirectoryEnumerator);
|
||||
let entry;
|
||||
while (entry = entries.nextFile)
|
||||
while ((entry = entries.nextFile))
|
||||
size += getFileSize(entry);
|
||||
entries.close();
|
||||
return size;
|
||||
|
Loading…
Reference in New Issue
Block a user