visitFunctionNode method

  1. @override
Null? visitFunctionNode(
  1. FunctionNode node
)
override

Implementation

@override
visitFunctionNode(FunctionNode node) {
  node.environment = <String?>{};
  Scope? oldScope = currentScope;
  currentScope = node;
  node.environment!.add('arguments');
  if (node.isExpression && node.name != null) {
    addVar(node.name!);
  }
  node.params.forEach(addVar);
  visit(node.body);
  currentScope = oldScope;
}