scala-js/scala-js — pull request #207 by sjrd (2014-02-07 12:39:56+00:00)
Title: Stack traces

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.