diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-01-24 12:02:42 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-01-24 12:02:42 -0800 |
commit | 64c779641a2a9587613cc65ad7251890f18e25c3 (patch) | |
tree | 87344a57db509e92b3196e5a4291a8c3bd8c2449 /src/library_browser.js | |
parent | 4e09482e006eda934527e1707036d74245d8dd91 (diff) | |
parent | 03e2e6c321d28e3df3b37a2c0bed3ba9d04e52b3 (diff) |
Merge branch 'incoming'
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 |