зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1118806 - Handle uncaught promise rejections in the storage inspector;r=pbrosset
This commit is contained in:
Родитель
f428537ae6
Коммит
3004465c29
|
@ -81,7 +81,7 @@ this.StorageUI = function StorageUI(front, target, panelWin) {
|
|||
|
||||
this.front.listStores().then(storageTypes => {
|
||||
this.populateStorageTree(storageTypes);
|
||||
});
|
||||
}).then(null, Cu.reportError);
|
||||
this.onUpdate = this.onUpdate.bind(this);
|
||||
this.front.on("stores-update", this.onUpdate);
|
||||
|
||||
|
@ -275,7 +275,7 @@ StorageUI.prototype = {
|
|||
}
|
||||
this.populateTable(data, reason);
|
||||
this.emit("store-objects-updated");
|
||||
});
|
||||
}, Cu.reportError);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -183,7 +183,14 @@ HighlightersOverlay.prototype = {
|
|||
_hideCurrent: function() {
|
||||
if (this.highlighterShown) {
|
||||
this._getHighlighter(this.highlighterShown).then(highlighter => {
|
||||
highlighter.hide();
|
||||
// For some reason, the call to highlighter.hide doesn't always return a
|
||||
// promise. This causes some tests to fail when trying to install a
|
||||
// rejection handler on the result of the call. To avoid this, check
|
||||
// whether the result is truthy before installing the handler.
|
||||
let promise = highlighter.hide();
|
||||
if (promise) {
|
||||
promise.then(null, Cu.reportError);
|
||||
}
|
||||
this.highlighterShown = null;
|
||||
});
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче