replaceNestedTrys(oldState, newState) {
    let states = [];
    for (let i = 0; i < this.nestedTrys.length; i++) {
      states.push(this.nestedTrys[i].replaceState(oldState, newState));
    }
    return states;
  }
Helper for replaceState.
@param {number} oldState
@param {number} newState
@return {Array.<TryState>}