*listener* must be a function or an object with a *handleEvent* method, so this shouldn't check that *handleEvent* is callable before calling it and ignore it if isn't. It would be better for the code to simply throw, informing the developer about the problem, than to fail silently, i.e.:

          if (typeof listener == "function") {
            listener.call(this, evt);
          } else {
            listener.handleEvent(evt);
          }