Bug 1328802 - Enable the no-unsafe-finally rule for eslint and fix the four errors that are triggered by it by moving the control flow statement outside of the finally block. r=mossop

MozReview-Commit-ID: 7UFBBpvptdd

--HG--
extra : rebase_source : b31f86341571ec6928caea130597e6c918a34636
This commit is contained in:
Jared Wein 2017-01-05 00:38:24 -05:00
parent 6d7634cec1
commit 60b5555bc2
5 changed files with 7 additions and 4 deletions

View File

@ -1151,8 +1151,8 @@ var gHistorySwipeAnimation = {
};
} finally {
img.src = url;
return img;
}
return img;
},
/**

View File

@ -171,6 +171,9 @@ module.exports = {
// No unreachable statements
"no-unreachable": "error",
// Disallow control flow statements in finally blocks
"no-unsafe-finally": "error",
// Disallow negating the left operand of relational operators
"no-unsafe-negation": "error",

View File

@ -1521,8 +1521,8 @@ var TelemetryStorageImpl = {
Telemetry.getHistogramById("TELEMETRY_DISCARDED_PENDING_PINGS_SIZE_MB")
.add(Math.floor(info.size / 1024 / 1024));
Telemetry.getHistogramById("TELEMETRY_PING_SIZE_EXCEEDED_PENDING").add();
continue;
}
continue;
}
let id = OS.Path.basename(file.path);

View File

@ -84,7 +84,7 @@ var WindowsRegistry = {
} catch (ex) {
} finally {
registry.close();
return result;
}
return result;
}
};

View File

@ -312,8 +312,8 @@ GMPWrapper.prototype = {
throw e;
} finally {
this._updateTask = null;
return true;
}
return true;
}.bind(this));
return this._updateTask;