'use strict'

class EventEmitter {
  constructor(name) {
    this.eventName = name;
    this.target = [];
    
  }

  emit() {
    for (let i = 0; i < this.target.length; i++) {
      this.target[i]._events[this.eventName] += 1;
    }
  }
}

class EventListener {
  constructor() {
    Object.defineProperty(this, '_events', {
      configurable: true,
      enumerable: false,
      value: {},
      writable: false
    });
  }

  on(eventName, eventEmitter, handler) {
    eventEmitter = eventEmitter || new EventEmitter();
    eventEmitter.target.push(this);
    Object.defineProperty(this._events, eventName, {
      configurable: true,
    set: (v) => {
      setTimeout(handler, 0);
      }
    });
  }
}

@@ -116,16 +116,19 @@
 %0A  emit(
+msg
 ) %7B%0A    
@@ -226,9 +226,11 @@
  += 
-1
+msg
 ;%0A  

Update event.js