Sage/streamlinejs — pull request #155 by goffrie (2013-07-28 18:28:56+00:00)
Title: Source maps for callbacks mode

This commit replaces the string-appending logic in format.js with SourceNodes, making it possible to create a source map. It adds a new option to the compiler, --source-map, which tells the compiler to write out a source map to the supplied filename. Source map mode implies --lines-ignore mode, for now, since manipulating SourceNodes isn't as easy as manipulating real strings. If the original source is CoffeeScript it also invokes the CoffeeScript compiler with its source map option enabled, and then composes the two source maps, giving a source map from the final JS to the original _coffee file.

It's still pretty hack-tacular, for now. Any hints? :) Also it adds a dependency on Mozilla's `source-map` module.

(For some reason it subtly alters the generated output, as you can see in the diff, where there are extra spaces in a couple situations.)