aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/postamble.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/postamble.js b/src/postamble.js
index 63495914..d6c059b8 100644
--- a/src/postamble.js
+++ b/src/postamble.js
@@ -117,16 +117,15 @@ function run(args) {
preRun();
- if (runDependencies > 0) {
- // a preRun added a dependency, run will be called later
- return;
- }
+ if (runDependencies > 0) return; // a preRun added a dependency, run will be called later
+ if (Module['calledRun']) return; // run may have just been called through dependencies being fulfilled just in this very frame
function doRun() {
ensureInitRuntime();
preMain();
+ assert(!Module['calledRun']);
Module['calledRun'] = true;
if (Module['_main'] && shouldRunNow) {
Module['callMain'](args);