Skip to content

Commit 7817d47

Browse files
committed
Updated Cache docs.
1 parent ad36418 commit 7817d47

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/loader/Cache.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,7 +1302,7 @@ Phaser.Cache.prototype = {
13021302
* @method Phaser.Cache#getJSON
13031303
* @param {string} key - The key of the asset to retrieve from the cache.
13041304
* @param {boolean} [clone=false] - Return a clone of the original object (true) or a reference to it? (false)
1305-
* @return {object} The JSON object.
1305+
* @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.
13061306
*/
13071307
getJSON: function (key, clone) {
13081308

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

0 commit comments

Comments
 (0)