CatchClauseImpl constructor
CatchClauseImpl({
- required Token? onKeyword,
- required TypeAnnotationImpl? exceptionType,
- required Token? catchKeyword,
- required Token? leftParenthesis,
- required CatchClauseParameterImpl? exceptionParameter,
- required Token? comma,
- required CatchClauseParameterImpl? stackTraceParameter,
- required Token? rightParenthesis,
- required BlockImpl body,
Initialize a newly created catch clause. The onKeyword and
exceptionType
can be null
if the clause will catch all exceptions. The
comma and _stackTraceParameter
can be null
if the stack trace
parameter is not defined.
Implementation
CatchClauseImpl({
required this.onKeyword,
required TypeAnnotationImpl? exceptionType,
required this.catchKeyword,
required this.leftParenthesis,
required CatchClauseParameterImpl? exceptionParameter,
required this.comma,
required CatchClauseParameterImpl? stackTraceParameter,
required this.rightParenthesis,
required BlockImpl body,
}) : assert(onKeyword != null || catchKeyword != null),
_exceptionType = exceptionType,
_exceptionParameter = exceptionParameter,
_stackTraceParameter = stackTraceParameter,
_body = body {
_becomeParentOf(_exceptionType);
_becomeParentOf(_exceptionParameter);
_becomeParentOf(_stackTraceParameter);
_becomeParentOf(_body);
}