diff --git a/pkg/dart2wasm/bin/run_wasm.js b/pkg/dart2wasm/bin/run_wasm.js index 895d578c5fea..bd1bd78768aa 100644 --- a/pkg/dart2wasm/bin/run_wasm.js +++ b/pkg/dart2wasm/bin/run_wasm.js @@ -394,15 +394,13 @@ const main = async () => { } // Instantiate the Dart module, importing from the global scope. - const dartInstance = await dart2wasm.instantiate( - dart2wasm.compile(readBytes(args[wasmArg])), - Promise.resolve(importObject), - ); + const compiledApp = await dart2wasm.compile(readBytes(args[wasmArg])); + const appInstance = await compiledApp.instantiate(importObject); // Call `main`. If tasks are placed into the event loop (by scheduling tasks // explicitly or awaiting Futures), these will automatically keep the script // alive even after `main` returns. - await dart2wasm.invoke(dartInstance, ...dartArgs); + await appInstance.invokeMain(...dartArgs); }; dartMainRunner(main, []); diff --git a/pkg/test_runner/lib/src/browser.dart b/pkg/test_runner/lib/src/browser.dart index 201c9ece99cc..6a225886404b 100644 --- a/pkg/test_runner/lib/src/browser.dart +++ b/pkg/test_runner/lib/src/browser.dart @@ -328,15 +328,16 @@ String dart2wasmHtml(String title, String wasmPath, String mjsPath) { src="/root_dart/pkg/test_runner/lib/src/test_controller.js"> """;