diff options
-rw-r--r-- | src/postamble.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/postamble.js b/src/postamble.js index 50db3c30..d164f049 100644 --- a/src/postamble.js +++ b/src/postamble.js @@ -32,6 +32,11 @@ Module.callMain = function callMain(args) { function run(args) { args = args || Module['arguments']; + if (runDependencies > 0) { + Module.printErr('run() called, but dependencies remain, so not running'); + return 0; + } + if (Module['preRun']) { if (typeof Module['preRun'] == 'function') Module['preRun'] = [Module['preRun']]; var toRun = Module['preRun']; @@ -91,14 +96,15 @@ if (Module['preInit']) { initRuntime(); #if INVOKE_RUN +var shouldRunNow = true; #else -addRunDependency(); +var shouldRunNow = false; #endif if (Module['noInitialRun']) { - addRunDependency(); + shouldRunNow = false; } -if (runDependencies == 0) { +if (shouldRunNow) { var ret = run(); #if CATCH_EXIT_CODE Module.print('Exit Status: ' + ret); |