mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
Fix bug when setTimeout is called from within a timeout in specs
This commit is contained in:
@@ -136,13 +136,17 @@ window.fakeClearTimeout = (idToClear) ->
|
||||
|
||||
window.advanceClock = (delta=1) ->
|
||||
window.now += delta
|
||||
callbacks = []
|
||||
|
||||
window.timeouts = window.timeouts.filter ([id, strikeTime, callback]) ->
|
||||
if strikeTime <= window.now
|
||||
callback()
|
||||
callbacks.push(callback)
|
||||
false
|
||||
else
|
||||
true
|
||||
|
||||
callback() for callback in callbacks
|
||||
|
||||
window.pagePixelPositionForPoint = (editor, point) ->
|
||||
point = Point.fromObject point
|
||||
top = editor.renderedLines.offset().top + point.row * editor.lineHeight
|
||||
|
||||
Reference in New Issue
Block a user