diff options
author | Andrew Dolgov <[email protected]> | 2013-03-18 10:26:24 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-03-18 10:26:26 +0400 |
commit | f0cfe83e3725f9a3928da97a6e3085e79cb25309 (patch) | |
tree | 4b0af188defaa807c7bc6ff3a101b41c9166c463 /lib/dojo/promise/Promise.js.uncompressed.js | |
parent | 9a2885da170ffd64358b99194095851a2d09c1b6 (diff) |
upgrade dojo to 1.8.3 (refs #570)
Diffstat (limited to 'lib/dojo/promise/Promise.js.uncompressed.js')
-rw-r--r-- | lib/dojo/promise/Promise.js.uncompressed.js | 133 |
1 files changed, 133 insertions, 0 deletions
diff --git a/lib/dojo/promise/Promise.js.uncompressed.js b/lib/dojo/promise/Promise.js.uncompressed.js new file mode 100644 index 000000000..eba0080fd --- /dev/null +++ b/lib/dojo/promise/Promise.js.uncompressed.js @@ -0,0 +1,133 @@ +define("dojo/promise/Promise", [ + "../_base/lang" +], function(lang){ + "use strict"; + + // module: + // dojo/promise/Promise + + function throwAbstract(){ + throw new TypeError("abstract"); + } + + return lang.extend(function Promise(){ + // summary: + // The public interface to a deferred. + // description: + // The public interface to a deferred. All promises in Dojo are + // instances of this class. + }, { + then: function(callback, errback, progback){ + // summary: + // Add new callbacks to the promise. + // description: + // Add new callbacks to the deferred. Callbacks can be added + // before or after the deferred is fulfilled. + // callback: Function? + // Callback to be invoked when the promise is resolved. + // Receives the resolution value. + // errback: Function? + // Callback to be invoked when the promise is rejected. + // Receives the rejection error. + // progback: Function? + // Callback to be invoked when the promise emits a progress + // update. Receives the progress update. + // returns: dojo/promise/Promise + // Returns a new promise for the result of the callback(s). + // This can be used for chaining many asynchronous operations. + + throwAbstract(); + }, + + cancel: function(reason, strict){ + // summary: + // Inform the deferred it may cancel its asynchronous operation. + // description: + // Inform the deferred it may cancel its asynchronous operation. + // The deferred's (optional) canceler is invoked and the + // deferred will be left in a rejected state. Can affect other + // promises that originate with the same deferred. + // reason: any + // A message that may be sent to the deferred's canceler, + // explaining why it's being canceled. + // strict: Boolean? + // If strict, will throw an error if the deferred has already + // been fulfilled and consequently cannot be canceled. + // returns: any + // Returns the rejection reason if the deferred was canceled + // normally. + + throwAbstract(); + }, + + isResolved: function(){ + // summary: + // Checks whether the promise has been resolved. + // returns: Boolean + + throwAbstract(); + }, + + isRejected: function(){ + // summary: + // Checks whether the promise has been rejected. + // returns: Boolean + + throwAbstract(); + }, + + isFulfilled: function(){ + // summary: + // Checks whether the promise has been resolved or rejected. + // returns: Boolean + + throwAbstract(); + }, + + isCanceled: function(){ + // summary: + // Checks whether the promise has been canceled. + // returns: Boolean + + throwAbstract(); + }, + + always: function(callbackOrErrback){ + // summary: + // Add a callback to be invoked when the promise is resolved + // or rejected. + // callbackOrErrback: Function? + // A function that is used both as a callback and errback. + // returns: dojo/promise/Promise + // Returns a new promise for the result of the callback/errback. + + return this.then(callbackOrErrback, callbackOrErrback); + }, + + otherwise: function(errback){ + // summary: + // Add new errbacks to the promise. + // errback: Function? + // Callback to be invoked when the promise is rejected. + // returns: dojo/promise/Promise + // Returns a new promise for the result of the errback. + + return this.then(null, errback); + }, + + trace: function(){ + return this; + }, + + traceRejected: function(){ + return this; + }, + + toString: function(){ + // returns: string + // Returns `[object Promise]`. + + return "[object Promise]"; + } + }); +}); |