Bug 1460396 - Make notifyHistoryObservers an arrow function. r?tcsc
MozReview-Commit-ID: B4BPE98YxEi
--- 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)) {