1 dump('entering util/exec.js\n');
3 if (typeof util == 'undefined') var util = {};
6 util.exec.EXPORT_OK = [ 'chain_exec' ];
7 util.exec.EXPORT_TAGS = { ':all' : util.exec.EXPORT_OK };
9 // This executes a series of functions, but tries to give other events/functions a chance to
10 // execute between each one.
11 util.exec.chain = function () {
13 for (var i = 0; i < arguments.length; i++) {
14 var arg = arguments[i];
15 switch(arg.constructor.name) {
20 for (var j = 0; j < arg.length; j++) {
21 if (typeof arg[j] == 'function') args.push( arg[j] );
26 if (typeof arg[j] == 'function') args.push( arg[j] );
31 if (args.length > 0) setTimeout(
34 if (args.length > 1 ) util.exec.chain( args.slice(1) );
39 dump('exiting util/exec.js\n');