2020-11-30 17:54:35 +00:00
|
|
|
diff --git a/emsdk/fastcomp/emscripten/src/support.js b/emsdk/fastcomp/emscripten/src/support.js
|
2019-01-16 21:57:46 +00:00
|
|
|
index 8e1df8e82..4d07d6bef 100644
|
2020-11-30 17:54:35 +00:00
|
|
|
--- a/emsdk/fastcomp/emscripten/src/support.js
|
|
|
|
+++ b/emsdk/fastcomp/emscripten/src/support.js
|
2020-05-28 16:13:51 +00:00
|
|
|
@@ -471,7 +471,18 @@
|
2019-01-16 21:57:46 +00:00
|
|
|
// present in the dynamic library but not in the main JS,
|
|
|
|
// and the dynamic library cannot provide JS for it. Use
|
|
|
|
// the generic "X" invoke for it.
|
2020-05-28 16:13:51 +00:00
|
|
|
- return obj[prop] = invoke_X;
|
2019-01-16 21:57:46 +00:00
|
|
|
+ var dynCallName = 'dynCall_' + prop.slice(7);
|
2020-05-28 16:13:51 +00:00
|
|
|
+ return obj[prop] = function() {
|
2019-01-16 21:57:46 +00:00
|
|
|
+ var sp = stackSave();
|
2020-05-28 16:13:51 +00:00
|
|
|
+ try {
|
2019-01-16 21:57:46 +00:00
|
|
|
+ var args = Array.prototype.slice.call(arguments);
|
|
|
|
+ return Module[dynCallName].apply(null, args);
|
|
|
|
+ } catch(e) {
|
|
|
|
+ stackRestore(sp);
|
|
|
|
+ if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
|
|
|
+ Module["setThrew"](1, 0);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
}
|
2020-05-28 16:13:51 +00:00
|
|
|
// otherwise this is regular function import - call it indirectly
|
|
|
|
return obj[prop] = function() {
|
|
|
|
@@ -530,6 +541,11 @@
|
2019-01-16 21:57:46 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
+ if (e.startsWith("dynCall_")) {
|
|
|
|
+ if (!Module.hasOwnProperty(e)) {
|
|
|
|
+ Module[e] = value;
|
2018-12-20 16:58:10 +00:00
|
|
|
+ }
|
|
|
|
+ }
|
2019-01-16 21:57:46 +00:00
|
|
|
exports[e] = value;
|
2020-05-28 16:13:51 +00:00
|
|
|
#if WASM_BACKEND
|
|
|
|
moduleLocal['_' + e] = value;
|