Skip to content

Commit

Permalink
Use wasmExports instead of obsolete asm.
Browse files Browse the repository at this point in the history
  • Loading branch information
darkstarx committed Nov 21, 2023
1 parent bf4aad5 commit 0cf51f8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/src/modules/emscripten/emscripten_module.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class _EmscriptenModuleJs {
external Uint8List? get wasmBinary;
external Uint8List? get HEAPU8;
external Object? get asm;
external Object? get wasmExports;

// Must have an unnamed factory constructor with named arguments.
external factory _EmscriptenModuleJs({Uint8List wasmBinary});
Expand Down Expand Up @@ -108,13 +109,13 @@ class EmscriptenModule extends Module {
this._emscriptenModuleJs, this._exports, this._malloc, this._free);

factory EmscriptenModule._fromJs(_EmscriptenModuleJs module) {
Object? asm = module.asm;
if (asm != null) {
final wasmExports = module.wasmExports ?? module.asm;
if (wasmExports != null) {
Map<int, WasmSymbol> knownAddresses = {};
_Malloc? malloc;
_Free? free;
List<WasmSymbol> exports = [];
List? entries = _entries(asm);
List? entries = _entries(wasmExports);
if (entries != null) {
for (dynamic entry in entries) {
if (entry is List) {
Expand Down

0 comments on commit 0cf51f8

Please sign in to comment.