Kernel-Transcript.deploy.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. smalltalk.addPackage('Kernel-Transcript', {});
  2. smalltalk.addClass('Transcript', smalltalk.Object, ['textarea'], 'Kernel-Transcript');
  3. smalltalk.Transcript.klass.iVarNames = ['current'];
  4. smalltalk.addMethod(
  5. '_open',
  6. smalltalk.method({
  7. selector: 'open',
  8. fn: function (){
  9. var self=this;
  10. smalltalk.send(smalltalk.send(self, "_current", []), "_open", []);
  11. return self;}
  12. }),
  13. smalltalk.Transcript.klass);
  14. smalltalk.addMethod(
  15. '_new',
  16. smalltalk.method({
  17. selector: 'new',
  18. fn: function (){
  19. var self=this;
  20. smalltalk.send(self, "_shouldNotImplement", []);
  21. return self;}
  22. }),
  23. smalltalk.Transcript.klass);
  24. smalltalk.addMethod(
  25. '_current',
  26. smalltalk.method({
  27. selector: 'current',
  28. fn: function (){
  29. var self=this;
  30. return self['@current'];
  31. return self;}
  32. }),
  33. smalltalk.Transcript.klass);
  34. smalltalk.addMethod(
  35. '_show_',
  36. smalltalk.method({
  37. selector: 'show:',
  38. fn: function (anObject){
  39. var self=this;
  40. smalltalk.send(smalltalk.send(self, "_current", []), "_show_", [anObject]);
  41. return self;}
  42. }),
  43. smalltalk.Transcript.klass);
  44. smalltalk.addMethod(
  45. '_cr',
  46. smalltalk.method({
  47. selector: 'cr',
  48. fn: function (){
  49. var self=this;
  50. smalltalk.send(smalltalk.send(self, "_current", []), "_show_", [smalltalk.send((smalltalk.String || String), "_cr", [])]);
  51. return self;}
  52. }),
  53. smalltalk.Transcript.klass);
  54. smalltalk.addMethod(
  55. '_clear',
  56. smalltalk.method({
  57. selector: 'clear',
  58. fn: function (){
  59. var self=this;
  60. smalltalk.send(smalltalk.send(self, "_current", []), "_clear", []);
  61. return self;}
  62. }),
  63. smalltalk.Transcript.klass);
  64. smalltalk.addMethod(
  65. '_register_',
  66. smalltalk.method({
  67. selector: 'register:',
  68. fn: function (aTranscript){
  69. var self=this;
  70. self['@current']=aTranscript;
  71. return self;}
  72. }),
  73. smalltalk.Transcript.klass);
  74. smalltalk.addClass('ConsoleTranscript', smalltalk.Object, ['textarea'], 'Kernel-Transcript');
  75. smalltalk.addMethod(
  76. '_clear',
  77. smalltalk.method({
  78. selector: 'clear',
  79. fn: function (){
  80. var self=this;
  81. return self;}
  82. }),
  83. smalltalk.ConsoleTranscript);
  84. smalltalk.addMethod(
  85. '_cr',
  86. smalltalk.method({
  87. selector: 'cr',
  88. fn: function (){
  89. var self=this;
  90. return self;}
  91. }),
  92. smalltalk.ConsoleTranscript);
  93. smalltalk.addMethod(
  94. '_show_',
  95. smalltalk.method({
  96. selector: 'show:',
  97. fn: function (anObject){
  98. var self=this;
  99. var string=nil;
  100. string=smalltalk.send(anObject, "_asString", []);
  101. console.log(String(string));
  102. return self;}
  103. }),
  104. smalltalk.ConsoleTranscript);
  105. smalltalk.addMethod(
  106. '_open',
  107. smalltalk.method({
  108. selector: 'open',
  109. fn: function (){
  110. var self=this;
  111. return self;}
  112. }),
  113. smalltalk.ConsoleTranscript);
  114. smalltalk.addMethod(
  115. '_initialize',
  116. smalltalk.method({
  117. selector: 'initialize',
  118. fn: function (){
  119. var self=this;
  120. smalltalk.send((smalltalk.Transcript || Transcript), "_register_", [smalltalk.send(self, "_new", [])]);
  121. return self;}
  122. }),
  123. smalltalk.ConsoleTranscript.klass);