constructor.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <rtl code>
  2. var m = function (){
  3. RTL$.extend(Derived, T);
  4. RTL$.extend(RecordWithFieldDerived, T);
  5. RTL$.extend(DerivedRecordWithParamConstructor, RecordWithParamConstructor);
  6. RTL$.extend(DerivedRecordWithParamConstructorBaseWithNoParameters, T);
  7. function DerivedRecordWithParamConstructorWithoutConstructor(){
  8. RecordWithParamConstructor.apply(this, arguments);
  9. }
  10. RTL$.extend(DerivedRecordWithParamConstructorWithoutConstructor, RecordWithParamConstructor);
  11. function MixAutoAndManualInitFields(){
  12. this.iAuto = 0;
  13. this.iManual = 123;
  14. this.rAuto = new T();
  15. this.rManual = new RecordWithParamConstructor(345);
  16. this.setManual = 8;
  17. this.stringAuto = '';
  18. }
  19. function UsingSelfInFieldsInit(){
  20. this.i1 = 123;
  21. this.i2 = this.i1;
  22. }
  23. function FieldInitAndBody(){
  24. this.i = 1;
  25. this.i = 2;
  26. }
  27. function T(){
  28. }
  29. function Derived(){
  30. T.call(this);
  31. }
  32. function RecordWithField(){
  33. this.i = 0;
  34. }
  35. function RecordWithFieldDerived(){
  36. T.call(this);
  37. }
  38. function passAsArgument(o/*T*/){
  39. }
  40. function RecordWithParamConstructor(a/*INTEGER*/){
  41. }
  42. function DerivedRecordWithParamConstructor(){
  43. RecordWithParamConstructor.call(this, 123);
  44. }
  45. function DerivedRecordWithParamConstructorBaseWithNoParameters(a/*INTEGER*/){
  46. T.call(this);
  47. }
  48. function InitializeField(){
  49. this.i = 123;
  50. }
  51. function InitializeRecordField(){
  52. this.r = new RecordWithParamConstructor(123);
  53. }
  54. function InitializeMangledField(){
  55. this.constructor$ = 123;
  56. this.prototype$ = true;
  57. }
  58. passAsArgument(new T());
  59. var r = new T();
  60. var i = new RecordWithField().i;
  61. var rParam = new RecordWithParamConstructor(123);
  62. var derived = new DerivedRecordWithParamConstructorWithoutConstructor(123);
  63. }();