Skip to content

Commit 0333274

Browse files
committed
Issue #1498: bug on cc.isObject
1 parent 0e4310b commit 0333274

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

frameworks/js-bindings/bindings/script/jsb_boot.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ cc.isString = function(obj) {
102102
*/
103103
cc.isArray = function(obj) {
104104
return Array.isArray(obj) ||
105-
(typeof obj === 'object' && Object.prototype.toString.call(obj) === '[object Array]');
105+
(typeof obj === 'object' && objectToString(obj) === '[object Array]');
106106
};
107107

108108
/**
@@ -120,7 +120,8 @@ cc.isUndefined = function(obj) {
120120
* @returns {boolean}
121121
*/
122122
cc.isObject = function(obj) {
123-
return typeof obj === "object" && Object.prototype.toString.call(obj) === '[object Object]';
123+
return obj.__nativeObj !== undefined ||
124+
( typeof obj === "object" && Object.prototype.toString.call(obj) === '[object Object]' );
124125
};
125126

126127
/**

0 commit comments

Comments
 (0)