aboutsummaryrefslogtreecommitdiff
path: root/src/preamble.js
diff options
context:
space:
mode:
authorAlon Zakai <azakai@mozilla.com>2010-11-05 20:48:19 -0700
committerAlon Zakai <azakai@mozilla.com>2010-11-05 20:48:19 -0700
commit906a8745c2a70d3bf797bce28c5c0ba055f8b98a (patch)
tree98df65205fea7e448f12df4afb5674dea8af5936 /src/preamble.js
parent093bfe5c5ac4c9713250dc7da75e5c20022bbe01 (diff)
framework for integration tests
Diffstat (limited to 'src/preamble.js')
-rw-r--r--src/preamble.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/preamble.js b/src/preamble.js
index 07ddf7ea..8a42243a 100644
--- a/src/preamble.js
+++ b/src/preamble.js
@@ -168,6 +168,16 @@ function __initializeRuntime__() {
STATICTOP = alignMemoryPage(STACK_MAX);
}
+function __shutdownRuntime__() {
+ while( __ATEXIT__.length > 0) {
+ var func = __ATEXIT__.pop();
+ if (typeof func === 'number') {
+ func = FUNCTION_TABLE[func];
+ }
+ func();
+ }
+}
+
// stdio.h
// C-style: we work on ints on the HEAP.