Skip to content

Commit

Permalink
Fix for +isKindOfClass: and +isMemberOfClass: not being there.
Browse files Browse the repository at this point in the history
[cappuccino#171 state:resolved].

Reviewed by me.
  • Loading branch information
Francisco Ryan Tolmasky I committed Dec 17, 2008
1 parent d73450d commit a9b57d4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
5 changes: 5 additions & 0 deletions AppKit/Cib/_CPCibCustomObject.j
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ var _CPCibCustomObjectClassName = @"_CPCibCustomObjectClassName";
CPString _className;
}

- (CPString)customClassName
{
return _className;
}

@end

@implementation _CPCibCustomObject (CPCoding)
Expand Down
5 changes: 5 additions & 0 deletions AppKit/Cib/_CPCibCustomView.j
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
CPString _className;
}

- (CPString)customClassName
{
return _className;
}

@end

var _CPCibCustomViewClassNameKey = @"_CPCibCustomViewClassNameKey";
Expand Down
15 changes: 13 additions & 2 deletions Foundation/CPObject.j
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@
var theClass = self;

for(; theClass; theClass = theClass.super_class)
if(theClass == aClass) return YES;
if(theClass === aClass)
return YES;

return NO;
}
Expand All @@ -140,13 +141,23 @@
return [isa isSubclassOfClass:aClass];
}

+ (BOOL)isKindOfClass:(Class)aClass
{
return [self isSubclassOfClass:aClass];
}

/*!
Returns <code>YES</code> if the receiver is of the <code>aClass</code> class type.
@param aClass the class to test the receiper
*/
- (BOOL)isMemberOfClass:(Class)aClass
{
return self.isa == aClass;
return self.isa === aClass;
}

+ (BOOL)isMemberOfClass:(Class)aClass
{
return self === aClass;
}

/*!
Expand Down

0 comments on commit a9b57d4

Please sign in to comment.