function CodePathState(idGenerator,onLooped){_classCallCheck(this,CodePathState);this.idGenerator=idGenerator;this.notifyLooped=onLooped;this.forkContext=ForkContext.newRoot(idGenerator);this.choiceContext=null;this.switchContext=null;this.tryContext=null;this.loopContext=null;this.breakContext=null;this.currentSegments=[];this.initialSegment=this.forkContext.head[0];// returnedSegments and thrownSegments push elements into finalSegments also.
var final=this.finalSegments=[];var returned=this.returnedForkContext=[];var thrown=this.thrownForkContext=[];returned.add=addToReturnedOrThrown.bind(null,returned,thrown,final);thrown.add=addToReturnedOrThrown.bind(null,thrown,returned,final);}
@param {IdGenerator} idGenerator - An id generator to generate id for code
  path segments.
@param {Function} onLooped - A callback function to notify looping.