ad5f6cdb7e
Bug: skia: Change-Id: I4d38e60f03bb315dee9c9db655ce168e9b3b475f Reviewed-on: https://skia-review.googlesource.com/c/skia/+/195580 Commit-Queue: Nathaniel Nifong <nifong@google.com> Reviewed-by: Kevin Lubick <kjlubick@google.com>
16 lines
486 B
JavaScript
16 lines
486 B
JavaScript
// 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;
|
|
if (runtimeInitialized) {
|
|
resolve(Module);
|
|
} else {
|
|
addOnPostRun(function() {
|
|
resolve(Module);
|
|
});
|
|
}
|
|
});
|
|
}
|
|
delete Module['then']; |