Deferred: stop the next "done"

Deferred: stop the next "done"

It would be possible to "stop" the next "done" in the following code using only the deferred object? Thanks.

  1. var defer = new $.Deferred();
  2. var prom = defer.promise();

  3. defer.resolve();

  4. prom.done(function () {
  5.     // I want to stop the second done
  6.     defer.reject();
  7. });

  8. prom.done(function () {
  9.     console.log('I do not wont this to be executed');
  10. });