mirror of
https://github.com/gnustep/libs-steptalk.git
synced 2025-02-21 02:31:01 +00:00
Fix bug where instance variables of an actor got lost when set to nil.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/steptalk/trunk@36476 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
be39511ed8
commit
9576ab41c4
2 changed files with 16 additions and 6 deletions
|
@ -1,3 +1,8 @@
|
|||
2013-04-06 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Frameworks/StepTalk/STActor.m (-setValue:forKey:): Fix bug where
|
||||
instance variables of an actor got lost when set to nil.
|
||||
|
||||
2013-04-04 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Frameworks/StepTalk/NSObject+additions.h (-yourself):
|
||||
|
|
|
@ -63,8 +63,13 @@
|
|||
|
||||
- (void)setValue:(id)value forKey:(NSString *)key
|
||||
{
|
||||
if (value == nil)
|
||||
{
|
||||
value = STNil;
|
||||
}
|
||||
|
||||
/* FIXME: this is not optimal */
|
||||
if([ivars valueForKey:key] != nil)
|
||||
if ([ivars valueForKey:key] != nil)
|
||||
{
|
||||
[ivars setValue:value forKey:key];
|
||||
}
|
||||
|
@ -79,7 +84,7 @@
|
|||
|
||||
value = [ivars valueForKey:key];
|
||||
|
||||
if(value == nil)
|
||||
if (value == nil)
|
||||
{
|
||||
value = [super valueForKey:key];
|
||||
}
|
||||
|
@ -135,7 +140,7 @@ some other, more clever mechanism. */
|
|||
}
|
||||
- (BOOL)respondsToSelector:(SEL)aSelector
|
||||
{
|
||||
if( [super respondsToSelector:(SEL)aSelector] )
|
||||
if ([super respondsToSelector:(SEL)aSelector])
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
@ -149,7 +154,7 @@ some other, more clever mechanism. */
|
|||
|
||||
signature = [super methodSignatureForSelector:sel];
|
||||
|
||||
if(!signature)
|
||||
if (!signature)
|
||||
{
|
||||
signature = STConstructMethodSignatureForSelector(sel);
|
||||
}
|
||||
|
@ -170,7 +175,7 @@ some other, more clever mechanism. */
|
|||
|
||||
method = [methodDictionary objectForKey:methodName];
|
||||
|
||||
if(!method)
|
||||
if (!method)
|
||||
{
|
||||
[NSException raise:@"STActorException"
|
||||
format:@"No script object method with name '%@'",
|
||||
|
@ -184,7 +189,7 @@ some other, more clever mechanism. */
|
|||
count = [[invocation methodSignature] numberOfArguments];
|
||||
args = [NSMutableArray array];
|
||||
|
||||
for(index = 2; index < count; index++)
|
||||
for (index = 2; index < count; index++)
|
||||
{
|
||||
arg = [invocation getArgumentAsObjectAtIndex:index];
|
||||
|
||||
|
|
Loading…
Reference in a new issue