From 00089fc7cedb22fce5b6423fc259e28b657fa729 Mon Sep 17 00:00:00 2001 From: zhangyunlong Date: Tue, 29 Oct 2013 12:43:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dcss=E4=B8=ADurl(xxx=20)?= =?UTF-8?q?=E4=BB=A3=E7=A0=81xx=E4=B9=8B=E5=90=8E=E6=9C=89=E7=A9=BA?= =?UTF-8?q?=E6=A0=BC=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +--- fis-kernel.js | 19 ++----------------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 8e335b1..58aa46d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ # FIS Kernel -This is fis kernel. - -这个分支用来做一些源码分析注释。 \ No newline at end of file +This is fis kernel. \ No newline at end of file diff --git a/fis-kernel.js b/fis-kernel.js index cdda0db..0b4bf6a 100644 --- a/fis-kernel.js +++ b/fis-kernel.js @@ -8,7 +8,6 @@ var last = Date.now(); //oo -var superTest = /\b_super\b/; Function.prototype.derive = function(constructor, proto){ if(typeof constructor === 'object'){ proto = constructor; @@ -21,33 +20,19 @@ Function.prototype.derive = function(constructor, proto){ constructor.apply(this, arguments); }; var tmp = function(){}; - var addSuper = function(name, fn, parent) { - return function() { - var temp = this._super; - this._super = parent[name]; - var ret = fn.apply(this, arguments); - this._super = temp; - return ret; - } - } tmp.prototype = parent.prototype; var fp = new tmp(), cp = constructor.prototype, - pp = parent.prototype, key; for(key in cp){ if(cp.hasOwnProperty(key)){ - fp[key] = - (typeof cp[key] === 'function' && typeof pp[name] === 'function' && superTest.test(cp[key])) ? addSuper(key, cp[key],pp) : - cp[key]; + fp[key] = cp[key]; } } proto = proto || {}; for(key in proto){ if(proto.hasOwnProperty(key)){ - fp[key] = - (typeof proto[key] === 'function' && (typeof cp[key] === 'function' || typeof pp[key] === 'function') && superTest.test(proto[key])) ? addSuper(key, proto[key], typeof cp[key] === 'function' ? cp : pp) : - proto[key]; + fp[key] = proto[key]; } } fp.constructor = constructor.prototype.constructor;