Kernel-Transcript.js 4.8 KB

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