aboutsummaryrefslogtreecommitdiff
path: root/src/postamble.js
diff options
context:
space:
mode:
authorAlon Zakai <azakai@mozilla.com>2011-03-05 18:41:13 -0800
committerAlon Zakai <azakai@mozilla.com>2011-03-05 18:41:13 -0800
commit6db5de718d90cbbc6653cde526c53bd1b7b895a1 (patch)
tree7a0a698faf53010f01de97196bc8d87b0ca21114 /src/postamble.js
parent7d2f7540ed3201b3d3a1f029a31bc8add70499fe (diff)
refactor calling of _main()
Diffstat (limited to 'src/postamble.js')
-rw-r--r--src/postamble.js21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/postamble.js b/src/postamble.js
index 70c45b98..435a6930 100644
--- a/src/postamble.js
+++ b/src/postamble.js
@@ -1,13 +1,7 @@
// === Auto-generated postamble setup entry stuff ===
-function run(args) {
- __initializeRuntime__();
-
- var globalFuncs = [];
-
-{{GLOBAL_VARS}}
-
+function callMain(args) {
var argc = args.length+1;
function pad() {
for (var i = 0; i < QUANTUM_SIZE-1; i++) {
@@ -23,10 +17,21 @@ function run(args) {
argv.push(0);
argv = Pointer_make(argv, null);
+ Module._main(argc, argv, 0);
+}
+Module['callMain'] = callMain;
+
+function run(args) {
+ __initializeRuntime__();
+
+ var globalFuncs = [];
+
+{{GLOBAL_VARS}}
+
__globalConstructor__();
if (Module['_main']) {
- _main(argc, argv, 0);
+ Module.callMain(args);
__shutdownRuntime__();
}
}