From 7817d47a25aabd40c07a95d2aece3c56ce89f9a7 Mon Sep 17 00:00:00 2001 From: photonstorm Date: Tue, 14 Jun 2016 12:18:32 +0100 Subject: [PATCH] Updated Cache docs. --- src/loader/Cache.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/loader/Cache.js b/src/loader/Cache.js index 86911c9eb..cd6e8d2c4 100644 --- a/src/loader/Cache.js +++ b/src/loader/Cache.js @@ -1302,7 +1302,7 @@ Phaser.Cache.prototype = { * @method Phaser.Cache#getJSON * @param {string} key - The key of the asset to retrieve from the cache. * @param {boolean} [clone=false] - Return a clone of the original object (true) or a reference to it? (false) - * @return {object} The JSON object. + * @return {object} The JSON object, or an Array if the key points to an Array property. If the property wasn't found, it returns null. */ getJSON: function (key, clone) { @@ -1312,8 +1312,7 @@ Phaser.Cache.prototype = { { if (clone) { - var base = Array.isArray(data) ? [] : {}; - return Phaser.Utils.extend(true, base, data); + return Phaser.Utils.extend(true, Array.isArray(data) ? [] : {}, data); } else {