Bug 1460396 - Make notifyHistoryObservers an arrow function. r?tcsc draft
authorEdouard Oger <eoger@fastmail.com>
Wed, 09 May 2018 15:26:04 -0400
changeset 793248 179ed518dd9b74452de03ed07129b29479ccc0a6
parent 793238 76aad17f5b50a1b969eec8cbb5aa9875555640bc
push id109326
push userbmo:eoger@fastmail.com
push dateWed, 09 May 2018 19:32:47 +0000
reviewerstcsc
bugs1460396
milestone62.0a1
Bug 1460396 - Make notifyHistoryObservers an arrow function. r?tcsc MozReview-Commit-ID: B4BPE98YxEi
services/sync/modules/engines/history.js
--- a/services/sync/modules/engines/history.js
+++ b/services/sync/modules/engines/history.js
@@ -227,27 +227,27 @@ HistoryStore.prototype = {
           failed.push(record.id);
         }
       }
     }
     if (toAdd.length || toRemove.length) {
       // We want to notify history observers that a batch operation is underway
       // so they don't do lots of work for each incoming record.
       let observers = PlacesUtils.history.getObservers();
-      function notifyHistoryObservers(notification) {
+      const notifyHistoryObservers = (notification) => {
         for (let observer of observers) {
           try {
             observer[notification]();
           } catch (ex) {
             // don't log an error - it's not our code that failed and we don't
             // want an error log written just for this.
             this._log.info("history observer failed", ex);
           }
         }
-      }
+      };
       notifyHistoryObservers("onBeginUpdateBatch");
       try {
         if (toRemove.length) {
           // PlacesUtils.history.remove takes an array of visits to remove,
           // but the error semantics are tricky - a single "bad" entry will cause
           // an exception before anything is removed. So we do remove them one at
           // a time.
           for await (let record of Async.yieldingIterator(toRemove)) {