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

Delta Between Two Patch Sets: lib/crawler.js

Issue 29355271: Noissue - Don't import JavaScript modules into the global scope (includes removing unused module). (Closed)
Left Patch Set: Created Sept. 29, 2016, 12:05 p.m.
Right Patch Set: address comments Created Sept. 29, 2016, 8:56 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « lib/commandLine.js ('k') | lib/main.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This Source Code is subject to the terms of the Mozilla Public License 2 * This Source Code is subject to the terms of the Mozilla Public License
3 * version 2.0 (the "License"). You can obtain a copy of the License at 3 * version 2.0 (the "License"). You can obtain a copy of the License at
4 * http://mozilla.org/MPL/2.0/. 4 * http://mozilla.org/MPL/2.0/.
5 */ 5 */
6 6
7 "use strict"; 7 "use strict";
8 8
9 /** 9 /**
10 * @module crawler 10 * @module crawler
11 */ 11 */
12 12
13 const {Services} = Cu.import("resource://gre/modules/Services.jsm", {}); 13 const {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
14 const {XPCOMUtils} = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {}); 14 const {XPCOMUtils} = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
15 const {Task} = Cu.import("resource://gre/modules/Task.jsm", {}); 15 const {Task} = Cu.import("resource://gre/modules/Task.jsm", {});
Wladimir Palant 2016/09/29 18:19:28 You cannot remove Promise.jsm without getting rid
sergei 2016/09/29 21:00:18 Restored. Sorry, overlooked it, thought last defe
16 const {Promise} = Cu.import("resource://gre/modules/Promise.jsm", {});
16 17
17 function abprequire(module) 18 function abprequire(module)
18 { 19 {
19 let result = {}; 20 let result = {};
20 result.wrappedJSObject = result; 21 result.wrappedJSObject = result;
21 Services.obs.notifyObservers(result, "adblockplus-require", module); 22 Services.obs.notifyObservers(result, "adblockplus-require", module);
22 return result.exports; 23 return result.exports;
23 } 24 }
24 25
25 let {RequestNotifier} = abprequire("requestNotifier"); 26 let {RequestNotifier} = abprequire("requestNotifier");
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 397
397 function reportException(e) 398 function reportException(e)
398 { 399 {
399 let stack = ""; 400 let stack = "";
400 if (e && typeof e == "object" && "stack" in e) 401 if (e && typeof e == "object" && "stack" in e)
401 stack = e.stack + "\n"; 402 stack = e.stack + "\n";
402 403
403 Cu.reportError(e); 404 Cu.reportError(e);
404 dump(e + "\n" + stack + "\n"); 405 dump(e + "\n" + stack + "\n");
405 } 406 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld