constructor(emitters) {
    this.emitter = {
      emit(event, ...args) {
        emitters[event]?.(...args);
      },
    };
    this.codePath = null;
    this.idGenerator = new IdGenerator('s');
    this.currentNode = null;
    this.onLooped = this.onLooped.bind(this);
  }
@param {EventGenerator} eventGenerator An event generator to wrap.