aboutsummaryrefslogtreecommitdiff
path: root/src/postamble.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/postamble.js')
-rw-r--r--src/postamble.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/postamble.js b/src/postamble.js
index 382d3117..bb1e334c 100644
--- a/src/postamble.js
+++ b/src/postamble.js
@@ -2,19 +2,21 @@
// === Auto-generated postamble setup entry stuff ===
if (memoryInitializer) {
- function applyData(data) {
+ if (ENVIRONMENT_IS_NODE || ENVIRONMENT_IS_SHELL) {
+ var data = Module['readBinary'](memoryInitializer);
#if USE_TYPED_ARRAYS == 2
HEAPU8.set(data, STATIC_BASE);
#else
allocate(data, 'i8', ALLOC_NONE, STATIC_BASE);
#endif
- }
- if (ENVIRONMENT_IS_NODE || ENVIRONMENT_IS_SHELL) {
- applyData(Module['readBinary'](memoryInitializer));
} else {
addRunDependency('memory initializer');
Browser.asyncLoad(memoryInitializer, function(data) {
- applyData(data);
+#if USE_TYPED_ARRAYS == 2
+ HEAPU8.set(data, STATIC_BASE);
+#else
+ allocate(data, 'i8', ALLOC_NONE, STATIC_BASE);
+#endif
removeRunDependency('memory initializer');
}, function(data) {
throw 'could not load memory initializer ' + memoryInitializer;