cc.sys.isObjectValid 为什么会判断c++对象,源码里面好像没有体现?

/**

  • 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
  • @method isObjectValid
  • @param {Object} obj
  • @return {Boolean} Validity of the object
    */
    sys.isObjectValid = function (obj) {
    if (obj) return true;
    else return false;
    };

JSB的判断不是走的这个函数,而是 C++ 层的 JSB_isObjectValid

1赞