From ee3afd4403d318536ab8fe4d147a1784d9afeb10 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 4 Apr 2018 17:32:29 +0800 Subject: [PATCH] bugfix in equalsToDefault. --- cocos2d/core/platform/instantiate-jit.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/cocos2d/core/platform/instantiate-jit.js b/cocos2d/core/platform/instantiate-jit.js index 4b1cdcf2ee..f891f5af1a 100644 --- a/cocos2d/core/platform/instantiate-jit.js +++ b/cocos2d/core/platform/instantiate-jit.js @@ -162,14 +162,7 @@ function equalsToDefault (def, value) { (def.constructor === Object && value.constructor === Object) ) { try { - if (CC_JSB) { - //FIXME: JSON.stringify will take lots of time for compare object at runtime on JSB. - // We need to consider a new way for checking whether two objects are equal. - return false; - } - else { - return JSON.stringify(def) === JSON.stringify(value); - } + return Array.isArray(def) && Array.isArray(value) && def.length === 0 && value.length === 0; } catch (e) { }