Fixed inheritance issue for bindAll and unbindAll

This commit is contained in:
sinnus
2017-12-15 16:07:15 +03:00
parent 2ca2c1f46e
commit deb69b00f3
2 changed files with 54 additions and 21 deletions
+25
View File
@@ -36,6 +36,31 @@ class InheritanceTest extends BuddySuite {
bp.i = 2;
callNum.should.be(3);
});
it("bindx should support class inheritance for bindAll", function () {
b.s = "a";
Bind.bindAll(b, function (_, _, _) callNum++, true);
b.s = "b";
callNum.should.be(1);
b.i = 1;
callNum.should.be(2);
});
it("bindx should support class inheritance for unbindAll", function () {
b.i = 1;
b.s = "a";
Bind.bind(b.i, function (_, _) callNum++);
Bind.bind(b.s, function (_, _) callNum++);
b.i = 2;
b.s = "b";
callNum.should.be(2);
Bind.unbindAll(b);
b.i = 3;
b.s = "c";
callNum.should.be(2);
});
});
}
}