1
0

Kernel-Announcements.js 26 KB

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