is.js 489 B

123456789101112131415161718192021222324252627
  1. <rtl code>
  2. var m = function (){
  3. function Base(){
  4. }
  5. function Derived1(){
  6. Base.call(this);
  7. this.field1 = 0;
  8. }
  9. RTL$.extend(Derived1, Base);
  10. function Derived2(){
  11. Derived1.call(this);
  12. this.field2 = 0;
  13. }
  14. RTL$.extend(Derived2, Derived1);
  15. var pb = null;
  16. var pd1 = null;
  17. var pd2 = null;
  18. var b = false;
  19. pd2 = new Derived2();
  20. pb = pd2;
  21. pd1 = pd2;
  22. b = pb instanceof Derived1;
  23. b = pb instanceof Derived1;
  24. b = pb instanceof Derived2;
  25. b = pd1 instanceof Derived2;
  26. b = !(pb instanceof Derived1);
  27. }();