As we have a tool-free bridges between many classes and JavaScript types by setting the isa property on the type, for example CPArray and Array. Using the for...in enumeration the isa property will be included in the loop if the property is enumerable (this is the default behavior). This commit set the property as not enumerable.
Also added test case for check that the isa property on classes are not enumerable using a for...in loop.
Delegate methods described on lines 76 and 85 are not the selectors
checked on lines 305 and line 302, but are the methods actually called
on the delegate on lines 195 and 225. This fix updates the method
selectors checked on the delegate, to match those defined and called
within the CPKeyedArchiver class.
Fixes#2679
This new warning adds a lot of warnings in the Cappuccino frameworks. I have turned off
the warning in the Jakefiles when compiling most of the Cappuccino frameworks. But it is
on as default for any user projects.
So there is also a new feature to turn off/on warnings as a compiler flag.
These flags are (all flags are on as default):
-Wunused-but-set-variable Warning when a local variable is never read.
-Wshadow-ivar Warning when a local variable is shadowing an instance variable for the class.
-Wcreate-global-inside-function-or-method Warning when creating a global variable inside a function or method.
-Wunknown-class-or-global Warning when a class or global variable is not known.
-Wunknown-ivar-type Warning when the type for an instance variable is not known.
To turn off a flag add a 'no-' prefix. Example: -Wno-unused-but-set-variable
For an example how to use it in a Jakefile please look at the Jakefiles in this commit.
An example:
var array = @[ @{@"Name": @"1"},
@{@"Name": @"2", @"approveTime": @"Now"}
];
var predicate = [CPPredicate predicateWithFormat:@"approveTime != nil"];
CPLog(@"result: %@", [array filteredArrayUsingPredicate:predicate]); // result: <empty array>
If I run this in Cappuccino I get an empty array
If I run it in Cocoa on a Mac I get:
result: (
{
Name = 2;
approveTime = Now;
}
This pull request adds a kvoValueForKey: method used by _CPKVOForwardingObserver for getting values.
The default action is to just return the valueForKey value.
Override this method if you want any other behavior.
It can be used to just return nil if you are implementing a lazy load behavior on a class.
It can allow a combined binding to observe this object without trigger any lazy loading.