Resolve all deferreds that were cancelled previously, if any. This allows the user to bind callbacks to any render callback, even if it was cancelled above.
974767
function resolveDeferreds() {
      for (var i = 0; i < manager.deferreds.length; i++){
        manager.deferreds[i].resolveWith(root, [root]);
      }
      manager.deferreds = [];
    }
435148
function (canceller) {
        var self = this;
        this._canceller = canceller;
        this._timeout = null;
        this._timer = null;

        this.handled = false;

        this.waiting = [];
        this.result = undefined;
        this.isError = false;
        this.finished = false;

        //this.currentContextHandler = contextHandler.getHandler && contextHandler.getHandler();
        this.__defineGetter__('promise', this.getPromise);
    }
1085806
function Q(resolver) {
          if (!angular.isFunction(resolver)) {
            throw new Error('missing resolver function');
          }

          var deferred = $q.defer();

          function resolveFn(value) {
            deferred.resolve(value);
          }

          function rejectFn(reason) {
            deferred.reject(reason);
          }

          resolver(resolveFn, rejectFn);

          return deferred.promise;
        }
849783
function(error) {
      if (this._resolved || this._rejected) {
        throw "A promise was rejected even though it had already been " +
          (this._resolved ? "resolved" : "rejected") + ".";
      }
      this._rejected = true;
      this._error = error;
      Parse._arrayEach(this._rejectedCallbacks, function(rejectedCallback) {
        rejectedCallback(error);
      });
      this._resolvedCallbacks = [];
      this._rejectedCallbacks = [];
    }
977000
function(){
		var me = this,
			dispatchArguments = arguments,
			promises = []
		;

		this._promises = [];

		// A closure is needed for the callback id
		Object.keys( this._callbacks ).forEach( function( id ){

			// All the promises must be set in me._promises before trying to resolve
			// in order to make waitFor work ok
			me._promises[ id ] = me._Promise.resolve()
				.then( function(){
					return me._callbacks[ id ].apply( me, dispatchArguments );
				})
				.catch( function( err ){
					console.error( err.stack || err );
				})
			;

			promises.push( me._promises[ id ] );
		});

		//
		var dequeue = function(){
			me._dispatchQueue.shift();
			if( !me._dispatchQueue.length )
				me._currentDispatch = false;
		};

		return this._Promise.all( promises )
			.then( dequeue, dequeue )
		;
	}
763446
function () {
            var self = this;
            var originalDeleteAction = self.options.actions.deleteAction;
            self.options.actions.deleteAction = function (postData) {
                return $.Deferred(function ($dfd) {

                    var input = $.extend({}, postData);

                    originalDeleteAction.method(input)
                        .done(function (result) {
                            $dfd.resolve({
                                "Result": "OK",
                                originalResult: result
                            });
                        })
                        .fail(function (error) {
                            self._handlerForFailOnAbpRequest($dfd, error);
                        });
                });
            };
        }
965782
def _connect_deferred(self, deferred):
        
        self._deferred = deferred

        # Because we use __del__, we need to make sure there are no cycles
        # involving this object, which is why we use a weakref:
        def put(result, eventual=weakref.ref(self)):
            eventual = eventual()
            if eventual:
                eventual._set_result(result)
            else:
                err(result, "Unhandled error in EventualResult")

        deferred.addBoth(put)
1192355
function() {
                        var args = Array.prototype.slice.call(arguments, 0);
                        deferredObject.reject.apply(null, ctxArgs.concat(args));
                    }
791455
function(success, error) {
                    // If this model is new, don't make an AJAX call.
                    // Instead, we have to construct the Deferred ourselves and return it.
                    if (this.isNew()) {
                        var self = this;
                        var def = can.Deferred();
                        def.then(success, error);

                        return def.done(function(data) {
                            self.destroyed(data);
                        }).resolve(self);
                    }

                    // If it isn't new, though, go ahead and make a request.
                    return makeRequest(this, 'destroy', success, error, 'destroyed');
                }
463338
function () {
		//check if we are able to execute
		if (!canExecuteWrapper.call(options.context || this)) {
			//dont attach any global handlers
			return instantDeferred(false, null, options.context || this).promise();
		}

		//notify that we are running and clear any existing error message
		isRunning(true);
		failed(false);
		failMessage('');

		//try to invoke the action and get a reference to the deferred object
		var promise;
		try {
			promise = options.action.apply(options.context || this, arguments);

			//if the returned result is *not* a promise, create a new one that is already resolved
			if (!isPromise(promise)) {
				promise = instantDeferred(true, promise, options.context || this).promise();
			}

		} catch (error) {
			promise = instantDeferred(false, error, options.context || this).promise();
		}

		//set up our callbacks
		callbacks.always.forEach(function(callback) {
			promise.then(callback, callback);
		});
		callbacks.fail.forEach(function(callback) {
			promise.then(null, callback);
		});
		callbacks.done.forEach(function(callback) {
			promise.then(callback);
		});

		return promise;
	}
437140
function (batch, xhr) {
                for (var i = 0, requestId; i < batch.length; i++) {
                    requestId = this._getRequestId(batch[i].method, batch[i].params);
                    this._rejectPromise(this._deferreds[requestId], xhr);
                    delete this._deferreds[requestId];
                }
            }
1212677
function() {
                var deferred = $.Deferred();
                if (this.isStale) {
                    this.setPage(1)
                        .done(function() {
                            deferred.resolve();
                        });
                } else {
                    deferred.resolve();
                }
                return deferred.promise();
            }
266093
function resolveRequest({ requestKey, res, err }) {
  const handlers = requests[requestKey] || [];

  handlers.forEach(handler => {
    if (res) {
      handler.resolve(res);
    } else {
      handler.reject(err);
    }
  });

  // This list of handlers has been, well, handled. So we
  // clear the handlers for the next request.
  requests[requestKey] = null;
}
505025
function(reason) {
        if (reason) {
          for (var i = 0; i < buffer.length; ++i) {
            buffer[i].deferred.reject(reason);
          }
        }
        buffer = [];
      }
1297132
function(argument) {
				//console.log("deep.Deferred.resolve : ", argument);
				if (this.rejected || this.resolved)
					throw new Error("deferred has already been ended !");
				if (argument instanceof Error)
					return this.reject(argument);
				this._success = argument;
				this.resolved = true;
				var self = this;
				this._promises.forEach(function(promise) {
					promise.resolve(argument);
				});
			}
326090
function resolveGeneration(err) {
            if (err) {
              next(err)
              if (deferred) {
                deferred.reject(err)
              }
            } else if (words.length < numWords) {
              var tooFewWordsError = new Error(
                "You asked for more words than could be generated. This may " +
                  "because you're asking for too many words of a certain length."
              )

              next(tooFewWordsError)
              if (deferred) {
                deferred.reject(tooFewWordsError)
              }
            } else {
              next(null, words)
              if (deferred) {
                deferred.resolve(words)
              }
            }
          }
413052
function() {
      var deferred = $q.defer();

      $rootScope.$evalAsync(function() {
        var n = _current.name;
        var p = angular.copy(_current.params);
        if(!_current.params) {
          _current.params = {};
        }
        _current.params.deprecated = true;

        // Notify
        $rootScope.$broadcast('$stateReload', null, _current);

        _changeStateAndBroadcastComplete(n, p).then(function() {
          deferred.resolve();
        }, function(err) {
          deferred.reject(err);
        });
      });

      return deferred.promise;
    }