diff options
Diffstat (limited to 'src/library_browser.js')
-rw-r--r-- | src/library_browser.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/library_browser.js b/src/library_browser.js index 13275702..0bc6d130 100644 --- a/src/library_browser.js +++ b/src/library_browser.js @@ -389,10 +389,10 @@ mergeInto(LibraryManager.library, { Browser.asyncLoad(Pointer_stringify(url), function(byteArray) { var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); - FUNCTION_TABLE[onload](arg, buffer, byteArray.length); + Runtime.dynCall('viii', onload, [arg, buffer, byteArray.length]); _free(buffer); }, function() { - if (onerror) FUNCTION_TABLE[onerror](arg); + if (onerror) Runtime.dynCall('vi', onerror, [arg]); }, true /* no need for run dependency, this is async but will not do any prepare etc. step */ ); }, @@ -411,21 +411,21 @@ mergeInto(LibraryManager.library, { http.onload = function(e) { if (http.status == 200) { FS.createDataFile( _file.substr(0, index), _file.substr(index + 1), new Uint8Array(http.response), true, true); - if (onload) FUNCTION_TABLE[onload](arg, file); + if (onload) Runtime.dynCall('vii', onload, [arg, file]); } else { - if (onerror) FUNCTION_TABLE[onerror](arg, http.status); + if (onerror) Runtime.dynCall('vii', onerror, [arg, http.status]); } }; // ERROR http.onerror = function(e) { - if (onerror) FUNCTION_TABLE[onerror](arg, http.status); + if (onerror) Runtime.dynCall('vii', onerror, [arg, http.status]); }; // PROGRESS http.onprogress = function(e) { var percentComplete = (e.position / e.totalSize)*100; - if (onprogress) FUNCTION_TABLE[onprogress](arg, percentComplete); + if (onprogress) Runtime.dynCall('vii', onprogress, [arg, percentComplete]); }; // Useful because the browser can limit the number of redirection |