From 86b4b32354991561c9974cf7c719e6d08afb460c Mon Sep 17 00:00:00 2001 From: dhrname Date: Sat, 1 Mar 2014 23:54:29 +0900 Subject: [PATCH] =?utf8?q?base=E9=96=A2=E6=95=B0=E5=86=85=E9=83=A8?= =?utf8?q?=E3=81=AE=E3=82=B3=E3=83=B3=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF?= =?utf8?q?=E3=82=BF=E9=96=A2=E6=95=B0=E3=82=92=E4=B8=80=E3=81=A4=E3=81=AB?= =?utf8?q?=E7=B5=B1=E4=B8=80=E3=81=97=E3=81=A6=E3=80=81=E9=AB=98=E9=80=9F?= =?utf8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- tool/funcproto/FuncSpecRunner.html | 13 +++++++++++++ tool/funcproto/base.js | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/tool/funcproto/FuncSpecRunner.html b/tool/funcproto/FuncSpecRunner.html index fe3947c..5377a6a 100644 --- a/tool/funcproto/FuncSpecRunner.html +++ b/tool/funcproto/FuncSpecRunner.html @@ -277,6 +277,15 @@ describe("base.js", function() { expect(base("$a").a).toBe("hogehoge"); expect(base("$a").b.d).toEqual(0); expect(base("$a").c()).toBe("hogehogehoge"); + + for (var i=0, arr = [];i<500;++i) { + arr.push(i); + } + for (i=0;i<100;++i) { + base("$a").mix(arr); + } + expect(base("$a")[0]).toEqual(0); + expect(base("$a")[499]).toEqual(499); }); it("an up method", function() { @@ -315,6 +324,10 @@ describe("base.js", function() { expect(this.$1.bb).toEqual(15); }); + for (var i=0;i<5000;++i) { + base("$c").up("$dd"); + } + expect(base("$c").$dd.hoge).toEqual(12); }); it("a mix method function", function() { diff --git a/tool/funcproto/base.js b/tool/funcproto/base.js index cb6a66c..6522912 100644 --- a/tool/funcproto/base.js +++ b/tool/funcproto/base.js @@ -9,7 +9,7 @@ function base(name) { /*upƒƒ\ƒbƒh‚ŌĂ΂ê‚Ä‚¨‚炸A‚©‚Aid“o˜^‚³‚ê‚Ä‚¢‚éê‡‚́A“o˜^‚³‚ꂽƒIƒuƒWƒFƒNƒg‚ð•Ô‚·*/ return this[name]; } else { - var F = function() {}, + var F = base.F, s; F.prototype = this; s = new F(); @@ -30,6 +30,7 @@ function base(name) { }; this.__id_ = null; +base.F = function() {}; (function(){ /*mixƒƒ\ƒbƒh‚ÅŽg‚¤NGƒnƒbƒVƒ…‚ðì¬*/ -- 2.11.0