From:  Brian Slesinsky <skybrian@google.com>
Date:  15 Mar 2014 08:19:36 Hong Kong Time
Newsgroup:  news.mozilla.org/mozilla.dev.js-sourcemap
Subject:  

Re: Source maps in ES7?

NNTP-Posting-Host:  63.245.216.66

On Fri, Mar 14, 2014 at 1:33 PM, Fitzgerald, Nick
wrote:

>
> One of the reasons I tried to instill the importance of an extensible
> architecture is from what I've learned about DWARF and talking with Jim
> Blandy (who was on the DWARF committee). DWARF is built upon Debugging
> Information Entries which are basically arbitrary debugging annotations
> that can be skipped over by debuggers that are unfamiliar with the
> specific annotation. Furthermore, this allows compilers to progressively
> add more debugging information and debuggers can start taking advantage
> of new annotations as they start appearing.
>

We already have extensibility at the top level - you can always add more
fields to the JSON map. I guess the question is whether we can hang
annotations somewhere else such as on the character ranges.

I suppose you could abuse the "names" index (field 5) to create a list
parallel to "names" that has whatever JSON type you want. I believe the
"names" index currently means "what function name should be returned here
in a stack trace?" So it's only good for a parallel annotation that applies
to an entire function in the source language. To annotate smaller AST nodes
we'd need additional indexes.

- Brian