evalCallExpression method

  1. @override
dynamic evalCallExpression(
  1. CallExpression expression,
  2. Map<String, dynamic> context
)

Implementation

@override
dynamic evalCallExpression(
    CallExpression expression, Map<String, dynamic> context) {
  dynamic result;
  var callee = eval(expression.callee, context);
  var arguments = expression.arguments.map((e) => eval(e, context)).toList();
  if (callee is JsonWidgetFunction) {
    result = Function.apply(callee, null, {
      const Symbol('args'): arguments,
      const Symbol('registry'): registry,
    });
  } else {
    result = Function.apply(callee, arguments);
  }
  return result;
}