Merge pull request #220 from minggo/sync-15085

fix wrong behavior of 'cc.isObject' function for undefined and null
This commit is contained in:
minggo
2016-07-18 18:00:35 +08:00
committed by GitHub
@@ -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" );
};
/**