| Index: ext/common.js |
| =================================================================== |
| --- a/ext/common.js |
| +++ b/ext/common.js |
| @@ -68,11 +68,29 @@ |
| { |
| return chrome.extension.getBackgroundPage(); |
| } |
| }; |
| /* Utils */ |
| + 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
|
| + { |
| + let iterator = iterable[Symbol.iterator](); |
| + return { |
| + [Symbol.iterator]() |
| + { |
| + return this; |
| + }, |
| + next() |
| + { |
| + let next = iterator.next(); |
| + if (!next.done) |
| + next.value = callback.call(thisArg, next.value); |
| + return next; |
| + } |
| + }; |
| + }; |
| + |
| ext.getURL = chrome.extension.getURL; |
| ext.i18n = chrome.i18n; |
| }()); |