Better -copy implementations for KVC arrays and sets.

Reviewed by me.
This commit is contained in:
Francisco Ryan Tolmasky I
2011-01-09 03:46:29 -08:00
parent 028a4fe5b2
commit 5af66b60e1
3 changed files with 7 additions and 13 deletions
+2 -2
View File
@@ -35,12 +35,12 @@ var indexOf = Array.prototype.indexOf,
- (id)initWithArray:(CPArray)anArray
{
return slice.call(anArray, 0);
return [self initWithArray:anArray copyItems:NO];
}
- (id)initWithArray:(CPArray)anArray copyItems:(BOOL)shouldCopyItems
{
if (!shouldCopyItems)
if (!shouldCopyItems && anArray.isa === _CPJavaScriptArray)
return slice.call(anArray, 0);
self = [super init];