1
0

Kernel-Classes.js 118 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187
  1. define("amber_core/Kernel-Classes", ["amber/boot", "amber_core/Kernel-Objects"], function($boot){"use strict";
  2. var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
  3. $core.addPackage('Kernel-Classes');
  4. $core.packages["Kernel-Classes"].innerEval = function (expr) { return eval(expr); };
  5. $core.packages["Kernel-Classes"].transport = {"type":"amd","amdNamespace":"amber_core"};
  6. $core.addClass('Behavior', $globals.Object, [], 'Kernel-Classes');
  7. //>>excludeStart("ide", pragmas.excludeIdeData);
  8. $globals.Behavior.comment="I am the superclass of all class objects.\x0a\x0aI define the protocol for creating instances of a class with `#basicNew` and `#new` (see `boot.js` for class constructors details).\x0a\x0aMy instances know about the subclass/superclass relationships between classes, contain the description that instances are created from,\x0aand hold the method dictionary that's associated with each class.\x0a\x0aI also provides methods for compiling methods, examining the method dictionary, and iterating over the class hierarchy.";
  9. //>>excludeEnd("ide");
  10. $core.addMethod(
  11. $core.method({
  12. selector: ">>",
  13. protocol: 'accessing',
  14. fn: function (aString){
  15. var self=this;
  16. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  17. return $core.withContext(function($ctx1) {
  18. //>>excludeEnd("ctx");
  19. return self._methodAt_(aString);
  20. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  21. }, function($ctx1) {$ctx1.fill(self,">>",{aString:aString},$globals.Behavior)});
  22. //>>excludeEnd("ctx");
  23. },
  24. //>>excludeStart("ide", pragmas.excludeIdeData);
  25. args: ["aString"],
  26. source: ">> aString\x0a\x09^ self methodAt: aString",
  27. referencedClasses: [],
  28. //>>excludeEnd("ide");
  29. messageSends: ["methodAt:"]
  30. }),
  31. $globals.Behavior);
  32. $core.addMethod(
  33. $core.method({
  34. selector: "addCompiledMethod:",
  35. protocol: 'compiling',
  36. fn: function (aMethod){
  37. var self=this;
  38. var oldMethod,announcement;
  39. function $MethodAdded(){return $globals.MethodAdded||(typeof MethodAdded=="undefined"?nil:MethodAdded)}
  40. function $MethodModified(){return $globals.MethodModified||(typeof MethodModified=="undefined"?nil:MethodModified)}
  41. function $SystemAnnouncer(){return $globals.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  42. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  43. return $core.withContext(function($ctx1) {
  44. //>>excludeEnd("ctx");
  45. var $2,$3,$1,$4,$5,$6,$7,$8,$9,$10,$receiver;
  46. oldMethod=$recv(self._methodDictionary())._at_ifAbsent_($recv(aMethod)._selector(),(function(){
  47. return nil;
  48. }));
  49. $2=self._protocols();
  50. $3=$recv(aMethod)._protocol();
  51. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  52. $ctx1.sendIdx["protocol"]=1;
  53. //>>excludeEnd("ctx");
  54. $1=$recv($2)._includes_($3);
  55. if(!$core.assert($1)){
  56. $4=self._organization();
  57. $5=$recv(aMethod)._protocol();
  58. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  59. $ctx1.sendIdx["protocol"]=2;
  60. //>>excludeEnd("ctx");
  61. $recv($4)._addElement_($5);
  62. };
  63. self._basicAddCompiledMethod_(aMethod);
  64. $6=oldMethod;
  65. if(($receiver = $6) == null || $receiver.isNil){
  66. $6;
  67. } else {
  68. self._removeProtocolIfEmpty_($recv(oldMethod)._protocol());
  69. };
  70. $7=oldMethod;
  71. if(($receiver = $7) == null || $receiver.isNil){
  72. $8=$recv($MethodAdded())._new();
  73. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  74. $ctx1.sendIdx["new"]=1;
  75. //>>excludeEnd("ctx");
  76. $recv($8)._method_(aMethod);
  77. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  78. $ctx1.sendIdx["method:"]=1;
  79. //>>excludeEnd("ctx");
  80. $9=$recv($8)._yourself();
  81. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  82. $ctx1.sendIdx["yourself"]=1;
  83. //>>excludeEnd("ctx");
  84. announcement=$9;
  85. } else {
  86. $10=$recv($MethodModified())._new();
  87. $recv($10)._oldMethod_(oldMethod);
  88. $recv($10)._method_(aMethod);
  89. announcement=$recv($10)._yourself();
  90. };
  91. $recv($recv($SystemAnnouncer())._current())._announce_(announcement);
  92. return self;
  93. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  94. }, function($ctx1) {$ctx1.fill(self,"addCompiledMethod:",{aMethod:aMethod,oldMethod:oldMethod,announcement:announcement},$globals.Behavior)});
  95. //>>excludeEnd("ctx");
  96. },
  97. //>>excludeStart("ide", pragmas.excludeIdeData);
  98. args: ["aMethod"],
  99. source: "addCompiledMethod: aMethod\x0a\x09| oldMethod announcement |\x0a\x09\x0a\x09oldMethod := self methodDictionary\x0a\x09\x09at: aMethod selector\x0a\x09\x09ifAbsent: [ nil ].\x0a\x09\x0a\x09(self protocols includes: aMethod protocol)\x0a\x09\x09ifFalse: [ self organization addElement: aMethod protocol ].\x0a\x0a\x09self basicAddCompiledMethod: aMethod.\x0a\x09\x0a\x09oldMethod ifNotNil: [\x0a\x09\x09self removeProtocolIfEmpty: oldMethod protocol ].\x0a\x09\x0a\x09announcement := oldMethod\x0a\x09\x09ifNil: [\x0a\x09\x09\x09MethodAdded new\x0a\x09\x09\x09\x09\x09method: aMethod;\x0a\x09\x09\x09\x09\x09yourself ]\x0a\x09\x09ifNotNil: [\x0a\x09\x09\x09MethodModified new\x0a\x09\x09\x09\x09\x09oldMethod: oldMethod;\x0a\x09\x09\x09\x09\x09method: aMethod;\x0a\x09\x09\x09\x09\x09yourself ].\x0a\x09\x09\x09\x09\x09\x0a\x09\x09\x09\x09\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09\x09\x09announce: announcement",
  100. referencedClasses: ["MethodAdded", "MethodModified", "SystemAnnouncer"],
  101. //>>excludeEnd("ide");
  102. messageSends: ["at:ifAbsent:", "methodDictionary", "selector", "ifFalse:", "includes:", "protocols", "protocol", "addElement:", "organization", "basicAddCompiledMethod:", "ifNotNil:", "removeProtocolIfEmpty:", "ifNil:ifNotNil:", "method:", "new", "yourself", "oldMethod:", "announce:", "current"]
  103. }),
  104. $globals.Behavior);
  105. $core.addMethod(
  106. $core.method({
  107. selector: "allInstanceVariableNames",
  108. protocol: 'accessing',
  109. fn: function (){
  110. var self=this;
  111. var result;
  112. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  113. return $core.withContext(function($ctx1) {
  114. //>>excludeEnd("ctx");
  115. var $1,$receiver;
  116. result=$recv(self._instanceVariableNames())._copy();
  117. $1=self._superclass();
  118. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  119. $ctx1.sendIdx["superclass"]=1;
  120. //>>excludeEnd("ctx");
  121. if(($receiver = $1) == null || $receiver.isNil){
  122. $1;
  123. } else {
  124. $recv(result)._addAll_($recv(self._superclass())._allInstanceVariableNames());
  125. };
  126. return result;
  127. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  128. }, function($ctx1) {$ctx1.fill(self,"allInstanceVariableNames",{result:result},$globals.Behavior)});
  129. //>>excludeEnd("ctx");
  130. },
  131. //>>excludeStart("ide", pragmas.excludeIdeData);
  132. args: [],
  133. source: "allInstanceVariableNames\x0a\x09| result |\x0a\x09result := self instanceVariableNames copy.\x0a\x09self superclass ifNotNil: [\x0a\x09\x09result addAll: self superclass allInstanceVariableNames ].\x0a\x09^ result",
  134. referencedClasses: [],
  135. //>>excludeEnd("ide");
  136. messageSends: ["copy", "instanceVariableNames", "ifNotNil:", "superclass", "addAll:", "allInstanceVariableNames"]
  137. }),
  138. $globals.Behavior);
  139. $core.addMethod(
  140. $core.method({
  141. selector: "allSelectors",
  142. protocol: 'accessing',
  143. fn: function (){
  144. var self=this;
  145. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  146. return $core.withContext(function($ctx1) {
  147. //>>excludeEnd("ctx");
  148. var $1,$2;
  149. $1=self._allSuperclasses();
  150. $2=self._selectors();
  151. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  152. $ctx1.sendIdx["selectors"]=1;
  153. //>>excludeEnd("ctx");
  154. return $recv($1)._inject_into_($2,(function(acc,each){
  155. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  156. return $core.withContext(function($ctx2) {
  157. //>>excludeEnd("ctx");
  158. $recv(acc)._addAll_($recv(each)._selectors());
  159. return $recv(acc)._yourself();
  160. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  161. }, function($ctx2) {$ctx2.fillBlock({acc:acc,each:each},$ctx1,1)});
  162. //>>excludeEnd("ctx");
  163. }));
  164. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  165. }, function($ctx1) {$ctx1.fill(self,"allSelectors",{},$globals.Behavior)});
  166. //>>excludeEnd("ctx");
  167. },
  168. //>>excludeStart("ide", pragmas.excludeIdeData);
  169. args: [],
  170. source: "allSelectors\x0a\x09^ self allSuperclasses\x0a\x09\x09inject: self selectors\x0a\x09\x09into: [ :acc :each | acc addAll: each selectors; yourself ]",
  171. referencedClasses: [],
  172. //>>excludeEnd("ide");
  173. messageSends: ["inject:into:", "allSuperclasses", "selectors", "addAll:", "yourself"]
  174. }),
  175. $globals.Behavior);
  176. $core.addMethod(
  177. $core.method({
  178. selector: "allSubclasses",
  179. protocol: 'accessing',
  180. fn: function (){
  181. var self=this;
  182. var subclasses,index;
  183. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  184. return $core.withContext(function($ctx1) {
  185. //>>excludeEnd("ctx");
  186. subclasses=self._subclasses();
  187. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  188. $ctx1.sendIdx["subclasses"]=1;
  189. //>>excludeEnd("ctx");
  190. index=(1);
  191. $recv((function(){
  192. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  193. return $core.withContext(function($ctx2) {
  194. //>>excludeEnd("ctx");
  195. return $recv(index).__gt($recv(subclasses)._size());
  196. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  197. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  198. //>>excludeEnd("ctx");
  199. }))._whileFalse_((function(){
  200. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  201. return $core.withContext(function($ctx2) {
  202. //>>excludeEnd("ctx");
  203. $recv(subclasses)._addAll_($recv($recv(subclasses)._at_(index))._subclasses());
  204. index=$recv(index).__plus((1));
  205. return index;
  206. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  207. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  208. //>>excludeEnd("ctx");
  209. }));
  210. return subclasses;
  211. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  212. }, function($ctx1) {$ctx1.fill(self,"allSubclasses",{subclasses:subclasses,index:index},$globals.Behavior)});
  213. //>>excludeEnd("ctx");
  214. },
  215. //>>excludeStart("ide", pragmas.excludeIdeData);
  216. args: [],
  217. source: "allSubclasses\x0a\x09\x22Answer an collection of the receiver's and the receiver's descendent's subclasses. \x22\x0a\x0a\x09| subclasses index |\x0a\x09\x0a\x09subclasses := self subclasses.\x0a\x09index := 1.\x0a\x09[ index > subclasses size ]\x0a\x09\x09whileFalse: [ subclasses addAll: (subclasses at: index) subclasses.\x0a\x09\x09\x09index := index + 1 ].\x0a\x0a\x09^ subclasses",
  218. referencedClasses: [],
  219. //>>excludeEnd("ide");
  220. messageSends: ["subclasses", "whileFalse:", ">", "size", "addAll:", "at:", "+"]
  221. }),
  222. $globals.Behavior);
  223. $core.addMethod(
  224. $core.method({
  225. selector: "allSubclassesDo:",
  226. protocol: 'enumerating',
  227. fn: function (aBlock){
  228. var self=this;
  229. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  230. return $core.withContext(function($ctx1) {
  231. //>>excludeEnd("ctx");
  232. $recv(self._allSubclasses())._do_((function(each){
  233. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  234. return $core.withContext(function($ctx2) {
  235. //>>excludeEnd("ctx");
  236. return $recv(aBlock)._value_(each);
  237. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  238. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  239. //>>excludeEnd("ctx");
  240. }));
  241. return self;
  242. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  243. }, function($ctx1) {$ctx1.fill(self,"allSubclassesDo:",{aBlock:aBlock},$globals.Behavior)});
  244. //>>excludeEnd("ctx");
  245. },
  246. //>>excludeStart("ide", pragmas.excludeIdeData);
  247. args: ["aBlock"],
  248. source: "allSubclassesDo: aBlock\x0a\x09\x22Evaluate the argument, aBlock, for each of the receiver's subclasses.\x22\x0a\x0a\x09self allSubclasses do: [ :each |\x0a \x09aBlock value: each ]",
  249. referencedClasses: [],
  250. //>>excludeEnd("ide");
  251. messageSends: ["do:", "allSubclasses", "value:"]
  252. }),
  253. $globals.Behavior);
  254. $core.addMethod(
  255. $core.method({
  256. selector: "allSuperclasses",
  257. protocol: 'accessing',
  258. fn: function (){
  259. var self=this;
  260. function $OrderedCollection(){return $globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  261. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  262. return $core.withContext(function($ctx1) {
  263. //>>excludeEnd("ctx");
  264. var $1,$3,$2,$receiver;
  265. $1=self._superclass();
  266. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  267. $ctx1.sendIdx["superclass"]=1;
  268. //>>excludeEnd("ctx");
  269. if(($receiver = $1) == null || $receiver.isNil){
  270. return [];
  271. } else {
  272. $1;
  273. };
  274. $3=self._superclass();
  275. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  276. $ctx1.sendIdx["superclass"]=2;
  277. //>>excludeEnd("ctx");
  278. $2=$recv($OrderedCollection())._with_($3);
  279. $recv($2)._addAll_($recv(self._superclass())._allSuperclasses());
  280. return $recv($2)._yourself();
  281. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  282. }, function($ctx1) {$ctx1.fill(self,"allSuperclasses",{},$globals.Behavior)});
  283. //>>excludeEnd("ctx");
  284. },
  285. //>>excludeStart("ide", pragmas.excludeIdeData);
  286. args: [],
  287. source: "allSuperclasses\x0a\x09\x0a\x09self superclass ifNil: [ ^ #() ].\x0a\x09\x0a\x09^ (OrderedCollection with: self superclass)\x0a\x09\x09addAll: self superclass allSuperclasses;\x0a\x09\x09yourself",
  288. referencedClasses: ["OrderedCollection"],
  289. //>>excludeEnd("ide");
  290. messageSends: ["ifNil:", "superclass", "addAll:", "with:", "allSuperclasses", "yourself"]
  291. }),
  292. $globals.Behavior);
  293. $core.addMethod(
  294. $core.method({
  295. selector: "basicAddCompiledMethod:",
  296. protocol: 'private',
  297. fn: function (aMethod){
  298. var self=this;
  299. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  300. return $core.withContext(function($ctx1) {
  301. //>>excludeEnd("ctx");
  302. $core.addMethod(aMethod, self);
  303. return self;
  304. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  305. }, function($ctx1) {$ctx1.fill(self,"basicAddCompiledMethod:",{aMethod:aMethod},$globals.Behavior)});
  306. //>>excludeEnd("ctx");
  307. },
  308. //>>excludeStart("ide", pragmas.excludeIdeData);
  309. args: ["aMethod"],
  310. source: "basicAddCompiledMethod: aMethod\x0a\x09<$core.addMethod(aMethod, self)>",
  311. referencedClasses: [],
  312. //>>excludeEnd("ide");
  313. messageSends: []
  314. }),
  315. $globals.Behavior);
  316. $core.addMethod(
  317. $core.method({
  318. selector: "basicNew",
  319. protocol: 'instance creation',
  320. fn: function (){
  321. var self=this;
  322. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  323. return $core.withContext(function($ctx1) {
  324. //>>excludeEnd("ctx");
  325. return new self.fn();
  326. return self;
  327. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  328. }, function($ctx1) {$ctx1.fill(self,"basicNew",{},$globals.Behavior)});
  329. //>>excludeEnd("ctx");
  330. },
  331. //>>excludeStart("ide", pragmas.excludeIdeData);
  332. args: [],
  333. source: "basicNew\x0a\x09<return new self.fn()>",
  334. referencedClasses: [],
  335. //>>excludeEnd("ide");
  336. messageSends: []
  337. }),
  338. $globals.Behavior);
  339. $core.addMethod(
  340. $core.method({
  341. selector: "basicRemoveCompiledMethod:",
  342. protocol: 'private',
  343. fn: function (aMethod){
  344. var self=this;
  345. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  346. return $core.withContext(function($ctx1) {
  347. //>>excludeEnd("ctx");
  348. $core.removeMethod(aMethod,self);
  349. return self;
  350. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  351. }, function($ctx1) {$ctx1.fill(self,"basicRemoveCompiledMethod:",{aMethod:aMethod},$globals.Behavior)});
  352. //>>excludeEnd("ctx");
  353. },
  354. //>>excludeStart("ide", pragmas.excludeIdeData);
  355. args: ["aMethod"],
  356. source: "basicRemoveCompiledMethod: aMethod\x0a\x09<$core.removeMethod(aMethod,self)>",
  357. referencedClasses: [],
  358. //>>excludeEnd("ide");
  359. messageSends: []
  360. }),
  361. $globals.Behavior);
  362. $core.addMethod(
  363. $core.method({
  364. selector: "canUnderstand:",
  365. protocol: 'testing',
  366. fn: function (aSelector){
  367. var self=this;
  368. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  369. return $core.withContext(function($ctx1) {
  370. //>>excludeEnd("ctx");
  371. var $2,$1;
  372. return $recv(self._includesSelector_($recv(aSelector)._asString()))._or_((function(){
  373. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  374. return $core.withContext(function($ctx2) {
  375. //>>excludeEnd("ctx");
  376. $2=self._superclass();
  377. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  378. $ctx2.sendIdx["superclass"]=1;
  379. //>>excludeEnd("ctx");
  380. $1=$recv($2)._notNil();
  381. return $recv($1)._and_((function(){
  382. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  383. return $core.withContext(function($ctx3) {
  384. //>>excludeEnd("ctx");
  385. return $recv(self._superclass())._canUnderstand_(aSelector);
  386. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  387. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  388. //>>excludeEnd("ctx");
  389. }));
  390. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  391. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  392. //>>excludeEnd("ctx");
  393. }));
  394. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  395. }, function($ctx1) {$ctx1.fill(self,"canUnderstand:",{aSelector:aSelector},$globals.Behavior)});
  396. //>>excludeEnd("ctx");
  397. },
  398. //>>excludeStart("ide", pragmas.excludeIdeData);
  399. args: ["aSelector"],
  400. source: "canUnderstand: aSelector\x0a\x09^ (self includesSelector: aSelector asString) or: [\x0a\x09\x09self superclass notNil and: [ self superclass canUnderstand: aSelector ]]",
  401. referencedClasses: [],
  402. //>>excludeEnd("ide");
  403. messageSends: ["or:", "includesSelector:", "asString", "and:", "notNil", "superclass", "canUnderstand:"]
  404. }),
  405. $globals.Behavior);
  406. $core.addMethod(
  407. $core.method({
  408. selector: "comment",
  409. protocol: 'accessing',
  410. fn: function (){
  411. var self=this;
  412. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  413. return $core.withContext(function($ctx1) {
  414. //>>excludeEnd("ctx");
  415. var $1,$receiver;
  416. $1=self._basicAt_("comment");
  417. if(($receiver = $1) == null || $receiver.isNil){
  418. return "";
  419. } else {
  420. return $1;
  421. };
  422. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  423. }, function($ctx1) {$ctx1.fill(self,"comment",{},$globals.Behavior)});
  424. //>>excludeEnd("ctx");
  425. },
  426. //>>excludeStart("ide", pragmas.excludeIdeData);
  427. args: [],
  428. source: "comment\x0a\x09^ (self basicAt: 'comment') ifNil: [ '' ]",
  429. referencedClasses: [],
  430. //>>excludeEnd("ide");
  431. messageSends: ["ifNil:", "basicAt:"]
  432. }),
  433. $globals.Behavior);
  434. $core.addMethod(
  435. $core.method({
  436. selector: "comment:",
  437. protocol: 'accessing',
  438. fn: function (aString){
  439. var self=this;
  440. function $SystemAnnouncer(){return $globals.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  441. function $ClassCommentChanged(){return $globals.ClassCommentChanged||(typeof ClassCommentChanged=="undefined"?nil:ClassCommentChanged)}
  442. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  443. return $core.withContext(function($ctx1) {
  444. //>>excludeEnd("ctx");
  445. var $1,$3,$2;
  446. self._basicAt_put_("comment",aString);
  447. $1=$recv($SystemAnnouncer())._current();
  448. $3=$recv($ClassCommentChanged())._new();
  449. $recv($3)._theClass_(self);
  450. $2=$recv($3)._yourself();
  451. $recv($1)._announce_($2);
  452. return self;
  453. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  454. }, function($ctx1) {$ctx1.fill(self,"comment:",{aString:aString},$globals.Behavior)});
  455. //>>excludeEnd("ctx");
  456. },
  457. //>>excludeStart("ide", pragmas.excludeIdeData);
  458. args: ["aString"],
  459. source: "comment: aString\x0a\x09self basicAt: 'comment' put: aString.\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (ClassCommentChanged new\x0a\x09\x09\x09theClass: self;\x0a\x09\x09\x09yourself)",
  460. referencedClasses: ["SystemAnnouncer", "ClassCommentChanged"],
  461. //>>excludeEnd("ide");
  462. messageSends: ["basicAt:put:", "announce:", "current", "theClass:", "new", "yourself"]
  463. }),
  464. $globals.Behavior);
  465. $core.addMethod(
  466. $core.method({
  467. selector: "compile:protocol:",
  468. protocol: 'compiling',
  469. fn: function (aString,anotherString){
  470. var self=this;
  471. function $Compiler(){return $globals.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  472. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  473. return $core.withContext(function($ctx1) {
  474. //>>excludeEnd("ctx");
  475. return $recv($recv($Compiler())._new())._install_forClass_protocol_(aString,self,anotherString);
  476. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  477. }, function($ctx1) {$ctx1.fill(self,"compile:protocol:",{aString:aString,anotherString:anotherString},$globals.Behavior)});
  478. //>>excludeEnd("ctx");
  479. },
  480. //>>excludeStart("ide", pragmas.excludeIdeData);
  481. args: ["aString", "anotherString"],
  482. source: "compile: aString protocol: anotherString\x0a\x09^ Compiler new\x0a\x09\x09install: aString\x0a\x09\x09forClass: self\x0a\x09\x09protocol: anotherString",
  483. referencedClasses: ["Compiler"],
  484. //>>excludeEnd("ide");
  485. messageSends: ["install:forClass:protocol:", "new"]
  486. }),
  487. $globals.Behavior);
  488. $core.addMethod(
  489. $core.method({
  490. selector: "definition",
  491. protocol: 'accessing',
  492. fn: function (){
  493. var self=this;
  494. return "";
  495. },
  496. //>>excludeStart("ide", pragmas.excludeIdeData);
  497. args: [],
  498. source: "definition\x0a\x09^ ''",
  499. referencedClasses: [],
  500. //>>excludeEnd("ide");
  501. messageSends: []
  502. }),
  503. $globals.Behavior);
  504. $core.addMethod(
  505. $core.method({
  506. selector: "includesBehavior:",
  507. protocol: 'testing',
  508. fn: function (aClass){
  509. var self=this;
  510. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  511. return $core.withContext(function($ctx1) {
  512. //>>excludeEnd("ctx");
  513. return $recv(self.__eq_eq(aClass))._or_((function(){
  514. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  515. return $core.withContext(function($ctx2) {
  516. //>>excludeEnd("ctx");
  517. return self._inheritsFrom_(aClass);
  518. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  519. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  520. //>>excludeEnd("ctx");
  521. }));
  522. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  523. }, function($ctx1) {$ctx1.fill(self,"includesBehavior:",{aClass:aClass},$globals.Behavior)});
  524. //>>excludeEnd("ctx");
  525. },
  526. //>>excludeStart("ide", pragmas.excludeIdeData);
  527. args: ["aClass"],
  528. source: "includesBehavior: aClass\x0a\x09^ self == aClass or: [\x0a\x09\x09\x09self inheritsFrom: aClass ]",
  529. referencedClasses: [],
  530. //>>excludeEnd("ide");
  531. messageSends: ["or:", "==", "inheritsFrom:"]
  532. }),
  533. $globals.Behavior);
  534. $core.addMethod(
  535. $core.method({
  536. selector: "includesSelector:",
  537. protocol: 'testing',
  538. fn: function (aString){
  539. var self=this;
  540. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  541. return $core.withContext(function($ctx1) {
  542. //>>excludeEnd("ctx");
  543. return $recv(self._methodDictionary())._includesKey_(aString);
  544. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  545. }, function($ctx1) {$ctx1.fill(self,"includesSelector:",{aString:aString},$globals.Behavior)});
  546. //>>excludeEnd("ctx");
  547. },
  548. //>>excludeStart("ide", pragmas.excludeIdeData);
  549. args: ["aString"],
  550. source: "includesSelector: aString\x0a\x09^ self methodDictionary includesKey: aString",
  551. referencedClasses: [],
  552. //>>excludeEnd("ide");
  553. messageSends: ["includesKey:", "methodDictionary"]
  554. }),
  555. $globals.Behavior);
  556. $core.addMethod(
  557. $core.method({
  558. selector: "inheritsFrom:",
  559. protocol: 'testing',
  560. fn: function (aClass){
  561. var self=this;
  562. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  563. return $core.withContext(function($ctx1) {
  564. //>>excludeEnd("ctx");
  565. var $1,$3,$2,$receiver;
  566. $1=self._superclass();
  567. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  568. $ctx1.sendIdx["superclass"]=1;
  569. //>>excludeEnd("ctx");
  570. if(($receiver = $1) == null || $receiver.isNil){
  571. return false;
  572. } else {
  573. $1;
  574. };
  575. $3=self._superclass();
  576. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  577. $ctx1.sendIdx["superclass"]=2;
  578. //>>excludeEnd("ctx");
  579. $2=$recv(aClass).__eq_eq($3);
  580. return $recv($2)._or_((function(){
  581. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  582. return $core.withContext(function($ctx2) {
  583. //>>excludeEnd("ctx");
  584. return $recv(self._superclass())._inheritsFrom_(aClass);
  585. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  586. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  587. //>>excludeEnd("ctx");
  588. }));
  589. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  590. }, function($ctx1) {$ctx1.fill(self,"inheritsFrom:",{aClass:aClass},$globals.Behavior)});
  591. //>>excludeEnd("ctx");
  592. },
  593. //>>excludeStart("ide", pragmas.excludeIdeData);
  594. args: ["aClass"],
  595. source: "inheritsFrom: aClass\x0a\x09self superclass ifNil: [ ^ false ].\x0a\x0a\x09^ aClass == self superclass or: [ \x0a\x09\x09self superclass inheritsFrom: aClass ]",
  596. referencedClasses: [],
  597. //>>excludeEnd("ide");
  598. messageSends: ["ifNil:", "superclass", "or:", "==", "inheritsFrom:"]
  599. }),
  600. $globals.Behavior);
  601. $core.addMethod(
  602. $core.method({
  603. selector: "instanceVariableNames",
  604. protocol: 'accessing',
  605. fn: function (){
  606. var self=this;
  607. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  608. return $core.withContext(function($ctx1) {
  609. //>>excludeEnd("ctx");
  610. return self.iVarNames;
  611. return self;
  612. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  613. }, function($ctx1) {$ctx1.fill(self,"instanceVariableNames",{},$globals.Behavior)});
  614. //>>excludeEnd("ctx");
  615. },
  616. //>>excludeStart("ide", pragmas.excludeIdeData);
  617. args: [],
  618. source: "instanceVariableNames\x0a\x09<return self.iVarNames>",
  619. referencedClasses: [],
  620. //>>excludeEnd("ide");
  621. messageSends: []
  622. }),
  623. $globals.Behavior);
  624. $core.addMethod(
  625. $core.method({
  626. selector: "isBehavior",
  627. protocol: 'testing',
  628. fn: function (){
  629. var self=this;
  630. return true;
  631. },
  632. //>>excludeStart("ide", pragmas.excludeIdeData);
  633. args: [],
  634. source: "isBehavior\x0a\x09^ true",
  635. referencedClasses: [],
  636. //>>excludeEnd("ide");
  637. messageSends: []
  638. }),
  639. $globals.Behavior);
  640. $core.addMethod(
  641. $core.method({
  642. selector: "javascriptConstructor",
  643. protocol: 'accessing',
  644. fn: function (){
  645. var self=this;
  646. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  647. return $core.withContext(function($ctx1) {
  648. //>>excludeEnd("ctx");
  649. return self.fn;
  650. return self;
  651. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  652. }, function($ctx1) {$ctx1.fill(self,"javascriptConstructor",{},$globals.Behavior)});
  653. //>>excludeEnd("ctx");
  654. },
  655. //>>excludeStart("ide", pragmas.excludeIdeData);
  656. args: [],
  657. source: "javascriptConstructor\x0a\x09\x22Answer the JS constructor used to instantiate. See boot.js\x22\x0a\x09\x0a\x09<return self.fn>",
  658. referencedClasses: [],
  659. //>>excludeEnd("ide");
  660. messageSends: []
  661. }),
  662. $globals.Behavior);
  663. $core.addMethod(
  664. $core.method({
  665. selector: "javascriptConstructor:",
  666. protocol: 'accessing',
  667. fn: function (aJavaScriptFunction){
  668. var self=this;
  669. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  670. return $core.withContext(function($ctx1) {
  671. //>>excludeEnd("ctx");
  672. $core.setClassConstructor(self, aJavaScriptFunction);;
  673. return self;
  674. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  675. }, function($ctx1) {$ctx1.fill(self,"javascriptConstructor:",{aJavaScriptFunction:aJavaScriptFunction},$globals.Behavior)});
  676. //>>excludeEnd("ctx");
  677. },
  678. //>>excludeStart("ide", pragmas.excludeIdeData);
  679. args: ["aJavaScriptFunction"],
  680. source: "javascriptConstructor: aJavaScriptFunction\x0a\x09\x22Set the JS constructor used to instantiate.\x0a\x09See the JS counter-part in boot.js `$core.setClassConstructor'\x22\x0a\x09\x0a\x09<$core.setClassConstructor(self, aJavaScriptFunction);>",
  681. referencedClasses: [],
  682. //>>excludeEnd("ide");
  683. messageSends: []
  684. }),
  685. $globals.Behavior);
  686. $core.addMethod(
  687. $core.method({
  688. selector: "lookupSelector:",
  689. protocol: 'accessing',
  690. fn: function (selector){
  691. var self=this;
  692. var lookupClass;
  693. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  694. return $core.withContext(function($ctx1) {
  695. //>>excludeEnd("ctx");
  696. var $1;
  697. var $early={};
  698. try {
  699. lookupClass=self;
  700. $recv((function(){
  701. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  702. return $core.withContext(function($ctx2) {
  703. //>>excludeEnd("ctx");
  704. return $recv(lookupClass).__eq(nil);
  705. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  706. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  707. //>>excludeEnd("ctx");
  708. }))._whileFalse_((function(){
  709. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  710. return $core.withContext(function($ctx2) {
  711. //>>excludeEnd("ctx");
  712. $1=$recv(lookupClass)._includesSelector_(selector);
  713. if($core.assert($1)){
  714. throw $early=[$recv(lookupClass)._methodAt_(selector)];
  715. };
  716. lookupClass=$recv(lookupClass)._superclass();
  717. return lookupClass;
  718. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  719. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  720. //>>excludeEnd("ctx");
  721. }));
  722. return nil;
  723. }
  724. catch(e) {if(e===$early)return e[0]; throw e}
  725. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  726. }, function($ctx1) {$ctx1.fill(self,"lookupSelector:",{selector:selector,lookupClass:lookupClass},$globals.Behavior)});
  727. //>>excludeEnd("ctx");
  728. },
  729. //>>excludeStart("ide", pragmas.excludeIdeData);
  730. args: ["selector"],
  731. source: "lookupSelector: selector\x0a\x09\x22Look up the given selector in my methodDictionary.\x0a\x09Return the corresponding method if found.\x0a\x09Otherwise chase the superclass chain and try again.\x0a\x09Return nil if no method is found.\x22\x0a\x09\x0a\x09| lookupClass |\x0a\x09\x0a\x09lookupClass := self.\x0a\x09[ lookupClass = nil ] whileFalse: [\x0a\x09\x09(lookupClass includesSelector: selector)\x0a\x09\x09\x09\x09ifTrue: [ ^ lookupClass methodAt: selector ].\x0a\x09\x09\x09lookupClass := lookupClass superclass ].\x0a\x09^ nil",
  732. referencedClasses: [],
  733. //>>excludeEnd("ide");
  734. messageSends: ["whileFalse:", "=", "ifTrue:", "includesSelector:", "methodAt:", "superclass"]
  735. }),
  736. $globals.Behavior);
  737. $core.addMethod(
  738. $core.method({
  739. selector: "methodAt:",
  740. protocol: 'accessing',
  741. fn: function (aString){
  742. var self=this;
  743. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  744. return $core.withContext(function($ctx1) {
  745. //>>excludeEnd("ctx");
  746. return $recv(self._methodDictionary())._at_(aString);
  747. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  748. }, function($ctx1) {$ctx1.fill(self,"methodAt:",{aString:aString},$globals.Behavior)});
  749. //>>excludeEnd("ctx");
  750. },
  751. //>>excludeStart("ide", pragmas.excludeIdeData);
  752. args: ["aString"],
  753. source: "methodAt: aString\x0a\x09^ self methodDictionary at: aString",
  754. referencedClasses: [],
  755. //>>excludeEnd("ide");
  756. messageSends: ["at:", "methodDictionary"]
  757. }),
  758. $globals.Behavior);
  759. $core.addMethod(
  760. $core.method({
  761. selector: "methodDictionary",
  762. protocol: 'accessing',
  763. fn: function (){
  764. var self=this;
  765. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  766. return $core.withContext(function($ctx1) {
  767. //>>excludeEnd("ctx");
  768. var dict = $globals.HashedCollection._new();
  769. var methods = self.methods;
  770. Object.keys(methods).forEach(function(i) {
  771. if(methods[i].selector) {
  772. dict._at_put_(methods[i].selector, methods[i]);
  773. }
  774. });
  775. return dict;
  776. return self;
  777. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  778. }, function($ctx1) {$ctx1.fill(self,"methodDictionary",{},$globals.Behavior)});
  779. //>>excludeEnd("ctx");
  780. },
  781. //>>excludeStart("ide", pragmas.excludeIdeData);
  782. args: [],
  783. source: "methodDictionary\x0a\x09<var dict = $globals.HashedCollection._new();\x0a\x09var methods = self.methods;\x0a\x09Object.keys(methods).forEach(function(i) {\x0a\x09\x09if(methods[i].selector) {\x0a\x09\x09\x09dict._at_put_(methods[i].selector, methods[i]);\x0a\x09\x09}\x0a\x09});\x0a\x09return dict>",
  784. referencedClasses: [],
  785. //>>excludeEnd("ide");
  786. messageSends: []
  787. }),
  788. $globals.Behavior);
  789. $core.addMethod(
  790. $core.method({
  791. selector: "methodTemplate",
  792. protocol: 'accessing',
  793. fn: function (){
  794. var self=this;
  795. function $String(){return $globals.String||(typeof String=="undefined"?nil:String)}
  796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  797. return $core.withContext(function($ctx1) {
  798. //>>excludeEnd("ctx");
  799. var $2,$3,$1,$6,$7,$5,$8,$4;
  800. return $recv($String())._streamContents_((function(stream){
  801. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  802. return $core.withContext(function($ctx2) {
  803. //>>excludeEnd("ctx");
  804. $recv(stream)._nextPutAll_("messageSelectorAndArgumentNames");
  805. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  806. $ctx2.sendIdx["nextPutAll:"]=1;
  807. //>>excludeEnd("ctx");
  808. $2=$recv($String())._lf();
  809. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  810. $ctx2.sendIdx["lf"]=1;
  811. //>>excludeEnd("ctx");
  812. $3=$recv($String())._tab();
  813. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  814. $ctx2.sendIdx["tab"]=1;
  815. //>>excludeEnd("ctx");
  816. $1=$recv($2).__comma($3);
  817. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  818. $ctx2.sendIdx[","]=1;
  819. //>>excludeEnd("ctx");
  820. $recv(stream)._nextPutAll_($1);
  821. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  822. $ctx2.sendIdx["nextPutAll:"]=2;
  823. //>>excludeEnd("ctx");
  824. $recv(stream)._nextPutAll_("\x22comment stating purpose of message\x22");
  825. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  826. $ctx2.sendIdx["nextPutAll:"]=3;
  827. //>>excludeEnd("ctx");
  828. $6=$recv($String())._lf();
  829. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  830. $ctx2.sendIdx["lf"]=2;
  831. //>>excludeEnd("ctx");
  832. $7=$recv($String())._lf();
  833. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  834. $ctx2.sendIdx["lf"]=3;
  835. //>>excludeEnd("ctx");
  836. $5=$recv($6).__comma($7);
  837. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  838. $ctx2.sendIdx[","]=3;
  839. //>>excludeEnd("ctx");
  840. $8=$recv($String())._tab();
  841. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  842. $ctx2.sendIdx["tab"]=2;
  843. //>>excludeEnd("ctx");
  844. $4=$recv($5).__comma($8);
  845. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  846. $ctx2.sendIdx[","]=2;
  847. //>>excludeEnd("ctx");
  848. $recv(stream)._nextPutAll_($4);
  849. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  850. $ctx2.sendIdx["nextPutAll:"]=4;
  851. //>>excludeEnd("ctx");
  852. $recv(stream)._nextPutAll_("| temporary variable names |");
  853. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  854. $ctx2.sendIdx["nextPutAll:"]=5;
  855. //>>excludeEnd("ctx");
  856. $recv(stream)._nextPutAll_($recv($recv($String())._lf()).__comma($recv($String())._tab()));
  857. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  858. $ctx2.sendIdx["nextPutAll:"]=6;
  859. //>>excludeEnd("ctx");
  860. return $recv(stream)._nextPutAll_("statements");
  861. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  862. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)});
  863. //>>excludeEnd("ctx");
  864. }));
  865. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  866. }, function($ctx1) {$ctx1.fill(self,"methodTemplate",{},$globals.Behavior)});
  867. //>>excludeEnd("ctx");
  868. },
  869. //>>excludeStart("ide", pragmas.excludeIdeData);
  870. args: [],
  871. source: "methodTemplate\x0a\x09^ String streamContents: [ :stream |\x0a\x09\x09stream \x0a\x09\x09\x09nextPutAll: 'messageSelectorAndArgumentNames';\x0a\x09\x09\x09nextPutAll: String lf, String tab;\x0a\x09\x09\x09nextPutAll: '\x22comment stating purpose of message\x22';\x0a\x09\x09\x09nextPutAll: String lf, String lf, String tab;\x0a\x09\x09\x09nextPutAll: '| temporary variable names |';\x0a\x09\x09\x09nextPutAll: String lf, String tab;\x0a\x09\x09\x09nextPutAll: 'statements' ]",
  872. referencedClasses: ["String"],
  873. //>>excludeEnd("ide");
  874. messageSends: ["streamContents:", "nextPutAll:", ",", "lf", "tab"]
  875. }),
  876. $globals.Behavior);
  877. $core.addMethod(
  878. $core.method({
  879. selector: "methods",
  880. protocol: 'accessing',
  881. fn: function (){
  882. var self=this;
  883. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  884. return $core.withContext(function($ctx1) {
  885. //>>excludeEnd("ctx");
  886. return $recv(self._methodDictionary())._values();
  887. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  888. }, function($ctx1) {$ctx1.fill(self,"methods",{},$globals.Behavior)});
  889. //>>excludeEnd("ctx");
  890. },
  891. //>>excludeStart("ide", pragmas.excludeIdeData);
  892. args: [],
  893. source: "methods\x0a\x09^ self methodDictionary values",
  894. referencedClasses: [],
  895. //>>excludeEnd("ide");
  896. messageSends: ["values", "methodDictionary"]
  897. }),
  898. $globals.Behavior);
  899. $core.addMethod(
  900. $core.method({
  901. selector: "methodsInProtocol:",
  902. protocol: 'accessing',
  903. fn: function (aString){
  904. var self=this;
  905. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  906. return $core.withContext(function($ctx1) {
  907. //>>excludeEnd("ctx");
  908. return $recv(self._methods())._select_((function(each){
  909. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  910. return $core.withContext(function($ctx2) {
  911. //>>excludeEnd("ctx");
  912. return $recv($recv(each)._protocol()).__eq(aString);
  913. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  914. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  915. //>>excludeEnd("ctx");
  916. }));
  917. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  918. }, function($ctx1) {$ctx1.fill(self,"methodsInProtocol:",{aString:aString},$globals.Behavior)});
  919. //>>excludeEnd("ctx");
  920. },
  921. //>>excludeStart("ide", pragmas.excludeIdeData);
  922. args: ["aString"],
  923. source: "methodsInProtocol: aString\x0a\x09^ self methods select: [ :each | each protocol = aString ]",
  924. referencedClasses: [],
  925. //>>excludeEnd("ide");
  926. messageSends: ["select:", "methods", "=", "protocol"]
  927. }),
  928. $globals.Behavior);
  929. $core.addMethod(
  930. $core.method({
  931. selector: "name",
  932. protocol: 'accessing',
  933. fn: function (){
  934. var self=this;
  935. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  936. return $core.withContext(function($ctx1) {
  937. //>>excludeEnd("ctx");
  938. return self.className || nil;
  939. return self;
  940. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  941. }, function($ctx1) {$ctx1.fill(self,"name",{},$globals.Behavior)});
  942. //>>excludeEnd("ctx");
  943. },
  944. //>>excludeStart("ide", pragmas.excludeIdeData);
  945. args: [],
  946. source: "name\x0a\x09<return self.className || nil>",
  947. referencedClasses: [],
  948. //>>excludeEnd("ide");
  949. messageSends: []
  950. }),
  951. $globals.Behavior);
  952. $core.addMethod(
  953. $core.method({
  954. selector: "new",
  955. protocol: 'instance creation',
  956. fn: function (){
  957. var self=this;
  958. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  959. return $core.withContext(function($ctx1) {
  960. //>>excludeEnd("ctx");
  961. return $recv(self._basicNew())._initialize();
  962. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  963. }, function($ctx1) {$ctx1.fill(self,"new",{},$globals.Behavior)});
  964. //>>excludeEnd("ctx");
  965. },
  966. //>>excludeStart("ide", pragmas.excludeIdeData);
  967. args: [],
  968. source: "new\x0a\x09^ self basicNew initialize",
  969. referencedClasses: [],
  970. //>>excludeEnd("ide");
  971. messageSends: ["initialize", "basicNew"]
  972. }),
  973. $globals.Behavior);
  974. $core.addMethod(
  975. $core.method({
  976. selector: "organization",
  977. protocol: 'accessing',
  978. fn: function (){
  979. var self=this;
  980. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  981. return $core.withContext(function($ctx1) {
  982. //>>excludeEnd("ctx");
  983. return self._basicAt_("organization");
  984. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  985. }, function($ctx1) {$ctx1.fill(self,"organization",{},$globals.Behavior)});
  986. //>>excludeEnd("ctx");
  987. },
  988. //>>excludeStart("ide", pragmas.excludeIdeData);
  989. args: [],
  990. source: "organization\x0a\x09^ self basicAt: 'organization'",
  991. referencedClasses: [],
  992. //>>excludeEnd("ide");
  993. messageSends: ["basicAt:"]
  994. }),
  995. $globals.Behavior);
  996. $core.addMethod(
  997. $core.method({
  998. selector: "ownMethods",
  999. protocol: 'accessing',
  1000. fn: function (){
  1001. var self=this;
  1002. function $OrderedCollection(){return $globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  1003. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1004. return $core.withContext(function($ctx1) {
  1005. //>>excludeEnd("ctx");
  1006. var $1;
  1007. return $recv($recv(self._ownProtocols())._inject_into_($recv($OrderedCollection())._new(),(function(acc,each){
  1008. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1009. return $core.withContext(function($ctx2) {
  1010. //>>excludeEnd("ctx");
  1011. return $recv(acc).__comma(self._methodsInProtocol_(each));
  1012. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1013. }, function($ctx2) {$ctx2.fillBlock({acc:acc,each:each},$ctx1,1)});
  1014. //>>excludeEnd("ctx");
  1015. })))._sorted_((function(a,b){
  1016. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1017. return $core.withContext(function($ctx2) {
  1018. //>>excludeEnd("ctx");
  1019. $1=$recv(a)._selector();
  1020. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1021. $ctx2.sendIdx["selector"]=1;
  1022. //>>excludeEnd("ctx");
  1023. return $recv($1).__lt_eq($recv(b)._selector());
  1024. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1025. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,2)});
  1026. //>>excludeEnd("ctx");
  1027. }));
  1028. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1029. }, function($ctx1) {$ctx1.fill(self,"ownMethods",{},$globals.Behavior)});
  1030. //>>excludeEnd("ctx");
  1031. },
  1032. //>>excludeStart("ide", pragmas.excludeIdeData);
  1033. args: [],
  1034. source: "ownMethods\x0a\x09\x22Answer the methods of the receiver that are not package extensions\x22\x0a\x0a\x09^ (self ownProtocols \x0a\x09\x09inject: OrderedCollection new\x0a\x09\x09into: [ :acc :each | acc, (self methodsInProtocol: each) ])\x0a\x09\x09\x09sorted: [ :a :b | a selector <= b selector ]",
  1035. referencedClasses: ["OrderedCollection"],
  1036. //>>excludeEnd("ide");
  1037. messageSends: ["sorted:", "inject:into:", "ownProtocols", "new", ",", "methodsInProtocol:", "<=", "selector"]
  1038. }),
  1039. $globals.Behavior);
  1040. $core.addMethod(
  1041. $core.method({
  1042. selector: "ownProtocols",
  1043. protocol: 'accessing',
  1044. fn: function (){
  1045. var self=this;
  1046. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1047. return $core.withContext(function($ctx1) {
  1048. //>>excludeEnd("ctx");
  1049. return $recv(self._protocols())._reject_((function(each){
  1050. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1051. return $core.withContext(function($ctx2) {
  1052. //>>excludeEnd("ctx");
  1053. return $recv(each)._match_("^\x5c*");
  1054. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1055. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  1056. //>>excludeEnd("ctx");
  1057. }));
  1058. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1059. }, function($ctx1) {$ctx1.fill(self,"ownProtocols",{},$globals.Behavior)});
  1060. //>>excludeEnd("ctx");
  1061. },
  1062. //>>excludeStart("ide", pragmas.excludeIdeData);
  1063. args: [],
  1064. source: "ownProtocols\x0a\x09\x22Answer the protocols of the receiver that are not package extensions\x22\x0a\x0a\x09^ self protocols reject: [ :each |\x0a\x09\x09each match: '^\x5c*' ]",
  1065. referencedClasses: [],
  1066. //>>excludeEnd("ide");
  1067. messageSends: ["reject:", "protocols", "match:"]
  1068. }),
  1069. $globals.Behavior);
  1070. $core.addMethod(
  1071. $core.method({
  1072. selector: "packageOfProtocol:",
  1073. protocol: 'accessing',
  1074. fn: function (aString){
  1075. var self=this;
  1076. function $Package(){return $globals.Package||(typeof Package=="undefined"?nil:Package)}
  1077. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1078. return $core.withContext(function($ctx1) {
  1079. //>>excludeEnd("ctx");
  1080. var $1;
  1081. $1=$recv(aString)._beginsWith_("*");
  1082. if(!$core.assert($1)){
  1083. return self._package();
  1084. };
  1085. return $recv($Package())._named_ifAbsent_($recv(aString)._allButFirst(),(function(){
  1086. return nil;
  1087. }));
  1088. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1089. }, function($ctx1) {$ctx1.fill(self,"packageOfProtocol:",{aString:aString},$globals.Behavior)});
  1090. //>>excludeEnd("ctx");
  1091. },
  1092. //>>excludeStart("ide", pragmas.excludeIdeData);
  1093. args: ["aString"],
  1094. source: "packageOfProtocol: aString\x0a\x09\x22Answer the package the method of receiver belongs to:\x0a\x09- if it is an extension method, answer the corresponding package\x0a\x09- else answer the receiver's package\x22\x0a\x09\x0a\x09(aString beginsWith: '*') ifFalse: [\x0a\x09\x09^ self package ].\x0a\x09\x09\x0a\x09^ Package \x0a\x09\x09named: aString allButFirst\x0a\x09\x09ifAbsent: [ nil ]",
  1095. referencedClasses: ["Package"],
  1096. //>>excludeEnd("ide");
  1097. messageSends: ["ifFalse:", "beginsWith:", "package", "named:ifAbsent:", "allButFirst"]
  1098. }),
  1099. $globals.Behavior);
  1100. $core.addMethod(
  1101. $core.method({
  1102. selector: "protocols",
  1103. protocol: 'accessing',
  1104. fn: function (){
  1105. var self=this;
  1106. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1107. return $core.withContext(function($ctx1) {
  1108. //>>excludeEnd("ctx");
  1109. return $recv($recv(self._organization())._elements())._sorted();
  1110. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1111. }, function($ctx1) {$ctx1.fill(self,"protocols",{},$globals.Behavior)});
  1112. //>>excludeEnd("ctx");
  1113. },
  1114. //>>excludeStart("ide", pragmas.excludeIdeData);
  1115. args: [],
  1116. source: "protocols\x0a\x09^ self organization elements sorted",
  1117. referencedClasses: [],
  1118. //>>excludeEnd("ide");
  1119. messageSends: ["sorted", "elements", "organization"]
  1120. }),
  1121. $globals.Behavior);
  1122. $core.addMethod(
  1123. $core.method({
  1124. selector: "protocolsDo:",
  1125. protocol: 'enumerating',
  1126. fn: function (aBlock){
  1127. var self=this;
  1128. var methodsByProtocol;
  1129. function $HashedCollection(){return $globals.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  1130. function $Array(){return $globals.Array||(typeof Array=="undefined"?nil:Array)}
  1131. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1132. return $core.withContext(function($ctx1) {
  1133. //>>excludeEnd("ctx");
  1134. methodsByProtocol=$recv($HashedCollection())._new();
  1135. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1136. $ctx1.sendIdx["new"]=1;
  1137. //>>excludeEnd("ctx");
  1138. $recv(self._methodDictionary())._valuesDo_((function(m){
  1139. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1140. return $core.withContext(function($ctx2) {
  1141. //>>excludeEnd("ctx");
  1142. return $recv($recv(methodsByProtocol)._at_ifAbsentPut_($recv(m)._protocol(),(function(){
  1143. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1144. return $core.withContext(function($ctx3) {
  1145. //>>excludeEnd("ctx");
  1146. return $recv($Array())._new();
  1147. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1148. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  1149. //>>excludeEnd("ctx");
  1150. })))._add_(m);
  1151. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1152. }, function($ctx2) {$ctx2.fillBlock({m:m},$ctx1,1)});
  1153. //>>excludeEnd("ctx");
  1154. }));
  1155. $recv(self._protocols())._do_((function(protocol){
  1156. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1157. return $core.withContext(function($ctx2) {
  1158. //>>excludeEnd("ctx");
  1159. return $recv(aBlock)._value_value_(protocol,$recv(methodsByProtocol)._at_(protocol));
  1160. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1161. }, function($ctx2) {$ctx2.fillBlock({protocol:protocol},$ctx1,3)});
  1162. //>>excludeEnd("ctx");
  1163. }));
  1164. return self;
  1165. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1166. }, function($ctx1) {$ctx1.fill(self,"protocolsDo:",{aBlock:aBlock,methodsByProtocol:methodsByProtocol},$globals.Behavior)});
  1167. //>>excludeEnd("ctx");
  1168. },
  1169. //>>excludeStart("ide", pragmas.excludeIdeData);
  1170. args: ["aBlock"],
  1171. source: "protocolsDo: aBlock\x0a\x09\x22Execute aBlock for each method protocol with\x0a\x09its collection of methods in the sort order of protocol name.\x22\x0a\x0a\x09| methodsByProtocol |\x0a\x09methodsByProtocol := HashedCollection new.\x0a\x09self methodDictionary valuesDo: [ :m |\x0a\x09\x09(methodsByProtocol at: m protocol ifAbsentPut: [ Array new ])\x0a\x09\x09\x09add: m ].\x0a\x09self protocols do: [ :protocol |\x0a\x09\x09aBlock value: protocol value: (methodsByProtocol at: protocol) ]",
  1172. referencedClasses: ["HashedCollection", "Array"],
  1173. //>>excludeEnd("ide");
  1174. messageSends: ["new", "valuesDo:", "methodDictionary", "add:", "at:ifAbsentPut:", "protocol", "do:", "protocols", "value:value:", "at:"]
  1175. }),
  1176. $globals.Behavior);
  1177. $core.addMethod(
  1178. $core.method({
  1179. selector: "prototype",
  1180. protocol: 'accessing',
  1181. fn: function (){
  1182. var self=this;
  1183. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1184. return $core.withContext(function($ctx1) {
  1185. //>>excludeEnd("ctx");
  1186. return self.fn.prototype;
  1187. return self;
  1188. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1189. }, function($ctx1) {$ctx1.fill(self,"prototype",{},$globals.Behavior)});
  1190. //>>excludeEnd("ctx");
  1191. },
  1192. //>>excludeStart("ide", pragmas.excludeIdeData);
  1193. args: [],
  1194. source: "prototype\x0a\x09<return self.fn.prototype>",
  1195. referencedClasses: [],
  1196. //>>excludeEnd("ide");
  1197. messageSends: []
  1198. }),
  1199. $globals.Behavior);
  1200. $core.addMethod(
  1201. $core.method({
  1202. selector: "recompile",
  1203. protocol: 'compiling',
  1204. fn: function (){
  1205. var self=this;
  1206. function $Compiler(){return $globals.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  1207. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1208. return $core.withContext(function($ctx1) {
  1209. //>>excludeEnd("ctx");
  1210. return $recv($recv($Compiler())._new())._recompile_(self);
  1211. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1212. }, function($ctx1) {$ctx1.fill(self,"recompile",{},$globals.Behavior)});
  1213. //>>excludeEnd("ctx");
  1214. },
  1215. //>>excludeStart("ide", pragmas.excludeIdeData);
  1216. args: [],
  1217. source: "recompile\x0a\x09^ Compiler new recompile: self",
  1218. referencedClasses: ["Compiler"],
  1219. //>>excludeEnd("ide");
  1220. messageSends: ["recompile:", "new"]
  1221. }),
  1222. $globals.Behavior);
  1223. $core.addMethod(
  1224. $core.method({
  1225. selector: "removeCompiledMethod:",
  1226. protocol: 'compiling',
  1227. fn: function (aMethod){
  1228. var self=this;
  1229. function $SystemAnnouncer(){return $globals.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  1230. function $MethodRemoved(){return $globals.MethodRemoved||(typeof MethodRemoved=="undefined"?nil:MethodRemoved)}
  1231. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1232. return $core.withContext(function($ctx1) {
  1233. //>>excludeEnd("ctx");
  1234. var $1,$3,$2;
  1235. self._basicRemoveCompiledMethod_(aMethod);
  1236. self._removeProtocolIfEmpty_($recv(aMethod)._protocol());
  1237. $1=$recv($SystemAnnouncer())._current();
  1238. $3=$recv($MethodRemoved())._new();
  1239. $recv($3)._method_(aMethod);
  1240. $2=$recv($3)._yourself();
  1241. $recv($1)._announce_($2);
  1242. return self;
  1243. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1244. }, function($ctx1) {$ctx1.fill(self,"removeCompiledMethod:",{aMethod:aMethod},$globals.Behavior)});
  1245. //>>excludeEnd("ctx");
  1246. },
  1247. //>>excludeStart("ide", pragmas.excludeIdeData);
  1248. args: ["aMethod"],
  1249. source: "removeCompiledMethod: aMethod\x0a\x09self basicRemoveCompiledMethod: aMethod.\x0a\x09\x0a\x09self removeProtocolIfEmpty: aMethod protocol.\x0a\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (MethodRemoved new\x0a\x09\x09\x09method: aMethod;\x0a\x09\x09\x09yourself)",
  1250. referencedClasses: ["SystemAnnouncer", "MethodRemoved"],
  1251. //>>excludeEnd("ide");
  1252. messageSends: ["basicRemoveCompiledMethod:", "removeProtocolIfEmpty:", "protocol", "announce:", "current", "method:", "new", "yourself"]
  1253. }),
  1254. $globals.Behavior);
  1255. $core.addMethod(
  1256. $core.method({
  1257. selector: "removeProtocolIfEmpty:",
  1258. protocol: 'accessing',
  1259. fn: function (aString){
  1260. var self=this;
  1261. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1262. return $core.withContext(function($ctx1) {
  1263. //>>excludeEnd("ctx");
  1264. $recv(self._methods())._detect_ifNone_((function(each){
  1265. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1266. return $core.withContext(function($ctx2) {
  1267. //>>excludeEnd("ctx");
  1268. return $recv($recv(each)._protocol()).__eq(aString);
  1269. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1270. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  1271. //>>excludeEnd("ctx");
  1272. }),(function(){
  1273. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1274. return $core.withContext(function($ctx2) {
  1275. //>>excludeEnd("ctx");
  1276. return $recv(self._organization())._removeElement_(aString);
  1277. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1278. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  1279. //>>excludeEnd("ctx");
  1280. }));
  1281. return self;
  1282. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1283. }, function($ctx1) {$ctx1.fill(self,"removeProtocolIfEmpty:",{aString:aString},$globals.Behavior)});
  1284. //>>excludeEnd("ctx");
  1285. },
  1286. //>>excludeStart("ide", pragmas.excludeIdeData);
  1287. args: ["aString"],
  1288. source: "removeProtocolIfEmpty: aString\x0a\x09self methods\x0a\x09\x09detect: [ :each | each protocol = aString ]\x0a\x09\x09ifNone: [ self organization removeElement: aString ]",
  1289. referencedClasses: [],
  1290. //>>excludeEnd("ide");
  1291. messageSends: ["detect:ifNone:", "methods", "=", "protocol", "removeElement:", "organization"]
  1292. }),
  1293. $globals.Behavior);
  1294. $core.addMethod(
  1295. $core.method({
  1296. selector: "selectors",
  1297. protocol: 'accessing',
  1298. fn: function (){
  1299. var self=this;
  1300. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1301. return $core.withContext(function($ctx1) {
  1302. //>>excludeEnd("ctx");
  1303. return $recv(self._methodDictionary())._keys();
  1304. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1305. }, function($ctx1) {$ctx1.fill(self,"selectors",{},$globals.Behavior)});
  1306. //>>excludeEnd("ctx");
  1307. },
  1308. //>>excludeStart("ide", pragmas.excludeIdeData);
  1309. args: [],
  1310. source: "selectors\x0a\x09^ self methodDictionary keys",
  1311. referencedClasses: [],
  1312. //>>excludeEnd("ide");
  1313. messageSends: ["keys", "methodDictionary"]
  1314. }),
  1315. $globals.Behavior);
  1316. $core.addMethod(
  1317. $core.method({
  1318. selector: "subclasses",
  1319. protocol: 'accessing',
  1320. fn: function (){
  1321. var self=this;
  1322. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1323. return $core.withContext(function($ctx1) {
  1324. //>>excludeEnd("ctx");
  1325. self._subclassResponsibility();
  1326. return self;
  1327. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1328. }, function($ctx1) {$ctx1.fill(self,"subclasses",{},$globals.Behavior)});
  1329. //>>excludeEnd("ctx");
  1330. },
  1331. //>>excludeStart("ide", pragmas.excludeIdeData);
  1332. args: [],
  1333. source: "subclasses\x0a\x09self subclassResponsibility",
  1334. referencedClasses: [],
  1335. //>>excludeEnd("ide");
  1336. messageSends: ["subclassResponsibility"]
  1337. }),
  1338. $globals.Behavior);
  1339. $core.addMethod(
  1340. $core.method({
  1341. selector: "superclass",
  1342. protocol: 'accessing',
  1343. fn: function (){
  1344. var self=this;
  1345. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1346. return $core.withContext(function($ctx1) {
  1347. //>>excludeEnd("ctx");
  1348. return self.superclass;
  1349. return self;
  1350. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1351. }, function($ctx1) {$ctx1.fill(self,"superclass",{},$globals.Behavior)});
  1352. //>>excludeEnd("ctx");
  1353. },
  1354. //>>excludeStart("ide", pragmas.excludeIdeData);
  1355. args: [],
  1356. source: "superclass\x0a\x09<return self.superclass>",
  1357. referencedClasses: [],
  1358. //>>excludeEnd("ide");
  1359. messageSends: []
  1360. }),
  1361. $globals.Behavior);
  1362. $core.addMethod(
  1363. $core.method({
  1364. selector: "theMetaClass",
  1365. protocol: 'accessing',
  1366. fn: function (){
  1367. var self=this;
  1368. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1369. return $core.withContext(function($ctx1) {
  1370. //>>excludeEnd("ctx");
  1371. self._subclassResponsibility();
  1372. return self;
  1373. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1374. }, function($ctx1) {$ctx1.fill(self,"theMetaClass",{},$globals.Behavior)});
  1375. //>>excludeEnd("ctx");
  1376. },
  1377. //>>excludeStart("ide", pragmas.excludeIdeData);
  1378. args: [],
  1379. source: "theMetaClass\x0a\x09self subclassResponsibility",
  1380. referencedClasses: [],
  1381. //>>excludeEnd("ide");
  1382. messageSends: ["subclassResponsibility"]
  1383. }),
  1384. $globals.Behavior);
  1385. $core.addMethod(
  1386. $core.method({
  1387. selector: "theNonMetaClass",
  1388. protocol: 'accessing',
  1389. fn: function (){
  1390. var self=this;
  1391. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1392. return $core.withContext(function($ctx1) {
  1393. //>>excludeEnd("ctx");
  1394. self._subclassResponsibility();
  1395. return self;
  1396. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1397. }, function($ctx1) {$ctx1.fill(self,"theNonMetaClass",{},$globals.Behavior)});
  1398. //>>excludeEnd("ctx");
  1399. },
  1400. //>>excludeStart("ide", pragmas.excludeIdeData);
  1401. args: [],
  1402. source: "theNonMetaClass\x0a\x09self subclassResponsibility",
  1403. referencedClasses: [],
  1404. //>>excludeEnd("ide");
  1405. messageSends: ["subclassResponsibility"]
  1406. }),
  1407. $globals.Behavior);
  1408. $core.addMethod(
  1409. $core.method({
  1410. selector: "withAllSubclasses",
  1411. protocol: 'accessing',
  1412. fn: function (){
  1413. var self=this;
  1414. function $Array(){return $globals.Array||(typeof Array=="undefined"?nil:Array)}
  1415. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1416. return $core.withContext(function($ctx1) {
  1417. //>>excludeEnd("ctx");
  1418. var $1;
  1419. $1=$recv($Array())._with_(self);
  1420. $recv($1)._addAll_(self._allSubclasses());
  1421. return $recv($1)._yourself();
  1422. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1423. }, function($ctx1) {$ctx1.fill(self,"withAllSubclasses",{},$globals.Behavior)});
  1424. //>>excludeEnd("ctx");
  1425. },
  1426. //>>excludeStart("ide", pragmas.excludeIdeData);
  1427. args: [],
  1428. source: "withAllSubclasses\x0a\x09^ (Array with: self) addAll: self allSubclasses; yourself",
  1429. referencedClasses: ["Array"],
  1430. //>>excludeEnd("ide");
  1431. messageSends: ["addAll:", "with:", "allSubclasses", "yourself"]
  1432. }),
  1433. $globals.Behavior);
  1434. $core.addClass('Class', $globals.Behavior, [], 'Kernel-Classes');
  1435. //>>excludeStart("ide", pragmas.excludeIdeData);
  1436. $globals.Class.comment="I am __the__ class object.\x0a\x0aMy instances are the classes of the system.\x0aClass creation is done throught a `ClassBuilder` instance.";
  1437. //>>excludeEnd("ide");
  1438. $core.addMethod(
  1439. $core.method({
  1440. selector: "asJavascript",
  1441. protocol: 'converting',
  1442. fn: function (){
  1443. var self=this;
  1444. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1445. return $core.withContext(function($ctx1) {
  1446. //>>excludeEnd("ctx");
  1447. return "$globals.".__comma(self._name());
  1448. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1449. }, function($ctx1) {$ctx1.fill(self,"asJavascript",{},$globals.Class)});
  1450. //>>excludeEnd("ctx");
  1451. },
  1452. //>>excludeStart("ide", pragmas.excludeIdeData);
  1453. args: [],
  1454. source: "asJavascript\x0a\x09^ '$globals.', self name",
  1455. referencedClasses: [],
  1456. //>>excludeEnd("ide");
  1457. messageSends: [",", "name"]
  1458. }),
  1459. $globals.Class);
  1460. $core.addMethod(
  1461. $core.method({
  1462. selector: "browse",
  1463. protocol: 'browsing',
  1464. fn: function (){
  1465. var self=this;
  1466. function $Finder(){return $globals.Finder||(typeof Finder=="undefined"?nil:Finder)}
  1467. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1468. return $core.withContext(function($ctx1) {
  1469. //>>excludeEnd("ctx");
  1470. $recv($Finder())._findClass_(self);
  1471. return self;
  1472. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1473. }, function($ctx1) {$ctx1.fill(self,"browse",{},$globals.Class)});
  1474. //>>excludeEnd("ctx");
  1475. },
  1476. //>>excludeStart("ide", pragmas.excludeIdeData);
  1477. args: [],
  1478. source: "browse\x0a\x09Finder findClass: self",
  1479. referencedClasses: ["Finder"],
  1480. //>>excludeEnd("ide");
  1481. messageSends: ["findClass:"]
  1482. }),
  1483. $globals.Class);
  1484. $core.addMethod(
  1485. $core.method({
  1486. selector: "category",
  1487. protocol: 'accessing',
  1488. fn: function (){
  1489. var self=this;
  1490. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1491. return $core.withContext(function($ctx1) {
  1492. //>>excludeEnd("ctx");
  1493. var $1,$receiver;
  1494. $1=self._package();
  1495. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1496. $ctx1.sendIdx["package"]=1;
  1497. //>>excludeEnd("ctx");
  1498. if(($receiver = $1) == null || $receiver.isNil){
  1499. return "Unclassified";
  1500. } else {
  1501. return $recv(self._package())._name();
  1502. };
  1503. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1504. }, function($ctx1) {$ctx1.fill(self,"category",{},$globals.Class)});
  1505. //>>excludeEnd("ctx");
  1506. },
  1507. //>>excludeStart("ide", pragmas.excludeIdeData);
  1508. args: [],
  1509. source: "category\x0a\x09^ self package ifNil: [ 'Unclassified' ] ifNotNil: [ self package name ]",
  1510. referencedClasses: [],
  1511. //>>excludeEnd("ide");
  1512. messageSends: ["ifNil:ifNotNil:", "package", "name"]
  1513. }),
  1514. $globals.Class);
  1515. $core.addMethod(
  1516. $core.method({
  1517. selector: "classTag",
  1518. protocol: 'accessing',
  1519. fn: function (){
  1520. var self=this;
  1521. return "class";
  1522. },
  1523. //>>excludeStart("ide", pragmas.excludeIdeData);
  1524. args: [],
  1525. source: "classTag\x0a\x09\x22Returns a tag or general category for this class.\x0a\x09Typically used to help tools do some reflection.\x0a\x09Helios, for example, uses this to decide what icon the class should display.\x22\x0a\x09\x0a\x09^ 'class'",
  1526. referencedClasses: [],
  1527. //>>excludeEnd("ide");
  1528. messageSends: []
  1529. }),
  1530. $globals.Class);
  1531. $core.addMethod(
  1532. $core.method({
  1533. selector: "definition",
  1534. protocol: 'accessing',
  1535. fn: function (){
  1536. var self=this;
  1537. function $String(){return $globals.String||(typeof String=="undefined"?nil:String)}
  1538. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1539. return $core.withContext(function($ctx1) {
  1540. //>>excludeEnd("ctx");
  1541. var $2,$3,$1,$4,$5;
  1542. return $recv($String())._streamContents_((function(stream){
  1543. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1544. return $core.withContext(function($ctx2) {
  1545. //>>excludeEnd("ctx");
  1546. $recv(stream)._nextPutAll_($recv(self._superclass())._asString());
  1547. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1548. $ctx2.sendIdx["nextPutAll:"]=1;
  1549. //>>excludeEnd("ctx");
  1550. $recv(stream)._nextPutAll_(" subclass: #");
  1551. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1552. $ctx2.sendIdx["nextPutAll:"]=2;
  1553. //>>excludeEnd("ctx");
  1554. $recv(stream)._nextPutAll_(self._name());
  1555. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1556. $ctx2.sendIdx["nextPutAll:"]=3;
  1557. //>>excludeEnd("ctx");
  1558. $2=$recv($String())._lf();
  1559. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1560. $ctx2.sendIdx["lf"]=1;
  1561. //>>excludeEnd("ctx");
  1562. $3=$recv($String())._tab();
  1563. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1564. $ctx2.sendIdx["tab"]=1;
  1565. //>>excludeEnd("ctx");
  1566. $1=$recv($2).__comma($3);
  1567. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1568. $ctx2.sendIdx[","]=1;
  1569. //>>excludeEnd("ctx");
  1570. $recv(stream)._nextPutAll_($1);
  1571. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1572. $ctx2.sendIdx["nextPutAll:"]=4;
  1573. //>>excludeEnd("ctx");
  1574. $4=$recv(stream)._nextPutAll_("instanceVariableNames: '");
  1575. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1576. $ctx2.sendIdx["nextPutAll:"]=5;
  1577. //>>excludeEnd("ctx");
  1578. $4;
  1579. $recv(self._instanceVariableNames())._do_separatedBy_((function(each){
  1580. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1581. return $core.withContext(function($ctx3) {
  1582. //>>excludeEnd("ctx");
  1583. return $recv(stream)._nextPutAll_(each);
  1584. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1585. $ctx3.sendIdx["nextPutAll:"]=6;
  1586. //>>excludeEnd("ctx");
  1587. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1588. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)});
  1589. //>>excludeEnd("ctx");
  1590. }),(function(){
  1591. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1592. return $core.withContext(function($ctx3) {
  1593. //>>excludeEnd("ctx");
  1594. return $recv(stream)._nextPutAll_(" ");
  1595. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1596. $ctx3.sendIdx["nextPutAll:"]=7;
  1597. //>>excludeEnd("ctx");
  1598. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1599. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)});
  1600. //>>excludeEnd("ctx");
  1601. }));
  1602. $5=$recv("'".__comma($recv($String())._lf())).__comma($recv($String())._tab());
  1603. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1604. $ctx2.sendIdx[","]=2;
  1605. //>>excludeEnd("ctx");
  1606. $recv(stream)._nextPutAll_($5);
  1607. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1608. $ctx2.sendIdx["nextPutAll:"]=8;
  1609. //>>excludeEnd("ctx");
  1610. $recv(stream)._nextPutAll_("package: '");
  1611. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1612. $ctx2.sendIdx["nextPutAll:"]=9;
  1613. //>>excludeEnd("ctx");
  1614. $recv(stream)._nextPutAll_(self._category());
  1615. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1616. $ctx2.sendIdx["nextPutAll:"]=10;
  1617. //>>excludeEnd("ctx");
  1618. return $recv(stream)._nextPutAll_("'");
  1619. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1620. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)});
  1621. //>>excludeEnd("ctx");
  1622. }));
  1623. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1624. }, function($ctx1) {$ctx1.fill(self,"definition",{},$globals.Class)});
  1625. //>>excludeEnd("ctx");
  1626. },
  1627. //>>excludeStart("ide", pragmas.excludeIdeData);
  1628. args: [],
  1629. source: "definition\x0a\x09^ String streamContents: [ :stream |\x0a\x09\x09stream\x0a\x09\x09\x09nextPutAll: self superclass asString;\x0a\x09\x09\x09nextPutAll: ' subclass: #';\x0a\x09\x09\x09nextPutAll: self name;\x0a\x09\x09\x09nextPutAll: String lf, String tab;\x0a\x09\x09\x09nextPutAll: 'instanceVariableNames: '''.\x0a\x09\x09self instanceVariableNames\x0a\x09\x09\x09do: [ :each | stream nextPutAll: each ]\x0a\x09\x09\x09separatedBy: [ stream nextPutAll: ' ' ].\x0a\x09\x09stream\x0a\x09\x09\x09nextPutAll: '''', String lf, String tab;\x0a\x09\x09\x09nextPutAll: 'package: ''';\x0a\x09\x09\x09nextPutAll: self category;\x0a\x09\x09\x09nextPutAll: '''' ]",
  1630. referencedClasses: ["String"],
  1631. //>>excludeEnd("ide");
  1632. messageSends: ["streamContents:", "nextPutAll:", "asString", "superclass", "name", ",", "lf", "tab", "do:separatedBy:", "instanceVariableNames", "category"]
  1633. }),
  1634. $globals.Class);
  1635. $core.addMethod(
  1636. $core.method({
  1637. selector: "isClass",
  1638. protocol: 'testing',
  1639. fn: function (){
  1640. var self=this;
  1641. return true;
  1642. },
  1643. //>>excludeStart("ide", pragmas.excludeIdeData);
  1644. args: [],
  1645. source: "isClass\x0a\x09^ true",
  1646. referencedClasses: [],
  1647. //>>excludeEnd("ide");
  1648. messageSends: []
  1649. }),
  1650. $globals.Class);
  1651. $core.addMethod(
  1652. $core.method({
  1653. selector: "package",
  1654. protocol: 'accessing',
  1655. fn: function (){
  1656. var self=this;
  1657. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1658. return $core.withContext(function($ctx1) {
  1659. //>>excludeEnd("ctx");
  1660. return self._basicAt_("pkg");
  1661. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1662. }, function($ctx1) {$ctx1.fill(self,"package",{},$globals.Class)});
  1663. //>>excludeEnd("ctx");
  1664. },
  1665. //>>excludeStart("ide", pragmas.excludeIdeData);
  1666. args: [],
  1667. source: "package\x0a\x09^ self basicAt: 'pkg'",
  1668. referencedClasses: [],
  1669. //>>excludeEnd("ide");
  1670. messageSends: ["basicAt:"]
  1671. }),
  1672. $globals.Class);
  1673. $core.addMethod(
  1674. $core.method({
  1675. selector: "package:",
  1676. protocol: 'accessing',
  1677. fn: function (aPackage){
  1678. var self=this;
  1679. var oldPackage;
  1680. function $SystemAnnouncer(){return $globals.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  1681. function $ClassMoved(){return $globals.ClassMoved||(typeof ClassMoved=="undefined"?nil:ClassMoved)}
  1682. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1683. return $core.withContext(function($ctx1) {
  1684. //>>excludeEnd("ctx");
  1685. var $2,$1,$3,$4,$6,$5;
  1686. $2=self._package();
  1687. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1688. $ctx1.sendIdx["package"]=1;
  1689. //>>excludeEnd("ctx");
  1690. $1=$recv($2).__eq(aPackage);
  1691. if($core.assert($1)){
  1692. return self;
  1693. };
  1694. oldPackage=self._package();
  1695. self._basicAt_put_("pkg",aPackage);
  1696. $3=$recv(oldPackage)._organization();
  1697. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1698. $ctx1.sendIdx["organization"]=1;
  1699. //>>excludeEnd("ctx");
  1700. $recv($3)._removeElement_(self);
  1701. $recv($recv(aPackage)._organization())._addElement_(self);
  1702. $4=$recv($SystemAnnouncer())._current();
  1703. $6=$recv($ClassMoved())._new();
  1704. $recv($6)._theClass_(self);
  1705. $recv($6)._oldPackage_(oldPackage);
  1706. $5=$recv($6)._yourself();
  1707. $recv($4)._announce_($5);
  1708. return self;
  1709. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1710. }, function($ctx1) {$ctx1.fill(self,"package:",{aPackage:aPackage,oldPackage:oldPackage},$globals.Class)});
  1711. //>>excludeEnd("ctx");
  1712. },
  1713. //>>excludeStart("ide", pragmas.excludeIdeData);
  1714. args: ["aPackage"],
  1715. source: "package: aPackage\x0a\x09| oldPackage |\x0a\x09\x0a\x09self package = aPackage ifTrue: [ ^ self ].\x0a\x09\x0a\x09oldPackage := self package.\x0a\x09\x0a\x09self basicAt: 'pkg' put: aPackage.\x0a\x09oldPackage organization removeElement: self.\x0a\x09aPackage organization addElement: self.\x0a\x0a\x09SystemAnnouncer current announce: (ClassMoved new\x0a\x09\x09theClass: self;\x0a\x09\x09oldPackage: oldPackage;\x0a\x09\x09yourself)",
  1716. referencedClasses: ["SystemAnnouncer", "ClassMoved"],
  1717. //>>excludeEnd("ide");
  1718. messageSends: ["ifTrue:", "=", "package", "basicAt:put:", "removeElement:", "organization", "addElement:", "announce:", "current", "theClass:", "new", "oldPackage:", "yourself"]
  1719. }),
  1720. $globals.Class);
  1721. $core.addMethod(
  1722. $core.method({
  1723. selector: "printOn:",
  1724. protocol: 'printing',
  1725. fn: function (aStream){
  1726. var self=this;
  1727. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1728. return $core.withContext(function($ctx1) {
  1729. //>>excludeEnd("ctx");
  1730. $recv(aStream)._nextPutAll_(self._name());
  1731. return self;
  1732. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1733. }, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},$globals.Class)});
  1734. //>>excludeEnd("ctx");
  1735. },
  1736. //>>excludeStart("ide", pragmas.excludeIdeData);
  1737. args: ["aStream"],
  1738. source: "printOn: aStream\x0a\x09aStream nextPutAll: self name",
  1739. referencedClasses: [],
  1740. //>>excludeEnd("ide");
  1741. messageSends: ["nextPutAll:", "name"]
  1742. }),
  1743. $globals.Class);
  1744. $core.addMethod(
  1745. $core.method({
  1746. selector: "rename:",
  1747. protocol: 'accessing',
  1748. fn: function (aString){
  1749. var self=this;
  1750. function $ClassBuilder(){return $globals.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  1751. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1752. return $core.withContext(function($ctx1) {
  1753. //>>excludeEnd("ctx");
  1754. $recv($recv($ClassBuilder())._new())._renameClass_to_(self,aString);
  1755. return self;
  1756. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1757. }, function($ctx1) {$ctx1.fill(self,"rename:",{aString:aString},$globals.Class)});
  1758. //>>excludeEnd("ctx");
  1759. },
  1760. //>>excludeStart("ide", pragmas.excludeIdeData);
  1761. args: ["aString"],
  1762. source: "rename: aString\x0a\x09ClassBuilder new renameClass: self to: aString",
  1763. referencedClasses: ["ClassBuilder"],
  1764. //>>excludeEnd("ide");
  1765. messageSends: ["renameClass:to:", "new"]
  1766. }),
  1767. $globals.Class);
  1768. $core.addMethod(
  1769. $core.method({
  1770. selector: "subclass:instanceVariableNames:",
  1771. protocol: 'class creation',
  1772. fn: function (aString,anotherString){
  1773. var self=this;
  1774. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1775. return $core.withContext(function($ctx1) {
  1776. //>>excludeEnd("ctx");
  1777. return self._subclass_instanceVariableNames_package_(aString,anotherString,nil);
  1778. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1779. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:",{aString:aString,anotherString:anotherString},$globals.Class)});
  1780. //>>excludeEnd("ctx");
  1781. },
  1782. //>>excludeStart("ide", pragmas.excludeIdeData);
  1783. args: ["aString", "anotherString"],
  1784. source: "subclass: aString instanceVariableNames: anotherString\x0a\x09\x22Kept for file-in compatibility.\x22\x0a\x09^ self subclass: aString instanceVariableNames: anotherString package: nil",
  1785. referencedClasses: [],
  1786. //>>excludeEnd("ide");
  1787. messageSends: ["subclass:instanceVariableNames:package:"]
  1788. }),
  1789. $globals.Class);
  1790. $core.addMethod(
  1791. $core.method({
  1792. selector: "subclass:instanceVariableNames:category:",
  1793. protocol: 'class creation',
  1794. fn: function (aString,aString2,aString3){
  1795. var self=this;
  1796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1797. return $core.withContext(function($ctx1) {
  1798. //>>excludeEnd("ctx");
  1799. return self._subclass_instanceVariableNames_package_(aString,aString2,aString3);
  1800. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1801. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:category:",{aString:aString,aString2:aString2,aString3:aString3},$globals.Class)});
  1802. //>>excludeEnd("ctx");
  1803. },
  1804. //>>excludeStart("ide", pragmas.excludeIdeData);
  1805. args: ["aString", "aString2", "aString3"],
  1806. source: "subclass: aString instanceVariableNames: aString2 category: aString3\x0a\x09\x22Kept for file-in compatibility.\x22\x0a\x09^ self subclass: aString instanceVariableNames: aString2 package: aString3",
  1807. referencedClasses: [],
  1808. //>>excludeEnd("ide");
  1809. messageSends: ["subclass:instanceVariableNames:package:"]
  1810. }),
  1811. $globals.Class);
  1812. $core.addMethod(
  1813. $core.method({
  1814. selector: "subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:",
  1815. protocol: 'class creation',
  1816. fn: function (aString,aString2,classVars,pools,aString3){
  1817. var self=this;
  1818. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1819. return $core.withContext(function($ctx1) {
  1820. //>>excludeEnd("ctx");
  1821. return self._subclass_instanceVariableNames_package_(aString,aString2,aString3);
  1822. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1823. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:",{aString:aString,aString2:aString2,classVars:classVars,pools:pools,aString3:aString3},$globals.Class)});
  1824. //>>excludeEnd("ctx");
  1825. },
  1826. //>>excludeStart("ide", pragmas.excludeIdeData);
  1827. args: ["aString", "aString2", "classVars", "pools", "aString3"],
  1828. source: "subclass: aString instanceVariableNames: aString2 classVariableNames: classVars poolDictionaries: pools category: aString3\x0a\x09\x22Kept for file-in compatibility. ignores class variables and pools.\x22\x0a\x09^ self subclass: aString instanceVariableNames: aString2 package: aString3",
  1829. referencedClasses: [],
  1830. //>>excludeEnd("ide");
  1831. messageSends: ["subclass:instanceVariableNames:package:"]
  1832. }),
  1833. $globals.Class);
  1834. $core.addMethod(
  1835. $core.method({
  1836. selector: "subclass:instanceVariableNames:package:",
  1837. protocol: 'class creation',
  1838. fn: function (aString,aString2,aString3){
  1839. var self=this;
  1840. function $ClassBuilder(){return $globals.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  1841. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1842. return $core.withContext(function($ctx1) {
  1843. //>>excludeEnd("ctx");
  1844. return $recv($recv($ClassBuilder())._new())._superclass_subclass_instanceVariableNames_package_(self,$recv(aString)._asString(),aString2,aString3);
  1845. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1846. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:package:",{aString:aString,aString2:aString2,aString3:aString3},$globals.Class)});
  1847. //>>excludeEnd("ctx");
  1848. },
  1849. //>>excludeStart("ide", pragmas.excludeIdeData);
  1850. args: ["aString", "aString2", "aString3"],
  1851. source: "subclass: aString instanceVariableNames: aString2 package: aString3\x0a\x09^ ClassBuilder new\x0a\x09\x09superclass: self subclass: aString asString instanceVariableNames: aString2 package: aString3",
  1852. referencedClasses: ["ClassBuilder"],
  1853. //>>excludeEnd("ide");
  1854. messageSends: ["superclass:subclass:instanceVariableNames:package:", "new", "asString"]
  1855. }),
  1856. $globals.Class);
  1857. $core.addMethod(
  1858. $core.method({
  1859. selector: "subclasses",
  1860. protocol: 'accessing',
  1861. fn: function (){
  1862. var self=this;
  1863. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1864. return $core.withContext(function($ctx1) {
  1865. //>>excludeEnd("ctx");
  1866. return self.subclasses._copy();
  1867. return self;
  1868. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1869. }, function($ctx1) {$ctx1.fill(self,"subclasses",{},$globals.Class)});
  1870. //>>excludeEnd("ctx");
  1871. },
  1872. //>>excludeStart("ide", pragmas.excludeIdeData);
  1873. args: [],
  1874. source: "subclasses\x0a\x09<return self.subclasses._copy()>",
  1875. referencedClasses: [],
  1876. //>>excludeEnd("ide");
  1877. messageSends: []
  1878. }),
  1879. $globals.Class);
  1880. $core.addMethod(
  1881. $core.method({
  1882. selector: "theMetaClass",
  1883. protocol: 'accessing',
  1884. fn: function (){
  1885. var self=this;
  1886. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1887. return $core.withContext(function($ctx1) {
  1888. //>>excludeEnd("ctx");
  1889. return self._class();
  1890. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1891. }, function($ctx1) {$ctx1.fill(self,"theMetaClass",{},$globals.Class)});
  1892. //>>excludeEnd("ctx");
  1893. },
  1894. //>>excludeStart("ide", pragmas.excludeIdeData);
  1895. args: [],
  1896. source: "theMetaClass\x0a\x09^ self class",
  1897. referencedClasses: [],
  1898. //>>excludeEnd("ide");
  1899. messageSends: ["class"]
  1900. }),
  1901. $globals.Class);
  1902. $core.addMethod(
  1903. $core.method({
  1904. selector: "theNonMetaClass",
  1905. protocol: 'accessing',
  1906. fn: function (){
  1907. var self=this;
  1908. return self;
  1909. },
  1910. //>>excludeStart("ide", pragmas.excludeIdeData);
  1911. args: [],
  1912. source: "theNonMetaClass\x0a\x09^ self",
  1913. referencedClasses: [],
  1914. //>>excludeEnd("ide");
  1915. messageSends: []
  1916. }),
  1917. $globals.Class);
  1918. $core.addClass('Metaclass', $globals.Behavior, [], 'Kernel-Classes');
  1919. //>>excludeStart("ide", pragmas.excludeIdeData);
  1920. $globals.Metaclass.comment="I am the root of the class hierarchy.\x0a\x0aMy instances are metaclasses, one for each real class, and have a single instance, which they hold onto: the class that they are the metaclass of.";
  1921. //>>excludeEnd("ide");
  1922. $core.addMethod(
  1923. $core.method({
  1924. selector: "asJavascript",
  1925. protocol: 'converting',
  1926. fn: function (){
  1927. var self=this;
  1928. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1929. return $core.withContext(function($ctx1) {
  1930. //>>excludeEnd("ctx");
  1931. var $1;
  1932. $1=$recv("$globals.".__comma($recv(self._instanceClass())._name())).__comma(".klass");
  1933. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1934. $ctx1.sendIdx[","]=1;
  1935. //>>excludeEnd("ctx");
  1936. return $1;
  1937. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1938. }, function($ctx1) {$ctx1.fill(self,"asJavascript",{},$globals.Metaclass)});
  1939. //>>excludeEnd("ctx");
  1940. },
  1941. //>>excludeStart("ide", pragmas.excludeIdeData);
  1942. args: [],
  1943. source: "asJavascript\x0a\x09^ '$globals.', self instanceClass name, '.klass'",
  1944. referencedClasses: [],
  1945. //>>excludeEnd("ide");
  1946. messageSends: [",", "name", "instanceClass"]
  1947. }),
  1948. $globals.Metaclass);
  1949. $core.addMethod(
  1950. $core.method({
  1951. selector: "definition",
  1952. protocol: 'accessing',
  1953. fn: function (){
  1954. var self=this;
  1955. function $String(){return $globals.String||(typeof String=="undefined"?nil:String)}
  1956. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1957. return $core.withContext(function($ctx1) {
  1958. //>>excludeEnd("ctx");
  1959. var $1;
  1960. return $recv($String())._streamContents_((function(stream){
  1961. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1962. return $core.withContext(function($ctx2) {
  1963. //>>excludeEnd("ctx");
  1964. $recv(stream)._nextPutAll_(self._asString());
  1965. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1966. $ctx2.sendIdx["nextPutAll:"]=1;
  1967. //>>excludeEnd("ctx");
  1968. $1=$recv(stream)._nextPutAll_(" instanceVariableNames: '");
  1969. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1970. $ctx2.sendIdx["nextPutAll:"]=2;
  1971. //>>excludeEnd("ctx");
  1972. $1;
  1973. $recv(self._instanceVariableNames())._do_separatedBy_((function(each){
  1974. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1975. return $core.withContext(function($ctx3) {
  1976. //>>excludeEnd("ctx");
  1977. return $recv(stream)._nextPutAll_(each);
  1978. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1979. $ctx3.sendIdx["nextPutAll:"]=3;
  1980. //>>excludeEnd("ctx");
  1981. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1982. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)});
  1983. //>>excludeEnd("ctx");
  1984. }),(function(){
  1985. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1986. return $core.withContext(function($ctx3) {
  1987. //>>excludeEnd("ctx");
  1988. return $recv(stream)._nextPutAll_(" ");
  1989. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1990. $ctx3.sendIdx["nextPutAll:"]=4;
  1991. //>>excludeEnd("ctx");
  1992. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1993. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)});
  1994. //>>excludeEnd("ctx");
  1995. }));
  1996. return $recv(stream)._nextPutAll_("'");
  1997. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1998. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)});
  1999. //>>excludeEnd("ctx");
  2000. }));
  2001. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2002. }, function($ctx1) {$ctx1.fill(self,"definition",{},$globals.Metaclass)});
  2003. //>>excludeEnd("ctx");
  2004. },
  2005. //>>excludeStart("ide", pragmas.excludeIdeData);
  2006. args: [],
  2007. source: "definition\x0a\x09^ String streamContents: [ :stream |\x0a\x09\x09stream\x0a\x09\x09\x09nextPutAll: self asString;\x0a\x09\x09\x09nextPutAll: ' instanceVariableNames: '''.\x0a\x09\x09self instanceVariableNames\x0a\x09\x09\x09do: [ :each | stream nextPutAll: each ]\x0a\x09\x09\x09separatedBy: [ stream nextPutAll: ' ' ].\x0a\x09\x09stream nextPutAll: '''' ]",
  2008. referencedClasses: ["String"],
  2009. //>>excludeEnd("ide");
  2010. messageSends: ["streamContents:", "nextPutAll:", "asString", "do:separatedBy:", "instanceVariableNames"]
  2011. }),
  2012. $globals.Metaclass);
  2013. $core.addMethod(
  2014. $core.method({
  2015. selector: "instanceClass",
  2016. protocol: 'accessing',
  2017. fn: function (){
  2018. var self=this;
  2019. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2020. return $core.withContext(function($ctx1) {
  2021. //>>excludeEnd("ctx");
  2022. return self.instanceClass;
  2023. return self;
  2024. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2025. }, function($ctx1) {$ctx1.fill(self,"instanceClass",{},$globals.Metaclass)});
  2026. //>>excludeEnd("ctx");
  2027. },
  2028. //>>excludeStart("ide", pragmas.excludeIdeData);
  2029. args: [],
  2030. source: "instanceClass\x0a\x09<return self.instanceClass>",
  2031. referencedClasses: [],
  2032. //>>excludeEnd("ide");
  2033. messageSends: []
  2034. }),
  2035. $globals.Metaclass);
  2036. $core.addMethod(
  2037. $core.method({
  2038. selector: "instanceVariableNames:",
  2039. protocol: 'accessing',
  2040. fn: function (aCollection){
  2041. var self=this;
  2042. function $ClassBuilder(){return $globals.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  2043. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2044. return $core.withContext(function($ctx1) {
  2045. //>>excludeEnd("ctx");
  2046. $recv($recv($ClassBuilder())._new())._class_instanceVariableNames_(self,aCollection);
  2047. return self;
  2048. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2049. }, function($ctx1) {$ctx1.fill(self,"instanceVariableNames:",{aCollection:aCollection},$globals.Metaclass)});
  2050. //>>excludeEnd("ctx");
  2051. },
  2052. //>>excludeStart("ide", pragmas.excludeIdeData);
  2053. args: ["aCollection"],
  2054. source: "instanceVariableNames: aCollection\x0a\x09ClassBuilder new\x0a\x09\x09class: self instanceVariableNames: aCollection",
  2055. referencedClasses: ["ClassBuilder"],
  2056. //>>excludeEnd("ide");
  2057. messageSends: ["class:instanceVariableNames:", "new"]
  2058. }),
  2059. $globals.Metaclass);
  2060. $core.addMethod(
  2061. $core.method({
  2062. selector: "isMetaclass",
  2063. protocol: 'testing',
  2064. fn: function (){
  2065. var self=this;
  2066. return true;
  2067. },
  2068. //>>excludeStart("ide", pragmas.excludeIdeData);
  2069. args: [],
  2070. source: "isMetaclass\x0a\x09^ true",
  2071. referencedClasses: [],
  2072. //>>excludeEnd("ide");
  2073. messageSends: []
  2074. }),
  2075. $globals.Metaclass);
  2076. $core.addMethod(
  2077. $core.method({
  2078. selector: "package",
  2079. protocol: 'accessing',
  2080. fn: function (){
  2081. var self=this;
  2082. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2083. return $core.withContext(function($ctx1) {
  2084. //>>excludeEnd("ctx");
  2085. return $recv(self._instanceClass())._package();
  2086. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2087. }, function($ctx1) {$ctx1.fill(self,"package",{},$globals.Metaclass)});
  2088. //>>excludeEnd("ctx");
  2089. },
  2090. //>>excludeStart("ide", pragmas.excludeIdeData);
  2091. args: [],
  2092. source: "package\x0a\x09^ self instanceClass package",
  2093. referencedClasses: [],
  2094. //>>excludeEnd("ide");
  2095. messageSends: ["package", "instanceClass"]
  2096. }),
  2097. $globals.Metaclass);
  2098. $core.addMethod(
  2099. $core.method({
  2100. selector: "printOn:",
  2101. protocol: 'printing',
  2102. fn: function (aStream){
  2103. var self=this;
  2104. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2105. return $core.withContext(function($ctx1) {
  2106. //>>excludeEnd("ctx");
  2107. $recv(aStream)._nextPutAll_($recv(self._instanceClass())._name());
  2108. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2109. $ctx1.sendIdx["nextPutAll:"]=1;
  2110. //>>excludeEnd("ctx");
  2111. $recv(aStream)._nextPutAll_(" class");
  2112. return self;
  2113. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2114. }, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},$globals.Metaclass)});
  2115. //>>excludeEnd("ctx");
  2116. },
  2117. //>>excludeStart("ide", pragmas.excludeIdeData);
  2118. args: ["aStream"],
  2119. source: "printOn: aStream\x0a\x09aStream\x0a\x09\x09nextPutAll: self instanceClass name;\x0a\x09\x09nextPutAll: ' class'",
  2120. referencedClasses: [],
  2121. //>>excludeEnd("ide");
  2122. messageSends: ["nextPutAll:", "name", "instanceClass"]
  2123. }),
  2124. $globals.Metaclass);
  2125. $core.addMethod(
  2126. $core.method({
  2127. selector: "subclasses",
  2128. protocol: 'accessing',
  2129. fn: function (){
  2130. var self=this;
  2131. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2132. return $core.withContext(function($ctx1) {
  2133. //>>excludeEnd("ctx");
  2134. return $recv($recv($recv(self._instanceClass())._subclasses())._select_((function(each){
  2135. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2136. return $core.withContext(function($ctx2) {
  2137. //>>excludeEnd("ctx");
  2138. return $recv($recv(each)._isMetaclass())._not();
  2139. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2140. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2141. //>>excludeEnd("ctx");
  2142. })))._collect_((function(each){
  2143. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2144. return $core.withContext(function($ctx2) {
  2145. //>>excludeEnd("ctx");
  2146. return $recv(each)._theMetaClass();
  2147. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2148. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  2149. //>>excludeEnd("ctx");
  2150. }));
  2151. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2152. }, function($ctx1) {$ctx1.fill(self,"subclasses",{},$globals.Metaclass)});
  2153. //>>excludeEnd("ctx");
  2154. },
  2155. //>>excludeStart("ide", pragmas.excludeIdeData);
  2156. args: [],
  2157. source: "subclasses\x0a\x09^ (self instanceClass subclasses \x0a\x09\x09select: [ :each | each isMetaclass not ])\x0a\x09\x09collect: [ :each | each theMetaClass ]",
  2158. referencedClasses: [],
  2159. //>>excludeEnd("ide");
  2160. messageSends: ["collect:", "select:", "subclasses", "instanceClass", "not", "isMetaclass", "theMetaClass"]
  2161. }),
  2162. $globals.Metaclass);
  2163. $core.addMethod(
  2164. $core.method({
  2165. selector: "theMetaClass",
  2166. protocol: 'accessing',
  2167. fn: function (){
  2168. var self=this;
  2169. return self;
  2170. },
  2171. //>>excludeStart("ide", pragmas.excludeIdeData);
  2172. args: [],
  2173. source: "theMetaClass\x0a\x09^ self",
  2174. referencedClasses: [],
  2175. //>>excludeEnd("ide");
  2176. messageSends: []
  2177. }),
  2178. $globals.Metaclass);
  2179. $core.addMethod(
  2180. $core.method({
  2181. selector: "theNonMetaClass",
  2182. protocol: 'accessing',
  2183. fn: function (){
  2184. var self=this;
  2185. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2186. return $core.withContext(function($ctx1) {
  2187. //>>excludeEnd("ctx");
  2188. return self._instanceClass();
  2189. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2190. }, function($ctx1) {$ctx1.fill(self,"theNonMetaClass",{},$globals.Metaclass)});
  2191. //>>excludeEnd("ctx");
  2192. },
  2193. //>>excludeStart("ide", pragmas.excludeIdeData);
  2194. args: [],
  2195. source: "theNonMetaClass\x0a\x09^ self instanceClass",
  2196. referencedClasses: [],
  2197. //>>excludeEnd("ide");
  2198. messageSends: ["instanceClass"]
  2199. }),
  2200. $globals.Metaclass);
  2201. $core.addClass('ClassBuilder', $globals.Object, [], 'Kernel-Classes');
  2202. //>>excludeStart("ide", pragmas.excludeIdeData);
  2203. $globals.ClassBuilder.comment="I am responsible for compiling new classes or modifying existing classes in the system.\x0a\x0aRather than using me directly to compile a class, use `Class >> subclass:instanceVariableNames:package:`.";
  2204. //>>excludeEnd("ide");
  2205. $core.addMethod(
  2206. $core.method({
  2207. selector: "addSubclassOf:named:instanceVariableNames:package:",
  2208. protocol: 'class definition',
  2209. fn: function (aClass,className,aCollection,packageName){
  2210. var self=this;
  2211. var theClass,thePackage;
  2212. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  2213. function $Package(){return $globals.Package||(typeof Package=="undefined"?nil:Package)}
  2214. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2215. return $core.withContext(function($ctx1) {
  2216. //>>excludeEnd("ctx");
  2217. var $1,$2,$receiver;
  2218. theClass=$recv($recv($Smalltalk())._globals())._at_(className);
  2219. thePackage=$recv($Package())._named_(packageName);
  2220. $1=theClass;
  2221. if(($receiver = $1) == null || $receiver.isNil){
  2222. $1;
  2223. } else {
  2224. $recv(theClass)._package_(thePackage);
  2225. $2=$recv($recv(theClass)._superclass()).__eq_eq(aClass);
  2226. if(!$core.assert($2)){
  2227. return self._migrateClassNamed_superclass_instanceVariableNames_package_(className,aClass,aCollection,packageName);
  2228. };
  2229. };
  2230. return self._basicAddSubclassOf_named_instanceVariableNames_package_(aClass,className,aCollection,packageName);
  2231. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2232. }, function($ctx1) {$ctx1.fill(self,"addSubclassOf:named:instanceVariableNames:package:",{aClass:aClass,className:className,aCollection:aCollection,packageName:packageName,theClass:theClass,thePackage:thePackage},$globals.ClassBuilder)});
  2233. //>>excludeEnd("ctx");
  2234. },
  2235. //>>excludeStart("ide", pragmas.excludeIdeData);
  2236. args: ["aClass", "className", "aCollection", "packageName"],
  2237. source: "addSubclassOf: aClass named: className instanceVariableNames: aCollection package: packageName\x0a\x09| theClass thePackage |\x0a\x09\x0a\x09theClass := Smalltalk globals at: className.\x0a\x09thePackage := Package named: packageName.\x0a\x09\x0a\x09theClass ifNotNil: [\x0a\x09\x09theClass package: thePackage.\x0a\x09\x09theClass superclass == aClass ifFalse: [\x0a\x09\x09\x09^ self\x0a\x09\x09\x09\x09migrateClassNamed: className\x0a\x09\x09\x09\x09superclass: aClass\x0a\x09\x09\x09\x09instanceVariableNames: aCollection\x0a\x09\x09\x09\x09package: packageName ] ].\x0a\x09\x09\x0a\x09^ self\x0a\x09\x09basicAddSubclassOf: aClass\x0a\x09\x09named: className\x0a\x09\x09instanceVariableNames: aCollection\x0a\x09\x09package: packageName",
  2238. referencedClasses: ["Smalltalk", "Package"],
  2239. //>>excludeEnd("ide");
  2240. messageSends: ["at:", "globals", "named:", "ifNotNil:", "package:", "ifFalse:", "==", "superclass", "migrateClassNamed:superclass:instanceVariableNames:package:", "basicAddSubclassOf:named:instanceVariableNames:package:"]
  2241. }),
  2242. $globals.ClassBuilder);
  2243. $core.addMethod(
  2244. $core.method({
  2245. selector: "basicAddSubclassOf:named:instanceVariableNames:package:",
  2246. protocol: 'private',
  2247. fn: function (aClass,aString,aCollection,packageName){
  2248. var self=this;
  2249. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2250. return $core.withContext(function($ctx1) {
  2251. //>>excludeEnd("ctx");
  2252. $core.addClass(aString, aClass, aCollection, packageName);
  2253. return $globals[aString]
  2254. ;
  2255. return self;
  2256. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2257. }, function($ctx1) {$ctx1.fill(self,"basicAddSubclassOf:named:instanceVariableNames:package:",{aClass:aClass,aString:aString,aCollection:aCollection,packageName:packageName},$globals.ClassBuilder)});
  2258. //>>excludeEnd("ctx");
  2259. },
  2260. //>>excludeStart("ide", pragmas.excludeIdeData);
  2261. args: ["aClass", "aString", "aCollection", "packageName"],
  2262. source: "basicAddSubclassOf: aClass named: aString instanceVariableNames: aCollection package: packageName\x0a\x09<\x0a\x09\x09$core.addClass(aString, aClass, aCollection, packageName);\x0a\x09\x09return $globals[aString]\x0a\x09>",
  2263. referencedClasses: [],
  2264. //>>excludeEnd("ide");
  2265. messageSends: []
  2266. }),
  2267. $globals.ClassBuilder);
  2268. $core.addMethod(
  2269. $core.method({
  2270. selector: "basicClass:instanceVariableNames:",
  2271. protocol: 'private',
  2272. fn: function (aClass,aString){
  2273. var self=this;
  2274. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2275. return $core.withContext(function($ctx1) {
  2276. //>>excludeEnd("ctx");
  2277. self._basicClass_instanceVariables_(aClass,self._instanceVariableNamesFor_(aString));
  2278. return self;
  2279. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2280. }, function($ctx1) {$ctx1.fill(self,"basicClass:instanceVariableNames:",{aClass:aClass,aString:aString},$globals.ClassBuilder)});
  2281. //>>excludeEnd("ctx");
  2282. },
  2283. //>>excludeStart("ide", pragmas.excludeIdeData);
  2284. args: ["aClass", "aString"],
  2285. source: "basicClass: aClass instanceVariableNames: aString\x0a\x09self basicClass: aClass instanceVariables: (self instanceVariableNamesFor: aString)",
  2286. referencedClasses: [],
  2287. //>>excludeEnd("ide");
  2288. messageSends: ["basicClass:instanceVariables:", "instanceVariableNamesFor:"]
  2289. }),
  2290. $globals.ClassBuilder);
  2291. $core.addMethod(
  2292. $core.method({
  2293. selector: "basicClass:instanceVariables:",
  2294. protocol: 'private',
  2295. fn: function (aClass,aCollection){
  2296. var self=this;
  2297. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2298. return $core.withContext(function($ctx1) {
  2299. //>>excludeEnd("ctx");
  2300. var $1;
  2301. $1=$recv(aClass)._isMetaclass();
  2302. if(!$core.assert($1)){
  2303. self._error_($recv($recv(aClass)._name()).__comma(" is not a metaclass"));
  2304. };
  2305. $recv(aClass)._basicAt_put_("iVarNames",aCollection);
  2306. return self;
  2307. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2308. }, function($ctx1) {$ctx1.fill(self,"basicClass:instanceVariables:",{aClass:aClass,aCollection:aCollection},$globals.ClassBuilder)});
  2309. //>>excludeEnd("ctx");
  2310. },
  2311. //>>excludeStart("ide", pragmas.excludeIdeData);
  2312. args: ["aClass", "aCollection"],
  2313. source: "basicClass: aClass instanceVariables: aCollection\x0a\x0a\x09aClass isMetaclass ifFalse: [ self error: aClass name, ' is not a metaclass' ].\x0a\x09aClass basicAt: 'iVarNames' put: aCollection",
  2314. referencedClasses: [],
  2315. //>>excludeEnd("ide");
  2316. messageSends: ["ifFalse:", "isMetaclass", "error:", ",", "name", "basicAt:put:"]
  2317. }),
  2318. $globals.ClassBuilder);
  2319. $core.addMethod(
  2320. $core.method({
  2321. selector: "basicRemoveClass:",
  2322. protocol: 'private',
  2323. fn: function (aClass){
  2324. var self=this;
  2325. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2326. return $core.withContext(function($ctx1) {
  2327. //>>excludeEnd("ctx");
  2328. $core.removeClass(aClass);
  2329. return self;
  2330. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2331. }, function($ctx1) {$ctx1.fill(self,"basicRemoveClass:",{aClass:aClass},$globals.ClassBuilder)});
  2332. //>>excludeEnd("ctx");
  2333. },
  2334. //>>excludeStart("ide", pragmas.excludeIdeData);
  2335. args: ["aClass"],
  2336. source: "basicRemoveClass: aClass\x0a\x09<$core.removeClass(aClass)>",
  2337. referencedClasses: [],
  2338. //>>excludeEnd("ide");
  2339. messageSends: []
  2340. }),
  2341. $globals.ClassBuilder);
  2342. $core.addMethod(
  2343. $core.method({
  2344. selector: "basicRenameClass:to:",
  2345. protocol: 'private',
  2346. fn: function (aClass,aString){
  2347. var self=this;
  2348. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2349. return $core.withContext(function($ctx1) {
  2350. //>>excludeEnd("ctx");
  2351. $globals[aString] = aClass;
  2352. delete $globals[aClass.className];
  2353. aClass.className = aString;
  2354. ;
  2355. return self;
  2356. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2357. }, function($ctx1) {$ctx1.fill(self,"basicRenameClass:to:",{aClass:aClass,aString:aString},$globals.ClassBuilder)});
  2358. //>>excludeEnd("ctx");
  2359. },
  2360. //>>excludeStart("ide", pragmas.excludeIdeData);
  2361. args: ["aClass", "aString"],
  2362. source: "basicRenameClass: aClass to: aString\x0a\x09<\x0a\x09\x09$globals[aString] = aClass;\x0a\x09\x09delete $globals[aClass.className];\x0a\x09\x09aClass.className = aString;\x0a\x09>",
  2363. referencedClasses: [],
  2364. //>>excludeEnd("ide");
  2365. messageSends: []
  2366. }),
  2367. $globals.ClassBuilder);
  2368. $core.addMethod(
  2369. $core.method({
  2370. selector: "basicSwapClassNames:with:",
  2371. protocol: 'private',
  2372. fn: function (aClass,anotherClass){
  2373. var self=this;
  2374. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2375. return $core.withContext(function($ctx1) {
  2376. //>>excludeEnd("ctx");
  2377. var tmp = aClass.className;
  2378. aClass.className = anotherClass.className;
  2379. anotherClass.className = tmp;
  2380. ;
  2381. return self;
  2382. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2383. }, function($ctx1) {$ctx1.fill(self,"basicSwapClassNames:with:",{aClass:aClass,anotherClass:anotherClass},$globals.ClassBuilder)});
  2384. //>>excludeEnd("ctx");
  2385. },
  2386. //>>excludeStart("ide", pragmas.excludeIdeData);
  2387. args: ["aClass", "anotherClass"],
  2388. source: "basicSwapClassNames: aClass with: anotherClass\x0a\x09<\x0a\x09\x09var tmp = aClass.className;\x0a\x09\x09aClass.className = anotherClass.className;\x0a\x09\x09anotherClass.className = tmp;\x0a\x09>",
  2389. referencedClasses: [],
  2390. //>>excludeEnd("ide");
  2391. messageSends: []
  2392. }),
  2393. $globals.ClassBuilder);
  2394. $core.addMethod(
  2395. $core.method({
  2396. selector: "class:instanceVariableNames:",
  2397. protocol: 'class definition',
  2398. fn: function (aClass,ivarNames){
  2399. var self=this;
  2400. function $SystemAnnouncer(){return $globals.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  2401. function $ClassDefinitionChanged(){return $globals.ClassDefinitionChanged||(typeof ClassDefinitionChanged=="undefined"?nil:ClassDefinitionChanged)}
  2402. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2403. return $core.withContext(function($ctx1) {
  2404. //>>excludeEnd("ctx");
  2405. var $1,$3,$2;
  2406. self._basicClass_instanceVariableNames_(aClass,ivarNames);
  2407. self._setupClass_(aClass);
  2408. $1=$recv($SystemAnnouncer())._current();
  2409. $3=$recv($ClassDefinitionChanged())._new();
  2410. $recv($3)._theClass_(aClass);
  2411. $2=$recv($3)._yourself();
  2412. $recv($1)._announce_($2);
  2413. return self;
  2414. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2415. }, function($ctx1) {$ctx1.fill(self,"class:instanceVariableNames:",{aClass:aClass,ivarNames:ivarNames},$globals.ClassBuilder)});
  2416. //>>excludeEnd("ctx");
  2417. },
  2418. //>>excludeStart("ide", pragmas.excludeIdeData);
  2419. args: ["aClass", "ivarNames"],
  2420. source: "class: aClass instanceVariableNames: ivarNames\x0a\x09self basicClass: aClass instanceVariableNames: ivarNames.\x0a\x09self setupClass: aClass.\x0a\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (ClassDefinitionChanged new\x0a\x09\x09\x09theClass: aClass;\x0a\x09\x09\x09yourself)",
  2421. referencedClasses: ["SystemAnnouncer", "ClassDefinitionChanged"],
  2422. //>>excludeEnd("ide");
  2423. messageSends: ["basicClass:instanceVariableNames:", "setupClass:", "announce:", "current", "theClass:", "new", "yourself"]
  2424. }),
  2425. $globals.ClassBuilder);
  2426. $core.addMethod(
  2427. $core.method({
  2428. selector: "copyClass:named:",
  2429. protocol: 'copying',
  2430. fn: function (aClass,className){
  2431. var self=this;
  2432. var newClass;
  2433. function $SystemAnnouncer(){return $globals.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  2434. function $ClassAdded(){return $globals.ClassAdded||(typeof ClassAdded=="undefined"?nil:ClassAdded)}
  2435. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2436. return $core.withContext(function($ctx1) {
  2437. //>>excludeEnd("ctx");
  2438. var $1,$3,$2;
  2439. newClass=self._addSubclassOf_named_instanceVariableNames_package_($recv(aClass)._superclass(),className,$recv(aClass)._instanceVariableNames(),$recv($recv(aClass)._package())._name());
  2440. self._copyClass_to_(aClass,newClass);
  2441. $1=$recv($SystemAnnouncer())._current();
  2442. $3=$recv($ClassAdded())._new();
  2443. $recv($3)._theClass_(newClass);
  2444. $2=$recv($3)._yourself();
  2445. $recv($1)._announce_($2);
  2446. return newClass;
  2447. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2448. }, function($ctx1) {$ctx1.fill(self,"copyClass:named:",{aClass:aClass,className:className,newClass:newClass},$globals.ClassBuilder)});
  2449. //>>excludeEnd("ctx");
  2450. },
  2451. //>>excludeStart("ide", pragmas.excludeIdeData);
  2452. args: ["aClass", "className"],
  2453. source: "copyClass: aClass named: className\x0a\x09| newClass |\x0a\x0a\x09newClass := self\x0a\x09\x09addSubclassOf: aClass superclass\x0a\x09\x09named: className\x0a\x09\x09instanceVariableNames: aClass instanceVariableNames\x0a\x09\x09package: aClass package name.\x0a\x0a\x09self copyClass: aClass to: newClass.\x0a\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (ClassAdded new\x0a\x09\x09\x09theClass: newClass;\x0a\x09\x09\x09yourself).\x0a\x09\x0a\x09^ newClass",
  2454. referencedClasses: ["SystemAnnouncer", "ClassAdded"],
  2455. //>>excludeEnd("ide");
  2456. messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "superclass", "instanceVariableNames", "name", "package", "copyClass:to:", "announce:", "current", "theClass:", "new", "yourself"]
  2457. }),
  2458. $globals.ClassBuilder);
  2459. $core.addMethod(
  2460. $core.method({
  2461. selector: "copyClass:to:",
  2462. protocol: 'copying',
  2463. fn: function (aClass,anotherClass){
  2464. var self=this;
  2465. function $Compiler(){return $globals.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  2466. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2467. return $core.withContext(function($ctx1) {
  2468. //>>excludeEnd("ctx");
  2469. var $1,$2,$3,$4,$5,$7,$6,$9,$8;
  2470. $recv(anotherClass)._comment_($recv(aClass)._comment());
  2471. $1=$recv(aClass)._methodDictionary();
  2472. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2473. $ctx1.sendIdx["methodDictionary"]=1;
  2474. //>>excludeEnd("ctx");
  2475. $recv($1)._valuesDo_((function(each){
  2476. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2477. return $core.withContext(function($ctx2) {
  2478. //>>excludeEnd("ctx");
  2479. $2=$recv($Compiler())._new();
  2480. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2481. $ctx2.sendIdx["new"]=1;
  2482. //>>excludeEnd("ctx");
  2483. $3=$recv(each)._source();
  2484. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2485. $ctx2.sendIdx["source"]=1;
  2486. //>>excludeEnd("ctx");
  2487. $4=$recv(each)._protocol();
  2488. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2489. $ctx2.sendIdx["protocol"]=1;
  2490. //>>excludeEnd("ctx");
  2491. return $recv($2)._install_forClass_protocol_($3,anotherClass,$4);
  2492. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2493. $ctx2.sendIdx["install:forClass:protocol:"]=1;
  2494. //>>excludeEnd("ctx");
  2495. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2496. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2497. //>>excludeEnd("ctx");
  2498. }));
  2499. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2500. $ctx1.sendIdx["valuesDo:"]=1;
  2501. //>>excludeEnd("ctx");
  2502. $5=$recv(anotherClass)._class();
  2503. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2504. $ctx1.sendIdx["class"]=1;
  2505. //>>excludeEnd("ctx");
  2506. $7=$recv(aClass)._class();
  2507. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2508. $ctx1.sendIdx["class"]=2;
  2509. //>>excludeEnd("ctx");
  2510. $6=$recv($7)._instanceVariableNames();
  2511. self._basicClass_instanceVariables_($5,$6);
  2512. $9=$recv(aClass)._class();
  2513. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2514. $ctx1.sendIdx["class"]=3;
  2515. //>>excludeEnd("ctx");
  2516. $8=$recv($9)._methodDictionary();
  2517. $recv($8)._valuesDo_((function(each){
  2518. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2519. return $core.withContext(function($ctx2) {
  2520. //>>excludeEnd("ctx");
  2521. return $recv($recv($Compiler())._new())._install_forClass_protocol_($recv(each)._source(),$recv(anotherClass)._class(),$recv(each)._protocol());
  2522. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2523. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  2524. //>>excludeEnd("ctx");
  2525. }));
  2526. self._setupClass_(anotherClass);
  2527. return self;
  2528. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2529. }, function($ctx1) {$ctx1.fill(self,"copyClass:to:",{aClass:aClass,anotherClass:anotherClass},$globals.ClassBuilder)});
  2530. //>>excludeEnd("ctx");
  2531. },
  2532. //>>excludeStart("ide", pragmas.excludeIdeData);
  2533. args: ["aClass", "anotherClass"],
  2534. source: "copyClass: aClass to: anotherClass\x0a\x0a\x09anotherClass comment: aClass comment.\x0a\x0a\x09aClass methodDictionary valuesDo: [ :each |\x0a\x09\x09Compiler new install: each source forClass: anotherClass protocol: each protocol ].\x0a\x0a\x09self basicClass: anotherClass class instanceVariables: aClass class instanceVariableNames.\x0a\x0a\x09aClass class methodDictionary valuesDo: [ :each |\x0a\x09\x09Compiler new install: each source forClass: anotherClass class protocol: each protocol ].\x0a\x0a\x09self setupClass: anotherClass",
  2535. referencedClasses: ["Compiler"],
  2536. //>>excludeEnd("ide");
  2537. messageSends: ["comment:", "comment", "valuesDo:", "methodDictionary", "install:forClass:protocol:", "new", "source", "protocol", "basicClass:instanceVariables:", "class", "instanceVariableNames", "setupClass:"]
  2538. }),
  2539. $globals.ClassBuilder);
  2540. $core.addMethod(
  2541. $core.method({
  2542. selector: "installMethod:forClass:protocol:",
  2543. protocol: 'method definition',
  2544. fn: function (aCompiledMethod,aBehavior,aString){
  2545. var self=this;
  2546. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2547. return $core.withContext(function($ctx1) {
  2548. //>>excludeEnd("ctx");
  2549. $recv(aCompiledMethod)._protocol_(aString);
  2550. $recv(aBehavior)._addCompiledMethod_(aCompiledMethod);
  2551. return aCompiledMethod;
  2552. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2553. }, function($ctx1) {$ctx1.fill(self,"installMethod:forClass:protocol:",{aCompiledMethod:aCompiledMethod,aBehavior:aBehavior,aString:aString},$globals.ClassBuilder)});
  2554. //>>excludeEnd("ctx");
  2555. },
  2556. //>>excludeStart("ide", pragmas.excludeIdeData);
  2557. args: ["aCompiledMethod", "aBehavior", "aString"],
  2558. source: "installMethod: aCompiledMethod forClass: aBehavior protocol: aString\x0a\x09aCompiledMethod protocol: aString.\x0a\x09aBehavior addCompiledMethod: aCompiledMethod.\x0a\x09^ aCompiledMethod",
  2559. referencedClasses: [],
  2560. //>>excludeEnd("ide");
  2561. messageSends: ["protocol:", "addCompiledMethod:"]
  2562. }),
  2563. $globals.ClassBuilder);
  2564. $core.addMethod(
  2565. $core.method({
  2566. selector: "instanceVariableNamesFor:",
  2567. protocol: 'accessing',
  2568. fn: function (aString){
  2569. var self=this;
  2570. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2571. return $core.withContext(function($ctx1) {
  2572. //>>excludeEnd("ctx");
  2573. return $recv($recv(aString)._tokenize_(" "))._reject_((function(each){
  2574. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2575. return $core.withContext(function($ctx2) {
  2576. //>>excludeEnd("ctx");
  2577. return $recv(each)._isEmpty();
  2578. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2579. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2580. //>>excludeEnd("ctx");
  2581. }));
  2582. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2583. }, function($ctx1) {$ctx1.fill(self,"instanceVariableNamesFor:",{aString:aString},$globals.ClassBuilder)});
  2584. //>>excludeEnd("ctx");
  2585. },
  2586. //>>excludeStart("ide", pragmas.excludeIdeData);
  2587. args: ["aString"],
  2588. source: "instanceVariableNamesFor: aString\x0a\x09^ (aString tokenize: ' ') reject: [ :each | each isEmpty ]",
  2589. referencedClasses: [],
  2590. //>>excludeEnd("ide");
  2591. messageSends: ["reject:", "tokenize:", "isEmpty"]
  2592. }),
  2593. $globals.ClassBuilder);
  2594. $core.addMethod(
  2595. $core.method({
  2596. selector: "migrateClass:superclass:",
  2597. protocol: 'class migration',
  2598. fn: function (aClass,anotherClass){
  2599. var self=this;
  2600. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2601. return $core.withContext(function($ctx1) {
  2602. //>>excludeEnd("ctx");
  2603. var $1;
  2604. $1=$recv(aClass)._name();
  2605. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2606. $ctx1.sendIdx["name"]=1;
  2607. //>>excludeEnd("ctx");
  2608. return self._migrateClassNamed_superclass_instanceVariableNames_package_($1,anotherClass,$recv(aClass)._instanceVariableNames(),$recv($recv(aClass)._package())._name());
  2609. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2610. }, function($ctx1) {$ctx1.fill(self,"migrateClass:superclass:",{aClass:aClass,anotherClass:anotherClass},$globals.ClassBuilder)});
  2611. //>>excludeEnd("ctx");
  2612. },
  2613. //>>excludeStart("ide", pragmas.excludeIdeData);
  2614. args: ["aClass", "anotherClass"],
  2615. source: "migrateClass: aClass superclass: anotherClass\x0a\x09^ self\x0a\x09\x09migrateClassNamed: aClass name\x0a\x09\x09superclass: anotherClass\x0a\x09\x09instanceVariableNames: aClass instanceVariableNames\x0a\x09\x09package: aClass package name",
  2616. referencedClasses: [],
  2617. //>>excludeEnd("ide");
  2618. messageSends: ["migrateClassNamed:superclass:instanceVariableNames:package:", "name", "instanceVariableNames", "package"]
  2619. }),
  2620. $globals.ClassBuilder);
  2621. $core.addMethod(
  2622. $core.method({
  2623. selector: "migrateClassNamed:superclass:instanceVariableNames:package:",
  2624. protocol: 'class migration',
  2625. fn: function (className,aClass,aCollection,packageName){
  2626. var self=this;
  2627. var oldClass,newClass,tmp;
  2628. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  2629. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  2630. function $SystemAnnouncer(){return $globals.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  2631. function $ClassMigrated(){return $globals.ClassMigrated||(typeof ClassMigrated=="undefined"?nil:ClassMigrated)}
  2632. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2633. return $core.withContext(function($ctx1) {
  2634. //>>excludeEnd("ctx");
  2635. var $1,$2,$4,$3;
  2636. tmp="new*".__comma(className);
  2637. oldClass=$recv($recv($Smalltalk())._globals())._at_(className);
  2638. newClass=self._addSubclassOf_named_instanceVariableNames_package_(aClass,tmp,aCollection,packageName);
  2639. self._basicSwapClassNames_with_(oldClass,newClass);
  2640. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2641. $ctx1.sendIdx["basicSwapClassNames:with:"]=1;
  2642. //>>excludeEnd("ctx");
  2643. $recv((function(){
  2644. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2645. return $core.withContext(function($ctx2) {
  2646. //>>excludeEnd("ctx");
  2647. return self._copyClass_to_(oldClass,newClass);
  2648. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2649. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2650. //>>excludeEnd("ctx");
  2651. }))._on_do_($Error(),(function(exception){
  2652. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2653. return $core.withContext(function($ctx2) {
  2654. //>>excludeEnd("ctx");
  2655. self._basicSwapClassNames_with_(oldClass,newClass);
  2656. $1=self._basicRemoveClass_(newClass);
  2657. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2658. $ctx2.sendIdx["basicRemoveClass:"]=1;
  2659. //>>excludeEnd("ctx");
  2660. $1;
  2661. return $recv(exception)._resignal();
  2662. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2663. }, function($ctx2) {$ctx2.fillBlock({exception:exception},$ctx1,2)});
  2664. //>>excludeEnd("ctx");
  2665. }));
  2666. self._rawRenameClass_to_(oldClass,tmp);
  2667. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2668. $ctx1.sendIdx["rawRenameClass:to:"]=1;
  2669. //>>excludeEnd("ctx");
  2670. self._rawRenameClass_to_(newClass,className);
  2671. $recv($recv(oldClass)._subclasses())._do_((function(each){
  2672. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2673. return $core.withContext(function($ctx2) {
  2674. //>>excludeEnd("ctx");
  2675. return self._migrateClass_superclass_(each,newClass);
  2676. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2677. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
  2678. //>>excludeEnd("ctx");
  2679. }));
  2680. self._basicRemoveClass_(oldClass);
  2681. $2=$recv($SystemAnnouncer())._current();
  2682. $4=$recv($ClassMigrated())._new();
  2683. $recv($4)._theClass_(newClass);
  2684. $recv($4)._oldClass_(oldClass);
  2685. $3=$recv($4)._yourself();
  2686. $recv($2)._announce_($3);
  2687. return newClass;
  2688. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2689. }, function($ctx1) {$ctx1.fill(self,"migrateClassNamed:superclass:instanceVariableNames:package:",{className:className,aClass:aClass,aCollection:aCollection,packageName:packageName,oldClass:oldClass,newClass:newClass,tmp:tmp},$globals.ClassBuilder)});
  2690. //>>excludeEnd("ctx");
  2691. },
  2692. //>>excludeStart("ide", pragmas.excludeIdeData);
  2693. args: ["className", "aClass", "aCollection", "packageName"],
  2694. source: "migrateClassNamed: className superclass: aClass instanceVariableNames: aCollection package: packageName\x0a\x09| oldClass newClass tmp |\x0a\x09\x0a\x09tmp := 'new*', className.\x0a\x09oldClass := Smalltalk globals at: className.\x0a\x09\x0a\x09newClass := self\x0a\x09\x09addSubclassOf: aClass\x0a\x09\x09named: tmp\x0a\x09\x09instanceVariableNames: aCollection\x0a\x09\x09package: packageName.\x0a\x0a\x09self basicSwapClassNames: oldClass with: newClass.\x0a\x0a\x09[ self copyClass: oldClass to: newClass ]\x0a\x09\x09on: Error\x0a\x09\x09do: [ :exception |\x0a\x09\x09\x09self\x0a\x09\x09\x09\x09basicSwapClassNames: oldClass with: newClass;\x0a\x09\x09\x09\x09basicRemoveClass: newClass.\x0a\x09\x09\x09\x09exception resignal ].\x0a\x0a\x09self\x0a\x09\x09rawRenameClass: oldClass to: tmp;\x0a\x09\x09rawRenameClass: newClass to: className.\x0a\x0a\x09oldClass subclasses \x0a\x09\x09do: [ :each | self migrateClass: each superclass: newClass ].\x0a\x0a\x09self basicRemoveClass: oldClass.\x0a\x09\x0a\x09SystemAnnouncer current announce: (ClassMigrated new\x0a\x09\x09theClass: newClass;\x0a\x09\x09oldClass: oldClass;\x0a\x09\x09yourself).\x0a\x09\x0a\x09^ newClass",
  2695. referencedClasses: ["Smalltalk", "Error", "SystemAnnouncer", "ClassMigrated"],
  2696. //>>excludeEnd("ide");
  2697. messageSends: [",", "at:", "globals", "addSubclassOf:named:instanceVariableNames:package:", "basicSwapClassNames:with:", "on:do:", "copyClass:to:", "basicRemoveClass:", "resignal", "rawRenameClass:to:", "do:", "subclasses", "migrateClass:superclass:", "announce:", "current", "theClass:", "new", "oldClass:", "yourself"]
  2698. }),
  2699. $globals.ClassBuilder);
  2700. $core.addMethod(
  2701. $core.method({
  2702. selector: "rawRenameClass:to:",
  2703. protocol: 'private',
  2704. fn: function (aClass,aString){
  2705. var self=this;
  2706. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2707. return $core.withContext(function($ctx1) {
  2708. //>>excludeEnd("ctx");
  2709. $globals[aString] = aClass;
  2710. ;
  2711. return self;
  2712. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2713. }, function($ctx1) {$ctx1.fill(self,"rawRenameClass:to:",{aClass:aClass,aString:aString},$globals.ClassBuilder)});
  2714. //>>excludeEnd("ctx");
  2715. },
  2716. //>>excludeStart("ide", pragmas.excludeIdeData);
  2717. args: ["aClass", "aString"],
  2718. source: "rawRenameClass: aClass to: aString\x0a\x09<\x0a\x09\x09$globals[aString] = aClass;\x0a\x09>",
  2719. referencedClasses: [],
  2720. //>>excludeEnd("ide");
  2721. messageSends: []
  2722. }),
  2723. $globals.ClassBuilder);
  2724. $core.addMethod(
  2725. $core.method({
  2726. selector: "renameClass:to:",
  2727. protocol: 'class migration',
  2728. fn: function (aClass,className){
  2729. var self=this;
  2730. function $SystemAnnouncer(){return $globals.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  2731. function $ClassRenamed(){return $globals.ClassRenamed||(typeof ClassRenamed=="undefined"?nil:ClassRenamed)}
  2732. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2733. return $core.withContext(function($ctx1) {
  2734. //>>excludeEnd("ctx");
  2735. var $1,$3,$2;
  2736. self._basicRenameClass_to_(aClass,className);
  2737. $recv(aClass)._recompile();
  2738. $1=$recv($SystemAnnouncer())._current();
  2739. $3=$recv($ClassRenamed())._new();
  2740. $recv($3)._theClass_(aClass);
  2741. $2=$recv($3)._yourself();
  2742. $recv($1)._announce_($2);
  2743. return self;
  2744. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2745. }, function($ctx1) {$ctx1.fill(self,"renameClass:to:",{aClass:aClass,className:className},$globals.ClassBuilder)});
  2746. //>>excludeEnd("ctx");
  2747. },
  2748. //>>excludeStart("ide", pragmas.excludeIdeData);
  2749. args: ["aClass", "className"],
  2750. source: "renameClass: aClass to: className\x0a\x09self basicRenameClass: aClass to: className.\x0a\x09\x0a\x09\x22Recompile the class to fix potential issues with super sends\x22\x0a\x09aClass recompile.\x0a\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (ClassRenamed new\x0a\x09\x09\x09theClass: aClass;\x0a\x09\x09\x09yourself)",
  2751. referencedClasses: ["SystemAnnouncer", "ClassRenamed"],
  2752. //>>excludeEnd("ide");
  2753. messageSends: ["basicRenameClass:to:", "recompile", "announce:", "current", "theClass:", "new", "yourself"]
  2754. }),
  2755. $globals.ClassBuilder);
  2756. $core.addMethod(
  2757. $core.method({
  2758. selector: "setupClass:",
  2759. protocol: 'public',
  2760. fn: function (aClass){
  2761. var self=this;
  2762. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2763. return $core.withContext(function($ctx1) {
  2764. //>>excludeEnd("ctx");
  2765. $core.init(aClass);;
  2766. return self;
  2767. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2768. }, function($ctx1) {$ctx1.fill(self,"setupClass:",{aClass:aClass},$globals.ClassBuilder)});
  2769. //>>excludeEnd("ctx");
  2770. },
  2771. //>>excludeStart("ide", pragmas.excludeIdeData);
  2772. args: ["aClass"],
  2773. source: "setupClass: aClass\x0a\x09<$core.init(aClass);>",
  2774. referencedClasses: [],
  2775. //>>excludeEnd("ide");
  2776. messageSends: []
  2777. }),
  2778. $globals.ClassBuilder);
  2779. $core.addMethod(
  2780. $core.method({
  2781. selector: "superclass:subclass:",
  2782. protocol: 'class definition',
  2783. fn: function (aClass,className){
  2784. var self=this;
  2785. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2786. return $core.withContext(function($ctx1) {
  2787. //>>excludeEnd("ctx");
  2788. return self._superclass_subclass_instanceVariableNames_package_(aClass,className,"",nil);
  2789. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2790. }, function($ctx1) {$ctx1.fill(self,"superclass:subclass:",{aClass:aClass,className:className},$globals.ClassBuilder)});
  2791. //>>excludeEnd("ctx");
  2792. },
  2793. //>>excludeStart("ide", pragmas.excludeIdeData);
  2794. args: ["aClass", "className"],
  2795. source: "superclass: aClass subclass: className\x0a\x09^ self superclass: aClass subclass: className instanceVariableNames: '' package: nil",
  2796. referencedClasses: [],
  2797. //>>excludeEnd("ide");
  2798. messageSends: ["superclass:subclass:instanceVariableNames:package:"]
  2799. }),
  2800. $globals.ClassBuilder);
  2801. $core.addMethod(
  2802. $core.method({
  2803. selector: "superclass:subclass:instanceVariableNames:package:",
  2804. protocol: 'class definition',
  2805. fn: function (aClass,className,ivarNames,packageName){
  2806. var self=this;
  2807. var newClass;
  2808. function $SystemAnnouncer(){return $globals.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  2809. function $ClassAdded(){return $globals.ClassAdded||(typeof ClassAdded=="undefined"?nil:ClassAdded)}
  2810. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2811. return $core.withContext(function($ctx1) {
  2812. //>>excludeEnd("ctx");
  2813. var $1,$2,$3,$5,$4,$receiver;
  2814. $1=self._instanceVariableNamesFor_(ivarNames);
  2815. if(($receiver = packageName) == null || $receiver.isNil){
  2816. $2="unclassified";
  2817. } else {
  2818. $2=packageName;
  2819. };
  2820. newClass=self._addSubclassOf_named_instanceVariableNames_package_(aClass,className,$1,$2);
  2821. self._setupClass_(newClass);
  2822. $3=$recv($SystemAnnouncer())._current();
  2823. $5=$recv($ClassAdded())._new();
  2824. $recv($5)._theClass_(newClass);
  2825. $4=$recv($5)._yourself();
  2826. $recv($3)._announce_($4);
  2827. return newClass;
  2828. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2829. }, function($ctx1) {$ctx1.fill(self,"superclass:subclass:instanceVariableNames:package:",{aClass:aClass,className:className,ivarNames:ivarNames,packageName:packageName,newClass:newClass},$globals.ClassBuilder)});
  2830. //>>excludeEnd("ctx");
  2831. },
  2832. //>>excludeStart("ide", pragmas.excludeIdeData);
  2833. args: ["aClass", "className", "ivarNames", "packageName"],
  2834. source: "superclass: aClass subclass: className instanceVariableNames: ivarNames package: packageName\x0a\x09| newClass |\x0a\x09\x0a\x09newClass := self addSubclassOf: aClass\x0a\x09\x09named: className instanceVariableNames: (self instanceVariableNamesFor: ivarNames)\x0a\x09\x09package: (packageName ifNil: [ 'unclassified' ]).\x0a\x09self setupClass: newClass.\x0a\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (ClassAdded new\x0a\x09\x09\x09theClass: newClass;\x0a\x09\x09\x09yourself).\x0a\x09\x0a\x09^ newClass",
  2835. referencedClasses: ["SystemAnnouncer", "ClassAdded"],
  2836. //>>excludeEnd("ide");
  2837. messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "instanceVariableNamesFor:", "ifNil:", "setupClass:", "announce:", "current", "theClass:", "new", "yourself"]
  2838. }),
  2839. $globals.ClassBuilder);
  2840. $core.addClass('ClassSorterNode', $globals.Object, ['theClass', 'level', 'nodes'], 'Kernel-Classes');
  2841. //>>excludeStart("ide", pragmas.excludeIdeData);
  2842. $globals.ClassSorterNode.comment="I provide an algorithm for sorting classes alphabetically.\x0a\x0aSee [Issue #143](https://github.com/amber-smalltalk/amber/issues/143) on GitHub.";
  2843. //>>excludeEnd("ide");
  2844. $core.addMethod(
  2845. $core.method({
  2846. selector: "getNodesFrom:",
  2847. protocol: 'accessing',
  2848. fn: function (aCollection){
  2849. var self=this;
  2850. var children,others;
  2851. function $ClassSorterNode(){return $globals.ClassSorterNode||(typeof ClassSorterNode=="undefined"?nil:ClassSorterNode)}
  2852. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2853. return $core.withContext(function($ctx1) {
  2854. //>>excludeEnd("ctx");
  2855. var $1;
  2856. children=[];
  2857. others=[];
  2858. $recv(aCollection)._do_((function(each){
  2859. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2860. return $core.withContext(function($ctx2) {
  2861. //>>excludeEnd("ctx");
  2862. $1=$recv($recv(each)._superclass()).__eq(self._theClass());
  2863. if($core.assert($1)){
  2864. return $recv(children)._add_(each);
  2865. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2866. $ctx2.sendIdx["add:"]=1;
  2867. //>>excludeEnd("ctx");
  2868. } else {
  2869. return $recv(others)._add_(each);
  2870. };
  2871. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2872. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2873. //>>excludeEnd("ctx");
  2874. }));
  2875. self["@nodes"]=$recv(children)._collect_((function(each){
  2876. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2877. return $core.withContext(function($ctx2) {
  2878. //>>excludeEnd("ctx");
  2879. return $recv($ClassSorterNode())._on_classes_level_(each,others,$recv(self._level()).__plus((1)));
  2880. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2881. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)});
  2882. //>>excludeEnd("ctx");
  2883. }));
  2884. return self;
  2885. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2886. }, function($ctx1) {$ctx1.fill(self,"getNodesFrom:",{aCollection:aCollection,children:children,others:others},$globals.ClassSorterNode)});
  2887. //>>excludeEnd("ctx");
  2888. },
  2889. //>>excludeStart("ide", pragmas.excludeIdeData);
  2890. args: ["aCollection"],
  2891. source: "getNodesFrom: aCollection\x0a\x09| children others |\x0a\x09children := #().\x0a\x09others := #().\x0a\x09aCollection do: [ :each |\x0a\x09\x09(each superclass = self theClass)\x0a\x09\x09\x09ifTrue: [ children add: each ]\x0a\x09\x09\x09ifFalse: [ others add: each ]].\x0a\x09nodes:= children collect: [ :each |\x0a\x09\x09ClassSorterNode on: each classes: others level: self level + 1 ]",
  2892. referencedClasses: ["ClassSorterNode"],
  2893. //>>excludeEnd("ide");
  2894. messageSends: ["do:", "ifTrue:ifFalse:", "=", "superclass", "theClass", "add:", "collect:", "on:classes:level:", "+", "level"]
  2895. }),
  2896. $globals.ClassSorterNode);
  2897. $core.addMethod(
  2898. $core.method({
  2899. selector: "level",
  2900. protocol: 'accessing',
  2901. fn: function (){
  2902. var self=this;
  2903. return self["@level"];
  2904. },
  2905. //>>excludeStart("ide", pragmas.excludeIdeData);
  2906. args: [],
  2907. source: "level\x0a\x09^ level",
  2908. referencedClasses: [],
  2909. //>>excludeEnd("ide");
  2910. messageSends: []
  2911. }),
  2912. $globals.ClassSorterNode);
  2913. $core.addMethod(
  2914. $core.method({
  2915. selector: "level:",
  2916. protocol: 'accessing',
  2917. fn: function (anInteger){
  2918. var self=this;
  2919. self["@level"]=anInteger;
  2920. return self;
  2921. },
  2922. //>>excludeStart("ide", pragmas.excludeIdeData);
  2923. args: ["anInteger"],
  2924. source: "level: anInteger\x0a\x09level := anInteger",
  2925. referencedClasses: [],
  2926. //>>excludeEnd("ide");
  2927. messageSends: []
  2928. }),
  2929. $globals.ClassSorterNode);
  2930. $core.addMethod(
  2931. $core.method({
  2932. selector: "nodes",
  2933. protocol: 'accessing',
  2934. fn: function (){
  2935. var self=this;
  2936. return self["@nodes"];
  2937. },
  2938. //>>excludeStart("ide", pragmas.excludeIdeData);
  2939. args: [],
  2940. source: "nodes\x0a\x09^ nodes",
  2941. referencedClasses: [],
  2942. //>>excludeEnd("ide");
  2943. messageSends: []
  2944. }),
  2945. $globals.ClassSorterNode);
  2946. $core.addMethod(
  2947. $core.method({
  2948. selector: "theClass",
  2949. protocol: 'accessing',
  2950. fn: function (){
  2951. var self=this;
  2952. return self["@theClass"];
  2953. },
  2954. //>>excludeStart("ide", pragmas.excludeIdeData);
  2955. args: [],
  2956. source: "theClass\x0a\x09^ theClass",
  2957. referencedClasses: [],
  2958. //>>excludeEnd("ide");
  2959. messageSends: []
  2960. }),
  2961. $globals.ClassSorterNode);
  2962. $core.addMethod(
  2963. $core.method({
  2964. selector: "theClass:",
  2965. protocol: 'accessing',
  2966. fn: function (aClass){
  2967. var self=this;
  2968. self["@theClass"]=aClass;
  2969. return self;
  2970. },
  2971. //>>excludeStart("ide", pragmas.excludeIdeData);
  2972. args: ["aClass"],
  2973. source: "theClass: aClass\x0a\x09theClass := aClass",
  2974. referencedClasses: [],
  2975. //>>excludeEnd("ide");
  2976. messageSends: []
  2977. }),
  2978. $globals.ClassSorterNode);
  2979. $core.addMethod(
  2980. $core.method({
  2981. selector: "traverseClassesWith:",
  2982. protocol: 'visiting',
  2983. fn: function (aCollection){
  2984. var self=this;
  2985. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2986. return $core.withContext(function($ctx1) {
  2987. //>>excludeEnd("ctx");
  2988. var $1,$3,$2;
  2989. $1=self._theClass();
  2990. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2991. $ctx1.sendIdx["theClass"]=1;
  2992. //>>excludeEnd("ctx");
  2993. $recv(aCollection)._add_($1);
  2994. $recv($recv(self._nodes())._sorted_((function(a,b){
  2995. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2996. return $core.withContext(function($ctx2) {
  2997. //>>excludeEnd("ctx");
  2998. $3=$recv(a)._theClass();
  2999. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3000. $ctx2.sendIdx["theClass"]=2;
  3001. //>>excludeEnd("ctx");
  3002. $2=$recv($3)._name();
  3003. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3004. $ctx2.sendIdx["name"]=1;
  3005. //>>excludeEnd("ctx");
  3006. return $recv($2).__lt_eq($recv($recv(b)._theClass())._name());
  3007. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3008. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,1)});
  3009. //>>excludeEnd("ctx");
  3010. })))._do_((function(aNode){
  3011. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3012. return $core.withContext(function($ctx2) {
  3013. //>>excludeEnd("ctx");
  3014. return $recv(aNode)._traverseClassesWith_(aCollection);
  3015. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3016. }, function($ctx2) {$ctx2.fillBlock({aNode:aNode},$ctx1,2)});
  3017. //>>excludeEnd("ctx");
  3018. }));
  3019. return self;
  3020. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3021. }, function($ctx1) {$ctx1.fill(self,"traverseClassesWith:",{aCollection:aCollection},$globals.ClassSorterNode)});
  3022. //>>excludeEnd("ctx");
  3023. },
  3024. //>>excludeStart("ide", pragmas.excludeIdeData);
  3025. args: ["aCollection"],
  3026. source: "traverseClassesWith: aCollection\x0a\x09\x22sort classes alphabetically Issue #143\x22\x0a\x0a\x09aCollection add: self theClass.\x0a\x09(self nodes sorted: [ :a :b | a theClass name <= b theClass name ]) do: [ :aNode |\x0a\x09\x09aNode traverseClassesWith: aCollection ].",
  3027. referencedClasses: [],
  3028. //>>excludeEnd("ide");
  3029. messageSends: ["add:", "theClass", "do:", "sorted:", "nodes", "<=", "name", "traverseClassesWith:"]
  3030. }),
  3031. $globals.ClassSorterNode);
  3032. $core.addMethod(
  3033. $core.method({
  3034. selector: "on:classes:level:",
  3035. protocol: 'instance creation',
  3036. fn: function (aClass,aCollection,anInteger){
  3037. var self=this;
  3038. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3039. return $core.withContext(function($ctx1) {
  3040. //>>excludeEnd("ctx");
  3041. var $1;
  3042. $1=self._new();
  3043. $recv($1)._theClass_(aClass);
  3044. $recv($1)._level_(anInteger);
  3045. $recv($1)._getNodesFrom_(aCollection);
  3046. return $recv($1)._yourself();
  3047. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3048. }, function($ctx1) {$ctx1.fill(self,"on:classes:level:",{aClass:aClass,aCollection:aCollection,anInteger:anInteger},$globals.ClassSorterNode.klass)});
  3049. //>>excludeEnd("ctx");
  3050. },
  3051. //>>excludeStart("ide", pragmas.excludeIdeData);
  3052. args: ["aClass", "aCollection", "anInteger"],
  3053. source: "on: aClass classes: aCollection level: anInteger\x0a\x09^ self new\x0a\x09\x09theClass: aClass;\x0a\x09\x09level: anInteger;\x0a\x09\x09getNodesFrom: aCollection;\x0a\x09\x09yourself",
  3054. referencedClasses: [],
  3055. //>>excludeEnd("ide");
  3056. messageSends: ["theClass:", "new", "level:", "getNodesFrom:", "yourself"]
  3057. }),
  3058. $globals.ClassSorterNode.klass);
  3059. });