kriskowal/q — pull request #485 by kriskowal (2014-02-22 04:46:16+00:00)
Title: Flip then and done

That is to say, implement `then` in terms of `done` instead of `done` in
terms of `then`. This makes quite a bit of sense since `done` can be
less expensive since it does not need to construct an intermediate
promise.

This factoring also creates special cases to avoid unnecessary try/catch
clauses by checking for `Q.onerror` up front. Thus, this is slightly
backward incompatible. `Q.onerror` must have been set before `done` or
`then` are called for errors to be trapped.