aboutsummaryrefslogtreecommitdiff
path: root/src/postamble.js
diff options
context:
space:
mode:
authortim.dawborn <tim.dawborn@gmail.com>2011-06-23 13:50:19 +1000
committertim.dawborn <tim.dawborn@gmail.com>2011-06-23 13:50:19 +1000
commit89ecb3e21c105df110a3c62a2d3366864fc5fe3c (patch)
tree787cede07897558a047b8da4295f35ba2d6c1b76 /src/postamble.js
parent68b06527633437767bbeaeb7cdf6a122db78ef56 (diff)
* propogated return value from main back to the return value from Module.run
* improved the behaviour of ungetc * added optional argument to intArrayFromString to not add the trailing NULL -- useful when adding JS strings as the data in the virtual file system
Diffstat (limited to 'src/postamble.js')
-rw-r--r--src/postamble.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/postamble.js b/src/postamble.js
index 98d8f578..9b61c0a7 100644
--- a/src/postamble.js
+++ b/src/postamble.js
@@ -17,7 +17,7 @@ Module.callMain = function callMain(args) {
argv.push(0);
argv = Pointer_make(argv, null, ALLOC_STATIC, 'i32');
- _main(argc, argv, 0);
+ return _main(argc, argv, 0);
}
function run(args) {
@@ -29,10 +29,12 @@ function run(args) {
__globalConstructor__();
+ var ret = null;
if (Module['_main']) {
- Module.callMain(args);
+ ret = Module.callMain(args);
__shutdownRuntime__();
}
+ return ret;
}
Module['run'] = run;