eval method
Implementation
Future<InstanceRef?> eval(
String expression, {
required Disposable? isAlive,
Map<String, String>? scope,
bool shouldLogError = true,
}) async {
if ((scope?.isNotEmpty ?? false) &&
serviceManager.connectedApp!.isDartWebAppNow!) {
final result = await eval(
'(${scope!.keys.join(',')}) => $expression',
isAlive: isAlive,
shouldLogError: shouldLogError,
);
if (result == null || (isAlive?.disposed ?? true)) return null;
return await invoke(
result,
'call',
scope.values.toList(),
isAlive: isAlive,
shouldLogError: shouldLogError,
);
}
return await addRequest<InstanceRef?>(
isAlive,
() => _eval(
expression,
scope: scope,
shouldLogError: shouldLogError,
),
);
}