diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-05-12 19:10:04 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-05-12 19:10:04 -0700 |
commit | 9b5c6ba745f847fdfb57e6606508ed0d58b6633d (patch) | |
tree | feb1792392715bbbc7b55ac16796d7a1e0a95192 /src/postamble.js | |
parent | 15d0f8bf3db70eaf915f1af0b205d751c9edceaa (diff) |
show Running... when calling run()
Diffstat (limited to 'src/postamble.js')
-rw-r--r-- | src/postamble.js | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/src/postamble.js b/src/postamble.js index 7a9785c8..263db773 100644 --- a/src/postamble.js +++ b/src/postamble.js @@ -41,29 +41,35 @@ function run(args) { } } + function doRun() { + var ret = 0; + if (Module['_main']) { + preMain(); + ret = Module.callMain(args); + if (!Module['noExitRuntime']) { + exitRuntime(); + } + } + if (Module['postRun']) { + Module['postRun'](); + } + return ret; + } + +#if GENERATING_HTML if (Module['setStatus']) { Module['setStatus']('Running...'); -#if GENERATING_HTML setTimeout(function() { - Module['setStatus'](''); // clear 'Running...' after first frame + doRun(); + Module['setStatus'](''); }, 1); -#endif + return 0; + } else { + return doRun(); } - - var ret = null; - if (Module['_main']) { - preMain(); - ret = Module.callMain(args); - if (!Module['noExitRuntime']) { - exitRuntime(); - } - } - - if (Module['postRun']) { - Module['postRun'](); - } - - return ret; +#else + return doRun(); +#endif } Module['run'] = run; |