mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1073259 - Print more descriptive errors when DOMRequestHelper tries to create a request with an invalid window. r=fabrice
This commit is contained in:
parent
bce4938883
commit
5a20b5cf2f
@ -276,6 +276,11 @@ DOMRequestIpcHelper.prototype = {
|
||||
},
|
||||
|
||||
createRequest: function() {
|
||||
// If we don't have a valid window object, throw.
|
||||
if (!this._window) {
|
||||
Cu.reportError("DOMRequestHelper trying to create a DOMRequest without a valid window, failing.");
|
||||
throw Cr.NS_ERROR_FAILURE;
|
||||
}
|
||||
return Services.DOMRequest.createRequest(this._window);
|
||||
},
|
||||
|
||||
@ -285,6 +290,11 @@ DOMRequestIpcHelper.prototype = {
|
||||
* reference to window owned by this DOMRequestIPCHelper.
|
||||
*/
|
||||
createPromise: function(aPromiseInit) {
|
||||
// If we don't have a valid window object, throw.
|
||||
if (!this._window) {
|
||||
Cu.reportError("DOMRequestHelper trying to create a Promise without a valid window, failing.");
|
||||
throw Cr.NS_ERROR_FAILURE;
|
||||
}
|
||||
return new this._window.Promise(aPromiseInit);
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user