mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-29 18:02:03 +00:00
Fix for minimizer not recognizing a var.
Reviewed by me.
This commit is contained in:
1 parent
7d8b02dd96
commit
1a8093c314
1 file changed
+12
-12
@@ -448,11 +448,22 @@ var _CPKVOInfoMake = function _CPKVOInfoMake(anObserver, theOptions, aContext, a
|
||||
};
|
||||
}
|
||||
|
||||
var _kvoKeyForSetter = function _kvoKeyForSetter(selector)
|
||||
{
|
||||
if (selector.split(":").length > 2 || !([selector hasPrefix:@"set"] || [selector hasPrefix:@"_set"]))
|
||||
return nil;
|
||||
|
||||
var keyIndex = selector.indexOf("set") + "set".length,
|
||||
colonIndex = selector.indexOf(":");
|
||||
|
||||
return selector.charAt(keyIndex).toLowerCase() + selector.substring(keyIndex+1, colonIndex);
|
||||
}
|
||||
|
||||
var _kvoMethodForMethod = function _kvoMethodForMethod(theObject, theMethod)
|
||||
{
|
||||
var methodName = theMethod.name,
|
||||
methodImplementation = theMethod.method_imp,
|
||||
setterKey = kvoKeyForSetter(methodName);
|
||||
setterKey = _kvoKeyForSetter(methodName);
|
||||
|
||||
if (setterKey && objj_msgSend(theObject, @selector(automaticallyNotifiesObserversForKey:), setterKey))
|
||||
{
|
||||
@@ -469,17 +480,6 @@ var _kvoMethodForMethod = function _kvoMethodForMethod(theObject, theMethod)
|
||||
return nil;
|
||||
}
|
||||
|
||||
var kvoKeyForSetter = function kvoKeyForSetter(selector)
|
||||
{
|
||||
if (selector.split(":").length > 2 || !([selector hasPrefix:@"set"] || [selector hasPrefix:@"_set"]))
|
||||
return nil;
|
||||
|
||||
var keyIndex = selector.indexOf("set") + "set".length,
|
||||
colonIndex = selector.indexOf(":");
|
||||
|
||||
return selector.charAt(keyIndex).toLowerCase() + selector.substring(keyIndex+1, colonIndex);
|
||||
}
|
||||
|
||||
@implementation CPArray (KeyValueObserving)
|
||||
|
||||
- (void)addObserver:(id)anObserver toObjectsAtIndexes:(CPIndexSet)indexes forKeyPath:(CPString)aKeyPath options:(unsigned)options context:(id)context
|
||||
|
||||
Reference in new issue
Block a user