From:  "Fitzgerald, Nick" <>
Date:  15 Mar 2014 04:37:59 Hong Kong Time

Re: Source maps in ES7?


On 3/13/14 10:21 PM, Joey Schorr wrote:
> As John alluded to, the original idea (way back in the old days of V1)
> was to do the more-detailed mapping out of band, given the variety and
> complexity of the possible translations. For example, having either a
> server API that understood how to do additional mapping of error
> messages after the fact or having the running debugger provide
> real-time mapping via its own API.
> I'm new to the recent discussion (so I apologize if this has been
> suggested before), but perhaps a solution is to allow the source map
> to call a predefined external API that can perform these additional
> calculations; that way, there isn't any untrusted code running on the
> user's machine, there is no need to ship the full AST/compiler
> information and it allows for flexible mappings. If the API were to
> run on top of a websocket, it could even be done in real-time. Local
> debuggers could then translate locally, while production code (that's
> being debugged) could provide their own pre-loaded state via extra
> endpoint(s).

To me, this seems to have many more moving parts for the user who is
debugging source that has been compiled to JS. They have to set up this
external API.

I'd much prefer that compilers were the ones that dealt with this
complexity (they would have to supply the external API, anyways; might
as well make it easy for the end user).