Bug 1072814 - Emulate old Promise.defer() API for non-trivial cases r=yoric

This commit is contained in:
Tim Taubert 2014-09-25 09:14:53 +02:00
parent 5c7423bada
commit d7d06deb0b
2 changed files with 20 additions and 2 deletions

View File

@ -337,7 +337,16 @@ let SessionStoreInternal = {
_deferredInitialState: null,
// A promise resolved once initialization is complete
_deferredInitialized: Promise.defer(),
_deferredInitialized: (function () {
let deferred = {};
deferred.promise = new Promise((resolve, reject) => {
deferred.resolve = resolve;
deferred.reject = reject;
});
return deferred;
})(),
// Whether session has been initialized
_sessionInitialized: false,

View File

@ -63,7 +63,16 @@ consoleMsg.init(aMsg, aException.fileName, null, aException.lineNumber, 0, Ci.ns
Services.console.logMessage(consoleMsg);
}
let gOnceInitializedDeferred = Promise.defer();
let gOnceInitializedDeferred = (function () {
let deferred = {};
deferred.promise = new Promise((resolve, reject) => {
deferred.resolve = resolve;
deferred.reject = reject;
});
return deferred;
})();
/* :::::::: The Service ::::::::::::::: */