mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
Fixed: Method isEqual: can handle nil as an argument for CPExpression and CPPredicate including sub classes.
This commit is contained in:
@@ -275,7 +275,7 @@ var CPComparisonPredicateModifier,
|
||||
if (self === anObject)
|
||||
return YES;
|
||||
|
||||
if (anObject.isa !== self.isa || _modifier !== [anObject comparisonPredicateModifier] || _type !== [anObject predicateOperatorType] || _options !== [anObject options] || _customSelector !== [anObject customSelector] || ![_left isEqual:[anObject leftExpression]] || ![_right isEqual:[anObject rightExpression]])
|
||||
if (anObject === nil || anObject.isa !== self.isa || _modifier !== [anObject comparisonPredicateModifier] || _type !== [anObject predicateOperatorType] || _options !== [anObject options] || _customSelector !== [anObject customSelector] || ![_left isEqual:[anObject leftExpression]] || ![_right isEqual:[anObject rightExpression]])
|
||||
return NO;
|
||||
|
||||
return YES;
|
||||
|
||||
@@ -215,7 +215,7 @@ var CPCompoundPredicateType;
|
||||
if (self === anObject)
|
||||
return YES;
|
||||
|
||||
if (anObject.isa !== self.isa || _type !== [anObject compoundPredicateType] || ![_predicates isEqualToArray:[anObject subpredicates]])
|
||||
if (anObject === nil || anObject.isa !== self.isa || _type !== [anObject compoundPredicateType] || ![_predicates isEqualToArray:[anObject subpredicates]])
|
||||
return NO;
|
||||
|
||||
return YES;
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
if (self === object)
|
||||
return YES;
|
||||
|
||||
if (object.isa !== self.isa || ![[object collection] isEqual:_aggregate])
|
||||
if (object === nil || object.isa !== self.isa || ![[object collection] isEqual:_aggregate])
|
||||
return NO;
|
||||
|
||||
return YES;
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
if (self === object)
|
||||
return YES;
|
||||
|
||||
if (object.isa !== self.isa || ![[object constantValue] isEqual:_value])
|
||||
if (object === nil || object.isa !== self.isa || ![[object constantValue] isEqual:_value])
|
||||
return NO;
|
||||
|
||||
return YES;
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
if (self === object)
|
||||
return YES;
|
||||
|
||||
if (object.isa !== self.isa || ![[object _function] isEqual:_selector] || ![[object operand] isEqual:_operand] || ![[object arguments] isEqualToArray:_arguments])
|
||||
if (object === nil || object.isa !== self.isa || ![[object _function] isEqual:_selector] || ![[object operand] isEqual:_operand] || ![[object arguments] isEqualToArray:_arguments])
|
||||
return NO;
|
||||
|
||||
return YES;
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
if (object === self)
|
||||
return YES;
|
||||
|
||||
if (object.isa !== self.isa || ![[object keyPath] isEqualToString:[self keyPath]])
|
||||
if (object === nil || object.isa !== self.isa || ![[object keyPath] isEqualToString:[self keyPath]])
|
||||
return NO;
|
||||
|
||||
return YES;
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
if (self === anObject)
|
||||
return YES;
|
||||
|
||||
if (self.isa !== anObject.isa || _value !== [anObject evaluateWithObject:nil])
|
||||
if (anObject === nil || self.isa !== anObject.isa || _value !== [anObject evaluateWithObject:nil])
|
||||
return NO;
|
||||
|
||||
return YES;
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
if (self === object)
|
||||
return YES;
|
||||
|
||||
if (object.isa !== self.isa || ![[object leftExpression] isEqual:_left] || ![[object rightExpression] isEqual:_right])
|
||||
if (object === nil || object.isa !== self.isa || ![[object leftExpression] isEqual:_left] || ![[object rightExpression] isEqual:_right])
|
||||
return NO;
|
||||
|
||||
return YES;
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
if (self === object)
|
||||
return YES;
|
||||
|
||||
if (object.isa !== self.isa || ![_collection isEqual:[object collection]] || ![_variableExpression isEqual:[object variableExpression]] || ![_subpredicate isEqual:[object predicate]])
|
||||
if (object === nil || object.isa !== self.isa || ![_collection isEqual:[object collection]] || ![_variableExpression isEqual:[object variableExpression]] || ![_subpredicate isEqual:[object predicate]])
|
||||
return NO;
|
||||
|
||||
return YES;
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
if (self === object)
|
||||
return YES;
|
||||
|
||||
if (object.isa !== self.isa || ![[object variable] isEqual:_variable])
|
||||
if (object === nil || object.isa !== self.isa || ![[object variable] isEqual:_variable])
|
||||
return NO;
|
||||
|
||||
return YES;
|
||||
|
||||
Reference in New Issue
Block a user