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

Side by Side Diff: ext/common.js

Issue 29417597: Issue 5161 - Use maps and sets where appropriate (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Created April 19, 2017, 4:33 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 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
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 sendMessage: chrome.runtime.sendMessage, 66 sendMessage: chrome.runtime.sendMessage,
67 getWindow() 67 getWindow()
68 { 68 {
69 return chrome.extension.getBackgroundPage(); 69 return chrome.extension.getBackgroundPage();
70 } 70 }
71 }; 71 };
72 72
73 73
74 /* Utils */ 74 /* Utils */
75 75
76 ext.mapIterable = function(iterable, callback, thisArg)
Sebastian Noack 2017/04/29 22:46:32 Why do we need this helper? IMO the calling code s
Manish Jethani 2017/05/04 14:47:33 Fair enough, the function that used this now retur
77 {
78 let iterator = iterable[Symbol.iterator]();
79 return {
80 [Symbol.iterator]()
81 {
82 return this;
83 },
84 next()
85 {
86 let next = iterator.next();
87 if (!next.done)
88 next.value = callback.call(thisArg, next.value);
89 return next;
90 }
91 };
92 };
93
76 ext.getURL = chrome.extension.getURL; 94 ext.getURL = chrome.extension.getURL;
77 ext.i18n = chrome.i18n; 95 ext.i18n = chrome.i18n;
78 }()); 96 }());
OLDNEW

Powered by Google App Engine
This is Rietveld