Sfoglia il codice sorgente

Fixed bug that didn't test listener type.

dev-tmpl
Bryan Miller 6 anni fa
parent
commit
6919de7f05
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  1. +2
    -0
      app/js/EventCaller.js

+ 2
- 0
app/js/EventCaller.js Vedi File

@@ -63,6 +63,8 @@ export class EventCaller{
* @returns {this}
*/
listen(eventName, callback, owner=null, once=false){
if (typeof(callback) !== 'function')
throw new TypeError("Expected callback argument to be a function or class method.");
try{
if (!this.is_listening(eventName, callback, owner)){
if (!this.__listeners.hasOwnProperty(eventName)){

Loading…
Annulla
Salva