evalSource method
dynamic
evalSource(})
Evaluate a HTSource.
If invokeFunc
is provided, will immediately
call the function after evaluation completed.
Implementation
dynamic evalSource(HTSource source,
{String? moduleName,
bool globallyImport = false,
String? invokeFunc,
List<dynamic> positionalArgs = const [],
Map<String, dynamic> namedArgs = const {},
List<HTType> typeArgs = const []}) {
if (source.content.trim().isEmpty) {
return null;
}
final bytes = _compileSource(source);
final result = interpreter.loadBytecode(
bytes: bytes,
moduleName: moduleName ?? source.fullName,
globallyImport: globallyImport,
invokeFunc: invokeFunc,
positionalArgs: positionalArgs,
namedArgs: namedArgs,
typeArgs: typeArgs,
printPerformanceStatistics: config.printPerformanceStatistics,
);
return result;
}