From:  Rob Campbell <rcampbell@mozilla.com>
Date:  22 May 2013 23:07:52 Hong Kong Time
Newsgroup:  news.mozilla.org/mozilla.dev.js-sourcemap
Subject:  

Re: What should happen to errors in translation

NNTP-Posting-Host:  63.245.216.66

On 2013-05-22, at 01:00 , Jim Blandy  wrote:

> On 05/21/2013 01:16 AM, Peter van der Zee wrote:
>> ftr, I was indeed talking about a bug in the compiler.
>> 
>> `log("foo");`
>> ->
>> `console log("foo");`
>> 
>> How can I tell that this is a problem in the compiler (missing dot in the
>> above case) and not my code? Scale this up to complex real code...
>> 
>> Since most-if-not-all vendors are watching, I think discussion about this
>> is good to have to make sure this issue at least gets some attention :)
>> 
> If I were developing a compiler, it would be nice to have (perhaps
> provided by an add-on?) a side-by-side view of the true source, and the
> (JavaScript) object code I generated from it.

As far as I know we're not planning on building a SourceMap compiler into our Devtools, though I guess it wouldn't be that far-fetched to do so at some point. We are planning on doing things like generating sourcemaps dynamically for minified code.

Seeing the generated code side-by-side would be pretty useful and including some sort of linter, like JSHint as a preflight generation step could reveal these types of syntax errors before actually generating the map.

> One could even make a web page that accepts a script URL, fetches the
> script, fetches any sourcemaps that refers to, fetches the original
> files the source maps cite, and then plots it all up nicely.

yeah, all kinds of possibilities for useful tools here. Not exactly part of the spec discussion though.

Rob Campbell