日期:2014-05-16 浏览次数:20383 次
klass.extend = function(obj){
var extended = obj.extended;//其实还有这一句,也不是很清楚它的用意
for (var i in obj){
klass[i] = obj[i];
}
if(extended) extend(klass)//就是这句不明白
};
var Class = function(){
var klass = function(){
this.init.apply(this, arguments);
};
klass.prototype.init = function(){};
klass.fn = klass.prototype;
klass.fn.parent = klass;
klass.extend = function(obj){
var extended = obj.extended;//其实还有这一句,也不是很清楚它的用意
for(var i in obj){
klass[i] = obj[i];
}
if (extended) extended(klass)//就是这句不明白
};
klass.include = function(obj){
var included = obj.included;
for(var i in obj){
klass.fn[i] = obj[i];
}
if (included) included(klass)
};
return klass;
};
var Class = function(){
var klass = function(){
this.init.apply(this, arguments);
};
klass.prototype.init = function(){};
klass.fn = klass.prototype;
klass.fn.parent = klass;
klass.extend = function(obj){
var extended = obj.extended;
for(var i in obj){
klass[i] =&nbs