531a4c8f62
Change-Id: I14963de5f6face564276955d21d63f4b038cf990 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378722 Reviewed-by: Leaf Petersen <leafp@google.com> Reviewed-by: Bob Nystrom <rnystrom@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Slava Egorov <vegorov@google.com> Reviewed-by: Sigmund Cherem <sigmund@google.com>
31 lines
1.1 KiB
Dart
31 lines
1.1 KiB
Dart
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
import 'dart:typed_data' show Uint8List;
|
|
import 'dart:_internal' as internal;
|
|
|
|
/// Load a dynamic module from [uri] and execute its entry point method.
|
|
///
|
|
/// Entry point method is a no-argument method annotated with
|
|
/// `@pragma('dyn-module:entry-point')`.
|
|
///
|
|
/// This API is experimental, can be changed or removed
|
|
/// without a notice.
|
|
///
|
|
/// Returns a future containing the result of the entry point method.
|
|
Future<Object?> loadModuleFromUri(Uri uri) =>
|
|
internal.loadDynamicModule(uri: uri);
|
|
|
|
/// Load a dynamic module from [bytes] and execute its entry point method.
|
|
///
|
|
/// Entry point method is a no-argument method annotated with
|
|
/// `@pragma('dyn-module:entry-point')`.
|
|
///
|
|
/// This API is experimental, can be changed or removed
|
|
/// without a notice.
|
|
///
|
|
/// Returns a future containing the result of the entry point method.
|
|
Future<Object?> loadModuleFromBytes(Uint8List bytes) =>
|
|
internal.loadDynamicModule(bytes: bytes);
|