docs: function Deferring(onSuccess, onFailure) {
  
      /* Statuses: 0 -> pending, -1 -> rejected, 1 -> resolved */
      var status = 0;
      var result = null;
      var chain = [];
  
      /* Notification of chained defers */
      var notify = function(chain) {
        var method = status > 0 ? "resolve" :
                     status < 0 ? "reject" :
                     null;
        if (method) for (var i in chain) {
          chain[i][method](result);
        }
      }
  
      var deferred = this;
      Object.defineProperties(this, {
        /**
         * Resolve this instance's derived {@link Deferred#promise promise} with
         * the specified _success_ value.
         *
         * @param {(*|Promise)} success - If the value is a _then-able_ (i.e. has a
         *                                `then(...)` method) this instance's
         *                                derived {@link Deferred#promise promise}
         *                                will **follow** that _then-able_, adopting
         *                                its eventual state.
         * @function module:$deferred.Deferred#resolve
         */
        "resolve": { enumerable: true, configurable: false, value: function(success) {
          if (success && (typeof(success.then) === 'function')) {
  
            /* If we were given a "then-able" just call ourselves back */
            success.then(function(success) {
              deferred.resolve(success);
            }, function(failure) {
              deferred.reject(failure);
            });
  
          } else {
  
            /* We were given a success, resolve immediately */
            if (status == 0) {
              result = success;
              status = 1;
              if (onSuccess) try {
                result = onSuccess(result);
              } catch (error) {
                result = error;
                status = -1;
              }
              notify(chain);
            }
          }
        }},
  
        /**
         * Rejects this instance's derived {@link Deferred#promise promise} with
         * the specified _failure_ reason.
         *
         * @param {*} failure - The reason for rejection.
         * @function module:$deferred.Deferred#reject
         */
        "reject": { enumerable: true, configurable: false, value: function(failure) {
          if (status == 0) {
            result = failure;
            status = -1;
            if (onFailure) try {
              result = onFailure(result);
              status = 1;
            } catch (error) {
              result = error;
            }
            notify(chain);
          }
        }},
  
        /**
         * The derived {@link Promise} associated with this {@link Deferred} instance.
         *
         * @member {Promise} module:$deferred.Deferred#promise
         */
        "promise": { enumerable: true, configurable: false, value:
          Object.defineProperties(Object.create(PromiseImpl.prototype), {
            "then":  { enumerable: true, configurable: false, value: function(onSuccess, onFailure) {
              var chained = new Deferring(onSuccess, onFailure);
              if (status == 0) {
                chain.push(chained);
              } else {
                notify([chained]);
              }
              return chained.promise;
            }}
          })
        }
      });
    }