Apply modifications by @jwalton

This commit is contained in:
Hao-kang Den
2013-03-14 08:23:27 +08:00
parent 052e3cc8eb
commit d4254a40a9
2 changed files with 6 additions and 12 deletions

View File

@@ -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