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

Unified Diff: messageResponder.js

Issue 29379570: Issue 4968 - Fix messageResponder syntax, declaring functions inside a block not allowed in strict … (Closed) Base URL: https://hg.adblockplus.org/adblockplusui
Patch Set: Created March 9, 2017, 11:14 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: messageResponder.js
===================================================================
--- a/messageResponder.js
+++ b/messageResponder.js
@@ -12,18 +12,19 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
"use strict";
+(function(global)
kzar 2017/03/10 13:42:33 Why pass `this` as the `global` instead of referri
Wladimir Palant 2017/03/12 08:16:18 Because that's assumptions about the global object
kzar 2017/03/13 07:47:24 Acknowledged.
{
- var ext = ext || require("ext_background");
+ let ext = global.ext || require("ext_background");
const {port} = require("messaging");
const {Prefs} = require("prefs");
const {Utils} = require("utils");
const {FilterStorage} = require("filterStorage");
const {FilterNotifier} = require("filterNotifier");
const {defaultMatcher} = require("matcher");
const {ElemHideEmulation} = require("elemHideEmulation");
@@ -419,9 +420,9 @@
let subscriptions = message.url ? [Subscription.fromURL(message.url)] :
FilterStorage.subscriptions;
for (let subscription of subscriptions)
{
if (subscription instanceof DownloadableSubscription)
Synchronizer.execute(subscription, true);
}
});
-}
+})(this);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld