Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(519)

Unified Diff: third_party/google_input_tools/third_party/closure_library/closure/goog/promise/thenable.js

Issue 1257313003: Update Google Input Tools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Free up grd resources. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/google_input_tools/third_party/closure_library/closure/goog/promise/thenable.js
diff --git a/third_party/google_input_tools/third_party/closure_library/closure/goog/promise/thenable.js b/third_party/google_input_tools/third_party/closure_library/closure/goog/promise/thenable.js
index dde8ec88cf7eab4129301b9ff7740ccf9d4f3d00..3999d6eaa4e0b8f78618cc2df274d2a47820a655 100644
--- a/third_party/google_input_tools/third_party/closure_library/closure/goog/promise/thenable.js
+++ b/third_party/google_input_tools/third_party/closure_library/closure/goog/promise/thenable.js
@@ -21,7 +21,7 @@ goog.provide('goog.Thenable');
* http://promisesaplus.com for interop with {@see goog.Promise}.
*
* @interface
- * @extends {IThenable.<TYPE>}
+ * @extends {IThenable<TYPE>}
* @template TYPE
*/
goog.Thenable = function() {};
@@ -41,8 +41,7 @@ goog.Thenable = function() {};
* with the rejection reason as argument, and the child Promise will be rejected
* with the return value of the callback or thrown value.
*
- * @param {?(function(this:THIS, TYPE):
- * (RESULT|IThenable.<RESULT>|Thenable))=} opt_onFulfilled A
+ * @param {?(function(this:THIS, TYPE): VALUE)=} opt_onFulfilled A
* function that will be invoked with the fulfillment value if the Promise
* is fullfilled.
* @param {?(function(this:THIS, *): *)=} opt_onRejected A function that will
@@ -50,9 +49,25 @@ goog.Thenable = function() {};
* @param {THIS=} opt_context An optional context object that will be the
* execution context for the callbacks. By default, functions are executed
* with the default this.
- * @return {!goog.Promise.<RESULT>} A new Promise that will receive the result
+ *
+ * @return {RESULT} A new Promise that will receive the result
* of the fulfillment or rejection callback.
- * @template RESULT,THIS
+ * @template VALUE
+ * @template THIS
+ *
+ * When a Promise (or thenable) is returned from the fulfilled callback,
+ * the result is the payload of that promise, not the promise itself.
+ *
+ * @template RESULT := type('goog.Promise',
+ * cond(isUnknown(VALUE), unknown(),
+ * mapunion(VALUE, (V) =>
+ * cond(isTemplatized(V) && sub(rawTypeOf(V), 'IThenable'),
+ * templateTypeOf(V, 0),
+ * cond(sub(V, 'Thenable'),
+ * unknown(),
+ * V)))))
+ * =:
+ *
*/
goog.Thenable.prototype.then = function(opt_onFulfilled, opt_onRejected,
opt_context) {};
@@ -76,7 +91,7 @@ goog.Thenable.IMPLEMENTED_BY_PROP = '$goog_Thenable';
* Exports a 'then' method on the constructor prototype, so that the objects
* also implement the extern {@see goog.Thenable} interface for interop with
* other Promise implementations.
- * @param {function(new:goog.Thenable,...[?])} ctor The class constructor. The
+ * @param {function(new:goog.Thenable,...?)} ctor The class constructor. The
* corresponding class must have already implemented the interface.
*/
goog.Thenable.addImplementation = function(ctor) {

Powered by Google App Engine
This is Rietveld 408576698