Bug 1301287 - Password manager: enable eslint no-new-object rule. r=johannh
MozReview-Commit-ID: 608ugBaVxrg
--- a/toolkit/components/passwordmgr/.eslintrc
+++ b/toolkit/components/passwordmgr/.eslintrc
@@ -8,16 +8,19 @@
"brace-style": [2, "1tbs", {"allowSingleLine": true}],
// No space before always a space after a comma
"comma-spacing": [2, {"before": false, "after": true}],
// Commas at the end of the line not the start
"comma-style": 2,
+ // Use {} instead of new Object()
+ "no-new-object": 2,
+
// No using undeclared variables
"no-undef": 2,
// Don't allow unused local variables unless they match the pattern
"no-unused-vars": [2, {"args": "none", "vars": "local", "varsIgnorePattern": "^(ids|ignored|unused)$"}],
// Always require semicolon at end of statement
"semi": [2, "always"],
--- a/toolkit/components/passwordmgr/content/passwordManager.js
+++ b/toolkit/components/passwordmgr/content/passwordManager.js
@@ -321,18 +321,18 @@ function LoadSignons() {
return true;
}
function GetTreeSelections() {
let selections = [];
let select = signonsTree.view.selection;
if (select) {
let count = select.getRangeCount();
- let min = new Object();
- let max = new Object();
+ let min = {};
+ let max = {};
for (let i = 0; i < count; i++) {
select.getRangeAt(i, min, max);
for (let k = min.value; k <= max.value; k++) {
if (k != -1) {
selections[selections.length] = k;
}
}
}