FunctionDeclarationImpl constructor

FunctionDeclarationImpl({
  1. required CommentImpl? comment,
  2. required List<AnnotationImpl>? metadata,
  3. required Token? augmentKeyword,
  4. required Token? externalKeyword,
  5. required TypeAnnotationImpl? returnType,
  6. required Token? propertyKeyword,
  7. required Token name,
  8. required FunctionExpressionImpl functionExpression,
})

Initialize a newly created function declaration. Either or both of the comment and metadata can be null if the function does not have the corresponding attribute. The externalKeyword can be null if the function is not an external function. The returnType can be null if no return type was specified. The propertyKeyword can be null if the function is neither a getter or a setter.

Implementation

FunctionDeclarationImpl({
  required super.comment,
  required super.metadata,
  required this.augmentKeyword,
  required this.externalKeyword,
  required TypeAnnotationImpl? returnType,
  required this.propertyKeyword,
  required super.name,
  required FunctionExpressionImpl functionExpression,
})  : _returnType = returnType,
      _functionExpression = functionExpression {
  _becomeParentOf(_returnType);
  _becomeParentOf(_functionExpression);
}