aboutsummaryrefslogtreecommitdiff
path: root/src/preamble.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-07-30 14:32:18 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-07-30 14:32:18 -0700
commitc03c413cbaaa1728cad3a1b87e966bc4e0586076 (patch)
treefaeedefc226206f615ec1e4dbd2b80927b1f415f /src/preamble.js
parentdd881bca9b8ec961046637b0efb763254e25dc10 (diff)
parentecd83ed3136015c80d646dc609243586c7371e41 (diff)
Merge pull request #1449 from inolen/postrun_fixes
update test_ccall to not use a postrun hook
Diffstat (limited to 'src/preamble.js')
-rw-r--r--src/preamble.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/preamble.js b/src/preamble.js
index f1a0de4c..296c22d2 100644
--- a/src/preamble.js
+++ b/src/preamble.js
@@ -723,6 +723,20 @@ function exitRuntime() {
callRuntimeCallbacks(__ATEXIT__);
}
+Module['addOnInit'] = function addOnInit(cb) {
+ __ATINIT__.unshift(cb);
+};
+
+Module['addOnPreMain'] = function addOnPreMain(cb) {
+ __ATMAIN__.unshift(cb);
+};
+
+Module['addOnExit'] = function addOnExit(cb) {
+ __ATEXIT__.unshift(cb);
+};
+
+// TODO add onprerun, onpostrun
+
// Tools
// This processes a JS string into a C-line array of numbers, 0-terminated.