bind chain optimizations
This commit is contained in:
+21
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user