Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 1328802 - Enable the no-unsafe-finally rule for eslint and fix th…
Browse files Browse the repository at this point in the history
…e four errors that are triggered by it by moving the control flow statement outside of the finally block. r=mossop

MozReview-Commit-ID: 7UFBBpvptdd
  • Loading branch information
msujaws committed Jan 5, 2017
1 parent 88b29a7 commit 1209789
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion browser/base/content/browser-gestureSupport.js
Original file line number Diff line number Diff line change
Expand Up @@ -1151,8 +1151,8 @@ var gHistorySwipeAnimation = {
};
} finally {
img.src = url;
return img;
}
return img;
},

/**
Expand Down
3 changes: 3 additions & 0 deletions toolkit/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",

Expand Down
2 changes: 1 addition & 1 deletion toolkit/components/telemetry/TelemetryStorage.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion toolkit/modules/WindowsRegistry.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ var WindowsRegistry = {
} catch (ex) {
} finally {
registry.close();
return result;
}
return result;
}
};
2 changes: 1 addition & 1 deletion toolkit/mozapps/extensions/internal/GMPProvider.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,8 @@ GMPWrapper.prototype = {
throw e;
} finally {
this._updateTask = null;
return true;
}
return true;
}.bind(this));

return this._updateTask;
Expand Down

0 comments on commit 1209789

Please sign in to comment.