File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -55,21 +55,23 @@ pub fn attribute_gdextension(decl: Declaration) -> ParseResult<TokenStream> {
5555 let script = std:: ffi:: CString :: new( concat!(
5656 "var pkgName = '" , env!( "CARGO_PKG_NAME" ) , "';" , r#"
5757 var libName = pkgName.replaceAll('-', '_') + '.wasm';
58- var dso = LDSO.loadedLibsByName[libName]["module"];
58+ var dso = LDSO.loadedLibsByName[libName];
59+ // This property was renamed as of emscripten 3.1.34
60+ var dso_exports = "module" in dso ? dso["module"] : dso["exports"];
5961 var registrants = [];
60- for (sym in dso ) {
62+ for (sym in dso_exports ) {
6163 if (sym.startsWith("dynCall_")) {
6264 if (!(sym in Module)) {
6365 console.log(`Patching Module with ${sym}`);
64- Module[sym] = dso [sym];
66+ Module[sym] = dso_exports [sym];
6567 }
6668 } else if (sym.startsWith("rust_gdext_registrant_")) {
6769 registrants.push(sym);
6870 }
6971 }
7072 for (sym of registrants) {
7173 console.log(`Running registrant ${sym}`);
72- dso [sym]();
74+ dso_exports [sym]();
7375 }
7476 console.log("Added", registrants.length, "plugins to registry!");
7577 "# ) ) . expect( "Unable to create CString from script" ) ;
You can’t perform that action at this time.
0 commit comments