aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/postamble.js42
-rw-r--r--src/shell.html2
2 files changed, 25 insertions, 19 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;
diff --git a/src/shell.html b/src/shell.html
index 035cd5ef..404c9c11 100644
--- a/src/shell.html
+++ b/src/shell.html
@@ -39,7 +39,7 @@
canvas: document.getElementById('canvas'),
setStatus: function(text) {
if (Module.setStatus.interval) clearInterval(Module.setStatus.interval);
- document.getElementById('status').innerHTML = '';
+ document.getElementById('status').innerHTML = text;
if (text) {
var counter = 0;
Module.setStatus.interval = setInterval(function() {