executeAsync method
Future<Object?>
executeAsync({
- required SCompilationUnit ast,
- String name = 'main',
- List<
Object?> ? positionalArgs, - Map<
String, Object?> ? namedArgs, - D4rtExecutionHooks? hooks,
Runs execute and settles its result: an entry point that returns a
Future (an async main) is awaited, so the host always receives the
final native value. A synchronous entry point's value comes back
unchanged. The script's error — thrown synchronously or by the Future —
fails the returned Future, as execute would have thrown it.
The arguments mean what they mean on execute.
Implementation
Future<Object?> executeAsync({
required SCompilationUnit ast,
String name = 'main',
List<Object?>? positionalArgs,
Map<String, Object?>? namedArgs,
D4rtExecutionHooks? hooks,
}) async {
final Object? result = execute(
ast: ast,
name: name,
positionalArgs: positionalArgs,
namedArgs: namedArgs,
hooks: hooks,
);
return result is Future ? await result : result;
}