3088c69b5f
The goal is to see how small this can be w/o disrupting CanvasKit. Change-Id: Ia96ebf94dbe335d9db481d9264279163f8c37e16 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285012 Reviewed-by: Florin Malita <fmalita@chromium.org>
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']; |