File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
frameworks/js-bindings/bindings/script Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,8 @@ cc.isString = function(obj) {
101
101
* @returns {boolean }
102
102
*/
103
103
cc . isArray = function ( obj ) {
104
- return Object . prototype . toString . call ( obj ) == '[object Array]' ;
104
+ return Array . isArray ( obj ) ||
105
+ ( typeof obj === 'object' && objectToString ( obj ) === '[object Array]' ) ;
105
106
} ;
106
107
107
108
/**
@@ -110,7 +111,7 @@ cc.isArray = function(obj) {
110
111
* @returns {boolean }
111
112
*/
112
113
cc . isUndefined = function ( obj ) {
113
- return typeof obj == 'undefined' ;
114
+ return typeof obj === 'undefined' ;
114
115
} ;
115
116
116
117
/**
@@ -119,9 +120,8 @@ cc.isUndefined = function(obj) {
119
120
* @returns {boolean }
120
121
*/
121
122
cc . isObject = function ( obj ) {
122
- var type = typeof obj ;
123
-
124
- return type == 'function' || ( obj && type == 'object' ) ;
123
+ return obj . __nativeObj !== undefined ||
124
+ ( typeof obj === "object" && Object . prototype . toString . call ( obj ) === '[object Object]' ) ;
125
125
} ;
126
126
127
127
/**
You can’t perform that action at this time.
0 commit comments