Skip to content

Commit 842ed1a

Browse files
committed
issue phaserjs#4411 fix
1 parent 916a13c commit 842ed1a

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/utils/array/Add.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
/**
88
* Adds the given item, or array of items, to the array.
9-
*
9+
*
1010
* Each item must be unique within the array.
11-
*
11+
*
1212
* The array is modified in-place and returned.
13-
*
13+
*
1414
* You can optionally specify a limit to the maximum size of the array. If the quantity of items being
1515
* added will take the array length over this limit, it will stop adding once the limit is reached.
16-
*
16+
*
1717
* You can optionally specify a callback to be invoked for each item successfully added to the array.
1818
*
1919
* @function Phaser.Utils.Array.Add
@@ -53,7 +53,7 @@ var Add = function (array, item, limit, callback, context)
5353
{
5454
callback.call(context, item);
5555
}
56-
56+
5757
return item;
5858
}
5959
else
@@ -72,7 +72,7 @@ var Add = function (array, item, limit, callback, context)
7272
if (array.indexOf(item[itemLength]) !== -1)
7373
{
7474
// Already exists in array, so remove it
75-
item.pop();
75+
item.splice(itemLength, 1);
7676
}
7777

7878
itemLength--;

0 commit comments

Comments
 (0)