1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00

Fixes #2765 -- incorrect line number in mappings

This commit is contained in:
Jeremy Ashkenas 2013-03-05 10:49:47 +13:00
parent b2ef77d92e
commit b62a90d54c
3 changed files with 4 additions and 3 deletions

View file

@ -93,7 +93,7 @@ task 'build:ultraviolet', 'build and install the Ultraviolet syntax highlighter'
task 'build:browser', 'rebuild the merged script for inclusion in the browser', ->
code = ''
for name in ['helpers', 'rewriter', 'lexer', 'parser', 'scope', 'nodes', 'coffee-script', 'browser']
for name in ['helpers', 'rewriter', 'lexer', 'parser', 'scope', 'nodes', 'sourcemap', 'coffee-script', 'browser']
code += """
require['./#{name}'] = new function() {
var exports = this;

View file

@ -52,7 +52,7 @@
sourceMap = new sourcemap.SourceMap();
}
fragments = (parser.parse(lexer.tokenize(code, options))).compileToFragments(options);
currentLine = 0;
currentLine = 2;
currentColumn = 0;
js = "";
for (_j = 0, _len1 = fragments.length; _j < _len1; _j++) {

View file

@ -49,7 +49,8 @@ exports.compile = compile = (code, options = {}) ->
fragments = (parser.parse lexer.tokenize(code, options)).compileToFragments options
currentLine = 0
# Two lines of comments will start the JS file.
currentLine = 2
currentColumn = 0
js = ""
for fragment in fragments