Bug 1372427 - enforce dot-notation over square-bracket-notation when possible. r=mattn
auto --fix
MozReview-Commit-ID: LDwtCje2Sb0
--- a/toolkit/components/satchel/.eslintrc.js
+++ b/toolkit/components/satchel/.eslintrc.js
@@ -49,10 +49,11 @@ module.exports = {
max: 2,
}],
"no-throw-literal": "error",
"padded-blocks": ["error", "never"],
radix: "error",
"array-bracket-spacing": ["error", "never"],
"space-in-parens": ["error", "never"],
"comma-dangle": ["error", "always-multiline"],
+ "dot-notation": "error",
},
};
--- a/toolkit/components/satchel/FormHistory.jsm
+++ b/toolkit/components/satchel/FormHistory.jsm
@@ -318,17 +318,17 @@ function makeUpdateStatement(aGuid, aNew
let queryTerms = makeQueryPredicates(aNewData, ", ");
if (!queryTerms) {
throw Components.Exception("Update query must define fields to modify.",
Cr.NS_ERROR_ILLEGAL_VALUE);
}
query += queryTerms + " WHERE guid = :existing_guid";
- aNewData["existing_guid"] = aGuid;
+ aNewData.existing_guid = aGuid;
return dbCreateAsyncStatement(query, aNewData, aBindingArrays);
}
function makeMoveToDeletedStatement(aGuid, aNow, aData, aBindingArrays) {
if (supportsDeletedTable) {
let query = "INSERT INTO moz_deleted_formhistory (guid, timeDeleted)";
let queryTerms = makeQueryPredicates(aData);
@@ -468,17 +468,17 @@ function dbInit() {
var Migrators = {
/*
* Updates the DB schema to v3 (bug 506402).
* Adds deleted form history table.
*/
dbMigrateToVersion4() {
if (!_dbConnection.tableExists("moz_deleted_formhistory")) {
- let table = dbSchema.tables["moz_deleted_formhistory"];
+ let table = dbSchema.tables.moz_deleted_formhistory;
let tSQL = Object.keys(table).map(col => [col, table[col]].join(" ")).join(", ");
_dbConnection.createTable("moz_deleted_formhistory", tSQL);
}
},
};
function dbCreate() {
log("Creating DB -- tables");
@@ -969,17 +969,17 @@ this.FormHistory = {
});
}
searchFailed = true;
return;
}
this.foundResult = true;
- changeToUpdate.guid = aResult["guid"];
+ changeToUpdate.guid = aResult.guid;
},
handleError(aError) {
if (aCallbacks && aCallbacks.handleError) {
aCallbacks.handleError(aError);
}
},