* Per discussion in #3075: if `sourceFiles` is unspecified, but `filename` is, use `filename`; output null instead of an empty string for `sources` or `sourceRoot`
* Update source map tests to reflect that now we return null instead of empty strings; check generated sources array
* Update source map documentation; still leave more obscure options undocumented
* Follow the TypeScript compiler’s example regarding v3SourceMap, but output empty strings instead of made-up filenames
* Have `sources` default to ‘<anonymous>’
This should have been done in commit 841b3cd2, but I forgot to. Since
that commit, `SourceMap::generate` returns an object instead of
`JSON.stringify()` of that object, but the tests still compared strings.
Fixes#4269.
Note: `SourceMap::generate` is only used internally, so its change in
return type is not a breaking change. The "public API" is unchanged.
These are the modifications I had to do in order to get source maps working
in 27.0.1425.2 (Official Build 185250) canary. I haven't tested other
browsers.
I first looked at the V3 spec and a few examples, and I saw that the
`source` key of the source map should be called `sources`.
After doing the `source` to `sources` change, the coffee source and for
some odd reason the javascript file would not show up in the browser
dev tools (it was being fetched but not evaluated).
To fix this, I had to add the coffee source to the `sources` list in the
source map file.