diff --git a/lib/coffee-script/coffee-script.js b/lib/coffee-script/coffee-script.js index c238a3f2..2b5bc335 100644 --- a/lib/coffee-script/coffee-script.js +++ b/lib/coffee-script/coffee-script.js @@ -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; diff --git a/src/coffee-script.coffee b/src/coffee-script.coffee index 550603c5..e806bf46 100644 --- a/src/coffee-script.coffee +++ b/src/coffee-script.coffee @@ -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