bodyExecute method

  1. @override
StatementContextBodyExecutionResult? bodyExecute(
  1. DartBlockArbiter arbiter,
  2. covariant StatementContextPreExecutionResult? preExecutionResult
)
override

Implementation

@override
StatementContextBodyExecutionResult? bodyExecute(
  DartBlockArbiter arbiter,
  covariant StatementContextPreExecutionResult? preExecutionResult,
) {
  initStatement?.run(arbiter);

  bool breakExecution = false;
  while (condition.getValue(arbiter)) {
    for (var statement in bodyStatements) {
      try {
        statement.run(arbiter);
      } on BreakStatementException catch (_) {
        breakExecution = true;
        break;
      } on ContinueStatementException catch (_) {
        break;
      }
    }
    if (breakExecution) {
      break;
    }

    postStatement?.run(arbiter);
  }

  return null;
}