mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
Apply modifications by @jwalton
This commit is contained in:
parent
052e3cc8eb
commit
d4254a40a9
2 changed files with 6 additions and 12 deletions
|
@ -233,12 +233,13 @@
|
|||
var answer, sourceMap;
|
||||
sourceMap = mainModule._sourceMaps[filename];
|
||||
if (sourceMap) {
|
||||
answer = sourceMap.getSourcePosition([line - 1, column]);
|
||||
answer = sourceMap.getSourcePosition([line - 1, column - 1]);
|
||||
}
|
||||
if (answer) {
|
||||
answer[0] += 1;
|
||||
return [answer[0] + 1, answer[1] + 1];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
return answer;
|
||||
};
|
||||
frames = (function() {
|
||||
var _j, _len1, _results;
|
||||
|
|
|
@ -210,15 +210,8 @@ patchStackTrace = ->
|
|||
|
||||
getSourceMapping = (filename, line, column) ->
|
||||
sourceMap = mainModule._sourceMaps[filename]
|
||||
answer = sourceMap.getSourcePosition [line - 1, column] if sourceMap
|
||||
if answer
|
||||
answer[0] += 1
|
||||
# # un-comment to dirty patch the column number, not very accurate
|
||||
# if answer[1] > 3
|
||||
# answer[1] -= 3
|
||||
# else
|
||||
# answer[1] = 0
|
||||
answer
|
||||
answer = sourceMap.getSourcePosition [line-1, column-1] if sourceMap
|
||||
if answer then [answer[0]+1, answer[1]+1] else null
|
||||
|
||||
frames = for frame in stack
|
||||
break if frame.getFunction() is exports.run
|
||||
|
|
Loading…
Reference in a new issue