aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/postamble.js9
-rw-r--r--src/shell.js11
-rw-r--r--tests/runner.py2
3 files changed, 18 insertions, 4 deletions
diff --git a/src/postamble.js b/src/postamble.js
index cb0521aa..4943b9e8 100644
--- a/src/postamble.js
+++ b/src/postamble.js
@@ -21,6 +21,8 @@ Module.callMain = function callMain(args) {
}
function run(args) {
+ args = args || Module.arguments;
+
__initializeRuntime__();
var globalFuncs = [];
@@ -39,8 +41,13 @@ Module['run'] = run;
// {{PRE_RUN_ADDITIONS}}
#if INVOKE_RUN
-run(args);
+#else
+Module.noInitialRun = true;
#endif
+if (!Module.noInitialRun) {
+ run();
+}
+
// {{POST_RUN_ADDITIONS}}
diff --git a/src/shell.js b/src/shell.js
index 3b762e18..f18fc3ca 100644
--- a/src/shell.js
+++ b/src/shell.js
@@ -6,8 +6,15 @@
// args = args || [];
// Runs much faster, for some reason
-this['Module'] = {};
-var args = arguments;
+if (!this['Module']) {
+ this['Module'] = {};
+}
+try {
+ Module.arguments = arguments;
+} catch(e) {
+ Module.arguments = [];
+}
+
{{BODY}}
// {{MODULE_ADDITIONS}}
diff --git a/tests/runner.py b/tests/runner.py
index 667fd16d..ea9b2f94 100644
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -2411,7 +2411,7 @@ else:
USE_CLOSURE_COMPILER = 1
- TEST_REPS = 10
+ TEST_REPS = 3
TOTAL_TESTS = 4
tests_done = 0