aboutsummaryrefslogtreecommitdiff
path: root/src/postamble.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-03-22 13:48:53 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-03-22 13:48:53 -0700
commite65c9798d79e84385e9caeb79c6055881ad64087 (patch)
treee1ee269faa1a7ef6182a3b954845791a19a86f5e /src/postamble.js
parent3b7bd2555a5e42814ce6c2ff39cc1dccc72d50dc (diff)
do preRun and postRun only if we actually run
Diffstat (limited to 'src/postamble.js')
-rw-r--r--src/postamble.js17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/postamble.js b/src/postamble.js
index 4a2fbf60..c42d6794 100644
--- a/src/postamble.js
+++ b/src/postamble.js
@@ -34,6 +34,10 @@ function run(args) {
initRuntime();
+ if (Module['preRun']) {
+ Module['preRun']();
+ }
+
var ret = null;
if (Module['_main']) {
ret = Module.callMain(args);
@@ -41,16 +45,17 @@ function run(args) {
exitRuntime();
}
}
+
+ if (Module['postRun']) {
+ Module['postRun']();
+ }
+
return ret;
}
Module['run'] = run;
// {{PRE_RUN_ADDITIONS}}
-if (Module['preRun']) {
- Module['preRun']();
-}
-
#if INVOKE_RUN
#else
addRunDependency();
@@ -65,7 +70,3 @@ if (runDependencies == 0) {
// {{POST_RUN_ADDITIONS}}
-if (Module['postRun']) {
- Module['postRun']();
-}
-