mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-11 03:02:19 +00:00
Slight initWithArray:shouldCopyItems: fix.
Reviewed by me.
This commit is contained in:
1 parent
e7dbd5a5cc
commit
2f86c0d9d2
1 file changed
+3
-2
@@ -49,13 +49,14 @@ var indexOf = Array.prototype.indexOf,
|
||||
|
||||
if (anArray.isa === _CPJavaScriptArray)
|
||||
{
|
||||
// If we're this far, shouldCopyItems must be YES.
|
||||
var count = anArray.length;
|
||||
|
||||
for (; index < count; ++index)
|
||||
{
|
||||
var object = anArray[index];
|
||||
|
||||
self[index] = object.isa ? [object copy] : object;
|
||||
self[index] = (object && object.isa) ? [object copy] : object;
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -67,7 +68,7 @@ var indexOf = Array.prototype.indexOf,
|
||||
{
|
||||
var object = [anArray objectAtIndex:index];
|
||||
|
||||
self[index] = object.isa ? [object copy] : object;
|
||||
self[index] = (shouldCopyItems && object && object.isa) ? [object copy] : object;
|
||||
}
|
||||
|
||||
return self;
|
||||
|
||||
Reference in new issue
Block a user