mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-27 05:57:04 +00:00
Better -copy implementations for KVC arrays and sets.
Reviewed by me.
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user