Skip to content

Commit

Permalink
Add cc.sys.isObjectValid
Browse files Browse the repository at this point in the history
  • Loading branch information
pandamicro committed Apr 21, 2015
1 parent 2588ad7 commit 770e08e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions CCBoot.js
Expand Up @@ -1780,6 +1780,21 @@ cc._initSys = function (config, CONFIG_KEY) {
// N/A in cocos2d-html5
};

/**
* Check whether an object is valid,
* In web engine, it will return true if the object exist
* In native engine, it will return true if the JS object and the correspond native object are both valid
* @memberof cc.sys
* @name isObjectValid
* @param {Object} obj
* @return {boolean} Validity of the object
* @function
*/
sys.isObjectValid = function (obj) {
if (obj) return true;
else return false;
};

/**
* Dump system informations
* @memberof cc.sys
Expand Down

0 comments on commit 770e08e

Please sign in to comment.