diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-09-09 10:18:06 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-09-09 10:18:06 -0700 |
commit | 16d08db683538b82efcde288db7ec2224fdfd1cd (patch) | |
tree | d06a57b65a1a662b41e5e6b4c93be1aef867d595 /src/postamble.js | |
parent | a7ed12182550b4aa2526f815248cc1951ee10bf6 (diff) |
clean up handling of initial run
Diffstat (limited to 'src/postamble.js')
-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); |