Don't use atom globals in LinesComponent

This commit is contained in:
Antonio Scandurra
2015-10-06 14:24:24 +02:00
committed by Nathan Sobo
parent 6fed847cce
commit eba18092fb
3 changed files with 5 additions and 5 deletions

View File

@@ -13,7 +13,7 @@ cloneObject = (object) ->
module.exports =
class LinesTileComponent
constructor: ({@presenter, @id, @domElementPool}) ->
constructor: ({@presenter, @id, @domElementPool, @assert}) ->
@tokenIterator = new TokenIterator
@measuredLines = new Set
@lineNodesByLineId = {}
@@ -361,7 +361,7 @@ class LinesTileComponent
rangeForMeasurement.setEnd(textNode, i + charLength)
else
rangeForMeasurement.setEnd(textNode, textNodeLength)
atom.assert false, "Expected index to be less than the length of text node while measuring", (error) =>
@assert false, "Expected index to be less than the length of text node while measuring", (error) =>
editor = @presenter.model
screenRow = tokenizedLine.screenRow
bufferRow = editor.bufferRowForScreenRow(screenRow)