aboutsummaryrefslogtreecommitdiff
path: root/src/postamble.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/postamble.js')
-rw-r--r--src/postamble.js7
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