Kernel-Transcript.js 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. smalltalk.addPackage('Kernel-Transcript');
  2. smalltalk.addClass('ConsoleTranscript', smalltalk.Object, ['textarea'], 'Kernel-Transcript');
  3. smalltalk.addMethod(
  4. smalltalk.method({
  5. selector: "clear",
  6. category: 'printing',
  7. fn: function (){
  8. var self=this;
  9. return smalltalk.withContext(function($ctx1) {
  10. return self}, function($ctx1) {$ctx1.fill(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. smalltalk.method({
  19. selector: "cr",
  20. category: 'printing',
  21. fn: function (){
  22. var self=this;
  23. return smalltalk.withContext(function($ctx1) {
  24. return self}, function($ctx1) {$ctx1.fill(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. smalltalk.method({
  33. selector: "open",
  34. category: 'actions',
  35. fn: function (){
  36. var self=this;
  37. return smalltalk.withContext(function($ctx1) {
  38. return self}, function($ctx1) {$ctx1.fill(self,"open",{},smalltalk.ConsoleTranscript)})},
  39. args: [],
  40. source: "open",
  41. messageSends: [],
  42. referencedClasses: []
  43. }),
  44. smalltalk.ConsoleTranscript);
  45. smalltalk.addMethod(
  46. smalltalk.method({
  47. selector: "show:",
  48. category: 'printing',
  49. fn: function (anObject){
  50. var self=this;
  51. return smalltalk.withContext(function($ctx1) {
  52. console.log(String(string._asString()));
  53. return self}, function($ctx1) {$ctx1.fill(self,"show:",{anObject:anObject},smalltalk.ConsoleTranscript)})},
  54. args: ["anObject"],
  55. source: "show: anObject\x0a\x09<console.log(String(string._asString()))>",
  56. messageSends: [],
  57. referencedClasses: []
  58. }),
  59. smalltalk.ConsoleTranscript);
  60. smalltalk.addMethod(
  61. smalltalk.method({
  62. selector: "initialize",
  63. category: 'initialization',
  64. fn: function (){
  65. var self=this;
  66. function $Transcript(){return smalltalk.Transcript||(typeof Transcript=="undefined"?nil:Transcript)}
  67. return smalltalk.withContext(function($ctx1) {
  68. _st($Transcript())._register_(_st(self)._new());
  69. return self}, function($ctx1) {$ctx1.fill(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. smalltalk.method({
  80. selector: "clear",
  81. category: 'printing',
  82. fn: function (){
  83. var self=this;
  84. return smalltalk.withContext(function($ctx1) {
  85. _st(_st(self)._current())._clear();
  86. return self}, function($ctx1) {$ctx1.fill(self,"clear",{},smalltalk.Transcript.klass)})},
  87. args: [],
  88. source: "clear\x0a\x09self current clear",
  89. messageSends: ["clear", "current"],
  90. referencedClasses: []
  91. }),
  92. smalltalk.Transcript.klass);
  93. smalltalk.addMethod(
  94. smalltalk.method({
  95. selector: "cr",
  96. category: 'printing',
  97. fn: function (){
  98. var self=this;
  99. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  100. return smalltalk.withContext(function($ctx1) {
  101. _st(_st(self)._current())._show_(_st($String())._cr());
  102. return self}, function($ctx1) {$ctx1.fill(self,"cr",{},smalltalk.Transcript.klass)})},
  103. args: [],
  104. source: "cr\x0a\x09self current show: String cr",
  105. messageSends: ["show:", "cr", "current"],
  106. referencedClasses: ["String"]
  107. }),
  108. smalltalk.Transcript.klass);
  109. smalltalk.addMethod(
  110. smalltalk.method({
  111. selector: "current",
  112. category: 'instance creation',
  113. fn: function (){
  114. var self=this;
  115. return smalltalk.withContext(function($ctx1) {
  116. var $1;
  117. $1=self["@current"];
  118. return $1;
  119. }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.Transcript.klass)})},
  120. args: [],
  121. source: "current\x0a\x09^current",
  122. messageSends: [],
  123. referencedClasses: []
  124. }),
  125. smalltalk.Transcript.klass);
  126. smalltalk.addMethod(
  127. smalltalk.method({
  128. selector: "new",
  129. category: 'instance creation',
  130. fn: function (){
  131. var self=this;
  132. return smalltalk.withContext(function($ctx1) {
  133. _st(self)._shouldNotImplement();
  134. return self}, function($ctx1) {$ctx1.fill(self,"new",{},smalltalk.Transcript.klass)})},
  135. args: [],
  136. source: "new\x0a\x09self shouldNotImplement",
  137. messageSends: ["shouldNotImplement"],
  138. referencedClasses: []
  139. }),
  140. smalltalk.Transcript.klass);
  141. smalltalk.addMethod(
  142. smalltalk.method({
  143. selector: "open",
  144. category: 'instance creation',
  145. fn: function (){
  146. var self=this;
  147. return smalltalk.withContext(function($ctx1) {
  148. _st(_st(self)._current())._open();
  149. return self}, function($ctx1) {$ctx1.fill(self,"open",{},smalltalk.Transcript.klass)})},
  150. args: [],
  151. source: "open\x0a\x09self current open",
  152. messageSends: ["open", "current"],
  153. referencedClasses: []
  154. }),
  155. smalltalk.Transcript.klass);
  156. smalltalk.addMethod(
  157. smalltalk.method({
  158. selector: "register:",
  159. category: 'instance creation',
  160. fn: function (aTranscript){
  161. var self=this;
  162. return smalltalk.withContext(function($ctx1) {
  163. self["@current"]=aTranscript;
  164. return self}, function($ctx1) {$ctx1.fill(self,"register:",{aTranscript:aTranscript},smalltalk.Transcript.klass)})},
  165. args: ["aTranscript"],
  166. source: "register: aTranscript\x0a\x09current := aTranscript",
  167. messageSends: [],
  168. referencedClasses: []
  169. }),
  170. smalltalk.Transcript.klass);
  171. smalltalk.addMethod(
  172. smalltalk.method({
  173. selector: "show:",
  174. category: 'printing',
  175. fn: function (anObject){
  176. var self=this;
  177. return smalltalk.withContext(function($ctx1) {
  178. _st(_st(self)._current())._show_(anObject);
  179. return self}, function($ctx1) {$ctx1.fill(self,"show:",{anObject:anObject},smalltalk.Transcript.klass)})},
  180. args: ["anObject"],
  181. source: "show: anObject\x0a\x09self current show: anObject",
  182. messageSends: ["show:", "current"],
  183. referencedClasses: []
  184. }),
  185. smalltalk.Transcript.klass);