From b83e2671f94d915909205ec78b187e6d4f0b5d19 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Mon, 19 Sep 2022 04:45:32 +0900 Subject: [PATCH] Fix StdEventTarget object --- lib/std.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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()) {