From 0f947a09ede2a68b5db6d65af30a1fdaf22510ba Mon Sep 17 00:00:00 2001 From: Jackson Gardner Date: Fri, 29 Sep 2023 10:41:45 -0700 Subject: [PATCH] Update the wasm bootstrap to allow access to the emscripten wrapper to skwasm. (#135723) Some upcoming engine changes will bind to a function provided by the emscripten JS wrapper around skwasm, rather than just the wasm module itself. This will make sure not to break the benchmarks when those engine changes land. See https://github.com/flutter/engine/pull/46388 --- .../lib/src/web/file_generators/wasm_bootstrap.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/flutter_tools/lib/src/web/file_generators/wasm_bootstrap.dart b/packages/flutter_tools/lib/src/web/file_generators/wasm_bootstrap.dart index 0d1a755c0f..caafc3d358 100644 --- a/packages/flutter_tools/lib/src/web/file_generators/wasm_bootstrap.dart +++ b/packages/flutter_tools/lib/src/web/file_generators/wasm_bootstrap.dart @@ -46,7 +46,8 @@ String generateImports(bool isSkwasm) { const skwasmInstance = await skwasm(); window._flutter_skwasmInstance = skwasmInstance; resolve({ - 'skwasm': skwasmInstance.asm ?? skwasmInstance.wasmExports, + 'skwasm': skwasmInstance.wasmExports, + 'skwasmWrapper': skwasmInstance, 'ffi': { 'memory': skwasmInstance.wasmMemory, }