Skip to content

Commit bf79a0f

Browse files
committed
ignoring new ArrayList(<num>), since Processing does, too. Also updated test.
1 parent 09ce6ae commit bf79a0f

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

processing.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -469,15 +469,10 @@
469469
}
470470

471471
function ArrayList(a) {
472-
var array;
472+
var array = [];
473473

474474
if (a && a.toArray) {
475475
array = a.toArray();
476-
} else {
477-
array = [];
478-
if (typeof a === "number") {
479-
array.length = a > 0 ? a : 0;
480-
}
481476
}
482477

483478
/**

test/unit/arrayList.pde

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ ArrayList list2 = new ArrayList(list1);
2323
_checkEqual(list1, list2);
2424

2525
ArrayList list3 = new ArrayList(5);
26-
_checkEqual(list3.size(), 5);
26+
_checkEqual(list3.size(), 0);

0 commit comments

Comments
 (0)