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

Function wrapIterator

examples/browser/nodeunit.js:890–910  ·  view source on GitHub ↗
(iterator)

Source from the content-addressed store, hash-verified

888 }
889 callback = callback || function () {};
890 var wrapIterator = function (iterator) {
891 return function (err) {
892 if (err) {
893 callback(err);
894 callback = function () {};
895 }
896 else {
897 var args = Array.prototype.slice.call(arguments, 1);
898 var next = iterator.next();
899 if (next) {
900 args.push(wrapIterator(next));
901 }
902 else {
903 args.push(callback);
904 }
905 async.nextTick(function () {
906 iterator.apply(null, args);
907 });
908 }
909 };
910 };
911 wrapIterator(async.iterator(tasks))();
912 };
913

Callers 1

nodeunit.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…