Kernel-Classes.js 130 KB

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