mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
Merge pull request #220 from minggo/sync-15085
fix wrong behavior of 'cc.isObject' function for undefined and null
This commit is contained in:
@@ -132,8 +132,7 @@ cc.isValidValue = function(obj) {
|
||||
* @returns {boolean}
|
||||
*/
|
||||
cc.isObject = function(obj) {
|
||||
return (obj && obj.__nativeObj !== undefined) ||
|
||||
( typeof obj === "object" && Object.prototype.toString.call(obj) === '[object Object]' );
|
||||
return ( obj !== null && typeof obj === "object" );
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user