fixes #2521: line numbers in errors affected by newlines in backticks
This commit is contained in:
parent
ba34f8d389
commit
1b14c035e7
|
@ -217,6 +217,7 @@
|
|||
return 0;
|
||||
}
|
||||
this.token('JS', (script = match[0]).slice(1, -1));
|
||||
this.line += count(script, '\n');
|
||||
return script.length;
|
||||
};
|
||||
|
||||
|
|
|
@ -197,6 +197,7 @@ exports.Lexer = class Lexer
|
|||
jsToken: ->
|
||||
return 0 unless @chunk.charAt(0) is '`' and match = JSTOKEN.exec @chunk
|
||||
@token 'JS', (script = match[0])[1...-1]
|
||||
@line += count script, '\n'
|
||||
script.length
|
||||
|
||||
# Matches regular expression literals. Lexing regular expressions is difficult
|
||||
|
|
Loading…
Reference in New Issue