web_ffi
web_ffi copied to clipboard
Use wasmExports instead of obsolete asm.
It's related to #10.
New versions of Emscripten declares the Model.asm
as deprecated and generates the getter asm
which aborts with corresponding message:
legacyModuleProp('asm', 'wasmExports');
...
function legacyModuleProp(prop, newName, incomming=true) {
if (!Object.getOwnPropertyDescriptor(Module, prop)) {
Object.defineProperty(Module, prop, {
configurable: true,
get() {
let extra = incomming ? ' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)' : '';
abort(`\`Module.${prop}\` has been replaced by \`${newName}\`` + extra);
}
});
}
}
...
missingGlobal('asm', 'Please use wasmExports instead');
So, to keep old versions of Emscripten supported as well as new versions, this PR is offered.