visionmedia/co — pull request #49 by jonathanong (2013-11-14 21:27:08+00:00)
Title: catch errors with a default callback if none provided

closes #48 and inadvertently #44. we now _expect_ a callback to be passed, but supply one if none is provided (thus arity 1).

this cleans up `next(err)` by just passing any errors to `done(err)` instead of throwing it. this effectively does the same thing, except you'll no longer get `Error: Generator is already running` errors (for whatever reason).

note that i also handle cases like `co(fn)('a', 'b', 'c')` where the last argument isn't a function/callback. not sure if you want to support that, but i'd rather have `co` be robust.