 
     @pendingComputations = []
     @willFlush = false
-    @inFlush = false
+    @inFlush = null
+    @inRequireFlush = false
     @inCompute = false
     @throwFirstError = false
     @afterFlushCallbacks = []


    if typeof Meteor isnt "undefined"
      Meteor.defer =>
        @_runFlush()
    else
      global.setImmediate =>
        @_runFlush()

    @willFlush = true

  _runFlush: (options) ->
    throw new Error "Can't call Tracker.flush while flushing" if @inFlush

    throw new Error "Can't flush inside Tracker.autorun" if @inCompute

    @inFlush = true
    @willFlush = true
    @throwFirstError = !!options?.throwFirstError



      finishedTry = true
    finally
      # We first have to set @inFlush to null, then we can return.

      inFlush = @inFlush
      unless finishedTry
        @inFlush = null
        inFlush.return() if inFlush instanceof Future
        @_runFlush
          finishSynchronously: options?.finishSynchronously
          throwFirstError: false

      @willFlush = false
      @inFlush = null
      inFlush.return() if inFlush instanceof Future
      if @pendingComputations.length or @afterFlushCallbacks.length
        throw new Error "still have more to do?" if options?.finishSynchronously
        Meteor.setTimeout =>
