您的位置:首页 > 编程语言

Douglas Crockford 的 源代码

2011-07-03 12:53 288 查看
Function.method('inherits', function(parent) {
var depth = 0;
var proto = this.prototype = new parent();
this.method('uber', function uber(name) {
var func; var ret; var v = parent.prototype;
if (depth) {
for ( var i = d; i > 0; i += 1 ) {
v = v.constructor.prototype;
}
func = v[name];
}
else {
func = proto[name];
if ( func == this[name] ) {
func = v[name];
}
}
depth += 1;
ret = func.apply(this, Array.prototype.slice.apply(arguments, [1]));
depth -= 1;
return ret;
});
return this;
});
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: