MCPcopy
hub / github.com/jsfiddle/togetherjs / run

Function run

togetherjs/tests/testutils.js:204–230  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

202 var index = 0;
203 var done = false;
204 function run() {
205 if (index >= args.length) {
206 done = true;
207 return;
208 }
209 var f = args[index];
210 if (!f.then) { f = f(); }
211 f.then(function () {
212 if (! arguments.length) {
213 print("(done)");
214 } else {
215 print.apply(null, arguments);
216 }
217 check(1);
218 }, function () {
219 if (! arguments.length) {
220 print("(error)");
221 } else {
222 print.apply(null, ["Error:"].concat(arguments));
223 }
224 check(1);
225 });
226 function check(increment) {
227 index += increment;
228 setTimeout(run);
229 }
230 }
231 wait(function () {return done;});
232 run();
233}

Callers 1

printChainedFunction · 0.70

Calls 2

fFunction · 0.70
checkFunction · 0.70

Tested by

no test coverage detected