Index: ext/common.js |
diff --git a/ext/common.js b/ext/common.js |
index c75ced186d633fc3bf4183be4fb5d9dd6c5db666..d13c89f2816e8112d67527ff552f2e4294d942ca 100644 |
--- a/ext/common.js |
+++ b/ext/common.js |
@@ -15,12 +15,12 @@ |
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
*/ |
+"use strict"; |
-(function() |
{ |
window.ext = {}; |
- var EventTarget = ext._EventTarget = function() |
+ let EventTarget = ext._EventTarget = function() |
{ |
this._listeners = []; |
}; |
@@ -32,19 +32,19 @@ |
}, |
removeListener: function(listener) |
{ |
- var idx = this._listeners.indexOf(listener); |
+ let idx = this._listeners.indexOf(listener); |
if (idx != -1) |
this._listeners.splice(idx, 1); |
}, |
_dispatch: function() |
{ |
- var results = []; |
- var listeners = this._listeners.slice(); |
+ let results = []; |
+ let listeners = this._listeners.slice(); |
- for (var i = 0; i < listeners.length; i++) |
- results.push(listeners[i].apply(null, arguments)); |
+ for (let listener of listeners) |
+ results.push(listener.apply(null, arguments)); |
return results; |
} |
}; |
-})(); |
+} |