2
0

Kernel-Transcript.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. smalltalk.addPackage('Kernel-Transcript', {});
  2. smalltalk.addClass('Transcript', smalltalk.Object, ['textarea'], 'Kernel-Transcript');
  3. smalltalk.Transcript.klass.iVarNames = ['current'];
  4. smalltalk.addMethod(
  5. unescape('_open'),
  6. smalltalk.method({
  7. selector: unescape('open'),
  8. category: 'instance creation',
  9. fn: function (){
  10. var self=this;
  11. smalltalk.send(smalltalk.send(self, "_current", []), "_open", []);
  12. return self;},
  13. args: [],
  14. source: unescape('open%0A%20%20%20%20self%20current%20open'),
  15. messageSends: ["open", "current"],
  16. referencedClasses: []
  17. }),
  18. smalltalk.Transcript.klass);
  19. smalltalk.addMethod(
  20. unescape('_new'),
  21. smalltalk.method({
  22. selector: unescape('new'),
  23. category: 'instance creation',
  24. fn: function (){
  25. var self=this;
  26. smalltalk.send(self, "_shouldNotImplement", []);
  27. return self;},
  28. args: [],
  29. source: unescape('new%0A%20%20%20%20self%20shouldNotImplement'),
  30. messageSends: ["shouldNotImplement"],
  31. referencedClasses: []
  32. }),
  33. smalltalk.Transcript.klass);
  34. smalltalk.addMethod(
  35. unescape('_current'),
  36. smalltalk.method({
  37. selector: unescape('current'),
  38. category: 'instance creation',
  39. fn: function (){
  40. var self=this;
  41. return self['@current'];
  42. return self;},
  43. args: [],
  44. source: unescape('current%0A%20%20%20%20%5Ecurrent'),
  45. messageSends: [],
  46. referencedClasses: []
  47. }),
  48. smalltalk.Transcript.klass);
  49. smalltalk.addMethod(
  50. unescape('_show_'),
  51. smalltalk.method({
  52. selector: unescape('show%3A'),
  53. category: 'printing',
  54. fn: function (anObject){
  55. var self=this;
  56. smalltalk.send(smalltalk.send(self, "_current", []), "_show_", [anObject]);
  57. return self;},
  58. args: ["anObject"],
  59. source: unescape('show%3A%20anObject%0A%20%20%20%20self%20current%20show%3A%20anObject'),
  60. messageSends: ["show:", "current"],
  61. referencedClasses: []
  62. }),
  63. smalltalk.Transcript.klass);
  64. smalltalk.addMethod(
  65. unescape('_cr'),
  66. smalltalk.method({
  67. selector: unescape('cr'),
  68. category: 'printing',
  69. fn: function (){
  70. var self=this;
  71. smalltalk.send(smalltalk.send(self, "_current", []), "_show_", [smalltalk.send((smalltalk.String || String), "_cr", [])]);
  72. return self;},
  73. args: [],
  74. source: unescape('cr%0A%20%20%20%20self%20current%20show%3A%20String%20cr'),
  75. messageSends: ["show:", "current", "cr"],
  76. referencedClasses: ["String"]
  77. }),
  78. smalltalk.Transcript.klass);
  79. smalltalk.addMethod(
  80. unescape('_clear'),
  81. smalltalk.method({
  82. selector: unescape('clear'),
  83. category: 'printing',
  84. fn: function (){
  85. var self=this;
  86. smalltalk.send(smalltalk.send(self, "_current", []), "_clear", []);
  87. return self;},
  88. args: [],
  89. source: unescape('clear%0A%20%20%20%20self%20current%20clear'),
  90. messageSends: ["clear", "current"],
  91. referencedClasses: []
  92. }),
  93. smalltalk.Transcript.klass);
  94. smalltalk.addMethod(
  95. unescape('_register_'),
  96. smalltalk.method({
  97. selector: unescape('register%3A'),
  98. category: 'instance creation',
  99. fn: function (aTranscript){
  100. var self=this;
  101. (self['@current']=aTranscript);
  102. return self;},
  103. args: ["aTranscript"],
  104. source: unescape('register%3A%20aTranscript%0A%09current%20%3A%3D%20aTranscript'),
  105. messageSends: [],
  106. referencedClasses: []
  107. }),
  108. smalltalk.Transcript.klass);
  109. smalltalk.addClass('ConsoleTranscript', smalltalk.Object, ['textarea'], 'Kernel-Transcript');
  110. smalltalk.addMethod(
  111. unescape('_clear'),
  112. smalltalk.method({
  113. selector: unescape('clear'),
  114. category: 'printing',
  115. fn: function (){
  116. var self=this;
  117. return self;},
  118. args: [],
  119. source: unescape('clear%0A%09%22no%20op%22'),
  120. messageSends: [],
  121. referencedClasses: []
  122. }),
  123. smalltalk.ConsoleTranscript);
  124. smalltalk.addMethod(
  125. unescape('_cr'),
  126. smalltalk.method({
  127. selector: unescape('cr'),
  128. category: 'printing',
  129. fn: function (){
  130. var self=this;
  131. return self;},
  132. args: [],
  133. source: unescape('cr%0A%09%22no%20op%22'),
  134. messageSends: [],
  135. referencedClasses: []
  136. }),
  137. smalltalk.ConsoleTranscript);
  138. smalltalk.addMethod(
  139. unescape('_show_'),
  140. smalltalk.method({
  141. selector: unescape('show%3A'),
  142. category: 'printing',
  143. fn: function (anObject){
  144. var self=this;
  145. var string=nil;
  146. (string=smalltalk.send(anObject, "_asString", []));
  147. console.log(String(string));
  148. return self;},
  149. args: ["anObject"],
  150. source: unescape('show%3A%20anObject%0A%09%7C%20string%20%7C%0A%09string%20%3A%3D%20anObject%20asString.%0A%09%3Cconsole.log%28String%28string%29%29%3E'),
  151. messageSends: ["asString"],
  152. referencedClasses: []
  153. }),
  154. smalltalk.ConsoleTranscript);
  155. smalltalk.addMethod(
  156. unescape('_open'),
  157. smalltalk.method({
  158. selector: unescape('open'),
  159. category: 'actions',
  160. fn: function (){
  161. var self=this;
  162. return self;},
  163. args: [],
  164. source: unescape('open'),
  165. messageSends: [],
  166. referencedClasses: []
  167. }),
  168. smalltalk.ConsoleTranscript);
  169. smalltalk.addMethod(
  170. unescape('_initialize'),
  171. smalltalk.method({
  172. selector: unescape('initialize'),
  173. category: 'initialization',
  174. fn: function (){
  175. var self=this;
  176. smalltalk.send((smalltalk.Transcript || Transcript), "_register_", [smalltalk.send(self, "_new", [])]);
  177. return self;},
  178. args: [],
  179. source: unescape('initialize%0A%09Transcript%20register%3A%20self%20new'),
  180. messageSends: ["register:", "new"],
  181. referencedClasses: ["Transcript"]
  182. }),
  183. smalltalk.ConsoleTranscript.klass);