Skip to content

Commit

Permalink
Backports an AngularJS 1.6 extern change to 1.5.
Browse files Browse the repository at this point in the history
Changes the type of promise from an @constructor to an @interface. This CL doesn't change the runtime of AngularJS and doesn't matter much to the actual users of the externs. However this CL matters in turns of the .d.ts files generated by Clutz. With this change, the Clutz emitted .d.ts files won't have the "private noStructuralTypings_: any" brand in promise (because it's not a class anymore). Therefore it becomes assignable to a TS AngularJS promise (from angular.d.ts).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209843524
  • Loading branch information
bowenni authored and blickly committed Aug 27, 2018
1 parent 334dad1 commit 27fc5d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions contrib/externs/angular-1.5-http-promise_templated.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
angular.HttpCallback;

/**
* @constructor
* @interface
* @template T
*/
angular.$http.Response = function() {};
Expand All @@ -54,7 +54,7 @@ angular.$http.Response.prototype.headers = function(name) {};
angular.$http.Response.prototype.config;

/**
* @constructor
* @interface
* @extends {angular.$q.Promise.<!angular.$http.Response.<T>>}
* @template T
*/
Expand Down
8 changes: 4 additions & 4 deletions contrib/externs/angular-1.5-q_templated.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
*****************************************************************************/

/**
* @constructor
* @interface
*/
angular.$q = function() {};

/**
* @constructor
* @interface
* @template T
* @implements {IThenable<T>}
* @extends {IThenable<T>}
*/
angular.$q.Promise = function() {};

Expand Down Expand Up @@ -80,7 +80,7 @@ angular.$q.Promise.prototype.finally =
function(callback, opt_notifyCallback) {};

/**
* @constructor
* @interface
* @template T
*/
angular.$q.Deferred = function() {};
Expand Down

0 comments on commit 27fc5d7

Please sign in to comment.