kriskowal/q — pull request #66 by domenic (2012-05-08 18:43:54+00:00)
Title: Adding basic long stack traces in V8 when `end`ing.

This needs review in a few ways, but just might be good enough to merge as a starting point. Notably there should be very little performance impact since `Error.captureStackTrace` gives us a lazily-evaluated getter and we defer parsing/filtering/assembling until `.end()` is called.

Points of concern:
* Copied a bunch of Google code from tlrobinson/long-stack-traces. Not sure how we want to handle that, e.g. where the copyright notice/disclaimer goes, whether I should have left the style as-is or integrated it as I did, how to handle the insertion I made (``), etc. Please advise.
* Promises are now carrying around a `promise.stack` getter. This might have security implications. It seemed like the only way to do this, without a weak map/private names. And it's rather convenient.

Going forward:
* We should record some or all messages sent to a promise, most importantly `then`s. See discussion in #57 for an example scenario where more stuff could be caught. This is quite possible; I managed to log some of the stack frames we'd want to the console. The only tricky part is carrying them around until they're desired, especially while preserving the performant laziness advantage.
* We should update rejection reason stacks (when the rejection reasons are error instances, as they should be) to be in this format as well.