returnedValues function

List<Expression> returnedValues(
  1. FunctionBody body
)

The values body returns: its expression, or the values of the return statements of its block outside the functions declared in it.

Implementation

List<Expression> returnedValues(FunctionBody body) {
  if (body is ExpressionFunctionBody) return [body.expression];
  if (body is! BlockFunctionBody) return const [];
  final returns = _Returns();
  body.block.accept(returns);
  return returns.values;
}