aboutsummaryrefslogtreecommitdiff
path: root/src/postamble.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/postamble.js')
-rw-r--r--src/postamble.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/postamble.js b/src/postamble.js
index dd4f4f37..4b3e831d 100644
--- a/src/postamble.js
+++ b/src/postamble.js
@@ -2,6 +2,12 @@
// === Auto-generated postamble setup entry stuff ===
Module.callMain = function callMain(args) {
+ assert(runDependencies == 0, 'cannot call main when async dependencies remain! (listen on __ATMAIN__)');
+
+ args = args || [];
+
+ ensureInitRuntime();
+
var argc = args.length+1;
function pad() {
for (var i = 0; i < {{{ QUANTUM_SIZE }}}-1; i++) {
@@ -70,6 +76,8 @@ function run(args) {
}
function doRun() {
+ ensureInitRuntime();
+
var ret = 0;
calledRun = true;
if (Module['_main']) {
@@ -112,8 +120,6 @@ if (Module['preInit']) {
}
}
-initRuntime();
-
#if INVOKE_RUN
var shouldRunNow = true;
#else