mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
bugfix in equalsToDefault.
This commit is contained in:
@@ -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) {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user