kriskowal/q — pull request #195 by rkatic (2013-02-02 01:29:07+00:00)
Title: Optimize nextTick

- Minimize the number of postMessage/setTimeout calls.
- Remove structural changes on list nodes.

OK, this is perhaps an "over-optimization", but could still be relevant specially for old browsers, where `setTimeout` is used and promises are used during some animation.

Currently if you run `Q.when(1).then().then().then().then()`, `nextTick` will be called 6 times.
With this change, that code will produce only one `postMessage/setTimeout`, but still respecting the spec.

Please, let me know if I am missing something.

NOTE: This pull would make [pull-191](/kriskowal/q/pull/191) unnecessary.