Always throw exceptions when translating rows on destroyed DisplayBuffer

Previously we only threw exceptions on non-release builds, but we
haven’t seen bundled packages cause issues in a while. Time to see what
third party packages cause problems.

Refs #3192
Esse commit está contido em:
Nathan Sobo
2014-11-06 12:54:07 -07:00
commit 0bcfa591f6
+1 -3
Ver Arquivo
@@ -735,9 +735,7 @@ class DisplayBuffer extends Model
# #
# Returns a {Point}. # Returns a {Point}.
screenPositionForBufferPosition: (bufferPosition, options) -> screenPositionForBufferPosition: (bufferPosition, options) ->
# TODO: Expand this exception to cover all versions once we burn it in on non-release builds throw new Error("This TextEditor has been destroyed") if @isDestroyed()
if @isDestroyed() and not atom.isReleasedVersion()
throw new Error("This TextEditor has been destroyed")
{ row, column } = @buffer.clipPosition(bufferPosition) { row, column } = @buffer.clipPosition(bufferPosition)
[startScreenRow, endScreenRow] = @rowMap.screenRowRangeForBufferRow(row) [startScreenRow, endScreenRow] = @rowMap.screenRowRangeForBufferRow(row)