Fix StdEventTarget object

This commit is contained in:
Namhyeon Go 2022-09-19 04:45:32 +09:00
parent d17138a980
commit b83e2671f9

View File

@ -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()) {