proc.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. var RTL$ = {
  2. extend: function extend(methods){
  3. function Type(){
  4. for(var m in methods)
  5. this[m] = methods[m];
  6. }
  7. Type.prototype = this.prototype;
  8. var result = methods.init;
  9. result.prototype = new Type(); // inherit this.prototype
  10. result.prototype.constructor = result; // to see constructor name in diagnostic
  11. result.extend = extend;
  12. return result;
  13. }
  14. };
  15. var m = function (){
  16. function p1(arg1/*INTEGER*/){
  17. var T1 = RTL$.extend({
  18. init: function T1(){
  19. this.field1 = 0;
  20. }
  21. });
  22. var T2 = T1.extend({
  23. init: function T2(){
  24. T1.prototype.init.call(this);
  25. this.field2 = false;
  26. }
  27. });
  28. var i = 0;var j = 0;
  29. var b = false;
  30. var t1 = new T1();
  31. var t2 = new T2();
  32. i = arg1 + 1 | 0;
  33. t1.field1 = i;
  34. t2.field1 = t1.field1;
  35. b = true;
  36. t2.field2 = b;
  37. }
  38. function p2(){
  39. p1(123);
  40. }
  41. function p3(i/*INTEGER*/){
  42. p1(123);
  43. p2();
  44. p2();
  45. return 123;
  46. }
  47. function p4(){
  48. return p3(123) + p3(p3(123)) | 0;
  49. }
  50. function p5(){
  51. return p5;
  52. }
  53. function emptyBegin(){
  54. }
  55. function emptyBeginWithReturn(){
  56. return 0;
  57. }
  58. }();