File tree 1 file changed +6
-4
lines changed
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> {
55
55
let script = std:: ffi:: CString :: new( concat!(
56
56
"var pkgName = '" , env!( "CARGO_PKG_NAME" ) , "';" , r#"
57
57
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"];
59
61
var registrants = [];
60
- for (sym in dso ) {
62
+ for (sym in dso_exports ) {
61
63
if (sym.startsWith("dynCall_")) {
62
64
if (!(sym in Module)) {
63
65
console.log(`Patching Module with ${sym}`);
64
- Module[sym] = dso [sym];
66
+ Module[sym] = dso_exports [sym];
65
67
}
66
68
} else if (sym.startsWith("rust_gdext_registrant_")) {
67
69
registrants.push(sym);
68
70
}
69
71
}
70
72
for (sym of registrants) {
71
73
console.log(`Running registrant ${sym}`);
72
- dso [sym]();
74
+ dso_exports [sym]();
73
75
}
74
76
console.log("Added", registrants.length, "plugins to registry!");
75
77
"# ) ) . expect( "Unable to create CString from script" ) ;
You can’t perform that action at this time.
0 commit comments