Bug 1110759 - Cleanup FormHistory a bit. r=markh
authorTom Schuster <evilpies@gmail.com>
Thu, 08 Jan 2015 19:58:45 +0100
changeset 222856 c3179d05230b05a39178a5dd901695f7bf3060f0
parent 222855 977aab16aad322fb4bd1cd0901ca07bd0ebf3035
child 222857 6429d270c004f34fe264ee5c7d64f4d552e89a9d
push id10731
push usercbook@mozilla.com
push dateFri, 09 Jan 2015 14:51:37 +0000
treeherderfx-team@e6756043d930 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarkh
bugs1110759
milestone37.0a1
Bug 1110759 - Cleanup FormHistory a bit. r=markh
toolkit/components/satchel/FormHistory.jsm
toolkit/components/satchel/nsInputListAutoComplete.js
--- a/toolkit/components/satchel/FormHistory.jsm
+++ b/toolkit/components/satchel/FormHistory.jsm
@@ -626,17 +626,17 @@ function updateFormHistoryWrite(aChanges
   // for each change, we either create and append a new storage statement to
   // stmts or bind a new set of parameters to an existing storage statement.
   // stmts and bindingArrays are updated when makeXXXStatement eventually
   // calls dbCreateAsyncStatement.
   let stmts = [];
   let notifications = [];
   let bindingArrays = new Map();
 
-  for each (let change in aChanges) {
+  for (let change of aChanges) {
     let operation = change.op;
     delete change.op;
     let stmt;
     switch (operation) {
       case "remove":
         log("Remove from form history  " + change);
         let delStmt = makeMoveToDeletedStatement(change.guid, now, change, bindingArrays);
         if (delStmt && stmts.indexOf(delStmt) == -1)
@@ -782,17 +782,17 @@ this.FormHistory = {
 
     let stmt = makeSearchStatement(aSearchData, aSelectTerms);
 
     let handlers = {
       handleResult : function(aResultSet) {
         let formHistoryFields = dbSchema.tables.moz_formhistory;
         for (let row = aResultSet.getNextRow(); row; row = aResultSet.getNextRow()) {
           let result = {};
-          for each (let field in aSelectTerms) {
+          for (let field of aSelectTerms) {
             result[field] = row.getResultByName(field);
           }
 
           if (aCallbacks && aCallbacks.handleResult) {
             aCallbacks.handleResult(result);
           }
         }
       },
@@ -855,17 +855,17 @@ this.FormHistory = {
     function validIdentifier(change) {
       // The identifier is only valid if one of either the guid or the (fieldname/value) are set
       return Boolean(change.guid) != Boolean(change.fieldname && change.value);
     }
 
     if (!("length" in aChanges))
       aChanges = [aChanges];
 
-    for each (let change in aChanges) {
+    for (let change of aChanges) {
       switch (change.op) {
         case "remove":
           validateSearchData(change, "Remove");
           continue;
         case "update":
           if (validIdentifier(change)) {
             validateOpData(change, "Update");
             if (change.guid) {
--- a/toolkit/components/satchel/nsInputListAutoComplete.js
+++ b/toolkit/components/satchel/nsInputListAutoComplete.js
@@ -18,17 +18,17 @@ InputListAutoComplete.prototype = {
     let comments = []; // "comments" column values for suggestions
     let [values, labels] = this.getListSuggestions(aField);
     let historyResults = [];
     let historyComments = [];
 
     // formHistoryResult will be null if form autocomplete is disabled.
     // We still want the list values to display.
     if (formHistoryResult) {
-      entries = formHistoryResult.wrappedJSObject.entries;
+      let entries = formHistoryResult.wrappedJSObject.entries;
       for (let i = 0; i < entries.length; ++i) {
         historyResults.push(entries[i].text);
         historyComments.push("");
       }
     }
 
     // fill out the comment column for the suggestions
     // if we have any suggestions, put a label at the top