diff --git a/lib/std.js b/lib/std.js index 294e32d..9c0c1f9 100644 --- a/lib/std.js +++ b/lib/std.js @@ -363,7 +363,7 @@ function StdEventTarget() { }; this.addEventListener = function(type, listener) { - if (typeof f === "function") { + if (typeof listener === "function") { this.__events__.push({ "type": type, "listener": listener, @@ -376,7 +376,7 @@ function StdEventTarget() { }; this.removeEventListener = function(type, listener) { - if (typeof f === "function") { + if (typeof listener === "function") { for (var i = 0; i < this.__events__.length; i++) { var e = this.__events__[i]; if (e.type == event.type && typeof(e.listener) === "function" && e.listener.toString() == listener.toString()) {