function addAllCatchStates(tryStates, catches) {
  for (let i = 0; i < tryStates.length; i++) {
    let tryState = tryStates[i];
    if (tryState.kind === TryState.Kind.CATCH) {
      catches.push(tryState);
    }
    addAllCatchStates(tryState.nestedTrys, catches);
  }
}
@param {Array.<TryState>} tryStates
@param {Array.<CatchState>} catches