aboutsummaryrefslogtreecommitdiff
path: root/src/postamble.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-09-08 09:26:48 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-09-08 09:26:48 -0700
commita7ed12182550b4aa2526f815248cc1951ee10bf6 (patch)
treeb35cd5199ad5ea8a46770b7713872c87ecc62ba2 /src/postamble.js
parent5ec60ca0ee4529eb5ca38025d8e47e068ce8c914 (diff)
fix preRun
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 4796fee3..50db3c30 100644
--- a/src/postamble.js
+++ b/src/postamble.js
@@ -34,8 +34,10 @@ function run(args) {
if (Module['preRun']) {
if (typeof Module['preRun'] == 'function') Module['preRun'] = [Module['preRun']];
- while (Module['preRun'].length > 0) {
- Module['preRun'].pop()();
+ var toRun = Module['preRun'];
+ Module['preRun'] = [];
+ for (var i = toRun.length-1; i >= 0; i--) {
+ toRun[i]();
}
if (runDependencies > 0) {
// a preRun added a dependency, run will be called later