MCPcopy Index your code
hub / github.com/caolan/nodeunit / wrapIterator

Function wrapIterator

deps/async.js:397–417  ·  view source on GitHub ↗
(iterator)

Source from the content-addressed store, hash-verified

395 }
396 callback = callback || function () {};
397 var wrapIterator = function (iterator) {
398 return function (err) {
399 if (err) {
400 callback(err);
401 callback = function () {};
402 }
403 else {
404 var args = Array.prototype.slice.call(arguments, 1);
405 var next = iterator.next();
406 if (next) {
407 args.push(wrapIterator(next));
408 }
409 else {
410 args.push(callback);
411 }
412 async.nextTick(function () {
413 iterator.apply(null, args);
414 });
415 }
416 };
417 };
418 wrapIterator(async.iterator(tasks))();
419 };
420

Callers 1

async.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…