invoke method

dynamic invoke(
  1. String funcName, {
  2. List positionalArgs = const [],
  3. Map<String, dynamic> namedArgs = const {},
  4. List<HTType> typeArgs = const [],
})

Call a member function of this HTInstance.

Implementation

dynamic invoke(String funcName,
    {List<dynamic> positionalArgs = const [],
    Map<String, dynamic> namedArgs = const {},
    List<HTType> typeArgs = const []}) {
  try {
    HTFunction func = memberGet(funcName);
    func.resolve();
    return func.call(
        positionalArgs: positionalArgs,
        namedArgs: namedArgs,
        typeArgs: typeArgs);
  } catch (error, stackTrace) {
    if (interpreter.config.processError) {
      interpreter.processError(error, stackTrace);
    } else {
      rethrow;
    }
  }
}