[dart2wasm] Remove deprecated mjs API functions
This is a re-land of [0] from 1.5 years ago. [0] https://dart-review.googlesource.com/c/sdk/+/385020 Change-Id: I92747494f7c0d9dc43c09040ce06a523453994f3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/510823 Reviewed-by: Srujan Gaddam <srujzs@google.com> Commit-Queue: Martin Kustermann <kustermann@google.com>
This commit is contained in:
committed by
dart-scoped@luci-project-accounts.iam.gserviceaccount.com
parent
5cd42e6b21
commit
8e751fbc02
@@ -21,25 +21,6 @@ export async function compile(bytes) {
|
|||||||
return new CompiledApp(await WebAssembly.compile(bytes, builtins), builtins);
|
return new CompiledApp(await WebAssembly.compile(bytes, builtins), builtins);
|
||||||
}
|
}
|
||||||
|
|
||||||
// DEPRECATED: Please use `compile` or `compileStreaming` to get a compiled app,
|
|
||||||
// use `instantiate` method to get an instantiated app and then call
|
|
||||||
// `invokeMain` to invoke the main function.
|
|
||||||
export async function instantiate(modulePromise, importObjectPromise) {
|
|
||||||
var moduleOrCompiledApp = await modulePromise;
|
|
||||||
if (!(moduleOrCompiledApp instanceof CompiledApp)) {
|
|
||||||
moduleOrCompiledApp = new CompiledApp(moduleOrCompiledApp);
|
|
||||||
}
|
|
||||||
const instantiatedApp = await moduleOrCompiledApp.instantiate(await importObjectPromise);
|
|
||||||
return instantiatedApp.instantiatedModule;
|
|
||||||
}
|
|
||||||
|
|
||||||
// DEPRECATED: Please use `compile` or `compileStreaming` to get a compiled app,
|
|
||||||
// use `instantiate` method to get an instantiated app and then call
|
|
||||||
// `invokeMain` to invoke the main function.
|
|
||||||
export const invoke = (moduleInstance, ...args) => {
|
|
||||||
moduleInstance.exports.$invokeMain(args);
|
|
||||||
}
|
|
||||||
|
|
||||||
class CompiledApp {
|
class CompiledApp {
|
||||||
constructor(module, builtins) {
|
constructor(module, builtins) {
|
||||||
this.module = module;
|
this.module = module;
|
||||||
|
|||||||
Reference in New Issue
Block a user