From:  John Lenz <concavelenz@gmail.com>
Date:  28 Jan 2014 01:02:08 Hong Kong Time
Newsgroup:  news.mozilla.org/mozilla.dev.js-sourcemap
Subject:  

Re: Un-minifying function names in stacktraces.

NNTP-Posting-Host:  63.245.216.66

The way I've seen this done, is that you use the original source and locate
the surrounding function.  There has been some discussions about enhancing
the source map to make this easier but nothing concrete.


On Mon, Jan 27, 2014 at 1:33 AM,  wrote:

> Hi All,
>
> I've been trying to write code to de-minify stacktraces. Unfortunately, it
> seems that reversing the function names is pretty tricky.
>
> I've put my example code https://gist.github.com/ConradIrwin/8645582
>
> I want to convert from:
>
> TypeError: Argument not optional
>    at n (http://localhost/bugsnag/big.min.js:1:26)
>    at o (http://localhost/bugsnag/big.min.js:1:46)
>    at t (http://localhost/bugsnag/big.min.js:1:63)
>    at i (http://localhost/bugsnag/big.min.js:1:80)
>    at u (http://localhost/bugsnag/big.min.js:1:97)
>
> to:
> TypeError: Argument not optional
>    at hello (http://localhost/bugsnag/big.min.js:5)
>    at world (http://localhost/bugsnag/big.js:7)
>    at how (http://localhost/bugsnag/big.js:11)
>    at are (http://localhost/bugsnag/big.js:15)
>    at you (http://localhost/bugsnag/big.js:19)
>
> It's easy to get the original file/line position for each line in the
> stacktrace, I can use the source-map directly.
>
> It's not easy to get the original method name. In most cases you can look
> up the calling line, and get the `.name` out of the stacktrace and hope for
> the best, but that doesn't work for the bottom-most line (or a few other
> edge cases).
>
> Is this fixable at the spec level, or does anyone spot something I'm
> missing?
>
> Conrad
> _______________________________________________
> dev-js-sourcemap mailing list
> dev-js-sourcemap@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-js-sourcemap
>