Distinguish between Arrays and Objects when cloning in Cache.getJSON.

Fixes #2551.
This commit is contained in:
David Hayes 2016-06-10 10:33:05 -05:00
parent 0880380ea9
commit 346aed2866

View file

@ -1312,7 +1312,8 @@ Phaser.Cache.prototype = {
{ {
if (clone) if (clone)
{ {
return Phaser.Utils.extend(true, {}, data); var base = Array.isArray(data) ? [] : {};
return Phaser.Utils.extend(true, base, data);
} }
else else
{ {