invoke method
dynamic
invoke(})
Call a static function of this HTClass.
Implementation
dynamic invoke(String funcName,
{List<dynamic> positionalArgs = const [],
Map<String, dynamic> namedArgs = const {},
List<HTType> typeArgs = const []}) {
try {
final func = memberGet(funcName);
if (func is HTFunction) {
func.resolve();
return func.call(
positionalArgs: positionalArgs,
namedArgs: namedArgs,
typeArgs: typeArgs);
} else {
throw HTError.notCallable(funcName,
filename: interpreter.currentFileName,
line: interpreter.currentLine,
column: interpreter.currentColumn);
}
} catch (error, stackTrace) {
if (interpreter.config.processError) {
interpreter.processError(error, stackTrace);
} else {
rethrow;
}
}
}