diff options
Diffstat (limited to 'src/library_browser.js')
-rw-r--r-- | src/library_browser.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/library_browser.js b/src/library_browser.js index e4966e15..cba8ecdf 100644 --- a/src/library_browser.js +++ b/src/library_browser.js @@ -688,6 +688,25 @@ mergeInto(LibraryManager.library, { }, millis); }, + emscripten_async_load_script: function(url, onload, onerror) { + Module['noExitRuntime'] = true; + + onload = Runtime.getFuncWrapper(onload, 'v'); + + assert(runDependencies === 0, 'async_load_script must be run when no other dependencies are active'); + var script = document.createElement('script'); + script.onload = function() { + if (runDependencies > 0) { + dependenciesFulfilled = onload; + } else { + onload(); + } + }; + script.onerror = onerror; + script.src = Pointer_stringify(url); + document.body.appendChild(script); + }, + emscripten_set_main_loop: function(func, fps, simulateInfiniteLoop) { Module['noExitRuntime'] = true; |