diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-07-30 14:32:18 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-07-30 14:32:18 -0700 |
commit | c03c413cbaaa1728cad3a1b87e966bc4e0586076 (patch) | |
tree | faeedefc226206f615ec1e4dbd2b80927b1f415f /src/preamble.js | |
parent | dd881bca9b8ec961046637b0efb763254e25dc10 (diff) | |
parent | ecd83ed3136015c80d646dc609243586c7371e41 (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.js | 14 |
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. |