示例#1
0
 otherType:function(b) {
     var b2 = new mod.Base;
     assert.equal(b.otherType(b2), "Base");
     assert.equal(b2.otherType(b), "Derived");
     assert.equal(b.otherTypeDerived(b), "Derived");
     assert.throws(function() { b.otherTypeDerived(new mod.Base); });
 }
示例#2
0
 otherType:function(b) {
     var b2 = new mod.Base;
     assert.equal(b.otherType(b2), "Base");
     assert.equal(b2.otherType(b), "Base");
     assert.throws(function() { b.otherType(undefined); });
     assert.throws(function() { b.otherType({}); });
     assert.throws(function() { b.otherType(new mod.Base2); });
 }
示例#3
0
 otherType:function(b) {
     var b2 = new mod.Base;
     assert.equal(b.otherType(b2), "Base");
     assert.equal(b2.otherType(b), "ReDerived");
 }