scala-js/scala-js — pull request #223 by sjrd (2014-02-07 22:11:24+00:00)
Title: Stack traces reloaded

This is a reload of #207. I have addressed your comments + I have made clearer what are the parts copied from stacktrace.js. I have also commented the lack of comments ^^

(original text of the PR follows:)

This pull request basically implements `Throwable.printStackTrace()` and `Throwable.getStackTrace()`. Browser-dependent stack trace state is captured when the `Throwable` is created. When `getStackTrace()` is called, the state is analyzed to create an `Array[StackTraceElement]`.

Note that the stack traces always refer to the .js files, not the original .scala files. Apparently browsers do not take source maps into account when building their stack trace state, which is a pity.

Also, there is no test in this PR, because I have not the slightest idea how I can test these things. Stack traces will be different depending on browser and absolute path names, so it's really tricky.