Kernel-Transcript.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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 smalltalk.withContext(function($ctx) { return self}, self, "clear", [], smalltalk.ConsoleTranscript)},
  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 smalltalk.withContext(function($ctx) { return self}, self, "cr", [], smalltalk.ConsoleTranscript)},
  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 smalltalk.withContext(function($ctx) { return self}, self, "open", [], smalltalk.ConsoleTranscript)},
  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. return smalltalk.withContext(function($ctx) { console.log(String(string._asString()));
  53. ;
  54. return self}, self, "show:", [anObject], smalltalk.ConsoleTranscript)},
  55. args: ["anObject"],
  56. source: "show: anObject\x0a\x09<console.log(String(string._asString()))>",
  57. messageSends: [],
  58. referencedClasses: []
  59. }),
  60. smalltalk.ConsoleTranscript);
  61. smalltalk.addMethod(
  62. "_initialize",
  63. smalltalk.method({
  64. selector: "initialize",
  65. category: 'initialization',
  66. fn: function (){
  67. var self=this;
  68. return smalltalk.withContext(function($ctx) { _st((smalltalk.Transcript || Transcript))._register_(_st(self)._new());
  69. return self}, self, "initialize", [], smalltalk.ConsoleTranscript.klass)},
  70. args: [],
  71. source: "initialize\x0a\x09Transcript register: self new",
  72. messageSends: ["register:", "new"],
  73. referencedClasses: ["Transcript"]
  74. }),
  75. smalltalk.ConsoleTranscript.klass);
  76. smalltalk.addClass('Transcript', smalltalk.Object, ['textarea'], 'Kernel-Transcript');
  77. smalltalk.Transcript.klass.iVarNames = ['current'];
  78. smalltalk.addMethod(
  79. "_clear",
  80. smalltalk.method({
  81. selector: "clear",
  82. category: 'printing',
  83. fn: function (){
  84. var self=this;
  85. return smalltalk.withContext(function($ctx) { _st(_st(self)._current())._clear();
  86. return self}, self, "clear", [], smalltalk.Transcript.klass)},
  87. args: [],
  88. source: "clear\x0a self current clear",
  89. messageSends: ["clear", "current"],
  90. referencedClasses: []
  91. }),
  92. smalltalk.Transcript.klass);
  93. smalltalk.addMethod(
  94. "_cr",
  95. smalltalk.method({
  96. selector: "cr",
  97. category: 'printing',
  98. fn: function (){
  99. var self=this;
  100. return smalltalk.withContext(function($ctx) { _st(_st(self)._current())._show_(_st((smalltalk.String || String))._cr());
  101. return self}, self, "cr", [], smalltalk.Transcript.klass)},
  102. args: [],
  103. source: "cr\x0a self current show: String cr",
  104. messageSends: ["show:", "cr", "current"],
  105. referencedClasses: ["String"]
  106. }),
  107. smalltalk.Transcript.klass);
  108. smalltalk.addMethod(
  109. "_current",
  110. smalltalk.method({
  111. selector: "current",
  112. category: 'instance creation',
  113. fn: function (){
  114. var self=this;
  115. return smalltalk.withContext(function($ctx) { return self["@current"];
  116. }, self, "current", [], smalltalk.Transcript.klass)},
  117. args: [],
  118. source: "current\x0a ^current",
  119. messageSends: [],
  120. referencedClasses: []
  121. }),
  122. smalltalk.Transcript.klass);
  123. smalltalk.addMethod(
  124. "_new",
  125. smalltalk.method({
  126. selector: "new",
  127. category: 'instance creation',
  128. fn: function (){
  129. var self=this;
  130. return smalltalk.withContext(function($ctx) { _st(self)._shouldNotImplement();
  131. return self}, self, "new", [], smalltalk.Transcript.klass)},
  132. args: [],
  133. source: "new\x0a self shouldNotImplement",
  134. messageSends: ["shouldNotImplement"],
  135. referencedClasses: []
  136. }),
  137. smalltalk.Transcript.klass);
  138. smalltalk.addMethod(
  139. "_open",
  140. smalltalk.method({
  141. selector: "open",
  142. category: 'instance creation',
  143. fn: function (){
  144. var self=this;
  145. return smalltalk.withContext(function($ctx) { _st(_st(self)._current())._open();
  146. return self}, self, "open", [], smalltalk.Transcript.klass)},
  147. args: [],
  148. source: "open\x0a self current open",
  149. messageSends: ["open", "current"],
  150. referencedClasses: []
  151. }),
  152. smalltalk.Transcript.klass);
  153. smalltalk.addMethod(
  154. "_register_",
  155. smalltalk.method({
  156. selector: "register:",
  157. category: 'instance creation',
  158. fn: function (aTranscript){
  159. var self=this;
  160. return smalltalk.withContext(function($ctx) { self["@current"]=aTranscript;
  161. return self}, self, "register:", [aTranscript], smalltalk.Transcript.klass)},
  162. args: ["aTranscript"],
  163. source: "register: aTranscript\x0a\x09current := aTranscript",
  164. messageSends: [],
  165. referencedClasses: []
  166. }),
  167. smalltalk.Transcript.klass);
  168. smalltalk.addMethod(
  169. "_show_",
  170. smalltalk.method({
  171. selector: "show:",
  172. category: 'printing',
  173. fn: function (anObject){
  174. var self=this;
  175. return smalltalk.withContext(function($ctx) { _st(_st(self)._current())._show_(anObject);
  176. return self}, self, "show:", [anObject], smalltalk.Transcript.klass)},
  177. args: ["anObject"],
  178. source: "show: anObject\x0a self current show: anObject",
  179. messageSends: ["show:", "current"],
  180. referencedClasses: []
  181. }),
  182. smalltalk.Transcript.klass);