Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/main.js

Issue 29355276: Noissue - Remove usage of the deprecated Promises.jsm module. (Closed)
Patch Set: address comments Created Sept. 29, 2016, 8:57 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« lib/crawler.js ('K') | « lib/crawler.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/main.js
diff --git a/lib/main.js b/lib/main.js
index df9b54a62a138cac1ca095967a0408a267c41388..000fe45f57204ab5557321a6f522ca79e466d9ae 100644
--- a/lib/main.js
+++ b/lib/main.js
@@ -12,7 +12,6 @@
const {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
const {XPCOMUtils} = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
-const {Promise} = Cu.import("resource://gre/modules/Promise.jsm", {});
require("commandLine");
let {run} = require("crawler");
@@ -23,24 +22,19 @@ let baseURL = null;
* Waits for the application to initialize.
* @type {Promise}
*/
-let applicationReady = (function()
+let applicationReady = new Promise((resolve, reject) =>
{
- let deferred = Promise.defer();
-
let observer = {
observe: function(subject, topic, data)
{
Services.obs.removeObserver(this, "sessionstore-windows-restored");
- deferred.resolve();
+ resolve();
},
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, Ci.nsISupportsWeakReference])
};
-
Services.obs.addObserver(observer, "sessionstore-windows-restored", true);
onShutdown.add(() => Services.obs.removeObserver(observer, "sessionstore-windows-restored"));
-
- return deferred.promise;
-})();
+});
/**
* Startup function, called from command line handler.
« lib/crawler.js ('K') | « lib/crawler.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld