constructor.js 657 B

1234567891011121314151617181920212223242526272829303132
  1. var RTL$ = {
  2. extend: function (cons, base){
  3. function Type(){}
  4. Type.prototype = base.prototype;
  5. cons.prototype = new Type();
  6. cons.prototype.constructor = cons;
  7. }
  8. };
  9. var m = function (){
  10. function T(){
  11. }
  12. function Derived(){
  13. T.call(this);
  14. }
  15. RTL$.extend(Derived, T);
  16. function RecordWithField(){
  17. this.i = 0;
  18. }
  19. function RecordWithFieldDerived(){
  20. T.call(this);
  21. }
  22. RTL$.extend(RecordWithFieldDerived, T);
  23. function passAsArgument(o/*T*/){
  24. }
  25. function RecordWithParamConstructor(a/*INTEGER*/){
  26. }
  27. passAsArgument(new T());
  28. var r = new T();
  29. var i = new RecordWithField().i;
  30. var rParam = new RecordWithParamConstructor(123);
  31. }();