mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
removing sourceColumn reset
This commit is contained in:
parent
7f0610d0bd
commit
78d10f30a0
3 changed files with 4 additions and 9 deletions
|
@ -101,10 +101,7 @@
|
|||
lastColumn = mapping.column;
|
||||
buffer += this.encodeVlq(0);
|
||||
buffer += this.encodeVlq(mapping.sourceLine - lastSourceLine);
|
||||
if (lastSourceLine !== mapping.sourceLine) {
|
||||
lastSourceLine = mapping.sourceLine;
|
||||
lastSourceColumn = 0;
|
||||
}
|
||||
lastSourceLine = mapping.sourceLine;
|
||||
buffer += this.encodeVlq(mapping.sourceColumn - lastSourceColumn);
|
||||
lastSourceColumn = mapping.sourceColumn;
|
||||
needComma = true;
|
||||
|
|
|
@ -108,9 +108,7 @@ The index into the list of sources:
|
|||
The starting line in the original source, relative to the previous source line.
|
||||
|
||||
buffer += @encodeVlq mapping.sourceLine - lastSourceLine
|
||||
if lastSourceLine isnt mapping.sourceLine
|
||||
lastSourceLine = mapping.sourceLine
|
||||
lastSourceColumn = 0
|
||||
lastSourceLine = mapping.sourceLine
|
||||
|
||||
The starting column in the original source, relative to the previous column.
|
||||
|
||||
|
|
|
@ -31,8 +31,8 @@ test "SourceMap tests", ->
|
|||
sourceRoot: "",
|
||||
sourceFiles: ["source.coffee"],
|
||||
generatedFile: "source.js"}
|
||||
eqJson testWithFilenames, '{"version":3,"file":"source.js","sourceRoot":"","sources":["source.coffee"],"names":[],"mappings":"AAAA;;IACK,GAAC,CAAG;IAEA"}'
|
||||
eqJson map.generate(), '{"version":3,"file":"","sourceRoot":"","sources":[""],"names":[],"mappings":"AAAA;;IACK,GAAC,CAAG;IAEA"}'
|
||||
eqJson testWithFilenames, '{"version":3,"file":"source.js","sourceRoot":"","sources":["source.coffee"],"names":[],"mappings":"AAAA;;IACK,GAAC,CAAG;IAET"}'
|
||||
eqJson map.generate(), '{"version":3,"file":"","sourceRoot":"","sources":[""],"names":[],"mappings":"AAAA;;IACK,GAAC,CAAG;IAET"}'
|
||||
|
||||
# Look up a generated column - should get back the original source position.
|
||||
arrayEq map.sourceLocation([2,8]), [1,9]
|
||||
|
|
Loading…
Reference in a new issue