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

Delta Between Two Patch Sets: bootstrap.js.tmpl

Issue 11237002: Provide an XMLHttpRequest constructor if used in JS modules (Closed)
Left Patch Set: Created July 25, 2013, 12:35 p.m.
Right Patch Set: Created July 25, 2013, 3:43 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 | « no previous file | packagerGecko.py » ('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 file is part of the Adblock Plus build tools, 2 * This file is part of the Adblock Plus build tools,
3 * Copyright (C) 2006-2013 Eyeo GmbH 3 * Copyright (C) 2006-2013 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 17
18 const Cc = Components.classes; 18 const Cc = Components.classes;
19 const Ci = Components.interfaces; 19 const Ci = Components.interfaces;
20 const Cr = Components.results; 20 const Cr = Components.results;
21 const Cu = Components.utils; 21 const Cu = Components.utils;
22 22
23 let {Services, atob, btoa, File} = Cu.import("resource://gre/modules/Services.js m", null); 23 let {Services, atob, btoa, File} = Cu.import("resource://gre/modules/Services.js m", null);
24 24
25 {%- if hasXMLHttpRequest %} 25 {%- if hasXMLHttpRequest %}
26 var XMLHttpRequest = Components.Constructor("@mozilla.org/xmlextras/xmlhttpreque st;1", "nsIXMLHttpRequest"); 26 let XMLHttpRequest = Components.Constructor("@mozilla.org/xmlextras/xmlhttpreque st;1", "nsIXMLHttpRequest");
Felix Dahlke 2013/07/25 13:24:11 Why var and not let?
Wladimir Palant 2013/07/25 15:43:45 Fixed
27 {%- endif %} 27 {%- endif %}
28 28
29 let addonData = null; 29 let addonData = null;
30 30
31 function startup(params, reason) 31 function startup(params, reason)
32 { 32 {
33 addonData = params; 33 addonData = params;
34 34
35 {%- if hasChromeRequires %} 35 {%- if hasChromeRequires %}
36 Services.obs.addObserver(RequireObserver, "{{metadata.get('general', 'basename ')}}-require", true); 36 Services.obs.addObserver(RequireObserver, "{{metadata.get('general', 'basename ')}}-require", true);
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 { 193 {
194 if (topic == "{{metadata.get('general', 'basename')}}-require") 194 if (topic == "{{metadata.get('general', 'basename')}}-require")
195 { 195 {
196 subject.wrappedJSObject.exports = require(data); 196 subject.wrappedJSObject.exports = require(data);
197 } 197 }
198 }, 198 },
199 199
200 QueryInterface: XPCOMUtils.generateQI([Ci.nsISupportsWeakReference, Ci.nsIObse rver]) 200 QueryInterface: XPCOMUtils.generateQI([Ci.nsISupportsWeakReference, Ci.nsIObse rver])
201 }; 201 };
202 {%- endif %} 202 {%- endif %}
LEFTRIGHT
« no previous file | packagerGecko.py » ('j') | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld