File tree Expand file tree Collapse file tree 2 files changed +28
-4
lines changed Expand file tree Collapse file tree 2 files changed +28
-4
lines changed Original file line number Diff line number Diff line change @@ -6851,9 +6851,21 @@ var td;
68516851 * @returns TRUE if the given type equals this type, FALSE otherwise.
68526852 */
68536853 TypeParameterType . prototype . equals = function ( type ) {
6854- return type instanceof TypeParameterType &&
6854+ if ( ! ( type instanceof TypeParameterType ) ) {
6855+ return false ;
6856+ }
6857+ var constraintEquals ;
6858+ if ( this . constraint && type . constraint ) {
6859+ constraintEquals = type . constraint . equals ( this . constraint ) ;
6860+ }
6861+ else if ( ! this . constraint && ! type . constraint ) {
6862+ constraintEquals = true ;
6863+ }
6864+ else {
6865+ return false ;
6866+ }
6867+ return constraintEquals &&
68556868 type . isArray == this . isArray &&
6856- type . constraint . equals ( this . constraint ) &&
68576869 type . name == this . name ;
68586870 } ;
68596871 /**
Original file line number Diff line number Diff line change @@ -39,9 +39,21 @@ module td.models
3939 * @returns TRUE if the given type equals this type, FALSE otherwise.
4040 */
4141 equals ( type :TypeParameterType ) :boolean {
42- return type instanceof TypeParameterType &&
42+ if ( ! ( type instanceof TypeParameterType ) ) {
43+ return false ;
44+ }
45+
46+ var constraintEquals ;
47+ if ( this . constraint && type . constraint ) {
48+ constraintEquals = type . constraint . equals ( this . constraint ) ;
49+ } else if ( ! this . constraint && ! type . constraint ) {
50+ constraintEquals = true ;
51+ } else {
52+ return false ;
53+ }
54+
55+ return constraintEquals &&
4356 type . isArray == this . isArray &&
44- type . constraint . equals ( this . constraint ) &&
4557 type . name == this . name ;
4658 }
4759
You can’t perform that action at this time.
0 commit comments