call method

dynamic call (List<Node> args)

Call the last valid name of method

Implementation

dynamic call(List<Node> args) {
  if (name == null) return null;

  final FunctionRegistryItem item = registry[name];
  final List<dynamic> arguments =
      item.listArguments ? <List<Node>>[args] : args;
  final InstanceMirror instanceMirror = reflect(this);

  return instanceMirror.invoke(Symbol(item.name), arguments).reflectee;
}