erik-kallen/SaltarelleCompiler — pull request #313 by ProdigySim (2014-05-06 04:32:08+00:00)
Title: Provide stack traces on Exception objects when available.

[Stack traces are available on all Javascript Error objects in most major browsers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack), and I wanted to be able to use them with Saltarelle. Of course, when available I could simply access `JsErrorException.Error`, but there are a lot of other cases where having a stack trace would be very helpful. In my case, I use async methods in Saltarelle very frequently and want to be able to generically track the original stack trace of any exceptions hit.

I was primarily concerned with:
1. Making sure `ss.Exception.wrap()` preserves the original Error's stack trace in all cases (not just in the `JsErrorException` case).
2. Making sure some form of a stack trace was available on all exceptions.

This implementation is entirely open to change. Let me know if you have any feedback on how this could be better accomplished.