Posted on 2009-07-06 13:50
oathleo 阅读(1432)
评论(0) 编辑 收藏 所属分类:
Web
override: function(origclass, overrides){
if (overrides) {
var p = origclass.prototype;
for (var method in overrides) {
//IE下无法遍历到
//"toString", "toLocaleString", "valueOf",
//"hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable"这几个方法
p[method] = overrides[method];
}
if (TWaver.isIE) { //IE 问题,目前只有'toString'用到,先处理
if (p['toString'] != overrides['toString']) {
p['toString'] = overrides['toString'];
}
}
}
}