diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-04-05 10:37:32 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-04-05 10:37:32 -0700 |
commit | e4d888ce84ea774e95e4b1122e908fb2a6a2f64c (patch) | |
tree | 0e79479db0d880fa1c7da51d17cccb33bee268ef /src/postamble.js | |
parent | d79e23b630c76f628b9f183106912d1f47b14d22 (diff) |
initialize runtime from run() (asynchronously, if run is asynchronous)
Diffstat (limited to 'src/postamble.js')
-rw-r--r-- | src/postamble.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/postamble.js b/src/postamble.js index dd4f4f37..388d0127 100644 --- a/src/postamble.js +++ b/src/postamble.js @@ -51,6 +51,11 @@ Module.callMain = function callMain(args) { function run(args) { args = args || Module['arguments']; + if (!calledInit) { + initRuntime(); + calledInit = true; + } + if (runDependencies > 0) { Module.printErr('run() called, but dependencies remain, so not running'); return 0; @@ -112,8 +117,6 @@ if (Module['preInit']) { } } -initRuntime(); - #if INVOKE_RUN var shouldRunNow = true; #else |