2
0

Kernel-Transcript.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. smalltalk.addPackage('Kernel-Transcript', {});
  2. smalltalk.addClass('ConsoleTranscript', smalltalk.Object, ['textarea'], 'Kernel-Transcript');
  3. smalltalk.addMethod(
  4. "_clear",
  5. smalltalk.method({
  6. selector: "clear",
  7. category: 'printing',
  8. fn: function (){
  9. var self=this;
  10. return self;},
  11. args: [],
  12. source: "clear\x0a\x09\x22no op\x22",
  13. messageSends: [],
  14. referencedClasses: []
  15. }),
  16. smalltalk.ConsoleTranscript);
  17. smalltalk.addMethod(
  18. "_cr",
  19. smalltalk.method({
  20. selector: "cr",
  21. category: 'printing',
  22. fn: function (){
  23. var self=this;
  24. return self;},
  25. args: [],
  26. source: "cr\x0a\x09\x22no op\x22",
  27. messageSends: [],
  28. referencedClasses: []
  29. }),
  30. smalltalk.ConsoleTranscript);
  31. smalltalk.addMethod(
  32. "_open",
  33. smalltalk.method({
  34. selector: "open",
  35. category: 'actions',
  36. fn: function (){
  37. var self=this;
  38. return self;},
  39. args: [],
  40. source: "open",
  41. messageSends: [],
  42. referencedClasses: []
  43. }),
  44. smalltalk.ConsoleTranscript);
  45. smalltalk.addMethod(
  46. "_show_",
  47. smalltalk.method({
  48. selector: "show:",
  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: "show: anObject\x0a\x09| string |\x0a\x09string := anObject asString.\x0a\x09<console.log(String(string))>",
  58. messageSends: ["asString"],
  59. referencedClasses: []
  60. }),
  61. smalltalk.ConsoleTranscript);
  62. smalltalk.addMethod(
  63. "_initialize",
  64. smalltalk.method({
  65. selector: "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: "initialize\x0a\x09Transcript register: self new",
  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. "_clear",
  81. smalltalk.method({
  82. selector: "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: "clear\x0a self current clear",
  90. messageSends: ["clear", "current"],
  91. referencedClasses: []
  92. }),
  93. smalltalk.Transcript.klass);
  94. smalltalk.addMethod(
  95. "_cr",
  96. smalltalk.method({
  97. selector: "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: "cr\x0a self current show: String cr",
  105. messageSends: ["show:", "current", "cr"],
  106. referencedClasses: ["String"]
  107. }),
  108. smalltalk.Transcript.klass);
  109. smalltalk.addMethod(
  110. "_current",
  111. smalltalk.method({
  112. selector: "current",
  113. category: 'instance creation',
  114. fn: function (){
  115. var self=this;
  116. return self['@current'];
  117. return self;},
  118. args: [],
  119. source: "current\x0a ^current",
  120. messageSends: [],
  121. referencedClasses: []
  122. }),
  123. smalltalk.Transcript.klass);
  124. smalltalk.addMethod(
  125. "_new",
  126. smalltalk.method({
  127. selector: "new",
  128. category: 'instance creation',
  129. fn: function (){
  130. var self=this;
  131. smalltalk.send(self, "_shouldNotImplement", []);
  132. return self;},
  133. args: [],
  134. source: "new\x0a self shouldNotImplement",
  135. messageSends: ["shouldNotImplement"],
  136. referencedClasses: []
  137. }),
  138. smalltalk.Transcript.klass);
  139. smalltalk.addMethod(
  140. "_open",
  141. smalltalk.method({
  142. selector: "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: "open\x0a self current open",
  150. messageSends: ["open", "current"],
  151. referencedClasses: []
  152. }),
  153. smalltalk.Transcript.klass);
  154. smalltalk.addMethod(
  155. "_register_",
  156. smalltalk.method({
  157. selector: "register:",
  158. category: 'instance creation',
  159. fn: function (aTranscript){
  160. var self=this;
  161. (self['@current']=aTranscript);
  162. return self;},
  163. args: ["aTranscript"],
  164. source: "register: aTranscript\x0a\x09current := aTranscript",
  165. messageSends: [],
  166. referencedClasses: []
  167. }),
  168. smalltalk.Transcript.klass);
  169. smalltalk.addMethod(
  170. "_show_",
  171. smalltalk.method({
  172. selector: "show:",
  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: "show: anObject\x0a self current show: anObject",
  180. messageSends: ["show:", "current"],
  181. referencedClasses: []
  182. }),
  183. smalltalk.Transcript.klass);