2019-01-04 19:38:29 +00:00
|
|
|
// See https://github.com/kripken/emscripten/issues/5820#issuecomment-385722568
|
|
|
|
// for context on why the .then() that comes with Module breaks things (e.g. infinite loops)
|
|
|
|
// and why the below fixes it.
|
|
|
|
Module['ready'] = function() {
|
|
|
|
return new Promise(function (resolve, reject) {
|
|
|
|
Module['onAbort'] = reject;
|
2019-01-07 03:27:54 +00:00
|
|
|
if (runtimeInitialized) {
|
|
|
|
resolve(Module);
|
|
|
|
} else {
|
|
|
|
addOnPostRun(function() {
|
|
|
|
resolve(Module);
|
|
|
|
});
|
|
|
|
}
|
2019-01-04 19:38:29 +00:00
|
|
|
});
|
|
|
|
}
|
2019-02-25 21:04:02 +00:00
|
|
|
delete Module['then'];
|