2
0

Kernel-Announcements.deploy.js 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. smalltalk.addPackage('Kernel-Announcements', {});
  2. smalltalk.addClass('AnnouncementSubscription', smalltalk.Object, ['block', 'announcementClass'], 'Kernel-Announcements');
  3. smalltalk.addMethod(
  4. "_announcementClass",
  5. smalltalk.method({
  6. selector: "announcementClass",
  7. fn: function (){
  8. var self=this;
  9. return smalltalk.withContext(function($ctx1) { var $1;
  10. $1=self["@announcementClass"];
  11. return $1;
  12. }, function($ctx1) {$ctx1.fill(self,"announcementClass",{}, smalltalk.AnnouncementSubscription)})}
  13. }),
  14. smalltalk.AnnouncementSubscription);
  15. smalltalk.addMethod(
  16. "_announcementClass_",
  17. smalltalk.method({
  18. selector: "announcementClass:",
  19. fn: function (aClass){
  20. var self=this;
  21. return smalltalk.withContext(function($ctx1) { self["@announcementClass"]=aClass;
  22. return self}, function($ctx1) {$ctx1.fill(self,"announcementClass:",{aClass:aClass}, smalltalk.AnnouncementSubscription)})}
  23. }),
  24. smalltalk.AnnouncementSubscription);
  25. smalltalk.addMethod(
  26. "_block",
  27. smalltalk.method({
  28. selector: "block",
  29. fn: function (){
  30. var self=this;
  31. return smalltalk.withContext(function($ctx1) { var $1;
  32. $1=self["@block"];
  33. return $1;
  34. }, function($ctx1) {$ctx1.fill(self,"block",{}, smalltalk.AnnouncementSubscription)})}
  35. }),
  36. smalltalk.AnnouncementSubscription);
  37. smalltalk.addMethod(
  38. "_block_",
  39. smalltalk.method({
  40. selector: "block:",
  41. fn: function (aBlock){
  42. var self=this;
  43. return smalltalk.withContext(function($ctx1) { self["@block"]=aBlock;
  44. return self}, function($ctx1) {$ctx1.fill(self,"block:",{aBlock:aBlock}, smalltalk.AnnouncementSubscription)})}
  45. }),
  46. smalltalk.AnnouncementSubscription);
  47. smalltalk.addMethod(
  48. "_deliver_",
  49. smalltalk.method({
  50. selector: "deliver:",
  51. fn: function (anAnnouncement){
  52. var self=this;
  53. return smalltalk.withContext(function($ctx1) { var $1;
  54. $1=_st(self)._handlesAnnouncement_(anAnnouncement);
  55. if(smalltalk.assert($1)){
  56. _st(_st(self)._block())._value_(anAnnouncement);
  57. };
  58. return self}, function($ctx1) {$ctx1.fill(self,"deliver:",{anAnnouncement:anAnnouncement}, smalltalk.AnnouncementSubscription)})}
  59. }),
  60. smalltalk.AnnouncementSubscription);
  61. smalltalk.addMethod(
  62. "_handlesAnnouncement_",
  63. smalltalk.method({
  64. selector: "handlesAnnouncement:",
  65. fn: function (anAnnouncement){
  66. var self=this;
  67. return smalltalk.withContext(function($ctx1) { var $1;
  68. $1=_st(anAnnouncement)._isKindOf_(_st(self)._announcementClass());
  69. return $1;
  70. }, function($ctx1) {$ctx1.fill(self,"handlesAnnouncement:",{anAnnouncement:anAnnouncement}, smalltalk.AnnouncementSubscription)})}
  71. }),
  72. smalltalk.AnnouncementSubscription);
  73. smalltalk.addClass('Announcer', smalltalk.Object, ['registry', 'subscriptions'], 'Kernel-Announcements');
  74. smalltalk.addMethod(
  75. "_announce_",
  76. smalltalk.method({
  77. selector: "announce:",
  78. fn: function (anAnnouncement){
  79. var self=this;
  80. return smalltalk.withContext(function($ctx1) { _st(self["@subscriptions"])._do_((function(each){
  81. return smalltalk.withContext(function($ctx2) { return _st(each)._deliver_(anAnnouncement);
  82. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  83. return self}, function($ctx1) {$ctx1.fill(self,"announce:",{anAnnouncement:anAnnouncement}, smalltalk.Announcer)})}
  84. }),
  85. smalltalk.Announcer);
  86. smalltalk.addMethod(
  87. "_initialize",
  88. smalltalk.method({
  89. selector: "initialize",
  90. fn: function (){
  91. var self=this;
  92. return smalltalk.withContext(function($ctx1) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  93. self["@subscriptions"]=_st((smalltalk.Array || Array))._new();
  94. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.Announcer)})}
  95. }),
  96. smalltalk.Announcer);
  97. smalltalk.addMethod(
  98. "_on_do_",
  99. smalltalk.method({
  100. selector: "on:do:",
  101. fn: function (aClass,aBlock){
  102. var self=this;
  103. return smalltalk.withContext(function($ctx1) { var $1,$2;
  104. $1=_st((smalltalk.AnnouncementSubscription || AnnouncementSubscription))._new();
  105. _st($1)._block_(aBlock);
  106. _st($1)._announcementClass_(aClass);
  107. $2=_st($1)._yourself();
  108. _st(self["@subscriptions"])._add_($2);
  109. return self}, function($ctx1) {$ctx1.fill(self,"on:do:",{aClass:aClass,aBlock:aBlock}, smalltalk.Announcer)})}
  110. }),
  111. smalltalk.Announcer);
  112. smalltalk.addClass('SystemAnnouncer', smalltalk.Announcer, [], 'Kernel-Announcements');
  113. smalltalk.SystemAnnouncer.klass.iVarNames = ['current'];
  114. smalltalk.addMethod(
  115. "_current",
  116. smalltalk.method({
  117. selector: "current",
  118. fn: function (){
  119. var self=this;
  120. return smalltalk.withContext(function($ctx1) { var $2,$1;
  121. $2=self["@current"];
  122. if(($receiver = $2) == nil || $receiver == undefined){
  123. self["@current"]=smalltalk.Announcer.klass.fn.prototype._new.apply(_st(self), []);
  124. $1=self["@current"];
  125. } else {
  126. $1=$2;
  127. };
  128. return $1;
  129. }, function($ctx1) {$ctx1.fill(self,"current",{}, smalltalk.SystemAnnouncer.klass)})}
  130. }),
  131. smalltalk.SystemAnnouncer.klass);
  132. smalltalk.addMethod(
  133. "_new",
  134. smalltalk.method({
  135. selector: "new",
  136. fn: function (){
  137. var self=this;
  138. return smalltalk.withContext(function($ctx1) { _st(self)._shouldNotImplement();
  139. return self}, function($ctx1) {$ctx1.fill(self,"new",{}, smalltalk.SystemAnnouncer.klass)})}
  140. }),
  141. smalltalk.SystemAnnouncer.klass);
  142. smalltalk.addClass('SystemAnnouncement', smalltalk.Object, ['theClass'], 'Kernel-Announcements');
  143. smalltalk.addMethod(
  144. "_theClass",
  145. smalltalk.method({
  146. selector: "theClass",
  147. fn: function (){
  148. var self=this;
  149. return smalltalk.withContext(function($ctx1) { var $1;
  150. $1=self["@theClass"];
  151. return $1;
  152. }, function($ctx1) {$ctx1.fill(self,"theClass",{}, smalltalk.SystemAnnouncement)})}
  153. }),
  154. smalltalk.SystemAnnouncement);
  155. smalltalk.addMethod(
  156. "_theClass_",
  157. smalltalk.method({
  158. selector: "theClass:",
  159. fn: function (aClass){
  160. var self=this;
  161. return smalltalk.withContext(function($ctx1) { self["@theClass"]=aClass;
  162. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass}, smalltalk.SystemAnnouncement)})}
  163. }),
  164. smalltalk.SystemAnnouncement);
  165. smalltalk.addClass('ClassAdded', smalltalk.SystemAnnouncement, [], 'Kernel-Announcements');
  166. smalltalk.addClass('ClassCommentChanged', smalltalk.SystemAnnouncement, [], 'Kernel-Announcements');
  167. smalltalk.addClass('ClassDefinitionChanged', smalltalk.SystemAnnouncement, [], 'Kernel-Announcements');
  168. smalltalk.addClass('ClassRemoved', smalltalk.SystemAnnouncement, [], 'Kernel-Announcements');
  169. smalltalk.addClass('ClassRenamed', smalltalk.SystemAnnouncement, [], 'Kernel-Announcements');
  170. smalltalk.addClass('MethodAnnouncement', smalltalk.SystemAnnouncement, ['method'], 'Kernel-Announcements');
  171. smalltalk.addMethod(
  172. "_method",
  173. smalltalk.method({
  174. selector: "method",
  175. fn: function (){
  176. var self=this;
  177. return smalltalk.withContext(function($ctx1) { var $1;
  178. $1=self["@method"];
  179. return $1;
  180. }, function($ctx1) {$ctx1.fill(self,"method",{}, smalltalk.MethodAnnouncement)})}
  181. }),
  182. smalltalk.MethodAnnouncement);
  183. smalltalk.addMethod(
  184. "_method_",
  185. smalltalk.method({
  186. selector: "method:",
  187. fn: function (aCompiledMethod){
  188. var self=this;
  189. return smalltalk.withContext(function($ctx1) { self["@method"]=aCompiledMethod;
  190. return self}, function($ctx1) {$ctx1.fill(self,"method:",{aCompiledMethod:aCompiledMethod}, smalltalk.MethodAnnouncement)})}
  191. }),
  192. smalltalk.MethodAnnouncement);
  193. smalltalk.addClass('MethodAdded', smalltalk.MethodAnnouncement, [], 'Kernel-Announcements');
  194. smalltalk.addClass('MethodRemoved', smalltalk.MethodAnnouncement, [], 'Kernel-Announcements');