- 注册时间
- 2013-10-14
- 最后登录
- 2013-12-16
- 阅读权限
- 20
- 积分
- 132
- 精华
- 0
- 帖子
- 44
|
(function(){
/**
* 全局开始时间点
*
* @static
* @property _globalStartTimer
* @type {Number}
* @private
* @module buildingBlock
*/
_globalStartTimer = (new Date()).getTime();
/**
* (全局函数)返回从进入界面开始到现在的时间间隔。
* @static
* @class getTimer
* @return {int}
* @module buildingBlock
*/
getTimer = function(){
_currentTimer = (new Date()).getTime();
return parseInt(_globalStartTimer - _currentTimer);
}
})();
/**
* 执行继承。
* 旧代码会导致一个错误,就是子类在继承并执行基类构造函数时,基类构造函数中的 this,
* 为当前子类的对象引用,而此时子类还并未具备父类的方法,所以,基类中用 this 调用其方法是显示提示:
* "ReferenceError: (methodName) is not defined"。
* @static
* @class base
* @module buildingBlock
* @param {Object} thisObj
* @param {Object} baseClass
* @param {Array} argArr
*/
function base(thisObj, baseClass, argArr) {
var p=null,o=thisObj.constructor.prototype,h={};
for(p in o)h[p]=1;
for(p in baseClass.prototype){
if(!h[p])o[p] = baseClass.prototype[p];
o[p][SUPER] = baseClass.prototype;
}
if(Object.prototype.callParent){
delete Object.prototype.callParent;
}
/* try{*/
baseClass.apply(thisObj,argArr);
/* }catch(err){
trace(this + ".base(...) argArr = " + argArr + "--> 错误名称:" + err.name + ", \n错误信息:" + err.message );
}*/
} |
|