diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-12-01 10:34:07 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-12-07 14:23:21 -0800 |
commit | 4d0bf4e67ae46007a8870e8de344389b415981b3 (patch) | |
tree | 8db83fd01ffca4db54a87f7c2c12e8dd1eeac071 /src/library_browser.js | |
parent | b4d6f4030582cef2ec07ab9818385db4f143ccf8 (diff) |
dynCall
Diffstat (limited to 'src/library_browser.js')
-rw-r--r-- | src/library_browser.js | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/library_browser.js b/src/library_browser.js index c9c37491..21bad254 100644 --- a/src/library_browser.js +++ b/src/library_browser.js @@ -377,10 +377,10 @@ mergeInto(LibraryManager.library, { _file.substr(index +1), _url, true, true, function() { - if (onload) {{{ Functions.getTable('vi') }}}[onload](file); + if (onload) Runtime.dynCall('vi', onload, [file]); }, function() { - if (onerror) {{{ Functions.getTable('vi') }}}[onerror](file); + if (onerror) Runtime.dynCall('vi', onerror, [file]); } ); }, @@ -395,10 +395,10 @@ mergeInto(LibraryManager.library, { _file.substr(index +1), new Uint8Array(data.object.contents), true, true, function() { - if (onload) {{{ Functions.getTable('vi') }}}[onload](file); + if (onload) Runtime.dynCall('vi', onload, [file]); }, function() { - if (onerror) {{{ Functions.getTable('vi') }}}[onerror](file); + if (onerror) Runtime.dynCall('vi', onerror, [file]); }, true // don'tCreateFile - it's already there ); @@ -417,10 +417,10 @@ mergeInto(LibraryManager.library, { {{{ makeHEAPView('U8', 'data', 'data + size') }}}, true, true, function() { - if (onload) {{{ Functions.getTable('vi') }}}[onload](arg, cname); + if (onload) Runtime.dynCall('vii', onload, [file, cname]); }, function() { - if (onerror) {{{ Functions.getTable('vi') }}}[onerror](arg); + if (onerror) Runtime.dynCall('vi', onerror, [file]); }, true // don'tCreateFile - it's already there ); @@ -440,7 +440,6 @@ mergeInto(LibraryManager.library, { emscripten_set_main_loop: function(func, fps, simulateInfiniteLoop) { Module['noExitRuntime'] = true; - var jsFunc = {{{ Functions.getTable('v') }}}[func]; Browser.mainLoop.runner = function() { if (Browser.mainLoop.queue.length > 0) { var start = Date.now(); @@ -473,7 +472,7 @@ mergeInto(LibraryManager.library, { Module['preMainLoop'](); } - jsFunc(); + Runtime.dynCall('v', func); if (Module['postMainLoop']) { Module['postMainLoop'](); @@ -517,12 +516,16 @@ mergeInto(LibraryManager.library, { }, _emscripten_push_main_loop_blocker: function(func, arg, name) { - Browser.mainLoop.queue.push({ func: {{{ Functions.getTable('vi') }}}[func], arg: arg, name: Pointer_stringify(name), counted: true }); + Browser.mainLoop.queue.push({ func: function() { + Runtime.dynCall('vi', func, [arg]); + }, name: Pointer_stringify(name), counted: true }); Browser.mainLoop.updateStatus(); }, _emscripten_push_uncounted_main_loop_blocker: function(func, arg, name) { - Browser.mainLoop.queue.push({ func: {{{ Functions.getTable('vi') }}}[func], arg: arg, name: Pointer_stringify(name), counted: false }); + Browser.mainLoop.queue.push({ func: function() { + Runtime.dynCall('vi', func, [arg]); + }, name: Pointer_stringify(name), counted: false }); Browser.mainLoop.updateStatus(); }, |