Bug 1362882 - hand cleanup after applying the previous script-generated patch, r=Mossop.

This commit is contained in:
Florian Quèze 2017-05-12 14:56:12 +02:00
parent 97f401c644
commit 85e816d9e7
5 changed files with 11 additions and 12 deletions

View File

@ -98,11 +98,11 @@ function unlockWidth(aItemIDs) {
* @param aIsOverflowed if we're waiting for the item to be overflowed.
*/
function waitForOverflowed(aItem, aIsOverflowed) {
return new Promise(resolve => {
if (aItem.overflowed == aIsOverflowed) {
return resolve();
}
if (aItem.overflowed == aIsOverflowed) {
return Promise.resolve();
}
return new Promise(resolve => {
let observer = new MutationObserver(function(aMutations) {
if (aItem.overflowed == aIsOverflowed) {
observer.disconnect();
@ -110,6 +110,5 @@ function waitForOverflowed(aItem, aIsOverflowed) {
}
});
observer.observe(aItem.node, {attributes: true});
});
}

View File

@ -113,11 +113,11 @@ function promiseFocus() {
}
function promisePanelOpened() {
return new Promise(resolve => {
if (DownloadsPanel.panel && DownloadsPanel.panel.state == "open") {
return Promise.resolve();
}
if (DownloadsPanel.panel && DownloadsPanel.panel.state == "open") {
return resolve();
}
return new Promise(resolve => {
// Hook to wait until the panel is shown.
let originalOnPopupShown = DownloadsPanel.onPopupShown;

View File

@ -969,7 +969,7 @@ Experiments.Experiments.prototype = {
xhr.send(null);
} catch (e) {
this._log.error("httpGetRequest() - Error opening request to " + url + ": " + e);
return Promise.reject(new Error("Experiments - Error opening XHR for " + url));
reject(new Error("Experiments - Error opening XHR for " + url));
}
});
},

View File

@ -533,7 +533,7 @@ this.ContentSearch = {
// This throws if the URI is erroneously encoded.
xhr.send();
} catch (err) {
return Promise.resolve(null);
resolve(null);
}
});
},

View File

@ -410,7 +410,7 @@ function arrayBufferFromDataURI(uri) {
try {
xhr.send();
} catch (err) {
return Promise.resolve(null);
resolve(null);
}
});
}