Merge pull request #2552 from drhayes/dev

Distinguish between Arrays and Objects when cloning in Cache.getJSON.
This commit is contained in:
Richard Davey 2016-06-14 11:49:02 +01:00 committed by GitHub
commit 7108bc3de3

View file

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