bind chain optimizations

This commit is contained in:
Dima Granetchi
2014-11-21 00:58:36 +02:00
parent b72dad5b60
commit ddc85fe9a7
2 changed files with 36 additions and 31 deletions
+21 -1
View File
@@ -63,9 +63,25 @@ class ChainBindTest extends BuddySuite {
b.c.nc.c.f("tada").d = val = "b";
callNum.should.be(2);
b2.c.nc.c.f("tada").d = val = "c";
var t = b.c;
b.c = b2.c;
callNum.should.be(3);
val = t.nc.c.f("tada").d;
b.c = t;
callNum.should.be(4);
b2.c.nc.c.f("tada").d = val = "d";
b.c.nc.c = b2.c.nc.c;
callNum.should.be(5);
unbind();
b.c.nc.c.f("tada").d = "c";
callNum.should.be(2);
callNum.should.be(5);
});
it("BindExt.chain should bind chain changes (double gap)", {
@@ -119,6 +135,10 @@ class BindableChain implements bindx.IBindable {
return c;
}
public function nf(s:String):BindableChain {
return nc;
}
public function new(depth:Int) {
if (depth > 0) {
c = new BindableChain(depth - 1);