So when you query a source map for the original location for line L, column C, it will look for a mapping with the same line L and a column X, such that X≤C and X is as large as possible. If it finds such a mapping it returns the corresponding line and column from the source file. Is this correct?
CoffeeScript has multi-line strings. The compilation of a multi-line string is one line of JavaScript. Then it makes sense to put a mapping from the start of the compiled string to the start of the multi line string, doesn't it? Then any character in the compiled string maps back to the start of the multi line string, which makes sense to me.
However, if you'd like to go from line 2 of the multi line string to the compiled string, you can't because that line has no mapping. I'd expect to be taken to the beginning of the compiled string. One could argue that you should add one mapping to every line of the multi line string from the corresponding point in the compiled string – but is it really worth the extra complexity in the compiler? Or is this not an issue at all, since we usually just query from generated to original and not the other way around?
In that case, there is no spec to follow, right? The spec only defines the use case of going from compiled to source. The mozilla/source-map module does let you go the other way, too, if you wish. Fine. Let it do so. And let mappings go over EOLs in that case, since it is useful.
Is that sensible?