Fixed: The init method ’initWithObjects:count:’ for CPArray did not work on native CPJavaScriptArray when ’count’ is not the same as the length on the provided array.

A test case for this is also added in the test class CPArrayTest
This commit is contained in:
Martin Carlberg
2015-09-25 17:07:15 +02:00
parent 448c2a27d4
commit 8599ad4a3c
3 changed files with 41 additions and 1 deletions
+1 -1
View File
@@ -91,7 +91,7 @@ var concat = Array.prototype.concat,
- (id)initWithObjects:(CPArray)objects count:(CPUInteger)aCount
{
if ([objects isKindOfClass:_CPJavaScriptArray])
return slice.call(objects, 0);
return slice.call(objects, 0, aCount);
var array = [],
index = 0;