Kernel-Transcript.deploy.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. fn: function (){
  8. var self=this;
  9. return self}
  10. }),
  11. smalltalk.ConsoleTranscript);
  12. smalltalk.addMethod(
  13. "_cr",
  14. smalltalk.method({
  15. selector: "cr",
  16. fn: function (){
  17. var self=this;
  18. return self}
  19. }),
  20. smalltalk.ConsoleTranscript);
  21. smalltalk.addMethod(
  22. "_open",
  23. smalltalk.method({
  24. selector: "open",
  25. fn: function (){
  26. var self=this;
  27. return self}
  28. }),
  29. smalltalk.ConsoleTranscript);
  30. smalltalk.addMethod(
  31. "_show_",
  32. smalltalk.method({
  33. selector: "show:",
  34. fn: function (anObject){
  35. var self=this;
  36. var string;
  37. string=smalltalk.send(anObject,"_asString",[]);
  38. console.log(String(string));
  39. ;
  40. return self}
  41. }),
  42. smalltalk.ConsoleTranscript);
  43. smalltalk.addMethod(
  44. "_initialize",
  45. smalltalk.method({
  46. selector: "initialize",
  47. fn: function (){
  48. var self=this;
  49. smalltalk.send((smalltalk.Transcript || Transcript),"_register_",[smalltalk.send(self,"_new",[])]);
  50. return self}
  51. }),
  52. smalltalk.ConsoleTranscript.klass);
  53. smalltalk.addClass('Transcript', smalltalk.Object, ['textarea'], 'Kernel-Transcript');
  54. smalltalk.Transcript.klass.iVarNames = ['current'];
  55. smalltalk.addMethod(
  56. "_clear",
  57. smalltalk.method({
  58. selector: "clear",
  59. fn: function (){
  60. var self=this;
  61. smalltalk.send(smalltalk.send(self,"_current",[]),"_clear",[]);
  62. return self}
  63. }),
  64. smalltalk.Transcript.klass);
  65. smalltalk.addMethod(
  66. "_cr",
  67. smalltalk.method({
  68. selector: "cr",
  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. }),
  74. smalltalk.Transcript.klass);
  75. smalltalk.addMethod(
  76. "_current",
  77. smalltalk.method({
  78. selector: "current",
  79. fn: function (){
  80. var self=this;
  81. return self["@current"];
  82. }
  83. }),
  84. smalltalk.Transcript.klass);
  85. smalltalk.addMethod(
  86. "_new",
  87. smalltalk.method({
  88. selector: "new",
  89. fn: function (){
  90. var self=this;
  91. smalltalk.send(self,"_shouldNotImplement",[]);
  92. return self}
  93. }),
  94. smalltalk.Transcript.klass);
  95. smalltalk.addMethod(
  96. "_open",
  97. smalltalk.method({
  98. selector: "open",
  99. fn: function (){
  100. var self=this;
  101. smalltalk.send(smalltalk.send(self,"_current",[]),"_open",[]);
  102. return self}
  103. }),
  104. smalltalk.Transcript.klass);
  105. smalltalk.addMethod(
  106. "_register_",
  107. smalltalk.method({
  108. selector: "register:",
  109. fn: function (aTranscript){
  110. var self=this;
  111. self["@current"]=aTranscript;
  112. return self}
  113. }),
  114. smalltalk.Transcript.klass);
  115. smalltalk.addMethod(
  116. "_show_",
  117. smalltalk.method({
  118. selector: "show:",
  119. fn: function (anObject){
  120. var self=this;
  121. smalltalk.send(smalltalk.send(self,"_current",[]),"_show_",[anObject]);
  122. return self}
  123. }),
  124. smalltalk.Transcript.klass);