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

Unified Diff: lib/main.js

Issue 29355247: Noissue - fix according to coding style (Closed)
Patch Set: Created Sept. 29, 2016, 8:46 a.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 b25e05d19756f85c6ab928b106250c1b68fd1373..16efd1ec25b738ddba717fad49f23486d3921361 100644
--- a/lib/main.js
+++ b/lib/main.js
@@ -4,13 +4,13 @@
* http://mozilla.org/MPL/2.0/.
*/
+'use strict';
+
/**
* @module main
*/
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
+const {XPCOMUtils} = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
Wladimir Palant 2016/09/29 10:36:10 Why did you remove Services.jsm? It is being used
require("commandLine");
let {run} = require("crawler");
@@ -23,21 +23,21 @@ let baseURL = null;
*/
let applicationReady = (function()
{
- let deferred = Promise.defer();
+ let resolveWindowsRestored;
let observer = {
observe: function(subject, topic, data)
{
Services.obs.removeObserver(this, "sessionstore-windows-restored");
- deferred.resolve();
+ resolveWindowsRestored();
},
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, Ci.nsISupportsWeakReference])
};
-
+ let windowsRestored = new Promise((resolve) => resolveWindowsRestored = resolve);
Services.obs.addObserver(observer, "sessionstore-windows-restored", true);
onShutdown.add(() => Services.obs.removeObserver(observer, "sessionstore-windows-restored"));
- return deferred.promise;
+ return windowsRestored;
Wladimir Palant 2016/09/29 10:36:10 This is not how the code should be structured - yo
sergei 2016/09/29 12:46:16 Done in https://codereview.adblockplus.org/2935527
})();
/**
« lib/crawler.js ('K') | « lib/crawler.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld