aboutsummaryrefslogtreecommitdiff
path: root/tools/file_packager.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-10-22 14:54:53 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-10-22 14:54:53 -0700
commit901d12835ede93ab0f3883f8867c8b107210b035 (patch)
tree304d7a452dedf8bf855111d050bf54bd9d000469 /tools/file_packager.py
parent77f3f1b9b1ae5a4d8ca568e525a020091c61d3fb (diff)
move fetchRemotePackage to outside of file packager generated code
Diffstat (limited to 'tools/file_packager.py')
-rw-r--r--tools/file_packager.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/file_packager.py b/tools/file_packager.py
index f8e6efaf..2b7f9731 100644
--- a/tools/file_packager.py
+++ b/tools/file_packager.py
@@ -529,7 +529,7 @@ if has_preloaded:
};
'''
- code += r'''
+ ret += r'''
function fetchRemotePackage(packageName, callback, errback) {
var xhr = new XMLHttpRequest();
xhr.open('GET', packageName, true);
@@ -569,6 +569,12 @@ if has_preloaded:
xhr.send(null);
};
+ function handleError(error) {
+ console.error('package error:', error);
+ };
+ '''
+
+ code += r'''
function processPackageData(arrayBuffer) {
Module.finishedDataFileDownloads++;
assert(arrayBuffer, 'Loading data file failed.');
@@ -577,10 +583,6 @@ if has_preloaded:
%s
};
Module['addRunDependency']('datafile_%s');
-
- function handleError(error) {
- console.error('package error:', error);
- };
''' % (use_data, data_target) # use basename because from the browser's point of view, we need to find the datafile in the same dir as the html file
code += r'''