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