1
0

Kernel-Announcements.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777
  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 $3,$4,$2,$1;
  100. $3=_st($Smalltalk())._current();
  101. $ctx1.sendIdx["current"]=1;
  102. $4=_st(self._announcementClass())._name();
  103. $ctx1.sendIdx["name"]=1;
  104. $2=_st($3)._at_($4);
  105. $ctx1.sendIdx["at:"]=1;
  106. if(($receiver = $2) == nil || $receiver == null){
  107. return false;
  108. } else {
  109. var class_;
  110. class_=$receiver;
  111. $1=_st(_st(_st($Smalltalk())._current())._at_(_st(_st(_st(anAnnouncement)._class())._theNonMetaClass())._name()))._includesBehavior_(class_);
  112. };
  113. return $1;
  114. }, function($ctx1) {$ctx1.fill(self,"handlesAnnouncement:",{anAnnouncement:anAnnouncement},smalltalk.AnnouncementSubscription)})},
  115. args: ["anAnnouncement"],
  116. 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 ]",
  117. messageSends: ["ifNil:ifNotNil:", "at:", "current", "name", "announcementClass", "includesBehavior:", "theNonMetaClass", "class"],
  118. referencedClasses: ["Smalltalk"]
  119. }),
  120. smalltalk.AnnouncementSubscription);
  121. smalltalk.addMethod(
  122. smalltalk.method({
  123. selector: "receiver",
  124. category: 'accessing',
  125. fn: function (){
  126. var self=this;
  127. return smalltalk.withContext(function($ctx1) {
  128. var $1;
  129. $1=_st(self._valuable())._receiver();
  130. return $1;
  131. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.AnnouncementSubscription)})},
  132. args: [],
  133. source: "receiver\x0a\x09^ self valuable receiver",
  134. messageSends: ["receiver", "valuable"],
  135. referencedClasses: []
  136. }),
  137. smalltalk.AnnouncementSubscription);
  138. smalltalk.addMethod(
  139. smalltalk.method({
  140. selector: "valuable",
  141. category: 'accessing',
  142. fn: function (){
  143. var self=this;
  144. return smalltalk.withContext(function($ctx1) {
  145. var $1;
  146. $1=self["@valuable"];
  147. return $1;
  148. }, function($ctx1) {$ctx1.fill(self,"valuable",{},smalltalk.AnnouncementSubscription)})},
  149. args: [],
  150. source: "valuable\x0a\x09^ valuable",
  151. messageSends: [],
  152. referencedClasses: []
  153. }),
  154. smalltalk.AnnouncementSubscription);
  155. smalltalk.addMethod(
  156. smalltalk.method({
  157. selector: "valuable:",
  158. category: 'accessing',
  159. fn: function (aValuable){
  160. var self=this;
  161. return smalltalk.withContext(function($ctx1) {
  162. self["@valuable"]=aValuable;
  163. return self}, function($ctx1) {$ctx1.fill(self,"valuable:",{aValuable:aValuable},smalltalk.AnnouncementSubscription)})},
  164. args: ["aValuable"],
  165. source: "valuable: aValuable\x0a\x09valuable := aValuable",
  166. messageSends: [],
  167. referencedClasses: []
  168. }),
  169. smalltalk.AnnouncementSubscription);
  170. smalltalk.addClass('Announcer', smalltalk.Object, ['registry', 'subscriptions'], 'Kernel-Announcements');
  171. 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' ].";
  172. smalltalk.addMethod(
  173. smalltalk.method({
  174. selector: "announce:",
  175. category: 'announcing',
  176. fn: function (anAnnouncement){
  177. var self=this;
  178. return smalltalk.withContext(function($ctx1) {
  179. _st(self["@subscriptions"])._do_((function(each){
  180. return smalltalk.withContext(function($ctx2) {
  181. return _st(each)._deliver_(anAnnouncement);
  182. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  183. return self}, function($ctx1) {$ctx1.fill(self,"announce:",{anAnnouncement:anAnnouncement},smalltalk.Announcer)})},
  184. args: ["anAnnouncement"],
  185. source: "announce: anAnnouncement\x0a\x09subscriptions do: [ :each |\x0a\x09\x09each deliver: anAnnouncement ]",
  186. messageSends: ["do:", "deliver:"],
  187. referencedClasses: []
  188. }),
  189. smalltalk.Announcer);
  190. smalltalk.addMethod(
  191. smalltalk.method({
  192. selector: "initialize",
  193. category: 'initialization',
  194. fn: function (){
  195. var self=this;
  196. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  197. return smalltalk.withContext(function($ctx1) {
  198. smalltalk.Announcer.superclass.fn.prototype._initialize.apply(_st(self), []);
  199. self["@subscriptions"]=_st($OrderedCollection())._new();
  200. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Announcer)})},
  201. args: [],
  202. source: "initialize\x0a\x09super initialize.\x0a\x09subscriptions := OrderedCollection new",
  203. messageSends: ["initialize", "new"],
  204. referencedClasses: ["OrderedCollection"]
  205. }),
  206. smalltalk.Announcer);
  207. smalltalk.addMethod(
  208. smalltalk.method({
  209. selector: "on:do:",
  210. category: 'subscribing',
  211. fn: function (aClass,aBlock){
  212. var self=this;
  213. function $AnnouncementSubscription(){return smalltalk.AnnouncementSubscription||(typeof AnnouncementSubscription=="undefined"?nil:AnnouncementSubscription)}
  214. return smalltalk.withContext(function($ctx1) {
  215. var $1,$2;
  216. $1=_st($AnnouncementSubscription())._new();
  217. _st($1)._valuable_(aBlock);
  218. _st($1)._announcementClass_(aClass);
  219. $2=_st($1)._yourself();
  220. _st(self["@subscriptions"])._add_($2);
  221. return self}, function($ctx1) {$ctx1.fill(self,"on:do:",{aClass:aClass,aBlock:aBlock},smalltalk.Announcer)})},
  222. args: ["aClass", "aBlock"],
  223. source: "on: aClass do: aBlock\x0a\x09subscriptions add: (AnnouncementSubscription new\x0a\x09\x09valuable: aBlock;\x0a\x09\x09announcementClass: aClass;\x0a\x09\x09yourself)",
  224. messageSends: ["add:", "valuable:", "new", "announcementClass:", "yourself"],
  225. referencedClasses: ["AnnouncementSubscription"]
  226. }),
  227. smalltalk.Announcer);
  228. smalltalk.addMethod(
  229. smalltalk.method({
  230. selector: "on:send:to:",
  231. category: 'subscribing',
  232. fn: function (aClass,aSelector,anObject){
  233. var self=this;
  234. function $AnnouncementSubscription(){return smalltalk.AnnouncementSubscription||(typeof AnnouncementSubscription=="undefined"?nil:AnnouncementSubscription)}
  235. function $MessageSend(){return smalltalk.MessageSend||(typeof MessageSend=="undefined"?nil:MessageSend)}
  236. return smalltalk.withContext(function($ctx1) {
  237. var $1,$3,$4,$6,$7,$5,$8,$2;
  238. $1=self["@subscriptions"];
  239. $3=_st($AnnouncementSubscription())._new();
  240. $ctx1.sendIdx["new"]=1;
  241. $4=$3;
  242. $6=_st($MessageSend())._new();
  243. _st($6)._receiver_(anObject);
  244. _st($6)._selector_(aSelector);
  245. $7=_st($6)._yourself();
  246. $ctx1.sendIdx["yourself"]=1;
  247. $5=$7;
  248. _st($4)._valuable_($5);
  249. _st($3)._announcementClass_(aClass);
  250. $8=_st($3)._yourself();
  251. $2=$8;
  252. _st($1)._add_($2);
  253. return self}, function($ctx1) {$ctx1.fill(self,"on:send:to:",{aClass:aClass,aSelector:aSelector,anObject:anObject},smalltalk.Announcer)})},
  254. args: ["aClass", "aSelector", "anObject"],
  255. 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)",
  256. messageSends: ["add:", "valuable:", "new", "receiver:", "selector:", "yourself", "announcementClass:"],
  257. referencedClasses: ["AnnouncementSubscription", "MessageSend"]
  258. }),
  259. smalltalk.Announcer);
  260. smalltalk.addMethod(
  261. smalltalk.method({
  262. selector: "unsubscribe:",
  263. category: 'subscribing',
  264. fn: function (anObject){
  265. var self=this;
  266. return smalltalk.withContext(function($ctx1) {
  267. self["@subscriptions"]=_st(self["@subscriptions"])._reject_((function(each){
  268. return smalltalk.withContext(function($ctx2) {
  269. return _st(_st(each)._receiver()).__eq(anObject);
  270. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  271. return self}, function($ctx1) {$ctx1.fill(self,"unsubscribe:",{anObject:anObject},smalltalk.Announcer)})},
  272. args: ["anObject"],
  273. source: "unsubscribe: anObject\x0a\x09subscriptions := subscriptions reject: [ :each |\x0a\x09\x09each receiver = anObject ]",
  274. messageSends: ["reject:", "=", "receiver"],
  275. referencedClasses: []
  276. }),
  277. smalltalk.Announcer);
  278. smalltalk.addClass('SystemAnnouncer', smalltalk.Announcer, [], 'Kernel-Announcements');
  279. 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`";
  280. smalltalk.SystemAnnouncer.klass.iVarNames = ['current'];
  281. smalltalk.addMethod(
  282. smalltalk.method({
  283. selector: "current",
  284. category: 'accessing',
  285. fn: function (){
  286. var self=this;
  287. return smalltalk.withContext(function($ctx1) {
  288. var $2,$1;
  289. $2=self["@current"];
  290. if(($receiver = $2) == nil || $receiver == null){
  291. self["@current"]=smalltalk.SystemAnnouncer.klass.superclass.fn.prototype._new.apply(_st(self), []);
  292. $1=self["@current"];
  293. } else {
  294. $1=$2;
  295. };
  296. return $1;
  297. }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.SystemAnnouncer.klass)})},
  298. args: [],
  299. source: "current\x0a\x09^ current ifNil: [ current := super new ]",
  300. messageSends: ["ifNil:", "new"],
  301. referencedClasses: []
  302. }),
  303. smalltalk.SystemAnnouncer.klass);
  304. smalltalk.addMethod(
  305. smalltalk.method({
  306. selector: "new",
  307. category: 'instance creation',
  308. fn: function (){
  309. var self=this;
  310. return smalltalk.withContext(function($ctx1) {
  311. self._shouldNotImplement();
  312. return self}, function($ctx1) {$ctx1.fill(self,"new",{},smalltalk.SystemAnnouncer.klass)})},
  313. args: [],
  314. source: "new\x0a\x09self shouldNotImplement",
  315. messageSends: ["shouldNotImplement"],
  316. referencedClasses: []
  317. }),
  318. smalltalk.SystemAnnouncer.klass);
  319. smalltalk.addClass('SystemAnnouncement', smalltalk.Object, ['theClass'], 'Kernel-Announcements');
  320. smalltalk.SystemAnnouncement.comment="I am the superclass of all system announcements";
  321. smalltalk.addMethod(
  322. smalltalk.method({
  323. selector: "theClass",
  324. category: 'accessing',
  325. fn: function (){
  326. var self=this;
  327. return smalltalk.withContext(function($ctx1) {
  328. var $1;
  329. $1=self["@theClass"];
  330. return $1;
  331. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.SystemAnnouncement)})},
  332. args: [],
  333. source: "theClass\x0a\x09^ theClass",
  334. messageSends: [],
  335. referencedClasses: []
  336. }),
  337. smalltalk.SystemAnnouncement);
  338. smalltalk.addMethod(
  339. smalltalk.method({
  340. selector: "theClass:",
  341. category: 'accessing',
  342. fn: function (aClass){
  343. var self=this;
  344. return smalltalk.withContext(function($ctx1) {
  345. self["@theClass"]=aClass;
  346. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.SystemAnnouncement)})},
  347. args: ["aClass"],
  348. source: "theClass: aClass\x0a\x09theClass := aClass",
  349. messageSends: [],
  350. referencedClasses: []
  351. }),
  352. smalltalk.SystemAnnouncement);
  353. smalltalk.addMethod(
  354. smalltalk.method({
  355. selector: "heliosClass",
  356. category: 'helios',
  357. fn: function (){
  358. var self=this;
  359. return smalltalk.withContext(function($ctx1) {
  360. return "announcement";
  361. }, function($ctx1) {$ctx1.fill(self,"heliosClass",{},smalltalk.SystemAnnouncement.klass)})},
  362. args: [],
  363. source: "heliosClass\x0a\x09^ 'announcement'",
  364. messageSends: [],
  365. referencedClasses: []
  366. }),
  367. smalltalk.SystemAnnouncement.klass);
  368. smalltalk.addClass('ClassAnnouncement', smalltalk.SystemAnnouncement, ['theClass'], 'Kernel-Announcements');
  369. smalltalk.ClassAnnouncement.comment="I am the abstract superclass of class-related announcements.";
  370. smalltalk.addMethod(
  371. smalltalk.method({
  372. selector: "theClass",
  373. category: 'accessing',
  374. fn: function (){
  375. var self=this;
  376. return smalltalk.withContext(function($ctx1) {
  377. var $1;
  378. $1=self["@theClass"];
  379. return $1;
  380. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.ClassAnnouncement)})},
  381. args: [],
  382. source: "theClass\x0a\x09^ theClass",
  383. messageSends: [],
  384. referencedClasses: []
  385. }),
  386. smalltalk.ClassAnnouncement);
  387. smalltalk.addMethod(
  388. smalltalk.method({
  389. selector: "theClass:",
  390. category: 'accessing',
  391. fn: function (aClass){
  392. var self=this;
  393. return smalltalk.withContext(function($ctx1) {
  394. self["@theClass"]=aClass;
  395. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.ClassAnnouncement)})},
  396. args: ["aClass"],
  397. source: "theClass: aClass\x0a\x09theClass := aClass",
  398. messageSends: [],
  399. referencedClasses: []
  400. }),
  401. smalltalk.ClassAnnouncement);
  402. smalltalk.addClass('ClassAdded', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
  403. smalltalk.ClassAdded.comment="I am emitted when a class is added to the system.\x0aSee ClassBuilder >> #addSubclassOf:... methods";
  404. smalltalk.addClass('ClassCommentChanged', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
  405. smalltalk.ClassCommentChanged.comment="I am emitted when the comment of a class changes. (Behavior >> #comment)";
  406. smalltalk.addClass('ClassDefinitionChanged', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
  407. smalltalk.ClassDefinitionChanged.comment="I am emitted when the definition of a class changes.\x0aSee ClassBuilder >> #class:instanceVariableNames:";
  408. smalltalk.addClass('ClassMigrated', smalltalk.ClassAnnouncement, ['oldClass'], 'Kernel-Announcements');
  409. smalltalk.ClassMigrated.comment="I am emitted when a class is migrated.";
  410. smalltalk.addMethod(
  411. smalltalk.method({
  412. selector: "oldClass",
  413. category: 'accessing',
  414. fn: function (){
  415. var self=this;
  416. return smalltalk.withContext(function($ctx1) {
  417. var $1;
  418. $1=self["@oldClass"];
  419. return $1;
  420. }, function($ctx1) {$ctx1.fill(self,"oldClass",{},smalltalk.ClassMigrated)})},
  421. args: [],
  422. source: "oldClass\x0a\x09^ oldClass",
  423. messageSends: [],
  424. referencedClasses: []
  425. }),
  426. smalltalk.ClassMigrated);
  427. smalltalk.addMethod(
  428. smalltalk.method({
  429. selector: "oldClass:",
  430. category: 'accessing',
  431. fn: function (aClass){
  432. var self=this;
  433. return smalltalk.withContext(function($ctx1) {
  434. self["@oldClass"]=aClass;
  435. return self}, function($ctx1) {$ctx1.fill(self,"oldClass:",{aClass:aClass},smalltalk.ClassMigrated)})},
  436. args: ["aClass"],
  437. source: "oldClass: aClass\x0a\x09oldClass := aClass",
  438. messageSends: [],
  439. referencedClasses: []
  440. }),
  441. smalltalk.ClassMigrated);
  442. smalltalk.addClass('ClassMoved', smalltalk.ClassAnnouncement, ['oldPackage'], 'Kernel-Announcements');
  443. smalltalk.ClassMoved.comment="I am emitted when a class is moved from one package to another.";
  444. smalltalk.addMethod(
  445. smalltalk.method({
  446. selector: "oldPackage",
  447. category: 'accessing',
  448. fn: function (){
  449. var self=this;
  450. return smalltalk.withContext(function($ctx1) {
  451. var $1;
  452. $1=self["@oldPackage"];
  453. return $1;
  454. }, function($ctx1) {$ctx1.fill(self,"oldPackage",{},smalltalk.ClassMoved)})},
  455. args: [],
  456. source: "oldPackage\x0a\x09^ oldPackage",
  457. messageSends: [],
  458. referencedClasses: []
  459. }),
  460. smalltalk.ClassMoved);
  461. smalltalk.addMethod(
  462. smalltalk.method({
  463. selector: "oldPackage:",
  464. category: 'accessing',
  465. fn: function (aPackage){
  466. var self=this;
  467. return smalltalk.withContext(function($ctx1) {
  468. self["@oldPackage"]=aPackage;
  469. return self}, function($ctx1) {$ctx1.fill(self,"oldPackage:",{aPackage:aPackage},smalltalk.ClassMoved)})},
  470. args: ["aPackage"],
  471. source: "oldPackage: aPackage\x0a\x09oldPackage := aPackage",
  472. messageSends: [],
  473. referencedClasses: []
  474. }),
  475. smalltalk.ClassMoved);
  476. smalltalk.addClass('ClassRemoved', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
  477. smalltalk.ClassRemoved.comment="I am emitted when a class is removed.\x0aSee Smalltalk >> #removeClass:";
  478. smalltalk.addClass('ClassRenamed', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
  479. smalltalk.ClassRenamed.comment="I am emitted when a class is renamed.\x0aSee ClassBuilder >> #renameClass:to:";
  480. smalltalk.addClass('MethodAnnouncement', smalltalk.SystemAnnouncement, ['method'], 'Kernel-Announcements');
  481. smalltalk.MethodAnnouncement.comment="I am the abstract superclass of method-related announcements.";
  482. smalltalk.addMethod(
  483. smalltalk.method({
  484. selector: "method",
  485. category: 'accessing',
  486. fn: function (){
  487. var self=this;
  488. return smalltalk.withContext(function($ctx1) {
  489. var $1;
  490. $1=self["@method"];
  491. return $1;
  492. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.MethodAnnouncement)})},
  493. args: [],
  494. source: "method\x0a\x09^ method",
  495. messageSends: [],
  496. referencedClasses: []
  497. }),
  498. smalltalk.MethodAnnouncement);
  499. smalltalk.addMethod(
  500. smalltalk.method({
  501. selector: "method:",
  502. category: 'accessing',
  503. fn: function (aCompiledMethod){
  504. var self=this;
  505. return smalltalk.withContext(function($ctx1) {
  506. self["@method"]=aCompiledMethod;
  507. return self}, function($ctx1) {$ctx1.fill(self,"method:",{aCompiledMethod:aCompiledMethod},smalltalk.MethodAnnouncement)})},
  508. args: ["aCompiledMethod"],
  509. source: "method: aCompiledMethod\x0a\x09method := aCompiledMethod",
  510. messageSends: [],
  511. referencedClasses: []
  512. }),
  513. smalltalk.MethodAnnouncement);
  514. smalltalk.addClass('MethodAdded', smalltalk.MethodAnnouncement, [], 'Kernel-Announcements');
  515. smalltalk.MethodAdded.comment="I am emitted when a `CompiledMethod` is added to a class.";
  516. smalltalk.addClass('MethodModified', smalltalk.MethodAnnouncement, ['oldMethod'], 'Kernel-Announcements');
  517. 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.";
  518. smalltalk.addMethod(
  519. smalltalk.method({
  520. selector: "oldMethod",
  521. category: 'accessing',
  522. fn: function (){
  523. var self=this;
  524. return smalltalk.withContext(function($ctx1) {
  525. var $1;
  526. $1=self["@oldMethod"];
  527. return $1;
  528. }, function($ctx1) {$ctx1.fill(self,"oldMethod",{},smalltalk.MethodModified)})},
  529. args: [],
  530. source: "oldMethod\x0a\x09^ oldMethod",
  531. messageSends: [],
  532. referencedClasses: []
  533. }),
  534. smalltalk.MethodModified);
  535. smalltalk.addMethod(
  536. smalltalk.method({
  537. selector: "oldMethod:",
  538. category: 'accessing',
  539. fn: function (aMethod){
  540. var self=this;
  541. return smalltalk.withContext(function($ctx1) {
  542. self["@oldMethod"]=aMethod;
  543. return self}, function($ctx1) {$ctx1.fill(self,"oldMethod:",{aMethod:aMethod},smalltalk.MethodModified)})},
  544. args: ["aMethod"],
  545. source: "oldMethod: aMethod\x0a\x09oldMethod := aMethod",
  546. messageSends: [],
  547. referencedClasses: []
  548. }),
  549. smalltalk.MethodModified);
  550. smalltalk.addClass('MethodMoved', smalltalk.MethodAnnouncement, ['oldProtocol'], 'Kernel-Announcements');
  551. 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.";
  552. smalltalk.addMethod(
  553. smalltalk.method({
  554. selector: "oldProtocol",
  555. category: 'accessing',
  556. fn: function (){
  557. var self=this;
  558. return smalltalk.withContext(function($ctx1) {
  559. var $1;
  560. $1=self["@oldProtocol"];
  561. return $1;
  562. }, function($ctx1) {$ctx1.fill(self,"oldProtocol",{},smalltalk.MethodMoved)})},
  563. args: [],
  564. source: "oldProtocol\x0a\x09^ oldProtocol",
  565. messageSends: [],
  566. referencedClasses: []
  567. }),
  568. smalltalk.MethodMoved);
  569. smalltalk.addMethod(
  570. smalltalk.method({
  571. selector: "oldProtocol:",
  572. category: 'accessing',
  573. fn: function (aString){
  574. var self=this;
  575. return smalltalk.withContext(function($ctx1) {
  576. self["@oldProtocol"]=aString;
  577. return self}, function($ctx1) {$ctx1.fill(self,"oldProtocol:",{aString:aString},smalltalk.MethodMoved)})},
  578. args: ["aString"],
  579. source: "oldProtocol: aString\x0a\x09oldProtocol := aString",
  580. messageSends: [],
  581. referencedClasses: []
  582. }),
  583. smalltalk.MethodMoved);
  584. smalltalk.addClass('MethodRemoved', smalltalk.MethodAnnouncement, [], 'Kernel-Announcements');
  585. smalltalk.MethodRemoved.comment="I am emitted when a `CompiledMethod` is removed from a class.";
  586. smalltalk.addClass('PackageAnnouncement', smalltalk.SystemAnnouncement, ['package'], 'Kernel-Announcements');
  587. smalltalk.PackageAnnouncement.comment="I am the abstract superclass of package-related announcements.";
  588. smalltalk.addMethod(
  589. smalltalk.method({
  590. selector: "package",
  591. category: 'accessing',
  592. fn: function (){
  593. var self=this;
  594. return smalltalk.withContext(function($ctx1) {
  595. var $1;
  596. $1=self["@package"];
  597. return $1;
  598. }, function($ctx1) {$ctx1.fill(self,"package",{},smalltalk.PackageAnnouncement)})},
  599. args: [],
  600. source: "package\x0a\x09^ package",
  601. messageSends: [],
  602. referencedClasses: []
  603. }),
  604. smalltalk.PackageAnnouncement);
  605. smalltalk.addMethod(
  606. smalltalk.method({
  607. selector: "package:",
  608. category: 'accessing',
  609. fn: function (aPackage){
  610. var self=this;
  611. return smalltalk.withContext(function($ctx1) {
  612. self["@package"]=aPackage;
  613. return self}, function($ctx1) {$ctx1.fill(self,"package:",{aPackage:aPackage},smalltalk.PackageAnnouncement)})},
  614. args: ["aPackage"],
  615. source: "package: aPackage\x0a\x09package := aPackage",
  616. messageSends: [],
  617. referencedClasses: []
  618. }),
  619. smalltalk.PackageAnnouncement);
  620. smalltalk.addClass('PackageAdded', smalltalk.PackageAnnouncement, [], 'Kernel-Announcements');
  621. smalltalk.PackageAdded.comment="I am emitted when a `Package` is added to the system.";
  622. smalltalk.addClass('PackageRemoved', smalltalk.PackageAnnouncement, [], 'Kernel-Announcements');
  623. smalltalk.PackageRemoved.comment="I am emitted when a `Package` is removed from the system.";
  624. smalltalk.addClass('ProtocolAnnouncement', smalltalk.SystemAnnouncement, ['theClass', 'protocol'], 'Kernel-Announcements');
  625. smalltalk.ProtocolAnnouncement.comment="I am the abstract superclass of protocol-related announcements.";
  626. smalltalk.addMethod(
  627. smalltalk.method({
  628. selector: "protocol",
  629. category: 'accessing',
  630. fn: function (){
  631. var self=this;
  632. return smalltalk.withContext(function($ctx1) {
  633. var $1;
  634. $1=self["@protocol"];
  635. return $1;
  636. }, function($ctx1) {$ctx1.fill(self,"protocol",{},smalltalk.ProtocolAnnouncement)})},
  637. args: [],
  638. source: "protocol\x0a\x09^ protocol",
  639. messageSends: [],
  640. referencedClasses: []
  641. }),
  642. smalltalk.ProtocolAnnouncement);
  643. smalltalk.addMethod(
  644. smalltalk.method({
  645. selector: "protocol:",
  646. category: 'accessing',
  647. fn: function (aString){
  648. var self=this;
  649. return smalltalk.withContext(function($ctx1) {
  650. self["@protocol"]=aString;
  651. return self}, function($ctx1) {$ctx1.fill(self,"protocol:",{aString:aString},smalltalk.ProtocolAnnouncement)})},
  652. args: ["aString"],
  653. source: "protocol: aString\x0a\x09protocol := aString",
  654. messageSends: [],
  655. referencedClasses: []
  656. }),
  657. smalltalk.ProtocolAnnouncement);
  658. smalltalk.addMethod(
  659. smalltalk.method({
  660. selector: "theClass",
  661. category: 'accessing',
  662. fn: function (){
  663. var self=this;
  664. return smalltalk.withContext(function($ctx1) {
  665. var $1;
  666. $1=self["@theClass"];
  667. return $1;
  668. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.ProtocolAnnouncement)})},
  669. args: [],
  670. source: "theClass\x0a\x09^ theClass",
  671. messageSends: [],
  672. referencedClasses: []
  673. }),
  674. smalltalk.ProtocolAnnouncement);
  675. smalltalk.addMethod(
  676. smalltalk.method({
  677. selector: "theClass:",
  678. category: 'accessing',
  679. fn: function (aClass){
  680. var self=this;
  681. return smalltalk.withContext(function($ctx1) {
  682. self["@theClass"]=aClass;
  683. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.ProtocolAnnouncement)})},
  684. args: ["aClass"],
  685. source: "theClass: aClass\x0a\x09theClass := aClass",
  686. messageSends: [],
  687. referencedClasses: []
  688. }),
  689. smalltalk.ProtocolAnnouncement);
  690. smalltalk.addClass('ProtocolAdded', smalltalk.ProtocolAnnouncement, [], 'Kernel-Announcements');
  691. smalltalk.ProtocolAdded.comment="I am emitted when a protocol is added to a class.";
  692. smalltalk.addClass('ProtocolRemoved', smalltalk.ProtocolAnnouncement, [], 'Kernel-Announcements');
  693. smalltalk.ProtocolRemoved.comment="I am emitted when a protocol is removed from a class.";
  694. });