   to resolve and this is set to the object defined by resolveWith if that
   variant is used.
   ###
-  done: (args...) ->
+  done: (args...) =>
     return this if args.length == 0
     functions = flatten(args)
     if @_state == 'resolved'

  Notify progress callbacks with additional context. Works the same way as notify(),
  except this is set to context when calling the functions.
  ###
  notifyWith: (context, args...) ->
    return this if @_state != 'pending'
    @_progressCallbacks?.forEach (fn) ->
      fn.apply(context, args)

  ###
  Add progress callbacks to be fired when using notify()
  ###
  progress: (args...) =>
    return this if args.length == 0 or @_state != 'pending'
    functions = flatten(args)
    @_progressCallbacks or= []
