TryStatementImpl constructor

TryStatementImpl({
  1. required Token tryKeyword,
  2. required BlockImpl body,
  3. required List<CatchClauseImpl> catchClauses,
  4. required Token? finallyKeyword,
  5. required BlockImpl? finallyBlock,
})

Initialize a newly created try statement. The list of catchClauses can benull if there are no catch clauses. The finallyKeyword and finallyBlock can be null if there is no finally clause.

Implementation

TryStatementImpl({
  required this.tryKeyword,
  required BlockImpl body,
  required List<CatchClauseImpl> catchClauses,
  required this.finallyKeyword,
  required BlockImpl? finallyBlock,
})  : _body = body,
      _finallyBlock = finallyBlock {
  _becomeParentOf(_body);
  _catchClauses._initialize(this, catchClauses);
  _becomeParentOf(_finallyBlock);
}