diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-04-09 14:21:19 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-04-09 17:26:56 -0700 |
commit | f643819fc1cffbd522d62512a0f23db0228fdcf7 (patch) | |
tree | 58bc029f45f482e015171427dc1ff06c8f46c0e8 | |
parent | c44aaae800adb84de2ae892e1eae77720118d8cf (diff) |
always load memory initializer asynchronously, to keep shell and web as similar as possible
-rw-r--r-- | src/preamble.js | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/preamble.js b/src/preamble.js index 68510e3a..56f01751 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -896,19 +896,18 @@ function loadMemoryInitializer(filename) { #endif } - if (ENVIRONMENT_IS_NODE || ENVIRONMENT_IS_SHELL) { - // synchronous - applyData(Module['readBinary'](filename)); - } else { - // asynchronous - addPreRun(function() { + // always do this asynchronously, to keep shell and web as similar as possible + addPreRun(function() { + if (ENVIRONMENT_IS_NODE || ENVIRONMENT_IS_SHELL) { + applyData(Module['readBinary'](filename)); + } else { Browser.asyncLoad(filename, function(data) { applyData(data); }, function(data) { throw 'could not load memory initializer ' + filename; }); - }); - } + } + }); } // === Body === |