2
0

Kernel-Announcements.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766
  1. define("amber_core/Kernel-Announcements", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st){
  2. smalltalk.addPackage('Kernel-Announcements');
  3. smalltalk.packages["Kernel-Announcements"].transport = {"type":"amd","amdNamespace":"amber_core"};
  4. smalltalk.addClass('AnnouncementSubscription', smalltalk.Object, ['valuable', 'announcementClass'], 'Kernel-Announcements');
  5. smalltalk.AnnouncementSubscription.comment="I am a single entry in a subscription registry of an `Announcer`.\x0aSeveral subscriptions by the same object is possible.";
  6. smalltalk.addMethod(
  7. smalltalk.method({
  8. selector: "announcementClass",
  9. category: 'accessing',
  10. fn: function (){
  11. var self=this;
  12. return smalltalk.withContext(function($ctx1) {
  13. var $1;
  14. $1=self["@announcementClass"];
  15. return $1;
  16. }, function($ctx1) {$ctx1.fill(self,"announcementClass",{},smalltalk.AnnouncementSubscription)})},
  17. args: [],
  18. source: "announcementClass\x0a\x09^ announcementClass",
  19. messageSends: [],
  20. referencedClasses: []
  21. }),
  22. smalltalk.AnnouncementSubscription);
  23. smalltalk.addMethod(
  24. smalltalk.method({
  25. selector: "announcementClass:",
  26. category: 'accessing',
  27. fn: function (aClass){
  28. var self=this;
  29. return smalltalk.withContext(function($ctx1) {
  30. self["@announcementClass"]=aClass;
  31. return self}, function($ctx1) {$ctx1.fill(self,"announcementClass:",{aClass:aClass},smalltalk.AnnouncementSubscription)})},
  32. args: ["aClass"],
  33. source: "announcementClass: aClass\x0a\x09announcementClass := aClass",
  34. messageSends: [],
  35. referencedClasses: []
  36. }),
  37. smalltalk.AnnouncementSubscription);
  38. smalltalk.addMethod(
  39. smalltalk.method({
  40. selector: "block",
  41. category: 'accessing',
  42. fn: function (){
  43. var self=this;
  44. return smalltalk.withContext(function($ctx1) {
  45. var $1;
  46. self._deprecatedAPI();
  47. $1=self._valuable();
  48. return $1;
  49. }, function($ctx1) {$ctx1.fill(self,"block",{},smalltalk.AnnouncementSubscription)})},
  50. args: [],
  51. source: "block\x0a\x09\x22Use #valuable instead\x22\x0a\x09\x0a\x09self deprecatedAPI.\x0a\x09^ self valuable",
  52. messageSends: ["deprecatedAPI", "valuable"],
  53. referencedClasses: []
  54. }),
  55. smalltalk.AnnouncementSubscription);
  56. smalltalk.addMethod(
  57. smalltalk.method({
  58. selector: "block:",
  59. category: 'accessing',
  60. fn: function (aValuable){
  61. var self=this;
  62. return smalltalk.withContext(function($ctx1) {
  63. self._deprecatedAPI();
  64. self._valuable_(aValuable);
  65. return self}, function($ctx1) {$ctx1.fill(self,"block:",{aValuable:aValuable},smalltalk.AnnouncementSubscription)})},
  66. args: ["aValuable"],
  67. source: "block: aValuable\x0a\x09\x22Use #valuable instead\x22\x0a\x09\x0a\x09self deprecatedAPI.\x0a\x09self valuable: aValuable",
  68. messageSends: ["deprecatedAPI", "valuable:"],
  69. referencedClasses: []
  70. }),
  71. smalltalk.AnnouncementSubscription);
  72. smalltalk.addMethod(
  73. smalltalk.method({
  74. selector: "deliver:",
  75. category: 'announcing',
  76. fn: function (anAnnouncement){
  77. var self=this;
  78. return smalltalk.withContext(function($ctx1) {
  79. var $1;
  80. $1=self._handlesAnnouncement_(anAnnouncement);
  81. if(smalltalk.assert($1)){
  82. _st(self._valuable())._value_(anAnnouncement);
  83. };
  84. return self}, function($ctx1) {$ctx1.fill(self,"deliver:",{anAnnouncement:anAnnouncement},smalltalk.AnnouncementSubscription)})},
  85. args: ["anAnnouncement"],
  86. source: "deliver: anAnnouncement\x0a\x09(self handlesAnnouncement: anAnnouncement)\x0a\x09\x09ifTrue: [self valuable value: anAnnouncement]",
  87. messageSends: ["ifTrue:", "handlesAnnouncement:", "value:", "valuable"],
  88. referencedClasses: []
  89. }),
  90. smalltalk.AnnouncementSubscription);
  91. smalltalk.addMethod(
  92. smalltalk.method({
  93. selector: "handlesAnnouncement:",
  94. category: 'announcing',
  95. fn: function (anAnnouncement){
  96. var self=this;
  97. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  98. return smalltalk.withContext(function($ctx1) {
  99. var $2,$1;
  100. $2=_st(_st($Smalltalk())._current())._at_(_st(self._announcementClass())._name());
  101. if(($receiver = $2) == nil || $receiver == null){
  102. return false;
  103. } else {
  104. var class_;
  105. class_=$receiver;
  106. $1=_st(_st(_st($Smalltalk())._current())._at_(_st(_st(_st(anAnnouncement)._class())._theNonMetaClass())._name()))._includesBehavior_(class_);
  107. };
  108. return $1;
  109. }, function($ctx1) {$ctx1.fill(self,"handlesAnnouncement:",{anAnnouncement:anAnnouncement},smalltalk.AnnouncementSubscription)})},
  110. args: ["anAnnouncement"],
  111. source: "handlesAnnouncement: anAnnouncement\x0a\x09\x22anAnnouncement might be announced from within another Amber environment\x22\x0a\x09\x0a\x09^ (Smalltalk current at: self announcementClass name)\x0a\x09\x09ifNil: [ ^ false ]\x0a\x09\x09ifNotNil: [ :class |\x0a\x09\x09(Smalltalk current at: anAnnouncement class theNonMetaClass name) includesBehavior: class ]",
  112. messageSends: ["ifNil:ifNotNil:", "at:", "current", "name", "announcementClass", "includesBehavior:", "theNonMetaClass", "class"],
  113. referencedClasses: ["Smalltalk"]
  114. }),
  115. smalltalk.AnnouncementSubscription);
  116. smalltalk.addMethod(
  117. smalltalk.method({
  118. selector: "receiver",
  119. category: 'accessing',
  120. fn: function (){
  121. var self=this;
  122. return smalltalk.withContext(function($ctx1) {
  123. var $1;
  124. $1=_st(self._valuable())._receiver();
  125. return $1;
  126. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.AnnouncementSubscription)})},
  127. args: [],
  128. source: "receiver\x0a\x09^ self valuable receiver",
  129. messageSends: ["receiver", "valuable"],
  130. referencedClasses: []
  131. }),
  132. smalltalk.AnnouncementSubscription);
  133. smalltalk.addMethod(
  134. smalltalk.method({
  135. selector: "valuable",
  136. category: 'accessing',
  137. fn: function (){
  138. var self=this;
  139. return smalltalk.withContext(function($ctx1) {
  140. var $1;
  141. $1=self["@valuable"];
  142. return $1;
  143. }, function($ctx1) {$ctx1.fill(self,"valuable",{},smalltalk.AnnouncementSubscription)})},
  144. args: [],
  145. source: "valuable\x0a\x09^ valuable",
  146. messageSends: [],
  147. referencedClasses: []
  148. }),
  149. smalltalk.AnnouncementSubscription);
  150. smalltalk.addMethod(
  151. smalltalk.method({
  152. selector: "valuable:",
  153. category: 'accessing',
  154. fn: function (aValuable){
  155. var self=this;
  156. return smalltalk.withContext(function($ctx1) {
  157. self["@valuable"]=aValuable;
  158. return self}, function($ctx1) {$ctx1.fill(self,"valuable:",{aValuable:aValuable},smalltalk.AnnouncementSubscription)})},
  159. args: ["aValuable"],
  160. source: "valuable: aValuable\x0a\x09valuable := aValuable",
  161. messageSends: [],
  162. referencedClasses: []
  163. }),
  164. smalltalk.AnnouncementSubscription);
  165. smalltalk.addClass('Announcer', smalltalk.Object, ['registry', 'subscriptions'], 'Kernel-Announcements');
  166. smalltalk.Announcer.comment="I hold annoncement subscriptions (instances of `AnnouncementSubscription`) in a private registry.\x0aI announce (trigger) announces, which are then dispatched to all subscriptions.\x0a\x0aThe code is based on the announcements as [described by Vassili Bykov](http://www.cincomsmalltalk.com/userblogs/vbykov/blogView?searchCategory=Announcements%20Framework).\x0a\x0a## API\x0a\x0aUse `#announce:` to trigger an announcement.\x0a\x0aUse `#on:do:` or `#on:send:to:` to register subscriptions.\x0a\x0aWhen using `#on:send:to:`, unregistration can be done with `#unregister:`.\x0a\x0a## Usage example:\x0a\x0a SystemAnnouncer current\x0a on: ClassAdded\x0a do: [ :ann | window alert: ann theClass name, ' added' ].";
  167. smalltalk.addMethod(
  168. smalltalk.method({
  169. selector: "announce:",
  170. category: 'announcing',
  171. fn: function (anAnnouncement){
  172. var self=this;
  173. return smalltalk.withContext(function($ctx1) {
  174. _st(self["@subscriptions"])._do_((function(each){
  175. return smalltalk.withContext(function($ctx2) {
  176. return _st(each)._deliver_(anAnnouncement);
  177. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  178. return self}, function($ctx1) {$ctx1.fill(self,"announce:",{anAnnouncement:anAnnouncement},smalltalk.Announcer)})},
  179. args: ["anAnnouncement"],
  180. source: "announce: anAnnouncement\x0a\x09subscriptions do: [ :each |\x0a\x09\x09each deliver: anAnnouncement ]",
  181. messageSends: ["do:", "deliver:"],
  182. referencedClasses: []
  183. }),
  184. smalltalk.Announcer);
  185. smalltalk.addMethod(
  186. smalltalk.method({
  187. selector: "initialize",
  188. category: 'initialization',
  189. fn: function (){
  190. var self=this;
  191. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  192. return smalltalk.withContext(function($ctx1) {
  193. smalltalk.Announcer.superclass.fn.prototype._initialize.apply(_st(self), []);
  194. self["@subscriptions"]=_st($OrderedCollection())._new();
  195. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Announcer)})},
  196. args: [],
  197. source: "initialize\x0a\x09super initialize.\x0a\x09subscriptions := OrderedCollection new",
  198. messageSends: ["initialize", "new"],
  199. referencedClasses: ["OrderedCollection"]
  200. }),
  201. smalltalk.Announcer);
  202. smalltalk.addMethod(
  203. smalltalk.method({
  204. selector: "on:do:",
  205. category: 'subscribing',
  206. fn: function (aClass,aBlock){
  207. var self=this;
  208. function $AnnouncementSubscription(){return smalltalk.AnnouncementSubscription||(typeof AnnouncementSubscription=="undefined"?nil:AnnouncementSubscription)}
  209. return smalltalk.withContext(function($ctx1) {
  210. var $1,$2;
  211. $1=_st($AnnouncementSubscription())._new();
  212. _st($1)._valuable_(aBlock);
  213. _st($1)._announcementClass_(aClass);
  214. $2=_st($1)._yourself();
  215. _st(self["@subscriptions"])._add_($2);
  216. return self}, function($ctx1) {$ctx1.fill(self,"on:do:",{aClass:aClass,aBlock:aBlock},smalltalk.Announcer)})},
  217. args: ["aClass", "aBlock"],
  218. source: "on: aClass do: aBlock\x0a\x09subscriptions add: (AnnouncementSubscription new\x0a\x09\x09valuable: aBlock;\x0a\x09\x09announcementClass: aClass;\x0a\x09\x09yourself)",
  219. messageSends: ["add:", "valuable:", "new", "announcementClass:", "yourself"],
  220. referencedClasses: ["AnnouncementSubscription"]
  221. }),
  222. smalltalk.Announcer);
  223. smalltalk.addMethod(
  224. smalltalk.method({
  225. selector: "on:send:to:",
  226. category: 'subscribing',
  227. fn: function (aClass,aSelector,anObject){
  228. var self=this;
  229. function $AnnouncementSubscription(){return smalltalk.AnnouncementSubscription||(typeof AnnouncementSubscription=="undefined"?nil:AnnouncementSubscription)}
  230. function $MessageSend(){return smalltalk.MessageSend||(typeof MessageSend=="undefined"?nil:MessageSend)}
  231. return smalltalk.withContext(function($ctx1) {
  232. var $1,$2,$3,$4;
  233. $1=_st($AnnouncementSubscription())._new();
  234. $2=_st($MessageSend())._new();
  235. _st($2)._receiver_(anObject);
  236. _st($2)._selector_(aSelector);
  237. $3=_st($2)._yourself();
  238. _st($1)._valuable_($3);
  239. _st($1)._announcementClass_(aClass);
  240. $4=_st($1)._yourself();
  241. _st(self["@subscriptions"])._add_($4);
  242. return self}, function($ctx1) {$ctx1.fill(self,"on:send:to:",{aClass:aClass,aSelector:aSelector,anObject:anObject},smalltalk.Announcer)})},
  243. args: ["aClass", "aSelector", "anObject"],
  244. source: "on: aClass send: aSelector to: anObject\x0a\x09subscriptions add: (AnnouncementSubscription new\x0a\x09\x09valuable: (MessageSend new\x0a\x09\x09\x09receiver: anObject;\x0a\x09\x09\x09selector: aSelector;\x0a\x09\x09\x09yourself);\x0a\x09\x09announcementClass: aClass;\x0a\x09\x09yourself)",
  245. messageSends: ["add:", "valuable:", "new", "receiver:", "selector:", "yourself", "announcementClass:"],
  246. referencedClasses: ["AnnouncementSubscription", "MessageSend"]
  247. }),
  248. smalltalk.Announcer);
  249. smalltalk.addMethod(
  250. smalltalk.method({
  251. selector: "unsubscribe:",
  252. category: 'subscribing',
  253. fn: function (anObject){
  254. var self=this;
  255. return smalltalk.withContext(function($ctx1) {
  256. self["@subscriptions"]=_st(self["@subscriptions"])._reject_((function(each){
  257. return smalltalk.withContext(function($ctx2) {
  258. return _st(_st(each)._receiver()).__eq(anObject);
  259. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  260. return self}, function($ctx1) {$ctx1.fill(self,"unsubscribe:",{anObject:anObject},smalltalk.Announcer)})},
  261. args: ["anObject"],
  262. source: "unsubscribe: anObject\x0a\x09subscriptions := subscriptions reject: [ :each |\x0a\x09\x09each receiver = anObject ]",
  263. messageSends: ["reject:", "=", "receiver"],
  264. referencedClasses: []
  265. }),
  266. smalltalk.Announcer);
  267. smalltalk.addClass('SystemAnnouncer', smalltalk.Announcer, [], 'Kernel-Announcements');
  268. smalltalk.SystemAnnouncer.comment="My unique instance is the global announcer handling all Amber system-related announces.\x0a\x0a## API\x0a\x0aAccess to the unique instance is done via `#current`";
  269. smalltalk.SystemAnnouncer.klass.iVarNames = ['current'];
  270. smalltalk.addMethod(
  271. smalltalk.method({
  272. selector: "current",
  273. category: 'accessing',
  274. fn: function (){
  275. var self=this;
  276. return smalltalk.withContext(function($ctx1) {
  277. var $2,$1;
  278. $2=self["@current"];
  279. if(($receiver = $2) == nil || $receiver == null){
  280. self["@current"]=smalltalk.SystemAnnouncer.klass.superclass.fn.prototype._new.apply(_st(self), []);
  281. $1=self["@current"];
  282. } else {
  283. $1=$2;
  284. };
  285. return $1;
  286. }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.SystemAnnouncer.klass)})},
  287. args: [],
  288. source: "current\x0a\x09^ current ifNil: [ current := super new ]",
  289. messageSends: ["ifNil:", "new"],
  290. referencedClasses: []
  291. }),
  292. smalltalk.SystemAnnouncer.klass);
  293. smalltalk.addMethod(
  294. smalltalk.method({
  295. selector: "new",
  296. category: 'instance creation',
  297. fn: function (){
  298. var self=this;
  299. return smalltalk.withContext(function($ctx1) {
  300. self._shouldNotImplement();
  301. return self}, function($ctx1) {$ctx1.fill(self,"new",{},smalltalk.SystemAnnouncer.klass)})},
  302. args: [],
  303. source: "new\x0a\x09self shouldNotImplement",
  304. messageSends: ["shouldNotImplement"],
  305. referencedClasses: []
  306. }),
  307. smalltalk.SystemAnnouncer.klass);
  308. smalltalk.addClass('SystemAnnouncement', smalltalk.Object, ['theClass'], 'Kernel-Announcements');
  309. smalltalk.SystemAnnouncement.comment="I am the superclass of all system announcements";
  310. smalltalk.addMethod(
  311. smalltalk.method({
  312. selector: "theClass",
  313. category: 'accessing',
  314. fn: function (){
  315. var self=this;
  316. return smalltalk.withContext(function($ctx1) {
  317. var $1;
  318. $1=self["@theClass"];
  319. return $1;
  320. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.SystemAnnouncement)})},
  321. args: [],
  322. source: "theClass\x0a\x09^ theClass",
  323. messageSends: [],
  324. referencedClasses: []
  325. }),
  326. smalltalk.SystemAnnouncement);
  327. smalltalk.addMethod(
  328. smalltalk.method({
  329. selector: "theClass:",
  330. category: 'accessing',
  331. fn: function (aClass){
  332. var self=this;
  333. return smalltalk.withContext(function($ctx1) {
  334. self["@theClass"]=aClass;
  335. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.SystemAnnouncement)})},
  336. args: ["aClass"],
  337. source: "theClass: aClass\x0a\x09theClass := aClass",
  338. messageSends: [],
  339. referencedClasses: []
  340. }),
  341. smalltalk.SystemAnnouncement);
  342. smalltalk.addMethod(
  343. smalltalk.method({
  344. selector: "heliosClass",
  345. category: 'helios',
  346. fn: function (){
  347. var self=this;
  348. return smalltalk.withContext(function($ctx1) {
  349. return "announcement";
  350. }, function($ctx1) {$ctx1.fill(self,"heliosClass",{},smalltalk.SystemAnnouncement.klass)})},
  351. args: [],
  352. source: "heliosClass\x0a\x09^ 'announcement'",
  353. messageSends: [],
  354. referencedClasses: []
  355. }),
  356. smalltalk.SystemAnnouncement.klass);
  357. smalltalk.addClass('ClassAnnouncement', smalltalk.SystemAnnouncement, ['theClass'], 'Kernel-Announcements');
  358. smalltalk.ClassAnnouncement.comment="I am the abstract superclass of class-related announcements.";
  359. smalltalk.addMethod(
  360. smalltalk.method({
  361. selector: "theClass",
  362. category: 'accessing',
  363. fn: function (){
  364. var self=this;
  365. return smalltalk.withContext(function($ctx1) {
  366. var $1;
  367. $1=self["@theClass"];
  368. return $1;
  369. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.ClassAnnouncement)})},
  370. args: [],
  371. source: "theClass\x0a\x09^ theClass",
  372. messageSends: [],
  373. referencedClasses: []
  374. }),
  375. smalltalk.ClassAnnouncement);
  376. smalltalk.addMethod(
  377. smalltalk.method({
  378. selector: "theClass:",
  379. category: 'accessing',
  380. fn: function (aClass){
  381. var self=this;
  382. return smalltalk.withContext(function($ctx1) {
  383. self["@theClass"]=aClass;
  384. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.ClassAnnouncement)})},
  385. args: ["aClass"],
  386. source: "theClass: aClass\x0a\x09theClass := aClass",
  387. messageSends: [],
  388. referencedClasses: []
  389. }),
  390. smalltalk.ClassAnnouncement);
  391. smalltalk.addClass('ClassAdded', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
  392. smalltalk.ClassAdded.comment="I am emitted when a class is added to the system.\x0aSee ClassBuilder >> #addSubclassOf:... methods";
  393. smalltalk.addClass('ClassCommentChanged', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
  394. smalltalk.ClassCommentChanged.comment="I am emitted when the comment of a class changes. (Behavior >> #comment)";
  395. smalltalk.addClass('ClassDefinitionChanged', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
  396. smalltalk.ClassDefinitionChanged.comment="I am emitted when the definition of a class changes.\x0aSee ClassBuilder >> #class:instanceVariableNames:";
  397. smalltalk.addClass('ClassMigrated', smalltalk.ClassAnnouncement, ['oldClass'], 'Kernel-Announcements');
  398. smalltalk.ClassMigrated.comment="I am emitted when a class is migrated.";
  399. smalltalk.addMethod(
  400. smalltalk.method({
  401. selector: "oldClass",
  402. category: 'accessing',
  403. fn: function (){
  404. var self=this;
  405. return smalltalk.withContext(function($ctx1) {
  406. var $1;
  407. $1=self["@oldClass"];
  408. return $1;
  409. }, function($ctx1) {$ctx1.fill(self,"oldClass",{},smalltalk.ClassMigrated)})},
  410. args: [],
  411. source: "oldClass\x0a\x09^ oldClass",
  412. messageSends: [],
  413. referencedClasses: []
  414. }),
  415. smalltalk.ClassMigrated);
  416. smalltalk.addMethod(
  417. smalltalk.method({
  418. selector: "oldClass:",
  419. category: 'accessing',
  420. fn: function (aClass){
  421. var self=this;
  422. return smalltalk.withContext(function($ctx1) {
  423. self["@oldClass"]=aClass;
  424. return self}, function($ctx1) {$ctx1.fill(self,"oldClass:",{aClass:aClass},smalltalk.ClassMigrated)})},
  425. args: ["aClass"],
  426. source: "oldClass: aClass\x0a\x09oldClass := aClass",
  427. messageSends: [],
  428. referencedClasses: []
  429. }),
  430. smalltalk.ClassMigrated);
  431. smalltalk.addClass('ClassMoved', smalltalk.ClassAnnouncement, ['oldPackage'], 'Kernel-Announcements');
  432. smalltalk.ClassMoved.comment="I am emitted when a class is moved from one package to another.";
  433. smalltalk.addMethod(
  434. smalltalk.method({
  435. selector: "oldPackage",
  436. category: 'accessing',
  437. fn: function (){
  438. var self=this;
  439. return smalltalk.withContext(function($ctx1) {
  440. var $1;
  441. $1=self["@oldPackage"];
  442. return $1;
  443. }, function($ctx1) {$ctx1.fill(self,"oldPackage",{},smalltalk.ClassMoved)})},
  444. args: [],
  445. source: "oldPackage\x0a\x09^ oldPackage",
  446. messageSends: [],
  447. referencedClasses: []
  448. }),
  449. smalltalk.ClassMoved);
  450. smalltalk.addMethod(
  451. smalltalk.method({
  452. selector: "oldPackage:",
  453. category: 'accessing',
  454. fn: function (aPackage){
  455. var self=this;
  456. return smalltalk.withContext(function($ctx1) {
  457. self["@oldPackage"]=aPackage;
  458. return self}, function($ctx1) {$ctx1.fill(self,"oldPackage:",{aPackage:aPackage},smalltalk.ClassMoved)})},
  459. args: ["aPackage"],
  460. source: "oldPackage: aPackage\x0a\x09oldPackage := aPackage",
  461. messageSends: [],
  462. referencedClasses: []
  463. }),
  464. smalltalk.ClassMoved);
  465. smalltalk.addClass('ClassRemoved', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
  466. smalltalk.ClassRemoved.comment="I am emitted when a class is removed.\x0aSee Smalltalk >> #removeClass:";
  467. smalltalk.addClass('ClassRenamed', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
  468. smalltalk.ClassRenamed.comment="I am emitted when a class is renamed.\x0aSee ClassBuilder >> #renameClass:to:";
  469. smalltalk.addClass('MethodAnnouncement', smalltalk.SystemAnnouncement, ['method'], 'Kernel-Announcements');
  470. smalltalk.MethodAnnouncement.comment="I am the abstract superclass of method-related announcements.";
  471. smalltalk.addMethod(
  472. smalltalk.method({
  473. selector: "method",
  474. category: 'accessing',
  475. fn: function (){
  476. var self=this;
  477. return smalltalk.withContext(function($ctx1) {
  478. var $1;
  479. $1=self["@method"];
  480. return $1;
  481. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.MethodAnnouncement)})},
  482. args: [],
  483. source: "method\x0a\x09^ method",
  484. messageSends: [],
  485. referencedClasses: []
  486. }),
  487. smalltalk.MethodAnnouncement);
  488. smalltalk.addMethod(
  489. smalltalk.method({
  490. selector: "method:",
  491. category: 'accessing',
  492. fn: function (aCompiledMethod){
  493. var self=this;
  494. return smalltalk.withContext(function($ctx1) {
  495. self["@method"]=aCompiledMethod;
  496. return self}, function($ctx1) {$ctx1.fill(self,"method:",{aCompiledMethod:aCompiledMethod},smalltalk.MethodAnnouncement)})},
  497. args: ["aCompiledMethod"],
  498. source: "method: aCompiledMethod\x0a\x09method := aCompiledMethod",
  499. messageSends: [],
  500. referencedClasses: []
  501. }),
  502. smalltalk.MethodAnnouncement);
  503. smalltalk.addClass('MethodAdded', smalltalk.MethodAnnouncement, [], 'Kernel-Announcements');
  504. smalltalk.MethodAdded.comment="I am emitted when a `CompiledMethod` is added to a class.";
  505. smalltalk.addClass('MethodModified', smalltalk.MethodAnnouncement, ['oldMethod'], 'Kernel-Announcements');
  506. smalltalk.MethodModified.comment="I am emitted when a `CompiledMethod` is modified (a new method is installed). I hold a reference to the old method being replaced.";
  507. smalltalk.addMethod(
  508. smalltalk.method({
  509. selector: "oldMethod",
  510. category: 'accessing',
  511. fn: function (){
  512. var self=this;
  513. return smalltalk.withContext(function($ctx1) {
  514. var $1;
  515. $1=self["@oldMethod"];
  516. return $1;
  517. }, function($ctx1) {$ctx1.fill(self,"oldMethod",{},smalltalk.MethodModified)})},
  518. args: [],
  519. source: "oldMethod\x0a\x09^ oldMethod",
  520. messageSends: [],
  521. referencedClasses: []
  522. }),
  523. smalltalk.MethodModified);
  524. smalltalk.addMethod(
  525. smalltalk.method({
  526. selector: "oldMethod:",
  527. category: 'accessing',
  528. fn: function (aMethod){
  529. var self=this;
  530. return smalltalk.withContext(function($ctx1) {
  531. self["@oldMethod"]=aMethod;
  532. return self}, function($ctx1) {$ctx1.fill(self,"oldMethod:",{aMethod:aMethod},smalltalk.MethodModified)})},
  533. args: ["aMethod"],
  534. source: "oldMethod: aMethod\x0a\x09oldMethod := aMethod",
  535. messageSends: [],
  536. referencedClasses: []
  537. }),
  538. smalltalk.MethodModified);
  539. smalltalk.addClass('MethodMoved', smalltalk.MethodAnnouncement, ['oldProtocol'], 'Kernel-Announcements');
  540. smalltalk.MethodMoved.comment="I am emitted when a `CompiledMethod` is moved to another protocol. I hold a refernce to the old protocol of the method.";
  541. smalltalk.addMethod(
  542. smalltalk.method({
  543. selector: "oldProtocol",
  544. category: 'accessing',
  545. fn: function (){
  546. var self=this;
  547. return smalltalk.withContext(function($ctx1) {
  548. var $1;
  549. $1=self["@oldProtocol"];
  550. return $1;
  551. }, function($ctx1) {$ctx1.fill(self,"oldProtocol",{},smalltalk.MethodMoved)})},
  552. args: [],
  553. source: "oldProtocol\x0a\x09^ oldProtocol",
  554. messageSends: [],
  555. referencedClasses: []
  556. }),
  557. smalltalk.MethodMoved);
  558. smalltalk.addMethod(
  559. smalltalk.method({
  560. selector: "oldProtocol:",
  561. category: 'accessing',
  562. fn: function (aString){
  563. var self=this;
  564. return smalltalk.withContext(function($ctx1) {
  565. self["@oldProtocol"]=aString;
  566. return self}, function($ctx1) {$ctx1.fill(self,"oldProtocol:",{aString:aString},smalltalk.MethodMoved)})},
  567. args: ["aString"],
  568. source: "oldProtocol: aString\x0a\x09oldProtocol := aString",
  569. messageSends: [],
  570. referencedClasses: []
  571. }),
  572. smalltalk.MethodMoved);
  573. smalltalk.addClass('MethodRemoved', smalltalk.MethodAnnouncement, [], 'Kernel-Announcements');
  574. smalltalk.MethodRemoved.comment="I am emitted when a `CompiledMethod` is removed from a class.";
  575. smalltalk.addClass('PackageAnnouncement', smalltalk.SystemAnnouncement, ['package'], 'Kernel-Announcements');
  576. smalltalk.PackageAnnouncement.comment="I am the abstract superclass of package-related announcements.";
  577. smalltalk.addMethod(
  578. smalltalk.method({
  579. selector: "package",
  580. category: 'accessing',
  581. fn: function (){
  582. var self=this;
  583. return smalltalk.withContext(function($ctx1) {
  584. var $1;
  585. $1=self["@package"];
  586. return $1;
  587. }, function($ctx1) {$ctx1.fill(self,"package",{},smalltalk.PackageAnnouncement)})},
  588. args: [],
  589. source: "package\x0a\x09^ package",
  590. messageSends: [],
  591. referencedClasses: []
  592. }),
  593. smalltalk.PackageAnnouncement);
  594. smalltalk.addMethod(
  595. smalltalk.method({
  596. selector: "package:",
  597. category: 'accessing',
  598. fn: function (aPackage){
  599. var self=this;
  600. return smalltalk.withContext(function($ctx1) {
  601. self["@package"]=aPackage;
  602. return self}, function($ctx1) {$ctx1.fill(self,"package:",{aPackage:aPackage},smalltalk.PackageAnnouncement)})},
  603. args: ["aPackage"],
  604. source: "package: aPackage\x0a\x09package := aPackage",
  605. messageSends: [],
  606. referencedClasses: []
  607. }),
  608. smalltalk.PackageAnnouncement);
  609. smalltalk.addClass('PackageAdded', smalltalk.PackageAnnouncement, [], 'Kernel-Announcements');
  610. smalltalk.PackageAdded.comment="I am emitted when a `Package` is added to the system.";
  611. smalltalk.addClass('PackageRemoved', smalltalk.PackageAnnouncement, [], 'Kernel-Announcements');
  612. smalltalk.PackageRemoved.comment="I am emitted when a `Package` is removed from the system.";
  613. smalltalk.addClass('ProtocolAnnouncement', smalltalk.SystemAnnouncement, ['theClass', 'protocol'], 'Kernel-Announcements');
  614. smalltalk.ProtocolAnnouncement.comment="I am the abstract superclass of protocol-related announcements.";
  615. smalltalk.addMethod(
  616. smalltalk.method({
  617. selector: "protocol",
  618. category: 'accessing',
  619. fn: function (){
  620. var self=this;
  621. return smalltalk.withContext(function($ctx1) {
  622. var $1;
  623. $1=self["@protocol"];
  624. return $1;
  625. }, function($ctx1) {$ctx1.fill(self,"protocol",{},smalltalk.ProtocolAnnouncement)})},
  626. args: [],
  627. source: "protocol\x0a\x09^ protocol",
  628. messageSends: [],
  629. referencedClasses: []
  630. }),
  631. smalltalk.ProtocolAnnouncement);
  632. smalltalk.addMethod(
  633. smalltalk.method({
  634. selector: "protocol:",
  635. category: 'accessing',
  636. fn: function (aString){
  637. var self=this;
  638. return smalltalk.withContext(function($ctx1) {
  639. self["@protocol"]=aString;
  640. return self}, function($ctx1) {$ctx1.fill(self,"protocol:",{aString:aString},smalltalk.ProtocolAnnouncement)})},
  641. args: ["aString"],
  642. source: "protocol: aString\x0a\x09protocol := aString",
  643. messageSends: [],
  644. referencedClasses: []
  645. }),
  646. smalltalk.ProtocolAnnouncement);
  647. smalltalk.addMethod(
  648. smalltalk.method({
  649. selector: "theClass",
  650. category: 'accessing',
  651. fn: function (){
  652. var self=this;
  653. return smalltalk.withContext(function($ctx1) {
  654. var $1;
  655. $1=self["@theClass"];
  656. return $1;
  657. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.ProtocolAnnouncement)})},
  658. args: [],
  659. source: "theClass\x0a\x09^ theClass",
  660. messageSends: [],
  661. referencedClasses: []
  662. }),
  663. smalltalk.ProtocolAnnouncement);
  664. smalltalk.addMethod(
  665. smalltalk.method({
  666. selector: "theClass:",
  667. category: 'accessing',
  668. fn: function (aClass){
  669. var self=this;
  670. return smalltalk.withContext(function($ctx1) {
  671. self["@theClass"]=aClass;
  672. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.ProtocolAnnouncement)})},
  673. args: ["aClass"],
  674. source: "theClass: aClass\x0a\x09theClass := aClass",
  675. messageSends: [],
  676. referencedClasses: []
  677. }),
  678. smalltalk.ProtocolAnnouncement);
  679. smalltalk.addClass('ProtocolAdded', smalltalk.ProtocolAnnouncement, [], 'Kernel-Announcements');
  680. smalltalk.ProtocolAdded.comment="I am emitted when a protocol is added to a class.";
  681. smalltalk.addClass('ProtocolRemoved', smalltalk.ProtocolAnnouncement, [], 'Kernel-Announcements');
  682. smalltalk.ProtocolRemoved.comment="I am emitted when a protocol is removed from a class.";
  683. });