From 90fb255bb8b975d2c2d999e1bfaccd6cca6cafce Mon Sep 17 00:00:00 2001 From: dhrname Date: Tue, 14 Jan 2014 23:05:42 +0900 Subject: [PATCH] =?utf8?q?mix=E3=83=A1=E3=82=BD=E3=83=83=E3=83=89=E3=81=AE?= =?utf8?q?=E8=BB=BD=E9=87=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- tool/funcproto/base.js | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/tool/funcproto/base.js b/tool/funcproto/base.js index 3cee86c..39318d1 100644 --- a/tool/funcproto/base.js +++ b/tool/funcproto/base.js @@ -30,22 +30,34 @@ function base(name) { this.__id_ = null; -base.__gl_ = this; //ƒOƒ[ƒoƒ‹•Ï” +(function(){ + /*mixƒƒ\ƒbƒh‚ÅŽg‚¤NGƒnƒbƒVƒ…‚ðì¬*/ + var hash = {}, + proto = Object.prototype; + for (var i in this) { + hash[i] = true; + } + for (var i in proto) { + hash[i] = true; + } + base.__ng_ = hash; +})(); base.mix = function(obj) { if (!arguments[0]) { throw new Error("No arguments errror"); } if (typeof obj !== "function") { - var proto = Object.prototype, - alias = base; + var alias = base; for (var i in obj) { - /*hasOwnPropertyƒƒ\ƒbƒh‚ðŽg‚í‚È‚¢‚̂́Aƒvƒƒgƒ^ƒCƒvƒ`ƒF[ƒ“‚ð‚½‚Ç‚é‚悤‚É‚·‚邽‚ß*/ - if (!proto[i] && !alias.__gl_[i]) { + /*hasOwnPropertyƒƒ\ƒbƒh‚ðŽg‚í‚È‚¢‚̂́Aƒvƒƒgƒ^ƒCƒvƒ`ƒF[ƒ“‚ð‚½‚Ç‚é‚悤‚É‚·‚邽‚ß + *‚È‚¨AprotoiŠî‘bƒIƒuƒWƒFƒNƒg)‚Æalias(ƒOƒ[ƒoƒ‹ƒIƒuƒWƒFƒNƒg)‚̃vƒƒpƒeƒB‚È‚Ç‚ÍŠO‚µ‚½•û‚ªƒGƒ‰[‚ª‚¨‚«‚É‚­‚¢ + */ + if (!alias.__ng_[i]) { this[i] = obj[i]; } } - i = proto = alias = void 0; + i = alias = void 0; } else { obj.call(this); } -- 2.11.0