aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-04-05 10:47:19 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-04-05 10:47:19 -0700
commit1c504965bdb643dc338774a4eb5027a0030ae837 (patch)
tree6871d3c7e5ab0b808c92ce699c8315adc144f0e3 /src
parente4d888ce84ea774e95e4b1122e908fb2a6a2f64c (diff)
allow calling callMain even if run() was not called
Diffstat (limited to 'src')
-rw-r--r--src/postamble.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/postamble.js b/src/postamble.js
index 388d0127..971568cd 100644
--- a/src/postamble.js
+++ b/src/postamble.js
@@ -2,6 +2,13 @@
// === Auto-generated postamble setup entry stuff ===
Module.callMain = function callMain(args) {
+ args = args || [];
+
+ if (!calledInit) {
+ initRuntime();
+ calledInit = true;
+ }
+
var argc = args.length+1;
function pad() {
for (var i = 0; i < {{{ QUANTUM_SIZE }}}-1; i++) {