Kernel-Classes.js 178 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871
  1. define(["amber/boot", "amber_core/Kernel-Collections", "amber_core/Kernel-Objects"], function($boot){"use strict";
  2. if(!$boot.nilAsReceiver)$boot.nilAsReceiver=$boot.nil;
  3. var $core=$boot.api,nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;
  4. if(!$boot.nilAsClass)$boot.nilAsClass=$boot.dnu;
  5. $core.addPackage("Kernel-Classes");
  6. $core.packages["Kernel-Classes"].innerEval = function (expr) { return eval(expr); };
  7. $core.packages["Kernel-Classes"].transport = {"type":"amd","amdNamespace":"amber_core"};
  8. $core.addClass("BehaviorBody", $globals.Object, [], "Kernel-Classes");
  9. //>>excludeStart("ide", pragmas.excludeIdeData);
  10. $globals.BehaviorBody.comment="I am the superclass of all behaviors.\x0a\x0aMy instances hold the method dictionary.\x0a\x0aI also provides methods for compiling methods and examining the method dictionary.";
  11. //>>excludeEnd("ide");
  12. $core.addMethod(
  13. $core.method({
  14. selector: ">>",
  15. protocol: "accessing",
  16. fn: function (aString){
  17. var self=this;
  18. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  19. return $core.withContext(function($ctx1) {
  20. //>>excludeEnd("ctx");
  21. return self._methodAt_(aString);
  22. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  23. }, function($ctx1) {$ctx1.fill(self,">>",{aString:aString},$globals.BehaviorBody)});
  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.BehaviorBody);
  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. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  42. return $core.withContext(function($ctx1) {
  43. //>>excludeEnd("ctx");
  44. var $2,$3,$1,$4,$5,$6,$7,$8,$9,$10,$receiver;
  45. oldMethod=$recv(self._methodDictionary())._at_ifAbsent_($recv(aMethod)._selector(),(function(){
  46. return nil;
  47. }));
  48. $2=self._protocols();
  49. $3=$recv(aMethod)._protocol();
  50. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  51. $ctx1.sendIdx["protocol"]=1;
  52. //>>excludeEnd("ctx");
  53. $1=$recv($2)._includes_($3);
  54. if(!$core.assert($1)){
  55. $4=self._organization();
  56. $5=$recv(aMethod)._protocol();
  57. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  58. $ctx1.sendIdx["protocol"]=2;
  59. //>>excludeEnd("ctx");
  60. $recv($4)._addElement_($5);
  61. }
  62. self._basicAddCompiledMethod_(aMethod);
  63. $6=oldMethod;
  64. if(($receiver = $6) == null || $receiver.a$nil){
  65. $6;
  66. } else {
  67. self._removeProtocolIfEmpty_($recv(oldMethod)._protocol());
  68. }
  69. $7=oldMethod;
  70. if(($receiver = $7) == null || $receiver.a$nil){
  71. $8=$recv($globals.MethodAdded)._new();
  72. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  73. $ctx1.sendIdx["new"]=1;
  74. //>>excludeEnd("ctx");
  75. $recv($8)._method_(aMethod);
  76. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  77. $ctx1.sendIdx["method:"]=1;
  78. //>>excludeEnd("ctx");
  79. $9=$recv($8)._yourself();
  80. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  81. $ctx1.sendIdx["yourself"]=1;
  82. //>>excludeEnd("ctx");
  83. announcement=$9;
  84. } else {
  85. $10=$recv($globals.MethodModified)._new();
  86. $recv($10)._oldMethod_(oldMethod);
  87. $recv($10)._method_(aMethod);
  88. announcement=$recv($10)._yourself();
  89. }
  90. $recv($recv($globals.SystemAnnouncer)._current())._announce_(announcement);
  91. return self;
  92. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  93. }, function($ctx1) {$ctx1.fill(self,"addCompiledMethod:",{aMethod:aMethod,oldMethod:oldMethod,announcement:announcement},$globals.BehaviorBody)});
  94. //>>excludeEnd("ctx");
  95. },
  96. //>>excludeStart("ide", pragmas.excludeIdeData);
  97. args: ["aMethod"],
  98. 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",
  99. referencedClasses: ["MethodAdded", "MethodModified", "SystemAnnouncer"],
  100. //>>excludeEnd("ide");
  101. messageSends: ["at:ifAbsent:", "methodDictionary", "selector", "ifFalse:", "includes:", "protocols", "protocol", "addElement:", "organization", "basicAddCompiledMethod:", "ifNotNil:", "removeProtocolIfEmpty:", "ifNil:ifNotNil:", "method:", "new", "yourself", "oldMethod:", "announce:", "current"]
  102. }),
  103. $globals.BehaviorBody);
  104. $core.addMethod(
  105. $core.method({
  106. selector: "allInstanceVariableNames",
  107. protocol: "accessing",
  108. fn: function (){
  109. var self=this;
  110. return [];
  111. },
  112. //>>excludeStart("ide", pragmas.excludeIdeData);
  113. args: [],
  114. source: "allInstanceVariableNames\x0a\x09\x22Default for non-classes; to be able to send #allInstanceVariableNames to any class / trait.\x22\x0a\x09^ #()",
  115. referencedClasses: [],
  116. //>>excludeEnd("ide");
  117. messageSends: []
  118. }),
  119. $globals.BehaviorBody);
  120. $core.addMethod(
  121. $core.method({
  122. selector: "allSubclassesDo:",
  123. protocol: "enumerating",
  124. fn: function (aBlock){
  125. var self=this;
  126. return self;
  127. },
  128. //>>excludeStart("ide", pragmas.excludeIdeData);
  129. args: ["aBlock"],
  130. source: "allSubclassesDo: aBlock\x0a\x09\x22Default for non-classes; to be able to send #allSubclassesDo: to any class / trait.\x22",
  131. referencedClasses: [],
  132. //>>excludeEnd("ide");
  133. messageSends: []
  134. }),
  135. $globals.BehaviorBody);
  136. $core.addMethod(
  137. $core.method({
  138. selector: "basicAddCompiledMethod:",
  139. protocol: "private",
  140. fn: function (aMethod){
  141. var self=this;
  142. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  143. return $core.withContext(function($ctx1) {
  144. //>>excludeEnd("ctx");
  145. $core.addMethod(aMethod, self);
  146. return self;
  147. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  148. }, function($ctx1) {$ctx1.fill(self,"basicAddCompiledMethod:",{aMethod:aMethod},$globals.BehaviorBody)});
  149. //>>excludeEnd("ctx");
  150. },
  151. //>>excludeStart("ide", pragmas.excludeIdeData);
  152. args: ["aMethod"],
  153. source: "basicAddCompiledMethod: aMethod\x0a\x09<inlineJS: '$core.addMethod(aMethod, self)'>",
  154. referencedClasses: [],
  155. //>>excludeEnd("ide");
  156. messageSends: []
  157. }),
  158. $globals.BehaviorBody);
  159. $core.addMethod(
  160. $core.method({
  161. selector: "basicRemoveCompiledMethod:",
  162. protocol: "private",
  163. fn: function (aMethod){
  164. var self=this;
  165. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  166. return $core.withContext(function($ctx1) {
  167. //>>excludeEnd("ctx");
  168. $core.removeMethod(aMethod,self);
  169. return self;
  170. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  171. }, function($ctx1) {$ctx1.fill(self,"basicRemoveCompiledMethod:",{aMethod:aMethod},$globals.BehaviorBody)});
  172. //>>excludeEnd("ctx");
  173. },
  174. //>>excludeStart("ide", pragmas.excludeIdeData);
  175. args: ["aMethod"],
  176. source: "basicRemoveCompiledMethod: aMethod\x0a\x09<inlineJS: '$core.removeMethod(aMethod,self)'>",
  177. referencedClasses: [],
  178. //>>excludeEnd("ide");
  179. messageSends: []
  180. }),
  181. $globals.BehaviorBody);
  182. $core.addMethod(
  183. $core.method({
  184. selector: "comment",
  185. protocol: "accessing",
  186. fn: function (){
  187. var self=this;
  188. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  189. return $core.withContext(function($ctx1) {
  190. //>>excludeEnd("ctx");
  191. var $1,$receiver;
  192. $1=self._basicAt_("comment");
  193. if(($receiver = $1) == null || $receiver.a$nil){
  194. return "";
  195. } else {
  196. return $1;
  197. }
  198. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  199. }, function($ctx1) {$ctx1.fill(self,"comment",{},$globals.BehaviorBody)});
  200. //>>excludeEnd("ctx");
  201. },
  202. //>>excludeStart("ide", pragmas.excludeIdeData);
  203. args: [],
  204. source: "comment\x0a\x09^ (self basicAt: 'comment') ifNil: [ '' ]",
  205. referencedClasses: [],
  206. //>>excludeEnd("ide");
  207. messageSends: ["ifNil:", "basicAt:"]
  208. }),
  209. $globals.BehaviorBody);
  210. $core.addMethod(
  211. $core.method({
  212. selector: "comment:",
  213. protocol: "accessing",
  214. fn: function (aString){
  215. var self=this;
  216. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  217. return $core.withContext(function($ctx1) {
  218. //>>excludeEnd("ctx");
  219. var $1,$3,$2;
  220. self._basicAt_put_("comment",aString);
  221. $1=$recv($globals.SystemAnnouncer)._current();
  222. $3=$recv($globals.ClassCommentChanged)._new();
  223. $recv($3)._theClass_(self);
  224. $2=$recv($3)._yourself();
  225. $recv($1)._announce_($2);
  226. return self;
  227. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  228. }, function($ctx1) {$ctx1.fill(self,"comment:",{aString:aString},$globals.BehaviorBody)});
  229. //>>excludeEnd("ctx");
  230. },
  231. //>>excludeStart("ide", pragmas.excludeIdeData);
  232. args: ["aString"],
  233. 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)",
  234. referencedClasses: ["SystemAnnouncer", "ClassCommentChanged"],
  235. //>>excludeEnd("ide");
  236. messageSends: ["basicAt:put:", "announce:", "current", "theClass:", "new", "yourself"]
  237. }),
  238. $globals.BehaviorBody);
  239. $core.addMethod(
  240. $core.method({
  241. selector: "compile:protocol:",
  242. protocol: "compiling",
  243. fn: function (aString,anotherString){
  244. var self=this;
  245. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  246. return $core.withContext(function($ctx1) {
  247. //>>excludeEnd("ctx");
  248. return $recv($recv($globals.Compiler)._new())._install_forClass_protocol_(aString,self,anotherString);
  249. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  250. }, function($ctx1) {$ctx1.fill(self,"compile:protocol:",{aString:aString,anotherString:anotherString},$globals.BehaviorBody)});
  251. //>>excludeEnd("ctx");
  252. },
  253. //>>excludeStart("ide", pragmas.excludeIdeData);
  254. args: ["aString", "anotherString"],
  255. source: "compile: aString protocol: anotherString\x0a\x09^ Compiler new\x0a\x09\x09install: aString\x0a\x09\x09forClass: self\x0a\x09\x09protocol: anotherString",
  256. referencedClasses: ["Compiler"],
  257. //>>excludeEnd("ide");
  258. messageSends: ["install:forClass:protocol:", "new"]
  259. }),
  260. $globals.BehaviorBody);
  261. $core.addMethod(
  262. $core.method({
  263. selector: "definition",
  264. protocol: "accessing",
  265. fn: function (){
  266. var self=this;
  267. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  268. return $core.withContext(function($ctx1) {
  269. //>>excludeEnd("ctx");
  270. self._subclassResponsibility();
  271. return self;
  272. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  273. }, function($ctx1) {$ctx1.fill(self,"definition",{},$globals.BehaviorBody)});
  274. //>>excludeEnd("ctx");
  275. },
  276. //>>excludeStart("ide", pragmas.excludeIdeData);
  277. args: [],
  278. source: "definition\x0a\x09self subclassResponsibility",
  279. referencedClasses: [],
  280. //>>excludeEnd("ide");
  281. messageSends: ["subclassResponsibility"]
  282. }),
  283. $globals.BehaviorBody);
  284. $core.addMethod(
  285. $core.method({
  286. selector: "includesSelector:",
  287. protocol: "testing",
  288. fn: function (aString){
  289. var self=this;
  290. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  291. return $core.withContext(function($ctx1) {
  292. //>>excludeEnd("ctx");
  293. return $recv(self._methodDictionary())._includesKey_(aString);
  294. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  295. }, function($ctx1) {$ctx1.fill(self,"includesSelector:",{aString:aString},$globals.BehaviorBody)});
  296. //>>excludeEnd("ctx");
  297. },
  298. //>>excludeStart("ide", pragmas.excludeIdeData);
  299. args: ["aString"],
  300. source: "includesSelector: aString\x0a\x09^ self methodDictionary includesKey: aString",
  301. referencedClasses: [],
  302. //>>excludeEnd("ide");
  303. messageSends: ["includesKey:", "methodDictionary"]
  304. }),
  305. $globals.BehaviorBody);
  306. $core.addMethod(
  307. $core.method({
  308. selector: "methodAt:",
  309. protocol: "accessing",
  310. fn: function (aString){
  311. var self=this;
  312. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  313. return $core.withContext(function($ctx1) {
  314. //>>excludeEnd("ctx");
  315. return $recv(self._methodDictionary())._at_(aString);
  316. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  317. }, function($ctx1) {$ctx1.fill(self,"methodAt:",{aString:aString},$globals.BehaviorBody)});
  318. //>>excludeEnd("ctx");
  319. },
  320. //>>excludeStart("ide", pragmas.excludeIdeData);
  321. args: ["aString"],
  322. source: "methodAt: aString\x0a\x09^ self methodDictionary at: aString",
  323. referencedClasses: [],
  324. //>>excludeEnd("ide");
  325. messageSends: ["at:", "methodDictionary"]
  326. }),
  327. $globals.BehaviorBody);
  328. $core.addMethod(
  329. $core.method({
  330. selector: "methodDictionary",
  331. protocol: "accessing",
  332. fn: function (){
  333. var self=this;
  334. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  335. return $core.withContext(function($ctx1) {
  336. //>>excludeEnd("ctx");
  337. var dict = $globals.HashedCollection._new();
  338. var methods = self.methods;
  339. Object.keys(methods).forEach(function(i) {
  340. if(methods[i].selector) {
  341. dict._at_put_(methods[i].selector, methods[i]);
  342. }
  343. });
  344. return dict;
  345. return self;
  346. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  347. }, function($ctx1) {$ctx1.fill(self,"methodDictionary",{},$globals.BehaviorBody)});
  348. //>>excludeEnd("ctx");
  349. },
  350. //>>excludeStart("ide", pragmas.excludeIdeData);
  351. args: [],
  352. source: "methodDictionary\x0a\x09<inlineJS: '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'>",
  353. referencedClasses: [],
  354. //>>excludeEnd("ide");
  355. messageSends: []
  356. }),
  357. $globals.BehaviorBody);
  358. $core.addMethod(
  359. $core.method({
  360. selector: "methodTemplate",
  361. protocol: "accessing",
  362. fn: function (){
  363. var self=this;
  364. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  365. return $core.withContext(function($ctx1) {
  366. //>>excludeEnd("ctx");
  367. return $recv($globals.String)._streamContents_((function(stream){
  368. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  369. return $core.withContext(function($ctx2) {
  370. //>>excludeEnd("ctx");
  371. $recv(stream)._write_("messageSelectorAndArgumentNames");
  372. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  373. $ctx2.sendIdx["write:"]=1;
  374. //>>excludeEnd("ctx");
  375. $recv(stream)._lf();
  376. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  377. $ctx2.sendIdx["lf"]=1;
  378. //>>excludeEnd("ctx");
  379. $recv(stream)._tab();
  380. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  381. $ctx2.sendIdx["tab"]=1;
  382. //>>excludeEnd("ctx");
  383. $recv(stream)._write_("\x22comment stating purpose of message\x22");
  384. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  385. $ctx2.sendIdx["write:"]=2;
  386. //>>excludeEnd("ctx");
  387. $recv(stream)._lf();
  388. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  389. $ctx2.sendIdx["lf"]=2;
  390. //>>excludeEnd("ctx");
  391. $recv(stream)._lf();
  392. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  393. $ctx2.sendIdx["lf"]=3;
  394. //>>excludeEnd("ctx");
  395. $recv(stream)._tab();
  396. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  397. $ctx2.sendIdx["tab"]=2;
  398. //>>excludeEnd("ctx");
  399. $recv(stream)._write_("| temporary variable names |");
  400. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  401. $ctx2.sendIdx["write:"]=3;
  402. //>>excludeEnd("ctx");
  403. $recv(stream)._lf();
  404. $recv(stream)._tab();
  405. return $recv(stream)._write_("statements");
  406. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  407. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)});
  408. //>>excludeEnd("ctx");
  409. }));
  410. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  411. }, function($ctx1) {$ctx1.fill(self,"methodTemplate",{},$globals.BehaviorBody)});
  412. //>>excludeEnd("ctx");
  413. },
  414. //>>excludeStart("ide", pragmas.excludeIdeData);
  415. args: [],
  416. source: "methodTemplate\x0a\x09^ String streamContents: [ :stream | stream \x0a\x09\x09write: 'messageSelectorAndArgumentNames'; lf;\x0a\x09\x09tab; write: '\x22comment stating purpose of message\x22'; lf;\x0a\x09\x09lf;\x0a\x09\x09tab; write: '| temporary variable names |'; lf;\x0a\x09\x09tab; write: 'statements' ]",
  417. referencedClasses: ["String"],
  418. //>>excludeEnd("ide");
  419. messageSends: ["streamContents:", "write:", "lf", "tab"]
  420. }),
  421. $globals.BehaviorBody);
  422. $core.addMethod(
  423. $core.method({
  424. selector: "methods",
  425. protocol: "accessing",
  426. fn: function (){
  427. var self=this;
  428. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  429. return $core.withContext(function($ctx1) {
  430. //>>excludeEnd("ctx");
  431. return $recv(self._methodDictionary())._values();
  432. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  433. }, function($ctx1) {$ctx1.fill(self,"methods",{},$globals.BehaviorBody)});
  434. //>>excludeEnd("ctx");
  435. },
  436. //>>excludeStart("ide", pragmas.excludeIdeData);
  437. args: [],
  438. source: "methods\x0a\x09^ self methodDictionary values",
  439. referencedClasses: [],
  440. //>>excludeEnd("ide");
  441. messageSends: ["values", "methodDictionary"]
  442. }),
  443. $globals.BehaviorBody);
  444. $core.addMethod(
  445. $core.method({
  446. selector: "methodsInProtocol:",
  447. protocol: "accessing",
  448. fn: function (aString){
  449. var self=this;
  450. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  451. return $core.withContext(function($ctx1) {
  452. //>>excludeEnd("ctx");
  453. return $recv(self._methods())._select_((function(each){
  454. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  455. return $core.withContext(function($ctx2) {
  456. //>>excludeEnd("ctx");
  457. return $recv($recv(each)._protocol()).__eq(aString);
  458. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  459. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  460. //>>excludeEnd("ctx");
  461. }));
  462. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  463. }, function($ctx1) {$ctx1.fill(self,"methodsInProtocol:",{aString:aString},$globals.BehaviorBody)});
  464. //>>excludeEnd("ctx");
  465. },
  466. //>>excludeStart("ide", pragmas.excludeIdeData);
  467. args: ["aString"],
  468. source: "methodsInProtocol: aString\x0a\x09^ self methods select: [ :each | each protocol = aString ]",
  469. referencedClasses: [],
  470. //>>excludeEnd("ide");
  471. messageSends: ["select:", "methods", "=", "protocol"]
  472. }),
  473. $globals.BehaviorBody);
  474. $core.addMethod(
  475. $core.method({
  476. selector: "name",
  477. protocol: "accessing",
  478. fn: function (){
  479. var self=this;
  480. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  481. return $core.withContext(function($ctx1) {
  482. //>>excludeEnd("ctx");
  483. return self.className || nil;
  484. return self;
  485. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  486. }, function($ctx1) {$ctx1.fill(self,"name",{},$globals.BehaviorBody)});
  487. //>>excludeEnd("ctx");
  488. },
  489. //>>excludeStart("ide", pragmas.excludeIdeData);
  490. args: [],
  491. source: "name\x0a\x09<inlineJS: 'return self.className || nil'>",
  492. referencedClasses: [],
  493. //>>excludeEnd("ide");
  494. messageSends: []
  495. }),
  496. $globals.BehaviorBody);
  497. $core.addMethod(
  498. $core.method({
  499. selector: "organization",
  500. protocol: "accessing",
  501. fn: function (){
  502. var self=this;
  503. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  504. return $core.withContext(function($ctx1) {
  505. //>>excludeEnd("ctx");
  506. return self._basicAt_("organization");
  507. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  508. }, function($ctx1) {$ctx1.fill(self,"organization",{},$globals.BehaviorBody)});
  509. //>>excludeEnd("ctx");
  510. },
  511. //>>excludeStart("ide", pragmas.excludeIdeData);
  512. args: [],
  513. source: "organization\x0a\x09^ self basicAt: 'organization'",
  514. referencedClasses: [],
  515. //>>excludeEnd("ide");
  516. messageSends: ["basicAt:"]
  517. }),
  518. $globals.BehaviorBody);
  519. $core.addMethod(
  520. $core.method({
  521. selector: "ownMethods",
  522. protocol: "accessing",
  523. fn: function (){
  524. var self=this;
  525. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  526. return $core.withContext(function($ctx1) {
  527. //>>excludeEnd("ctx");
  528. var $1;
  529. return $recv($recv(self._ownProtocols())._inject_into_($recv($globals.OrderedCollection)._new(),(function(acc,each){
  530. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  531. return $core.withContext(function($ctx2) {
  532. //>>excludeEnd("ctx");
  533. return $recv(acc).__comma(self._ownMethodsInProtocol_(each));
  534. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  535. }, function($ctx2) {$ctx2.fillBlock({acc:acc,each:each},$ctx1,1)});
  536. //>>excludeEnd("ctx");
  537. })))._sorted_((function(a,b){
  538. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  539. return $core.withContext(function($ctx2) {
  540. //>>excludeEnd("ctx");
  541. $1=$recv(a)._selector();
  542. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  543. $ctx2.sendIdx["selector"]=1;
  544. //>>excludeEnd("ctx");
  545. return $recv($1).__lt_eq($recv(b)._selector());
  546. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  547. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,2)});
  548. //>>excludeEnd("ctx");
  549. }));
  550. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  551. }, function($ctx1) {$ctx1.fill(self,"ownMethods",{},$globals.BehaviorBody)});
  552. //>>excludeEnd("ctx");
  553. },
  554. //>>excludeStart("ide", pragmas.excludeIdeData);
  555. args: [],
  556. source: "ownMethods\x0a\x09\x22Answer the methods of the receiver that are not package extensions\x0a\x09nor obtained via trait composition\x22\x0a\x0a\x09^ (self ownProtocols \x0a\x09\x09inject: OrderedCollection new\x0a\x09\x09into: [ :acc :each | acc, (self ownMethodsInProtocol: each) ])\x0a\x09\x09\x09sorted: [ :a :b | a selector <= b selector ]",
  557. referencedClasses: ["OrderedCollection"],
  558. //>>excludeEnd("ide");
  559. messageSends: ["sorted:", "inject:into:", "ownProtocols", "new", ",", "ownMethodsInProtocol:", "<=", "selector"]
  560. }),
  561. $globals.BehaviorBody);
  562. $core.addMethod(
  563. $core.method({
  564. selector: "ownMethodsInProtocol:",
  565. protocol: "accessing",
  566. fn: function (aString){
  567. var self=this;
  568. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  569. return $core.withContext(function($ctx1) {
  570. //>>excludeEnd("ctx");
  571. return $recv(self._methodsInProtocol_(aString))._select_((function(each){
  572. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  573. return $core.withContext(function($ctx2) {
  574. //>>excludeEnd("ctx");
  575. return $recv($recv(each)._methodClass()).__eq(self);
  576. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  577. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  578. //>>excludeEnd("ctx");
  579. }));
  580. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  581. }, function($ctx1) {$ctx1.fill(self,"ownMethodsInProtocol:",{aString:aString},$globals.BehaviorBody)});
  582. //>>excludeEnd("ctx");
  583. },
  584. //>>excludeStart("ide", pragmas.excludeIdeData);
  585. args: ["aString"],
  586. source: "ownMethodsInProtocol: aString\x0a\x09^ (self methodsInProtocol: aString) select: [ :each | each methodClass = self ]",
  587. referencedClasses: [],
  588. //>>excludeEnd("ide");
  589. messageSends: ["select:", "methodsInProtocol:", "=", "methodClass"]
  590. }),
  591. $globals.BehaviorBody);
  592. $core.addMethod(
  593. $core.method({
  594. selector: "ownProtocols",
  595. protocol: "accessing",
  596. fn: function (){
  597. var self=this;
  598. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  599. return $core.withContext(function($ctx1) {
  600. //>>excludeEnd("ctx");
  601. return $recv(self._protocols())._reject_((function(each){
  602. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  603. return $core.withContext(function($ctx2) {
  604. //>>excludeEnd("ctx");
  605. return $recv(each)._match_("^\x5c*");
  606. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  607. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  608. //>>excludeEnd("ctx");
  609. }));
  610. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  611. }, function($ctx1) {$ctx1.fill(self,"ownProtocols",{},$globals.BehaviorBody)});
  612. //>>excludeEnd("ctx");
  613. },
  614. //>>excludeStart("ide", pragmas.excludeIdeData);
  615. args: [],
  616. 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*' ]",
  617. referencedClasses: [],
  618. //>>excludeEnd("ide");
  619. messageSends: ["reject:", "protocols", "match:"]
  620. }),
  621. $globals.BehaviorBody);
  622. $core.addMethod(
  623. $core.method({
  624. selector: "packageOfProtocol:",
  625. protocol: "accessing",
  626. fn: function (aString){
  627. var self=this;
  628. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  629. return $core.withContext(function($ctx1) {
  630. //>>excludeEnd("ctx");
  631. var $1;
  632. $1=$recv(aString)._beginsWith_("*");
  633. if(!$core.assert($1)){
  634. return self._package();
  635. }
  636. return $recv($globals.Package)._named_ifAbsent_($recv(aString)._allButFirst(),(function(){
  637. return nil;
  638. }));
  639. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  640. }, function($ctx1) {$ctx1.fill(self,"packageOfProtocol:",{aString:aString},$globals.BehaviorBody)});
  641. //>>excludeEnd("ctx");
  642. },
  643. //>>excludeStart("ide", pragmas.excludeIdeData);
  644. args: ["aString"],
  645. 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 ]",
  646. referencedClasses: ["Package"],
  647. //>>excludeEnd("ide");
  648. messageSends: ["ifFalse:", "beginsWith:", "package", "named:ifAbsent:", "allButFirst"]
  649. }),
  650. $globals.BehaviorBody);
  651. $core.addMethod(
  652. $core.method({
  653. selector: "printOn:",
  654. protocol: "printing",
  655. fn: function (aStream){
  656. var self=this;
  657. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  658. return $core.withContext(function($ctx1) {
  659. //>>excludeEnd("ctx");
  660. var $1,$receiver;
  661. $1=self._name();
  662. if(($receiver = $1) == null || $receiver.a$nil){
  663. (
  664. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  665. $ctx1.supercall = true,
  666. //>>excludeEnd("ctx");
  667. ($globals.BehaviorBody.superclass||$boot.nilAsClass).fn.prototype._printOn_.apply($recv(self), [aStream]));
  668. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  669. $ctx1.supercall = false;
  670. //>>excludeEnd("ctx");;
  671. } else {
  672. var name;
  673. name=$receiver;
  674. $recv(aStream)._nextPutAll_(name);
  675. }
  676. return self;
  677. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  678. }, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},$globals.BehaviorBody)});
  679. //>>excludeEnd("ctx");
  680. },
  681. //>>excludeStart("ide", pragmas.excludeIdeData);
  682. args: ["aStream"],
  683. source: "printOn: aStream\x0a\x09self name\x0a\x09\x09ifNil: [ super printOn: aStream ]\x0a\x09\x09ifNotNil: [ :name | aStream nextPutAll: name ]",
  684. referencedClasses: [],
  685. //>>excludeEnd("ide");
  686. messageSends: ["ifNil:ifNotNil:", "name", "printOn:", "nextPutAll:"]
  687. }),
  688. $globals.BehaviorBody);
  689. $core.addMethod(
  690. $core.method({
  691. selector: "protocols",
  692. protocol: "accessing",
  693. fn: function (){
  694. var self=this;
  695. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  696. return $core.withContext(function($ctx1) {
  697. //>>excludeEnd("ctx");
  698. return $recv($recv(self._organization())._elements())._sorted();
  699. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  700. }, function($ctx1) {$ctx1.fill(self,"protocols",{},$globals.BehaviorBody)});
  701. //>>excludeEnd("ctx");
  702. },
  703. //>>excludeStart("ide", pragmas.excludeIdeData);
  704. args: [],
  705. source: "protocols\x0a\x09^ self organization elements sorted",
  706. referencedClasses: [],
  707. //>>excludeEnd("ide");
  708. messageSends: ["sorted", "elements", "organization"]
  709. }),
  710. $globals.BehaviorBody);
  711. $core.addMethod(
  712. $core.method({
  713. selector: "protocolsDo:",
  714. protocol: "enumerating",
  715. fn: function (aBlock){
  716. var self=this;
  717. var methodsByProtocol;
  718. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  719. return $core.withContext(function($ctx1) {
  720. //>>excludeEnd("ctx");
  721. methodsByProtocol=$recv($globals.HashedCollection)._new();
  722. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  723. $ctx1.sendIdx["new"]=1;
  724. //>>excludeEnd("ctx");
  725. $recv(self._methodDictionary())._valuesDo_((function(m){
  726. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  727. return $core.withContext(function($ctx2) {
  728. //>>excludeEnd("ctx");
  729. return $recv($recv(methodsByProtocol)._at_ifAbsentPut_($recv(m)._protocol(),(function(){
  730. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  731. return $core.withContext(function($ctx3) {
  732. //>>excludeEnd("ctx");
  733. return $recv($globals.Array)._new();
  734. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  735. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  736. //>>excludeEnd("ctx");
  737. })))._add_(m);
  738. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  739. }, function($ctx2) {$ctx2.fillBlock({m:m},$ctx1,1)});
  740. //>>excludeEnd("ctx");
  741. }));
  742. $recv(self._protocols())._do_((function(protocol){
  743. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  744. return $core.withContext(function($ctx2) {
  745. //>>excludeEnd("ctx");
  746. return $recv(aBlock)._value_value_(protocol,$recv(methodsByProtocol)._at_(protocol));
  747. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  748. }, function($ctx2) {$ctx2.fillBlock({protocol:protocol},$ctx1,3)});
  749. //>>excludeEnd("ctx");
  750. }));
  751. return self;
  752. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  753. }, function($ctx1) {$ctx1.fill(self,"protocolsDo:",{aBlock:aBlock,methodsByProtocol:methodsByProtocol},$globals.BehaviorBody)});
  754. //>>excludeEnd("ctx");
  755. },
  756. //>>excludeStart("ide", pragmas.excludeIdeData);
  757. args: ["aBlock"],
  758. 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) ]",
  759. referencedClasses: ["HashedCollection", "Array"],
  760. //>>excludeEnd("ide");
  761. messageSends: ["new", "valuesDo:", "methodDictionary", "add:", "at:ifAbsentPut:", "protocol", "do:", "protocols", "value:value:", "at:"]
  762. }),
  763. $globals.BehaviorBody);
  764. $core.addMethod(
  765. $core.method({
  766. selector: "recompile",
  767. protocol: "compiling",
  768. fn: function (){
  769. var self=this;
  770. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  771. return $core.withContext(function($ctx1) {
  772. //>>excludeEnd("ctx");
  773. return $recv($recv($globals.Compiler)._new())._recompile_(self);
  774. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  775. }, function($ctx1) {$ctx1.fill(self,"recompile",{},$globals.BehaviorBody)});
  776. //>>excludeEnd("ctx");
  777. },
  778. //>>excludeStart("ide", pragmas.excludeIdeData);
  779. args: [],
  780. source: "recompile\x0a\x09^ Compiler new recompile: self",
  781. referencedClasses: ["Compiler"],
  782. //>>excludeEnd("ide");
  783. messageSends: ["recompile:", "new"]
  784. }),
  785. $globals.BehaviorBody);
  786. $core.addMethod(
  787. $core.method({
  788. selector: "removeCompiledMethod:",
  789. protocol: "compiling",
  790. fn: function (aMethod){
  791. var self=this;
  792. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  793. return $core.withContext(function($ctx1) {
  794. //>>excludeEnd("ctx");
  795. var $1,$3,$2;
  796. self._basicRemoveCompiledMethod_(aMethod);
  797. self._removeProtocolIfEmpty_($recv(aMethod)._protocol());
  798. $1=$recv($globals.SystemAnnouncer)._current();
  799. $3=$recv($globals.MethodRemoved)._new();
  800. $recv($3)._method_(aMethod);
  801. $2=$recv($3)._yourself();
  802. $recv($1)._announce_($2);
  803. return self;
  804. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  805. }, function($ctx1) {$ctx1.fill(self,"removeCompiledMethod:",{aMethod:aMethod},$globals.BehaviorBody)});
  806. //>>excludeEnd("ctx");
  807. },
  808. //>>excludeStart("ide", pragmas.excludeIdeData);
  809. args: ["aMethod"],
  810. 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)",
  811. referencedClasses: ["SystemAnnouncer", "MethodRemoved"],
  812. //>>excludeEnd("ide");
  813. messageSends: ["basicRemoveCompiledMethod:", "removeProtocolIfEmpty:", "protocol", "announce:", "current", "method:", "new", "yourself"]
  814. }),
  815. $globals.BehaviorBody);
  816. $core.addMethod(
  817. $core.method({
  818. selector: "removeProtocolIfEmpty:",
  819. protocol: "accessing",
  820. fn: function (aString){
  821. var self=this;
  822. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  823. return $core.withContext(function($ctx1) {
  824. //>>excludeEnd("ctx");
  825. $recv(self._methods())._detect_ifNone_((function(each){
  826. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  827. return $core.withContext(function($ctx2) {
  828. //>>excludeEnd("ctx");
  829. return $recv($recv(each)._protocol()).__eq(aString);
  830. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  831. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  832. //>>excludeEnd("ctx");
  833. }),(function(){
  834. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  835. return $core.withContext(function($ctx2) {
  836. //>>excludeEnd("ctx");
  837. return $recv(self._organization())._removeElement_(aString);
  838. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  839. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  840. //>>excludeEnd("ctx");
  841. }));
  842. return self;
  843. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  844. }, function($ctx1) {$ctx1.fill(self,"removeProtocolIfEmpty:",{aString:aString},$globals.BehaviorBody)});
  845. //>>excludeEnd("ctx");
  846. },
  847. //>>excludeStart("ide", pragmas.excludeIdeData);
  848. args: ["aString"],
  849. source: "removeProtocolIfEmpty: aString\x0a\x09self methods\x0a\x09\x09detect: [ :each | each protocol = aString ]\x0a\x09\x09ifNone: [ self organization removeElement: aString ]",
  850. referencedClasses: [],
  851. //>>excludeEnd("ide");
  852. messageSends: ["detect:ifNone:", "methods", "=", "protocol", "removeElement:", "organization"]
  853. }),
  854. $globals.BehaviorBody);
  855. $core.addMethod(
  856. $core.method({
  857. selector: "selectors",
  858. protocol: "accessing",
  859. fn: function (){
  860. var self=this;
  861. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  862. return $core.withContext(function($ctx1) {
  863. //>>excludeEnd("ctx");
  864. return $recv(self._methodDictionary())._keys();
  865. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  866. }, function($ctx1) {$ctx1.fill(self,"selectors",{},$globals.BehaviorBody)});
  867. //>>excludeEnd("ctx");
  868. },
  869. //>>excludeStart("ide", pragmas.excludeIdeData);
  870. args: [],
  871. source: "selectors\x0a\x09^ self methodDictionary keys",
  872. referencedClasses: [],
  873. //>>excludeEnd("ide");
  874. messageSends: ["keys", "methodDictionary"]
  875. }),
  876. $globals.BehaviorBody);
  877. $core.addMethod(
  878. $core.method({
  879. selector: "setTraitComposition:",
  880. protocol: "compiling",
  881. fn: function (aTraitComposition){
  882. var self=this;
  883. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  884. return $core.withContext(function($ctx1) {
  885. //>>excludeEnd("ctx");
  886. $core.setTraitComposition(aTraitComposition._asJavaScriptObject(), self);
  887. return self;
  888. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  889. }, function($ctx1) {$ctx1.fill(self,"setTraitComposition:",{aTraitComposition:aTraitComposition},$globals.BehaviorBody)});
  890. //>>excludeEnd("ctx");
  891. },
  892. //>>excludeStart("ide", pragmas.excludeIdeData);
  893. args: ["aTraitComposition"],
  894. source: "setTraitComposition: aTraitComposition\x0a\x09<inlineJS: '$core.setTraitComposition(aTraitComposition._asJavaScriptObject(), self)'>",
  895. referencedClasses: [],
  896. //>>excludeEnd("ide");
  897. messageSends: []
  898. }),
  899. $globals.BehaviorBody);
  900. $core.addMethod(
  901. $core.method({
  902. selector: "superclass",
  903. protocol: "accessing",
  904. fn: function (){
  905. var self=this;
  906. return nil;
  907. },
  908. //>>excludeStart("ide", pragmas.excludeIdeData);
  909. args: [],
  910. source: "superclass\x0a\x09\x22Default for non-classes; to be able to send #superclass to any class / trait.\x22\x0a\x09^ nil",
  911. referencedClasses: [],
  912. //>>excludeEnd("ide");
  913. messageSends: []
  914. }),
  915. $globals.BehaviorBody);
  916. $core.addMethod(
  917. $core.method({
  918. selector: "theMetaClass",
  919. protocol: "accessing",
  920. fn: function (){
  921. var self=this;
  922. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  923. return $core.withContext(function($ctx1) {
  924. //>>excludeEnd("ctx");
  925. self._subclassResponsibility();
  926. return self;
  927. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  928. }, function($ctx1) {$ctx1.fill(self,"theMetaClass",{},$globals.BehaviorBody)});
  929. //>>excludeEnd("ctx");
  930. },
  931. //>>excludeStart("ide", pragmas.excludeIdeData);
  932. args: [],
  933. source: "theMetaClass\x0a\x09self subclassResponsibility",
  934. referencedClasses: [],
  935. //>>excludeEnd("ide");
  936. messageSends: ["subclassResponsibility"]
  937. }),
  938. $globals.BehaviorBody);
  939. $core.addMethod(
  940. $core.method({
  941. selector: "theNonMetaClass",
  942. protocol: "accessing",
  943. fn: function (){
  944. var self=this;
  945. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  946. return $core.withContext(function($ctx1) {
  947. //>>excludeEnd("ctx");
  948. self._subclassResponsibility();
  949. return self;
  950. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  951. }, function($ctx1) {$ctx1.fill(self,"theNonMetaClass",{},$globals.BehaviorBody)});
  952. //>>excludeEnd("ctx");
  953. },
  954. //>>excludeStart("ide", pragmas.excludeIdeData);
  955. args: [],
  956. source: "theNonMetaClass\x0a\x09self subclassResponsibility",
  957. referencedClasses: [],
  958. //>>excludeEnd("ide");
  959. messageSends: ["subclassResponsibility"]
  960. }),
  961. $globals.BehaviorBody);
  962. $core.addMethod(
  963. $core.method({
  964. selector: "traitComposition",
  965. protocol: "accessing",
  966. fn: function (){
  967. var self=this;
  968. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  969. return $core.withContext(function($ctx1) {
  970. //>>excludeEnd("ctx");
  971. return $recv(self._basicAt_("traitComposition"))._collect_((function(each){
  972. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  973. return $core.withContext(function($ctx2) {
  974. //>>excludeEnd("ctx");
  975. return $recv($globals.TraitTransformation)._fromJSON_(each);
  976. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  977. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  978. //>>excludeEnd("ctx");
  979. }));
  980. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  981. }, function($ctx1) {$ctx1.fill(self,"traitComposition",{},$globals.BehaviorBody)});
  982. //>>excludeEnd("ctx");
  983. },
  984. //>>excludeStart("ide", pragmas.excludeIdeData);
  985. args: [],
  986. source: "traitComposition\x0a\x09^ (self basicAt: 'traitComposition') collect: [ :each | TraitTransformation fromJSON: each ]",
  987. referencedClasses: ["TraitTransformation"],
  988. //>>excludeEnd("ide");
  989. messageSends: ["collect:", "basicAt:", "fromJSON:"]
  990. }),
  991. $globals.BehaviorBody);
  992. $core.addMethod(
  993. $core.method({
  994. selector: "traitCompositionDefinition",
  995. protocol: "accessing",
  996. fn: function (){
  997. var self=this;
  998. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  999. return $core.withContext(function($ctx1) {
  1000. //>>excludeEnd("ctx");
  1001. return $recv(self._traitComposition())._ifNotEmpty_((function(traitComposition){
  1002. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1003. return $core.withContext(function($ctx2) {
  1004. //>>excludeEnd("ctx");
  1005. return $recv($globals.String)._streamContents_((function(str){
  1006. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1007. return $core.withContext(function($ctx3) {
  1008. //>>excludeEnd("ctx");
  1009. $recv(str)._write_("{");
  1010. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1011. $ctx3.sendIdx["write:"]=1;
  1012. //>>excludeEnd("ctx");
  1013. $recv(traitComposition)._do_separatedBy_((function(each){
  1014. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1015. return $core.withContext(function($ctx4) {
  1016. //>>excludeEnd("ctx");
  1017. return $recv(str)._write_($recv(each)._definition());
  1018. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1019. $ctx4.sendIdx["write:"]=2;
  1020. //>>excludeEnd("ctx");
  1021. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1022. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3,3)});
  1023. //>>excludeEnd("ctx");
  1024. }),(function(){
  1025. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1026. return $core.withContext(function($ctx4) {
  1027. //>>excludeEnd("ctx");
  1028. return $recv(str)._write_(". ");
  1029. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1030. $ctx4.sendIdx["write:"]=3;
  1031. //>>excludeEnd("ctx");
  1032. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1033. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,4)});
  1034. //>>excludeEnd("ctx");
  1035. }));
  1036. return $recv(str)._write_("}");
  1037. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1038. }, function($ctx3) {$ctx3.fillBlock({str:str},$ctx2,2)});
  1039. //>>excludeEnd("ctx");
  1040. }));
  1041. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1042. }, function($ctx2) {$ctx2.fillBlock({traitComposition:traitComposition},$ctx1,1)});
  1043. //>>excludeEnd("ctx");
  1044. }));
  1045. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1046. }, function($ctx1) {$ctx1.fill(self,"traitCompositionDefinition",{},$globals.BehaviorBody)});
  1047. //>>excludeEnd("ctx");
  1048. },
  1049. //>>excludeStart("ide", pragmas.excludeIdeData);
  1050. args: [],
  1051. source: "traitCompositionDefinition\x0a\x09^ self traitComposition ifNotEmpty: [ :traitComposition |\x0a\x09\x09String streamContents: [ :str |\x0a\x09\x09\x09str write: '{'.\x0a\x09\x09\x09traitComposition\x0a\x09\x09\x09\x09do: [ :each | str write: each definition ]\x0a\x09\x09\x09\x09separatedBy: [ str write: '. ' ].\x0a\x09\x09\x09str write: '}' ] ]",
  1052. referencedClasses: ["String"],
  1053. //>>excludeEnd("ide");
  1054. messageSends: ["ifNotEmpty:", "traitComposition", "streamContents:", "write:", "do:separatedBy:", "definition"]
  1055. }),
  1056. $globals.BehaviorBody);
  1057. $core.addMethod(
  1058. $core.method({
  1059. selector: "traitUsers",
  1060. protocol: "accessing",
  1061. fn: function (){
  1062. var self=this;
  1063. return [];
  1064. },
  1065. //>>excludeStart("ide", pragmas.excludeIdeData);
  1066. args: [],
  1067. source: "traitUsers\x0a\x09\x22Default for non-traits; to be able to send #traitUsers to any class / trait\x22\x0a\x09^ #()",
  1068. referencedClasses: [],
  1069. //>>excludeEnd("ide");
  1070. messageSends: []
  1071. }),
  1072. $globals.BehaviorBody);
  1073. $core.addClass("Behavior", $globals.BehaviorBody, [], "Kernel-Classes");
  1074. //>>excludeStart("ide", pragmas.excludeIdeData);
  1075. $globals.Behavior.comment="I am the superclass of all class objects.\x0a\x0aIn addition to BehaviorBody, I define superclass/subclass relationships and instantiation.\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 and contain the description that instances are created from.\x0a\x0aI also provide iterating over the class hierarchy.";
  1076. //>>excludeEnd("ide");
  1077. $core.addMethod(
  1078. $core.method({
  1079. selector: "allInstanceVariableNames",
  1080. protocol: "accessing",
  1081. fn: function (){
  1082. var self=this;
  1083. var result;
  1084. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1085. return $core.withContext(function($ctx1) {
  1086. //>>excludeEnd("ctx");
  1087. var $1,$receiver;
  1088. result=$recv(self._instanceVariableNames())._copy();
  1089. $1=self._superclass();
  1090. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1091. $ctx1.sendIdx["superclass"]=1;
  1092. //>>excludeEnd("ctx");
  1093. if(($receiver = $1) == null || $receiver.a$nil){
  1094. $1;
  1095. } else {
  1096. $recv(result)._addAll_($recv(self._superclass())._allInstanceVariableNames());
  1097. }
  1098. return result;
  1099. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1100. }, function($ctx1) {$ctx1.fill(self,"allInstanceVariableNames",{result:result},$globals.Behavior)});
  1101. //>>excludeEnd("ctx");
  1102. },
  1103. //>>excludeStart("ide", pragmas.excludeIdeData);
  1104. args: [],
  1105. source: "allInstanceVariableNames\x0a\x09| result |\x0a\x09result := self instanceVariableNames copy.\x0a\x09self superclass ifNotNil: [\x0a\x09\x09result addAll: self superclass allInstanceVariableNames ].\x0a\x09^ result",
  1106. referencedClasses: [],
  1107. //>>excludeEnd("ide");
  1108. messageSends: ["copy", "instanceVariableNames", "ifNotNil:", "superclass", "addAll:", "allInstanceVariableNames"]
  1109. }),
  1110. $globals.Behavior);
  1111. $core.addMethod(
  1112. $core.method({
  1113. selector: "allSelectors",
  1114. protocol: "accessing",
  1115. fn: function (){
  1116. var self=this;
  1117. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1118. return $core.withContext(function($ctx1) {
  1119. //>>excludeEnd("ctx");
  1120. var $1,$2;
  1121. $1=self._allSuperclasses();
  1122. $2=self._selectors();
  1123. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1124. $ctx1.sendIdx["selectors"]=1;
  1125. //>>excludeEnd("ctx");
  1126. return $recv($1)._inject_into_($2,(function(acc,each){
  1127. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1128. return $core.withContext(function($ctx2) {
  1129. //>>excludeEnd("ctx");
  1130. $recv(acc)._addAll_($recv(each)._selectors());
  1131. return $recv(acc)._yourself();
  1132. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1133. }, function($ctx2) {$ctx2.fillBlock({acc:acc,each:each},$ctx1,1)});
  1134. //>>excludeEnd("ctx");
  1135. }));
  1136. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1137. }, function($ctx1) {$ctx1.fill(self,"allSelectors",{},$globals.Behavior)});
  1138. //>>excludeEnd("ctx");
  1139. },
  1140. //>>excludeStart("ide", pragmas.excludeIdeData);
  1141. args: [],
  1142. source: "allSelectors\x0a\x09^ self allSuperclasses\x0a\x09\x09inject: self selectors\x0a\x09\x09into: [ :acc :each | acc addAll: each selectors; yourself ]",
  1143. referencedClasses: [],
  1144. //>>excludeEnd("ide");
  1145. messageSends: ["inject:into:", "allSuperclasses", "selectors", "addAll:", "yourself"]
  1146. }),
  1147. $globals.Behavior);
  1148. $core.addMethod(
  1149. $core.method({
  1150. selector: "allSubclasses",
  1151. protocol: "accessing",
  1152. fn: function (){
  1153. var self=this;
  1154. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1155. return $core.withContext(function($ctx1) {
  1156. //>>excludeEnd("ctx");
  1157. return $recv($globals.Array)._streamContents_((function(str){
  1158. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1159. return $core.withContext(function($ctx2) {
  1160. //>>excludeEnd("ctx");
  1161. return self._allSubclassesDo_((function(each){
  1162. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1163. return $core.withContext(function($ctx3) {
  1164. //>>excludeEnd("ctx");
  1165. return $recv(str)._nextPut_(each);
  1166. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1167. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)});
  1168. //>>excludeEnd("ctx");
  1169. }));
  1170. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1171. }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1,1)});
  1172. //>>excludeEnd("ctx");
  1173. }));
  1174. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1175. }, function($ctx1) {$ctx1.fill(self,"allSubclasses",{},$globals.Behavior)});
  1176. //>>excludeEnd("ctx");
  1177. },
  1178. //>>excludeStart("ide", pragmas.excludeIdeData);
  1179. args: [],
  1180. source: "allSubclasses\x0a\x09\x22Answer an collection of the receiver's and the receiver's descendent's subclasses. \x22\x0a\x0a\x09^ Array streamContents: [ :str | self allSubclassesDo: [ :each | str nextPut: each ] ]",
  1181. referencedClasses: ["Array"],
  1182. //>>excludeEnd("ide");
  1183. messageSends: ["streamContents:", "allSubclassesDo:", "nextPut:"]
  1184. }),
  1185. $globals.Behavior);
  1186. $core.addMethod(
  1187. $core.method({
  1188. selector: "allSubclassesDo:",
  1189. protocol: "enumerating",
  1190. fn: function (aBlock){
  1191. var self=this;
  1192. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1193. return $core.withContext(function($ctx1) {
  1194. //>>excludeEnd("ctx");
  1195. $core.traverseClassTree(self, function(subclass) {
  1196. if (subclass !== self) aBlock._value_(subclass);
  1197. });
  1198. return self;
  1199. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1200. }, function($ctx1) {$ctx1.fill(self,"allSubclassesDo:",{aBlock:aBlock},$globals.Behavior)});
  1201. //>>excludeEnd("ctx");
  1202. },
  1203. //>>excludeStart("ide", pragmas.excludeIdeData);
  1204. args: ["aBlock"],
  1205. source: "allSubclassesDo: aBlock\x0a\x09\x22Evaluate the argument, aBlock, for each of the receiver's subclasses.\x22\x0a\x0a<inlineJS: '$core.traverseClassTree(self, function(subclass) {\x0a\x09if (subclass !== self) aBlock._value_(subclass);\x0a})'>",
  1206. referencedClasses: [],
  1207. //>>excludeEnd("ide");
  1208. messageSends: []
  1209. }),
  1210. $globals.Behavior);
  1211. $core.addMethod(
  1212. $core.method({
  1213. selector: "allSuperclasses",
  1214. protocol: "accessing",
  1215. fn: function (){
  1216. var self=this;
  1217. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1218. return $core.withContext(function($ctx1) {
  1219. //>>excludeEnd("ctx");
  1220. var $1,$3,$2,$receiver;
  1221. $1=self._superclass();
  1222. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1223. $ctx1.sendIdx["superclass"]=1;
  1224. //>>excludeEnd("ctx");
  1225. if(($receiver = $1) == null || $receiver.a$nil){
  1226. return [];
  1227. } else {
  1228. $1;
  1229. }
  1230. $3=self._superclass();
  1231. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1232. $ctx1.sendIdx["superclass"]=2;
  1233. //>>excludeEnd("ctx");
  1234. $2=$recv($globals.OrderedCollection)._with_($3);
  1235. $recv($2)._addAll_($recv(self._superclass())._allSuperclasses());
  1236. return $recv($2)._yourself();
  1237. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1238. }, function($ctx1) {$ctx1.fill(self,"allSuperclasses",{},$globals.Behavior)});
  1239. //>>excludeEnd("ctx");
  1240. },
  1241. //>>excludeStart("ide", pragmas.excludeIdeData);
  1242. args: [],
  1243. 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",
  1244. referencedClasses: ["OrderedCollection"],
  1245. //>>excludeEnd("ide");
  1246. messageSends: ["ifNil:", "superclass", "addAll:", "with:", "allSuperclasses", "yourself"]
  1247. }),
  1248. $globals.Behavior);
  1249. $core.addMethod(
  1250. $core.method({
  1251. selector: "basicNew",
  1252. protocol: "instance creation",
  1253. fn: function (){
  1254. var self=this;
  1255. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1256. return $core.withContext(function($ctx1) {
  1257. //>>excludeEnd("ctx");
  1258. return new self.fn();
  1259. return self;
  1260. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1261. }, function($ctx1) {$ctx1.fill(self,"basicNew",{},$globals.Behavior)});
  1262. //>>excludeEnd("ctx");
  1263. },
  1264. //>>excludeStart("ide", pragmas.excludeIdeData);
  1265. args: [],
  1266. source: "basicNew\x0a\x09<inlineJS: 'return new self.fn()'>",
  1267. referencedClasses: [],
  1268. //>>excludeEnd("ide");
  1269. messageSends: []
  1270. }),
  1271. $globals.Behavior);
  1272. $core.addMethod(
  1273. $core.method({
  1274. selector: "canUnderstand:",
  1275. protocol: "testing",
  1276. fn: function (aSelector){
  1277. var self=this;
  1278. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1279. return $core.withContext(function($ctx1) {
  1280. //>>excludeEnd("ctx");
  1281. var $2,$1;
  1282. return $recv(self._includesSelector_($recv(aSelector)._asString()))._or_((function(){
  1283. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1284. return $core.withContext(function($ctx2) {
  1285. //>>excludeEnd("ctx");
  1286. $2=self._superclass();
  1287. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1288. $ctx2.sendIdx["superclass"]=1;
  1289. //>>excludeEnd("ctx");
  1290. $1=$recv($2)._notNil();
  1291. return $recv($1)._and_((function(){
  1292. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1293. return $core.withContext(function($ctx3) {
  1294. //>>excludeEnd("ctx");
  1295. return $recv(self._superclass())._canUnderstand_(aSelector);
  1296. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1297. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  1298. //>>excludeEnd("ctx");
  1299. }));
  1300. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1301. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  1302. //>>excludeEnd("ctx");
  1303. }));
  1304. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1305. }, function($ctx1) {$ctx1.fill(self,"canUnderstand:",{aSelector:aSelector},$globals.Behavior)});
  1306. //>>excludeEnd("ctx");
  1307. },
  1308. //>>excludeStart("ide", pragmas.excludeIdeData);
  1309. args: ["aSelector"],
  1310. source: "canUnderstand: aSelector\x0a\x09^ (self includesSelector: aSelector asString) or: [\x0a\x09\x09self superclass notNil and: [ self superclass canUnderstand: aSelector ]]",
  1311. referencedClasses: [],
  1312. //>>excludeEnd("ide");
  1313. messageSends: ["or:", "includesSelector:", "asString", "and:", "notNil", "superclass", "canUnderstand:"]
  1314. }),
  1315. $globals.Behavior);
  1316. $core.addMethod(
  1317. $core.method({
  1318. selector: "includesBehavior:",
  1319. protocol: "testing",
  1320. fn: function (aClass){
  1321. var self=this;
  1322. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1323. return $core.withContext(function($ctx1) {
  1324. //>>excludeEnd("ctx");
  1325. return $recv(self.__eq_eq(aClass))._or_((function(){
  1326. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1327. return $core.withContext(function($ctx2) {
  1328. //>>excludeEnd("ctx");
  1329. return self._inheritsFrom_(aClass);
  1330. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1331. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  1332. //>>excludeEnd("ctx");
  1333. }));
  1334. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1335. }, function($ctx1) {$ctx1.fill(self,"includesBehavior:",{aClass:aClass},$globals.Behavior)});
  1336. //>>excludeEnd("ctx");
  1337. },
  1338. //>>excludeStart("ide", pragmas.excludeIdeData);
  1339. args: ["aClass"],
  1340. source: "includesBehavior: aClass\x0a\x09^ self == aClass or: [\x0a\x09\x09\x09self inheritsFrom: aClass ]",
  1341. referencedClasses: [],
  1342. //>>excludeEnd("ide");
  1343. messageSends: ["or:", "==", "inheritsFrom:"]
  1344. }),
  1345. $globals.Behavior);
  1346. $core.addMethod(
  1347. $core.method({
  1348. selector: "inheritsFrom:",
  1349. protocol: "testing",
  1350. fn: function (aClass){
  1351. var self=this;
  1352. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1353. return $core.withContext(function($ctx1) {
  1354. //>>excludeEnd("ctx");
  1355. var $1,$3,$2,$receiver;
  1356. $1=self._superclass();
  1357. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1358. $ctx1.sendIdx["superclass"]=1;
  1359. //>>excludeEnd("ctx");
  1360. if(($receiver = $1) == null || $receiver.a$nil){
  1361. return false;
  1362. } else {
  1363. $1;
  1364. }
  1365. $3=self._superclass();
  1366. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1367. $ctx1.sendIdx["superclass"]=2;
  1368. //>>excludeEnd("ctx");
  1369. $2=$recv(aClass).__eq_eq($3);
  1370. return $recv($2)._or_((function(){
  1371. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1372. return $core.withContext(function($ctx2) {
  1373. //>>excludeEnd("ctx");
  1374. return $recv(self._superclass())._inheritsFrom_(aClass);
  1375. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1376. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  1377. //>>excludeEnd("ctx");
  1378. }));
  1379. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1380. }, function($ctx1) {$ctx1.fill(self,"inheritsFrom:",{aClass:aClass},$globals.Behavior)});
  1381. //>>excludeEnd("ctx");
  1382. },
  1383. //>>excludeStart("ide", pragmas.excludeIdeData);
  1384. args: ["aClass"],
  1385. source: "inheritsFrom: aClass\x0a\x09self superclass ifNil: [ ^ false ].\x0a\x0a\x09^ aClass == self superclass or: [ \x0a\x09\x09self superclass inheritsFrom: aClass ]",
  1386. referencedClasses: [],
  1387. //>>excludeEnd("ide");
  1388. messageSends: ["ifNil:", "superclass", "or:", "==", "inheritsFrom:"]
  1389. }),
  1390. $globals.Behavior);
  1391. $core.addMethod(
  1392. $core.method({
  1393. selector: "instanceVariableNames",
  1394. protocol: "accessing",
  1395. fn: function (){
  1396. var self=this;
  1397. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1398. return $core.withContext(function($ctx1) {
  1399. //>>excludeEnd("ctx");
  1400. return self.iVarNames;
  1401. return self;
  1402. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1403. }, function($ctx1) {$ctx1.fill(self,"instanceVariableNames",{},$globals.Behavior)});
  1404. //>>excludeEnd("ctx");
  1405. },
  1406. //>>excludeStart("ide", pragmas.excludeIdeData);
  1407. args: [],
  1408. source: "instanceVariableNames\x0a\x09<inlineJS: 'return self.iVarNames'>",
  1409. referencedClasses: [],
  1410. //>>excludeEnd("ide");
  1411. messageSends: []
  1412. }),
  1413. $globals.Behavior);
  1414. $core.addMethod(
  1415. $core.method({
  1416. selector: "isBehavior",
  1417. protocol: "testing",
  1418. fn: function (){
  1419. var self=this;
  1420. return true;
  1421. },
  1422. //>>excludeStart("ide", pragmas.excludeIdeData);
  1423. args: [],
  1424. source: "isBehavior\x0a\x09^ true",
  1425. referencedClasses: [],
  1426. //>>excludeEnd("ide");
  1427. messageSends: []
  1428. }),
  1429. $globals.Behavior);
  1430. $core.addMethod(
  1431. $core.method({
  1432. selector: "javascriptConstructor",
  1433. protocol: "accessing",
  1434. fn: function (){
  1435. var self=this;
  1436. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1437. return $core.withContext(function($ctx1) {
  1438. //>>excludeEnd("ctx");
  1439. return self.fn;
  1440. return self;
  1441. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1442. }, function($ctx1) {$ctx1.fill(self,"javascriptConstructor",{},$globals.Behavior)});
  1443. //>>excludeEnd("ctx");
  1444. },
  1445. //>>excludeStart("ide", pragmas.excludeIdeData);
  1446. args: [],
  1447. source: "javascriptConstructor\x0a\x09\x22Answer the JS constructor used to instantiate. See boot.js\x22\x0a\x09\x0a\x09<inlineJS: 'return self.fn'>",
  1448. referencedClasses: [],
  1449. //>>excludeEnd("ide");
  1450. messageSends: []
  1451. }),
  1452. $globals.Behavior);
  1453. $core.addMethod(
  1454. $core.method({
  1455. selector: "javascriptConstructor:",
  1456. protocol: "accessing",
  1457. fn: function (aJavaScriptFunction){
  1458. var self=this;
  1459. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1460. return $core.withContext(function($ctx1) {
  1461. //>>excludeEnd("ctx");
  1462. $core.setClassConstructor(self, aJavaScriptFunction);;
  1463. return self;
  1464. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1465. }, function($ctx1) {$ctx1.fill(self,"javascriptConstructor:",{aJavaScriptFunction:aJavaScriptFunction},$globals.Behavior)});
  1466. //>>excludeEnd("ctx");
  1467. },
  1468. //>>excludeStart("ide", pragmas.excludeIdeData);
  1469. args: ["aJavaScriptFunction"],
  1470. 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<inlineJS: '$core.setClassConstructor(self, aJavaScriptFunction);'>",
  1471. referencedClasses: [],
  1472. //>>excludeEnd("ide");
  1473. messageSends: []
  1474. }),
  1475. $globals.Behavior);
  1476. $core.addMethod(
  1477. $core.method({
  1478. selector: "lookupSelector:",
  1479. protocol: "accessing",
  1480. fn: function (selector){
  1481. var self=this;
  1482. var lookupClass;
  1483. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1484. return $core.withContext(function($ctx1) {
  1485. //>>excludeEnd("ctx");
  1486. var $1;
  1487. var $early={};
  1488. try {
  1489. lookupClass=self;
  1490. $recv((function(){
  1491. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1492. return $core.withContext(function($ctx2) {
  1493. //>>excludeEnd("ctx");
  1494. return $recv(lookupClass).__eq(nil);
  1495. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1496. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  1497. //>>excludeEnd("ctx");
  1498. }))._whileFalse_((function(){
  1499. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1500. return $core.withContext(function($ctx2) {
  1501. //>>excludeEnd("ctx");
  1502. $1=$recv(lookupClass)._includesSelector_(selector);
  1503. if($core.assert($1)){
  1504. throw $early=[$recv(lookupClass)._methodAt_(selector)];
  1505. }
  1506. lookupClass=$recv(lookupClass)._superclass();
  1507. return lookupClass;
  1508. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1509. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  1510. //>>excludeEnd("ctx");
  1511. }));
  1512. return nil;
  1513. }
  1514. catch(e) {if(e===$early)return e[0]; throw e}
  1515. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1516. }, function($ctx1) {$ctx1.fill(self,"lookupSelector:",{selector:selector,lookupClass:lookupClass},$globals.Behavior)});
  1517. //>>excludeEnd("ctx");
  1518. },
  1519. //>>excludeStart("ide", pragmas.excludeIdeData);
  1520. args: ["selector"],
  1521. 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",
  1522. referencedClasses: [],
  1523. //>>excludeEnd("ide");
  1524. messageSends: ["whileFalse:", "=", "ifTrue:", "includesSelector:", "methodAt:", "superclass"]
  1525. }),
  1526. $globals.Behavior);
  1527. $core.addMethod(
  1528. $core.method({
  1529. selector: "new",
  1530. protocol: "instance creation",
  1531. fn: function (){
  1532. var self=this;
  1533. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1534. return $core.withContext(function($ctx1) {
  1535. //>>excludeEnd("ctx");
  1536. return $recv(self._basicNew())._initialize();
  1537. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1538. }, function($ctx1) {$ctx1.fill(self,"new",{},$globals.Behavior)});
  1539. //>>excludeEnd("ctx");
  1540. },
  1541. //>>excludeStart("ide", pragmas.excludeIdeData);
  1542. args: [],
  1543. source: "new\x0a\x09^ self basicNew initialize",
  1544. referencedClasses: [],
  1545. //>>excludeEnd("ide");
  1546. messageSends: ["initialize", "basicNew"]
  1547. }),
  1548. $globals.Behavior);
  1549. $core.addMethod(
  1550. $core.method({
  1551. selector: "prototype",
  1552. protocol: "accessing",
  1553. fn: function (){
  1554. var self=this;
  1555. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1556. return $core.withContext(function($ctx1) {
  1557. //>>excludeEnd("ctx");
  1558. return self.fn.prototype;
  1559. return self;
  1560. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1561. }, function($ctx1) {$ctx1.fill(self,"prototype",{},$globals.Behavior)});
  1562. //>>excludeEnd("ctx");
  1563. },
  1564. //>>excludeStart("ide", pragmas.excludeIdeData);
  1565. args: [],
  1566. source: "prototype\x0a\x09<inlineJS: 'return self.fn.prototype'>",
  1567. referencedClasses: [],
  1568. //>>excludeEnd("ide");
  1569. messageSends: []
  1570. }),
  1571. $globals.Behavior);
  1572. $core.addMethod(
  1573. $core.method({
  1574. selector: "subclasses",
  1575. protocol: "accessing",
  1576. fn: function (){
  1577. var self=this;
  1578. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1579. return $core.withContext(function($ctx1) {
  1580. //>>excludeEnd("ctx");
  1581. self._subclassResponsibility();
  1582. return self;
  1583. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1584. }, function($ctx1) {$ctx1.fill(self,"subclasses",{},$globals.Behavior)});
  1585. //>>excludeEnd("ctx");
  1586. },
  1587. //>>excludeStart("ide", pragmas.excludeIdeData);
  1588. args: [],
  1589. source: "subclasses\x0a\x09self subclassResponsibility",
  1590. referencedClasses: [],
  1591. //>>excludeEnd("ide");
  1592. messageSends: ["subclassResponsibility"]
  1593. }),
  1594. $globals.Behavior);
  1595. $core.addMethod(
  1596. $core.method({
  1597. selector: "superclass",
  1598. protocol: "accessing",
  1599. fn: function (){
  1600. var self=this;
  1601. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1602. return $core.withContext(function($ctx1) {
  1603. //>>excludeEnd("ctx");
  1604. return self.superclass;
  1605. return self;
  1606. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1607. }, function($ctx1) {$ctx1.fill(self,"superclass",{},$globals.Behavior)});
  1608. //>>excludeEnd("ctx");
  1609. },
  1610. //>>excludeStart("ide", pragmas.excludeIdeData);
  1611. args: [],
  1612. source: "superclass\x0a\x09<inlineJS: 'return self.superclass'>",
  1613. referencedClasses: [],
  1614. //>>excludeEnd("ide");
  1615. messageSends: []
  1616. }),
  1617. $globals.Behavior);
  1618. $core.addMethod(
  1619. $core.method({
  1620. selector: "theMetaClass",
  1621. protocol: "accessing",
  1622. fn: function (){
  1623. var self=this;
  1624. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1625. return $core.withContext(function($ctx1) {
  1626. //>>excludeEnd("ctx");
  1627. self._subclassResponsibility();
  1628. return self;
  1629. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1630. }, function($ctx1) {$ctx1.fill(self,"theMetaClass",{},$globals.Behavior)});
  1631. //>>excludeEnd("ctx");
  1632. },
  1633. //>>excludeStart("ide", pragmas.excludeIdeData);
  1634. args: [],
  1635. source: "theMetaClass\x0a\x09self subclassResponsibility",
  1636. referencedClasses: [],
  1637. //>>excludeEnd("ide");
  1638. messageSends: ["subclassResponsibility"]
  1639. }),
  1640. $globals.Behavior);
  1641. $core.addMethod(
  1642. $core.method({
  1643. selector: "theNonMetaClass",
  1644. protocol: "accessing",
  1645. fn: function (){
  1646. var self=this;
  1647. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1648. return $core.withContext(function($ctx1) {
  1649. //>>excludeEnd("ctx");
  1650. self._subclassResponsibility();
  1651. return self;
  1652. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1653. }, function($ctx1) {$ctx1.fill(self,"theNonMetaClass",{},$globals.Behavior)});
  1654. //>>excludeEnd("ctx");
  1655. },
  1656. //>>excludeStart("ide", pragmas.excludeIdeData);
  1657. args: [],
  1658. source: "theNonMetaClass\x0a\x09self subclassResponsibility",
  1659. referencedClasses: [],
  1660. //>>excludeEnd("ide");
  1661. messageSends: ["subclassResponsibility"]
  1662. }),
  1663. $globals.Behavior);
  1664. $core.addMethod(
  1665. $core.method({
  1666. selector: "withAllSubclasses",
  1667. protocol: "accessing",
  1668. fn: function (){
  1669. var self=this;
  1670. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1671. return $core.withContext(function($ctx1) {
  1672. //>>excludeEnd("ctx");
  1673. var $1;
  1674. $1=$recv($globals.Array)._with_(self);
  1675. $recv($1)._addAll_(self._allSubclasses());
  1676. return $recv($1)._yourself();
  1677. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1678. }, function($ctx1) {$ctx1.fill(self,"withAllSubclasses",{},$globals.Behavior)});
  1679. //>>excludeEnd("ctx");
  1680. },
  1681. //>>excludeStart("ide", pragmas.excludeIdeData);
  1682. args: [],
  1683. source: "withAllSubclasses\x0a\x09^ (Array with: self) addAll: self allSubclasses; yourself",
  1684. referencedClasses: ["Array"],
  1685. //>>excludeEnd("ide");
  1686. messageSends: ["addAll:", "with:", "allSubclasses", "yourself"]
  1687. }),
  1688. $globals.Behavior);
  1689. $core.addClass("Class", $globals.Behavior, [], "Kernel-Classes");
  1690. //>>excludeStart("ide", pragmas.excludeIdeData);
  1691. $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.";
  1692. //>>excludeEnd("ide");
  1693. $core.addMethod(
  1694. $core.method({
  1695. selector: "asJavaScriptSource",
  1696. protocol: "converting",
  1697. fn: function (){
  1698. var self=this;
  1699. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1700. return $core.withContext(function($ctx1) {
  1701. //>>excludeEnd("ctx");
  1702. return "$globals.".__comma(self._name());
  1703. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1704. }, function($ctx1) {$ctx1.fill(self,"asJavaScriptSource",{},$globals.Class)});
  1705. //>>excludeEnd("ctx");
  1706. },
  1707. //>>excludeStart("ide", pragmas.excludeIdeData);
  1708. args: [],
  1709. source: "asJavaScriptSource\x0a\x09^ '$globals.', self name",
  1710. referencedClasses: [],
  1711. //>>excludeEnd("ide");
  1712. messageSends: [",", "name"]
  1713. }),
  1714. $globals.Class);
  1715. $core.addMethod(
  1716. $core.method({
  1717. selector: "browse",
  1718. protocol: "browsing",
  1719. fn: function (){
  1720. var self=this;
  1721. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1722. return $core.withContext(function($ctx1) {
  1723. //>>excludeEnd("ctx");
  1724. $recv($globals.Finder)._findClass_(self);
  1725. return self;
  1726. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1727. }, function($ctx1) {$ctx1.fill(self,"browse",{},$globals.Class)});
  1728. //>>excludeEnd("ctx");
  1729. },
  1730. //>>excludeStart("ide", pragmas.excludeIdeData);
  1731. args: [],
  1732. source: "browse\x0a\x09Finder findClass: self",
  1733. referencedClasses: ["Finder"],
  1734. //>>excludeEnd("ide");
  1735. messageSends: ["findClass:"]
  1736. }),
  1737. $globals.Class);
  1738. $core.addMethod(
  1739. $core.method({
  1740. selector: "category",
  1741. protocol: "accessing",
  1742. fn: function (){
  1743. var self=this;
  1744. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1745. return $core.withContext(function($ctx1) {
  1746. //>>excludeEnd("ctx");
  1747. var $1,$receiver;
  1748. $1=self._package();
  1749. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1750. $ctx1.sendIdx["package"]=1;
  1751. //>>excludeEnd("ctx");
  1752. if(($receiver = $1) == null || $receiver.a$nil){
  1753. return "Unclassified";
  1754. } else {
  1755. return $recv(self._package())._name();
  1756. }
  1757. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1758. }, function($ctx1) {$ctx1.fill(self,"category",{},$globals.Class)});
  1759. //>>excludeEnd("ctx");
  1760. },
  1761. //>>excludeStart("ide", pragmas.excludeIdeData);
  1762. args: [],
  1763. source: "category\x0a\x09^ self package ifNil: [ 'Unclassified' ] ifNotNil: [ self package name ]",
  1764. referencedClasses: [],
  1765. //>>excludeEnd("ide");
  1766. messageSends: ["ifNil:ifNotNil:", "package", "name"]
  1767. }),
  1768. $globals.Class);
  1769. $core.addMethod(
  1770. $core.method({
  1771. selector: "classTag",
  1772. protocol: "accessing",
  1773. fn: function (){
  1774. var self=this;
  1775. return "class";
  1776. },
  1777. //>>excludeStart("ide", pragmas.excludeIdeData);
  1778. args: [],
  1779. 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'",
  1780. referencedClasses: [],
  1781. //>>excludeEnd("ide");
  1782. messageSends: []
  1783. }),
  1784. $globals.Class);
  1785. $core.addMethod(
  1786. $core.method({
  1787. selector: "definition",
  1788. protocol: "accessing",
  1789. fn: function (){
  1790. var self=this;
  1791. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1792. return $core.withContext(function($ctx1) {
  1793. //>>excludeEnd("ctx");
  1794. var $1,$2;
  1795. return $recv($globals.String)._streamContents_((function(stream){
  1796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1797. return $core.withContext(function($ctx2) {
  1798. //>>excludeEnd("ctx");
  1799. $recv(stream)._print_(self._superclass());
  1800. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1801. $ctx2.sendIdx["print:"]=1;
  1802. //>>excludeEnd("ctx");
  1803. $recv(stream)._write_(" subclass: ");
  1804. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1805. $ctx2.sendIdx["write:"]=1;
  1806. //>>excludeEnd("ctx");
  1807. $recv(stream)._printSymbol_(self._name());
  1808. $recv(stream)._lf();
  1809. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1810. $ctx2.sendIdx["lf"]=1;
  1811. //>>excludeEnd("ctx");
  1812. $recv(stream)._write_($recv(self._traitCompositionDefinition())._ifNotEmpty_((function(tcd){
  1813. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1814. return $core.withContext(function($ctx3) {
  1815. //>>excludeEnd("ctx");
  1816. $1=$recv($globals.String)._tab();
  1817. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1818. $ctx3.sendIdx["tab"]=1;
  1819. //>>excludeEnd("ctx");
  1820. $2=$recv($globals.String)._lf();
  1821. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1822. $ctx3.sendIdx["lf"]=2;
  1823. //>>excludeEnd("ctx");
  1824. return [$1,"uses: ",tcd,$2];
  1825. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1826. }, function($ctx3) {$ctx3.fillBlock({tcd:tcd},$ctx2,2)});
  1827. //>>excludeEnd("ctx");
  1828. })));
  1829. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1830. $ctx2.sendIdx["write:"]=2;
  1831. //>>excludeEnd("ctx");
  1832. $recv(stream)._tab();
  1833. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1834. $ctx2.sendIdx["tab"]=2;
  1835. //>>excludeEnd("ctx");
  1836. $recv(stream)._write_("instanceVariableNames: ");
  1837. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1838. $ctx2.sendIdx["write:"]=3;
  1839. //>>excludeEnd("ctx");
  1840. $recv(stream)._print_(" "._join_(self._instanceVariableNames()));
  1841. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1842. $ctx2.sendIdx["print:"]=2;
  1843. //>>excludeEnd("ctx");
  1844. $recv(stream)._lf();
  1845. $recv(stream)._tab();
  1846. $recv(stream)._write_("package: ");
  1847. return $recv(stream)._print_(self._category());
  1848. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1849. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)});
  1850. //>>excludeEnd("ctx");
  1851. }));
  1852. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1853. }, function($ctx1) {$ctx1.fill(self,"definition",{},$globals.Class)});
  1854. //>>excludeEnd("ctx");
  1855. },
  1856. //>>excludeStart("ide", pragmas.excludeIdeData);
  1857. args: [],
  1858. source: "definition\x0a\x09^ String streamContents: [ :stream | stream\x0a\x09\x09print: self superclass; write: ' subclass: '; printSymbol: self name; lf;\x0a\x09\x09write: (self traitCompositionDefinition ifNotEmpty: [ :tcd | { String tab. 'uses: '. tcd. String lf }]);\x0a\x09\x09tab; write: 'instanceVariableNames: '; print: (' ' join: self instanceVariableNames); lf;\x0a\x09\x09tab; write: 'package: '; print: self category ]",
  1859. referencedClasses: ["String"],
  1860. //>>excludeEnd("ide");
  1861. messageSends: ["streamContents:", "print:", "superclass", "write:", "printSymbol:", "name", "lf", "ifNotEmpty:", "traitCompositionDefinition", "tab", "join:", "instanceVariableNames", "category"]
  1862. }),
  1863. $globals.Class);
  1864. $core.addMethod(
  1865. $core.method({
  1866. selector: "isClass",
  1867. protocol: "testing",
  1868. fn: function (){
  1869. var self=this;
  1870. return true;
  1871. },
  1872. //>>excludeStart("ide", pragmas.excludeIdeData);
  1873. args: [],
  1874. source: "isClass\x0a\x09^ true",
  1875. referencedClasses: [],
  1876. //>>excludeEnd("ide");
  1877. messageSends: []
  1878. }),
  1879. $globals.Class);
  1880. $core.addMethod(
  1881. $core.method({
  1882. selector: "package",
  1883. protocol: "accessing",
  1884. fn: function (){
  1885. var self=this;
  1886. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1887. return $core.withContext(function($ctx1) {
  1888. //>>excludeEnd("ctx");
  1889. return self._basicAt_("pkg");
  1890. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1891. }, function($ctx1) {$ctx1.fill(self,"package",{},$globals.Class)});
  1892. //>>excludeEnd("ctx");
  1893. },
  1894. //>>excludeStart("ide", pragmas.excludeIdeData);
  1895. args: [],
  1896. source: "package\x0a\x09^ self basicAt: 'pkg'",
  1897. referencedClasses: [],
  1898. //>>excludeEnd("ide");
  1899. messageSends: ["basicAt:"]
  1900. }),
  1901. $globals.Class);
  1902. $core.addMethod(
  1903. $core.method({
  1904. selector: "package:",
  1905. protocol: "accessing",
  1906. fn: function (aPackage){
  1907. var self=this;
  1908. var oldPackage;
  1909. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1910. return $core.withContext(function($ctx1) {
  1911. //>>excludeEnd("ctx");
  1912. var $2,$1,$3,$4,$6,$5;
  1913. $2=self._package();
  1914. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1915. $ctx1.sendIdx["package"]=1;
  1916. //>>excludeEnd("ctx");
  1917. $1=$recv($2).__eq(aPackage);
  1918. if($core.assert($1)){
  1919. return self;
  1920. }
  1921. oldPackage=self._package();
  1922. self._basicAt_put_("pkg",aPackage);
  1923. $3=$recv(oldPackage)._organization();
  1924. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1925. $ctx1.sendIdx["organization"]=1;
  1926. //>>excludeEnd("ctx");
  1927. $recv($3)._removeElement_(self);
  1928. $recv($recv(aPackage)._organization())._addElement_(self);
  1929. $4=$recv($globals.SystemAnnouncer)._current();
  1930. $6=$recv($globals.ClassMoved)._new();
  1931. $recv($6)._theClass_(self);
  1932. $recv($6)._oldPackage_(oldPackage);
  1933. $5=$recv($6)._yourself();
  1934. $recv($4)._announce_($5);
  1935. return self;
  1936. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1937. }, function($ctx1) {$ctx1.fill(self,"package:",{aPackage:aPackage,oldPackage:oldPackage},$globals.Class)});
  1938. //>>excludeEnd("ctx");
  1939. },
  1940. //>>excludeStart("ide", pragmas.excludeIdeData);
  1941. args: ["aPackage"],
  1942. 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)",
  1943. referencedClasses: ["SystemAnnouncer", "ClassMoved"],
  1944. //>>excludeEnd("ide");
  1945. messageSends: ["ifTrue:", "=", "package", "basicAt:put:", "removeElement:", "organization", "addElement:", "announce:", "current", "theClass:", "new", "oldPackage:", "yourself"]
  1946. }),
  1947. $globals.Class);
  1948. $core.addMethod(
  1949. $core.method({
  1950. selector: "rename:",
  1951. protocol: "accessing",
  1952. fn: function (aString){
  1953. var self=this;
  1954. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1955. return $core.withContext(function($ctx1) {
  1956. //>>excludeEnd("ctx");
  1957. $recv($recv($globals.ClassBuilder)._new())._renameClass_to_(self,aString);
  1958. return self;
  1959. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1960. }, function($ctx1) {$ctx1.fill(self,"rename:",{aString:aString},$globals.Class)});
  1961. //>>excludeEnd("ctx");
  1962. },
  1963. //>>excludeStart("ide", pragmas.excludeIdeData);
  1964. args: ["aString"],
  1965. source: "rename: aString\x0a\x09ClassBuilder new renameClass: self to: aString",
  1966. referencedClasses: ["ClassBuilder"],
  1967. //>>excludeEnd("ide");
  1968. messageSends: ["renameClass:to:", "new"]
  1969. }),
  1970. $globals.Class);
  1971. $core.addMethod(
  1972. $core.method({
  1973. selector: "subclass:",
  1974. protocol: "class creation",
  1975. fn: function (aString){
  1976. var self=this;
  1977. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1978. return $core.withContext(function($ctx1) {
  1979. //>>excludeEnd("ctx");
  1980. return self._subclass_instanceVariableNames_package_(aString,"",nil);
  1981. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1982. }, function($ctx1) {$ctx1.fill(self,"subclass:",{aString:aString},$globals.Class)});
  1983. //>>excludeEnd("ctx");
  1984. },
  1985. //>>excludeStart("ide", pragmas.excludeIdeData);
  1986. args: ["aString"],
  1987. source: "subclass: aString \x0a\x09\x22Kept for file-in compatibility.\x22\x0a\x09^ self subclass: aString instanceVariableNames: '' package: nil",
  1988. referencedClasses: [],
  1989. //>>excludeEnd("ide");
  1990. messageSends: ["subclass:instanceVariableNames:package:"]
  1991. }),
  1992. $globals.Class);
  1993. $core.addMethod(
  1994. $core.method({
  1995. selector: "subclass:instanceVariableNames:",
  1996. protocol: "class creation",
  1997. fn: function (aString,anotherString){
  1998. var self=this;
  1999. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2000. return $core.withContext(function($ctx1) {
  2001. //>>excludeEnd("ctx");
  2002. return self._subclass_instanceVariableNames_package_(aString,anotherString,nil);
  2003. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2004. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:",{aString:aString,anotherString:anotherString},$globals.Class)});
  2005. //>>excludeEnd("ctx");
  2006. },
  2007. //>>excludeStart("ide", pragmas.excludeIdeData);
  2008. args: ["aString", "anotherString"],
  2009. source: "subclass: aString instanceVariableNames: anotherString\x0a\x09\x22Kept for file-in compatibility.\x22\x0a\x09^ self subclass: aString instanceVariableNames: anotherString package: nil",
  2010. referencedClasses: [],
  2011. //>>excludeEnd("ide");
  2012. messageSends: ["subclass:instanceVariableNames:package:"]
  2013. }),
  2014. $globals.Class);
  2015. $core.addMethod(
  2016. $core.method({
  2017. selector: "subclass:instanceVariableNames:category:",
  2018. protocol: "class creation",
  2019. fn: function (aString,aString2,aString3){
  2020. var self=this;
  2021. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2022. return $core.withContext(function($ctx1) {
  2023. //>>excludeEnd("ctx");
  2024. return self._subclass_instanceVariableNames_package_(aString,aString2,aString3);
  2025. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2026. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:category:",{aString:aString,aString2:aString2,aString3:aString3},$globals.Class)});
  2027. //>>excludeEnd("ctx");
  2028. },
  2029. //>>excludeStart("ide", pragmas.excludeIdeData);
  2030. args: ["aString", "aString2", "aString3"],
  2031. source: "subclass: aString instanceVariableNames: aString2 category: aString3\x0a\x09\x22Kept for file-in compatibility.\x22\x0a\x09^ self subclass: aString instanceVariableNames: aString2 package: aString3",
  2032. referencedClasses: [],
  2033. //>>excludeEnd("ide");
  2034. messageSends: ["subclass:instanceVariableNames:package:"]
  2035. }),
  2036. $globals.Class);
  2037. $core.addMethod(
  2038. $core.method({
  2039. selector: "subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:",
  2040. protocol: "class creation",
  2041. fn: function (aString,aString2,classVars,pools,aString3){
  2042. var self=this;
  2043. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2044. return $core.withContext(function($ctx1) {
  2045. //>>excludeEnd("ctx");
  2046. return self._subclass_instanceVariableNames_package_(aString,aString2,aString3);
  2047. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2048. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:",{aString:aString,aString2:aString2,classVars:classVars,pools:pools,aString3:aString3},$globals.Class)});
  2049. //>>excludeEnd("ctx");
  2050. },
  2051. //>>excludeStart("ide", pragmas.excludeIdeData);
  2052. args: ["aString", "aString2", "classVars", "pools", "aString3"],
  2053. 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",
  2054. referencedClasses: [],
  2055. //>>excludeEnd("ide");
  2056. messageSends: ["subclass:instanceVariableNames:package:"]
  2057. }),
  2058. $globals.Class);
  2059. $core.addMethod(
  2060. $core.method({
  2061. selector: "subclass:instanceVariableNames:package:",
  2062. protocol: "class creation",
  2063. fn: function (aString,aString2,aString3){
  2064. var self=this;
  2065. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2066. return $core.withContext(function($ctx1) {
  2067. //>>excludeEnd("ctx");
  2068. return $recv($recv($globals.ClassBuilder)._new())._superclass_subclass_instanceVariableNames_package_(self,$recv(aString)._asString(),aString2,aString3);
  2069. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2070. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:package:",{aString:aString,aString2:aString2,aString3:aString3},$globals.Class)});
  2071. //>>excludeEnd("ctx");
  2072. },
  2073. //>>excludeStart("ide", pragmas.excludeIdeData);
  2074. args: ["aString", "aString2", "aString3"],
  2075. source: "subclass: aString instanceVariableNames: aString2 package: aString3\x0a\x09^ ClassBuilder new\x0a\x09\x09superclass: self subclass: aString asString instanceVariableNames: aString2 package: aString3",
  2076. referencedClasses: ["ClassBuilder"],
  2077. //>>excludeEnd("ide");
  2078. messageSends: ["superclass:subclass:instanceVariableNames:package:", "new", "asString"]
  2079. }),
  2080. $globals.Class);
  2081. $core.addMethod(
  2082. $core.method({
  2083. selector: "subclass:uses:",
  2084. protocol: "class creation",
  2085. fn: function (aString,aTraitCompositionDescription){
  2086. var self=this;
  2087. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2088. return $core.withContext(function($ctx1) {
  2089. //>>excludeEnd("ctx");
  2090. return self._subclass_uses_instanceVariableNames_package_(aString,aTraitCompositionDescription,"",nil);
  2091. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2092. }, function($ctx1) {$ctx1.fill(self,"subclass:uses:",{aString:aString,aTraitCompositionDescription:aTraitCompositionDescription},$globals.Class)});
  2093. //>>excludeEnd("ctx");
  2094. },
  2095. //>>excludeStart("ide", pragmas.excludeIdeData);
  2096. args: ["aString", "aTraitCompositionDescription"],
  2097. source: "subclass: aString uses: aTraitCompositionDescription \x0a\x09\x22Kept for file-in compatibility.\x22\x0a\x09^ self subclass: aString uses: aTraitCompositionDescription instanceVariableNames: '' package: nil",
  2098. referencedClasses: [],
  2099. //>>excludeEnd("ide");
  2100. messageSends: ["subclass:uses:instanceVariableNames:package:"]
  2101. }),
  2102. $globals.Class);
  2103. $core.addMethod(
  2104. $core.method({
  2105. selector: "subclass:uses:instanceVariableNames:",
  2106. protocol: "class creation",
  2107. fn: function (aString,aTraitCompositionDescription,anotherString){
  2108. var self=this;
  2109. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2110. return $core.withContext(function($ctx1) {
  2111. //>>excludeEnd("ctx");
  2112. return self._subclass_uses_instanceVariableNames_package_(aString,aTraitCompositionDescription,anotherString,nil);
  2113. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2114. }, function($ctx1) {$ctx1.fill(self,"subclass:uses:instanceVariableNames:",{aString:aString,aTraitCompositionDescription:aTraitCompositionDescription,anotherString:anotherString},$globals.Class)});
  2115. //>>excludeEnd("ctx");
  2116. },
  2117. //>>excludeStart("ide", pragmas.excludeIdeData);
  2118. args: ["aString", "aTraitCompositionDescription", "anotherString"],
  2119. source: "subclass: aString uses: aTraitCompositionDescription instanceVariableNames: anotherString\x0a\x09\x22Kept for file-in compatibility.\x22\x0a\x09^ self subclass: aString uses: aTraitCompositionDescription instanceVariableNames: anotherString package: nil",
  2120. referencedClasses: [],
  2121. //>>excludeEnd("ide");
  2122. messageSends: ["subclass:uses:instanceVariableNames:package:"]
  2123. }),
  2124. $globals.Class);
  2125. $core.addMethod(
  2126. $core.method({
  2127. selector: "subclass:uses:instanceVariableNames:category:",
  2128. protocol: "class creation",
  2129. fn: function (aString,aTraitCompositionDescription,aString2,aString3){
  2130. var self=this;
  2131. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2132. return $core.withContext(function($ctx1) {
  2133. //>>excludeEnd("ctx");
  2134. return self._subclass_uses_instanceVariableNames_package_(aString,aTraitCompositionDescription,aString2,aString3);
  2135. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2136. }, function($ctx1) {$ctx1.fill(self,"subclass:uses:instanceVariableNames:category:",{aString:aString,aTraitCompositionDescription:aTraitCompositionDescription,aString2:aString2,aString3:aString3},$globals.Class)});
  2137. //>>excludeEnd("ctx");
  2138. },
  2139. //>>excludeStart("ide", pragmas.excludeIdeData);
  2140. args: ["aString", "aTraitCompositionDescription", "aString2", "aString3"],
  2141. source: "subclass: aString uses: aTraitCompositionDescription instanceVariableNames: aString2 category: aString3\x0a\x09\x22Kept for file-in compatibility.\x22\x0a\x09^ self subclass: aString uses: aTraitCompositionDescription instanceVariableNames: aString2 package: aString3",
  2142. referencedClasses: [],
  2143. //>>excludeEnd("ide");
  2144. messageSends: ["subclass:uses:instanceVariableNames:package:"]
  2145. }),
  2146. $globals.Class);
  2147. $core.addMethod(
  2148. $core.method({
  2149. selector: "subclass:uses:instanceVariableNames:classVariableNames:poolDictionaries:category:",
  2150. protocol: "class creation",
  2151. fn: function (aString,aTraitCompositionDescription,aString2,classVars,pools,aString3){
  2152. var self=this;
  2153. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2154. return $core.withContext(function($ctx1) {
  2155. //>>excludeEnd("ctx");
  2156. return self._subclass_uses_instanceVariableNames_package_(aString,aTraitCompositionDescription,aString2,aString3);
  2157. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2158. }, function($ctx1) {$ctx1.fill(self,"subclass:uses:instanceVariableNames:classVariableNames:poolDictionaries:category:",{aString:aString,aTraitCompositionDescription:aTraitCompositionDescription,aString2:aString2,classVars:classVars,pools:pools,aString3:aString3},$globals.Class)});
  2159. //>>excludeEnd("ctx");
  2160. },
  2161. //>>excludeStart("ide", pragmas.excludeIdeData);
  2162. args: ["aString", "aTraitCompositionDescription", "aString2", "classVars", "pools", "aString3"],
  2163. source: "subclass: aString uses: aTraitCompositionDescription 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 uses: aTraitCompositionDescription instanceVariableNames: aString2 package: aString3",
  2164. referencedClasses: [],
  2165. //>>excludeEnd("ide");
  2166. messageSends: ["subclass:uses:instanceVariableNames:package:"]
  2167. }),
  2168. $globals.Class);
  2169. $core.addMethod(
  2170. $core.method({
  2171. selector: "subclass:uses:instanceVariableNames:package:",
  2172. protocol: "class creation",
  2173. fn: function (aString,aTraitCompositionDescription,aString2,aString3){
  2174. var self=this;
  2175. var cls;
  2176. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2177. return $core.withContext(function($ctx1) {
  2178. //>>excludeEnd("ctx");
  2179. cls=self._subclass_instanceVariableNames_package_(aString,aString2,aString3);
  2180. $recv(cls)._setTraitComposition_($recv(aTraitCompositionDescription)._asTraitComposition());
  2181. return cls;
  2182. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2183. }, function($ctx1) {$ctx1.fill(self,"subclass:uses:instanceVariableNames:package:",{aString:aString,aTraitCompositionDescription:aTraitCompositionDescription,aString2:aString2,aString3:aString3,cls:cls},$globals.Class)});
  2184. //>>excludeEnd("ctx");
  2185. },
  2186. //>>excludeStart("ide", pragmas.excludeIdeData);
  2187. args: ["aString", "aTraitCompositionDescription", "aString2", "aString3"],
  2188. source: "subclass: aString uses: aTraitCompositionDescription instanceVariableNames: aString2 package: aString3\x0a\x09| cls |\x0a\x09cls := self subclass: aString instanceVariableNames: aString2 package: aString3.\x0a\x09cls setTraitComposition: aTraitCompositionDescription asTraitComposition.\x0a\x09^ cls",
  2189. referencedClasses: [],
  2190. //>>excludeEnd("ide");
  2191. messageSends: ["subclass:instanceVariableNames:package:", "setTraitComposition:", "asTraitComposition"]
  2192. }),
  2193. $globals.Class);
  2194. $core.addMethod(
  2195. $core.method({
  2196. selector: "subclasses",
  2197. protocol: "accessing",
  2198. fn: function (){
  2199. var self=this;
  2200. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2201. return $core.withContext(function($ctx1) {
  2202. //>>excludeEnd("ctx");
  2203. return self.subclasses._copy();
  2204. return self;
  2205. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2206. }, function($ctx1) {$ctx1.fill(self,"subclasses",{},$globals.Class)});
  2207. //>>excludeEnd("ctx");
  2208. },
  2209. //>>excludeStart("ide", pragmas.excludeIdeData);
  2210. args: [],
  2211. source: "subclasses\x0a\x09<inlineJS: 'return self.subclasses._copy()'>",
  2212. referencedClasses: [],
  2213. //>>excludeEnd("ide");
  2214. messageSends: []
  2215. }),
  2216. $globals.Class);
  2217. $core.addMethod(
  2218. $core.method({
  2219. selector: "theMetaClass",
  2220. protocol: "accessing",
  2221. fn: function (){
  2222. var self=this;
  2223. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2224. return $core.withContext(function($ctx1) {
  2225. //>>excludeEnd("ctx");
  2226. return self._class();
  2227. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2228. }, function($ctx1) {$ctx1.fill(self,"theMetaClass",{},$globals.Class)});
  2229. //>>excludeEnd("ctx");
  2230. },
  2231. //>>excludeStart("ide", pragmas.excludeIdeData);
  2232. args: [],
  2233. source: "theMetaClass\x0a\x09^ self class",
  2234. referencedClasses: [],
  2235. //>>excludeEnd("ide");
  2236. messageSends: ["class"]
  2237. }),
  2238. $globals.Class);
  2239. $core.addMethod(
  2240. $core.method({
  2241. selector: "theNonMetaClass",
  2242. protocol: "accessing",
  2243. fn: function (){
  2244. var self=this;
  2245. return self;
  2246. },
  2247. //>>excludeStart("ide", pragmas.excludeIdeData);
  2248. args: [],
  2249. source: "theNonMetaClass\x0a\x09^ self",
  2250. referencedClasses: [],
  2251. //>>excludeEnd("ide");
  2252. messageSends: []
  2253. }),
  2254. $globals.Class);
  2255. $core.addClass("Metaclass", $globals.Behavior, [], "Kernel-Classes");
  2256. //>>excludeStart("ide", pragmas.excludeIdeData);
  2257. $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.";
  2258. //>>excludeEnd("ide");
  2259. $core.addMethod(
  2260. $core.method({
  2261. selector: "asJavaScriptSource",
  2262. protocol: "converting",
  2263. fn: function (){
  2264. var self=this;
  2265. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2266. return $core.withContext(function($ctx1) {
  2267. //>>excludeEnd("ctx");
  2268. var $1;
  2269. $1=$recv("$globals.".__comma($recv(self._instanceClass())._name())).__comma(".a$cls");
  2270. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2271. $ctx1.sendIdx[","]=1;
  2272. //>>excludeEnd("ctx");
  2273. return $1;
  2274. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2275. }, function($ctx1) {$ctx1.fill(self,"asJavaScriptSource",{},$globals.Metaclass)});
  2276. //>>excludeEnd("ctx");
  2277. },
  2278. //>>excludeStart("ide", pragmas.excludeIdeData);
  2279. args: [],
  2280. source: "asJavaScriptSource\x0a\x09^ '$globals.', self instanceClass name, '.a$cls'",
  2281. referencedClasses: [],
  2282. //>>excludeEnd("ide");
  2283. messageSends: [",", "name", "instanceClass"]
  2284. }),
  2285. $globals.Metaclass);
  2286. $core.addMethod(
  2287. $core.method({
  2288. selector: "definition",
  2289. protocol: "accessing",
  2290. fn: function (){
  2291. var self=this;
  2292. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2293. return $core.withContext(function($ctx1) {
  2294. //>>excludeEnd("ctx");
  2295. var $1,$2;
  2296. return $recv($globals.String)._streamContents_((function(stream){
  2297. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2298. return $core.withContext(function($ctx2) {
  2299. //>>excludeEnd("ctx");
  2300. $recv(stream)._print_(self);
  2301. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2302. $ctx2.sendIdx["print:"]=1;
  2303. //>>excludeEnd("ctx");
  2304. $recv(stream)._write_($recv(self._traitCompositionDefinition())._ifEmpty_ifNotEmpty_((function(){
  2305. return " ";
  2306. }),(function(tcd){
  2307. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2308. return $core.withContext(function($ctx3) {
  2309. //>>excludeEnd("ctx");
  2310. $1=$recv($globals.String)._lf();
  2311. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2312. $ctx3.sendIdx["lf"]=1;
  2313. //>>excludeEnd("ctx");
  2314. $2=$recv($globals.String)._tab();
  2315. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2316. $ctx3.sendIdx["tab"]=1;
  2317. //>>excludeEnd("ctx");
  2318. return [$1,$2,"uses: ",tcd,$recv($globals.String)._lf(),$recv($globals.String)._tab()];
  2319. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2320. }, function($ctx3) {$ctx3.fillBlock({tcd:tcd},$ctx2,3)});
  2321. //>>excludeEnd("ctx");
  2322. })));
  2323. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2324. $ctx2.sendIdx["write:"]=1;
  2325. //>>excludeEnd("ctx");
  2326. $recv(stream)._write_("instanceVariableNames: ");
  2327. return $recv(stream)._print_(" "._join_(self._instanceVariableNames()));
  2328. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2329. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)});
  2330. //>>excludeEnd("ctx");
  2331. }));
  2332. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2333. }, function($ctx1) {$ctx1.fill(self,"definition",{},$globals.Metaclass)});
  2334. //>>excludeEnd("ctx");
  2335. },
  2336. //>>excludeStart("ide", pragmas.excludeIdeData);
  2337. args: [],
  2338. source: "definition\x0a\x09^ String streamContents: [ :stream | stream\x0a\x09\x09print: self;\x0a\x09\x09write: (self traitCompositionDefinition\x0a\x09\x09\x09ifEmpty: [' ']\x0a\x09\x09\x09ifNotEmpty: [ :tcd | { String lf. String tab. 'uses: '. tcd. String lf. String tab }]);\x0a\x09\x09write: 'instanceVariableNames: ';\x0a\x09\x09print: (' ' join: self instanceVariableNames) ]",
  2339. referencedClasses: ["String"],
  2340. //>>excludeEnd("ide");
  2341. messageSends: ["streamContents:", "print:", "write:", "ifEmpty:ifNotEmpty:", "traitCompositionDefinition", "lf", "tab", "join:", "instanceVariableNames"]
  2342. }),
  2343. $globals.Metaclass);
  2344. $core.addMethod(
  2345. $core.method({
  2346. selector: "instanceClass",
  2347. protocol: "accessing",
  2348. fn: function (){
  2349. var self=this;
  2350. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2351. return $core.withContext(function($ctx1) {
  2352. //>>excludeEnd("ctx");
  2353. return self.instanceClass;
  2354. return self;
  2355. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2356. }, function($ctx1) {$ctx1.fill(self,"instanceClass",{},$globals.Metaclass)});
  2357. //>>excludeEnd("ctx");
  2358. },
  2359. //>>excludeStart("ide", pragmas.excludeIdeData);
  2360. args: [],
  2361. source: "instanceClass\x0a\x09<inlineJS: 'return self.instanceClass'>",
  2362. referencedClasses: [],
  2363. //>>excludeEnd("ide");
  2364. messageSends: []
  2365. }),
  2366. $globals.Metaclass);
  2367. $core.addMethod(
  2368. $core.method({
  2369. selector: "instanceVariableNames:",
  2370. protocol: "accessing",
  2371. fn: function (aCollection){
  2372. var self=this;
  2373. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2374. return $core.withContext(function($ctx1) {
  2375. //>>excludeEnd("ctx");
  2376. $recv($recv($globals.ClassBuilder)._new())._class_instanceVariableNames_(self,aCollection);
  2377. return self;
  2378. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2379. }, function($ctx1) {$ctx1.fill(self,"instanceVariableNames:",{aCollection:aCollection},$globals.Metaclass)});
  2380. //>>excludeEnd("ctx");
  2381. },
  2382. //>>excludeStart("ide", pragmas.excludeIdeData);
  2383. args: ["aCollection"],
  2384. source: "instanceVariableNames: aCollection\x0a\x09ClassBuilder new\x0a\x09\x09class: self instanceVariableNames: aCollection.\x0a\x09^ self",
  2385. referencedClasses: ["ClassBuilder"],
  2386. //>>excludeEnd("ide");
  2387. messageSends: ["class:instanceVariableNames:", "new"]
  2388. }),
  2389. $globals.Metaclass);
  2390. $core.addMethod(
  2391. $core.method({
  2392. selector: "isMetaclass",
  2393. protocol: "testing",
  2394. fn: function (){
  2395. var self=this;
  2396. return true;
  2397. },
  2398. //>>excludeStart("ide", pragmas.excludeIdeData);
  2399. args: [],
  2400. source: "isMetaclass\x0a\x09^ true",
  2401. referencedClasses: [],
  2402. //>>excludeEnd("ide");
  2403. messageSends: []
  2404. }),
  2405. $globals.Metaclass);
  2406. $core.addMethod(
  2407. $core.method({
  2408. selector: "name",
  2409. protocol: "accessing",
  2410. fn: function (){
  2411. var self=this;
  2412. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2413. return $core.withContext(function($ctx1) {
  2414. //>>excludeEnd("ctx");
  2415. return $recv($recv(self._instanceClass())._name()).__comma(" class");
  2416. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2417. }, function($ctx1) {$ctx1.fill(self,"name",{},$globals.Metaclass)});
  2418. //>>excludeEnd("ctx");
  2419. },
  2420. //>>excludeStart("ide", pragmas.excludeIdeData);
  2421. args: [],
  2422. source: "name\x0a\x09^ self instanceClass name, ' class'",
  2423. referencedClasses: [],
  2424. //>>excludeEnd("ide");
  2425. messageSends: [",", "name", "instanceClass"]
  2426. }),
  2427. $globals.Metaclass);
  2428. $core.addMethod(
  2429. $core.method({
  2430. selector: "package",
  2431. protocol: "accessing",
  2432. fn: function (){
  2433. var self=this;
  2434. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2435. return $core.withContext(function($ctx1) {
  2436. //>>excludeEnd("ctx");
  2437. return $recv(self._instanceClass())._package();
  2438. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2439. }, function($ctx1) {$ctx1.fill(self,"package",{},$globals.Metaclass)});
  2440. //>>excludeEnd("ctx");
  2441. },
  2442. //>>excludeStart("ide", pragmas.excludeIdeData);
  2443. args: [],
  2444. source: "package\x0a\x09^ self instanceClass package",
  2445. referencedClasses: [],
  2446. //>>excludeEnd("ide");
  2447. messageSends: ["package", "instanceClass"]
  2448. }),
  2449. $globals.Metaclass);
  2450. $core.addMethod(
  2451. $core.method({
  2452. selector: "subclasses",
  2453. protocol: "accessing",
  2454. fn: function (){
  2455. var self=this;
  2456. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2457. return $core.withContext(function($ctx1) {
  2458. //>>excludeEnd("ctx");
  2459. return $core.metaSubclasses(self);
  2460. return self;
  2461. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2462. }, function($ctx1) {$ctx1.fill(self,"subclasses",{},$globals.Metaclass)});
  2463. //>>excludeEnd("ctx");
  2464. },
  2465. //>>excludeStart("ide", pragmas.excludeIdeData);
  2466. args: [],
  2467. source: "subclasses\x0a\x09<inlineJS: 'return $core.metaSubclasses(self)'>",
  2468. referencedClasses: [],
  2469. //>>excludeEnd("ide");
  2470. messageSends: []
  2471. }),
  2472. $globals.Metaclass);
  2473. $core.addMethod(
  2474. $core.method({
  2475. selector: "theMetaClass",
  2476. protocol: "accessing",
  2477. fn: function (){
  2478. var self=this;
  2479. return self;
  2480. },
  2481. //>>excludeStart("ide", pragmas.excludeIdeData);
  2482. args: [],
  2483. source: "theMetaClass\x0a\x09^ self",
  2484. referencedClasses: [],
  2485. //>>excludeEnd("ide");
  2486. messageSends: []
  2487. }),
  2488. $globals.Metaclass);
  2489. $core.addMethod(
  2490. $core.method({
  2491. selector: "theNonMetaClass",
  2492. protocol: "accessing",
  2493. fn: function (){
  2494. var self=this;
  2495. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2496. return $core.withContext(function($ctx1) {
  2497. //>>excludeEnd("ctx");
  2498. return self._instanceClass();
  2499. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2500. }, function($ctx1) {$ctx1.fill(self,"theNonMetaClass",{},$globals.Metaclass)});
  2501. //>>excludeEnd("ctx");
  2502. },
  2503. //>>excludeStart("ide", pragmas.excludeIdeData);
  2504. args: [],
  2505. source: "theNonMetaClass\x0a\x09^ self instanceClass",
  2506. referencedClasses: [],
  2507. //>>excludeEnd("ide");
  2508. messageSends: ["instanceClass"]
  2509. }),
  2510. $globals.Metaclass);
  2511. $core.addMethod(
  2512. $core.method({
  2513. selector: "uses:instanceVariableNames:",
  2514. protocol: "accessing",
  2515. fn: function (aTraitCompositionDescription,aCollection){
  2516. var self=this;
  2517. var metaclass;
  2518. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2519. return $core.withContext(function($ctx1) {
  2520. //>>excludeEnd("ctx");
  2521. metaclass=self._instanceVariableNames_(aCollection);
  2522. $recv(metaclass)._setTraitComposition_($recv(aTraitCompositionDescription)._asTraitComposition());
  2523. return metaclass;
  2524. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2525. }, function($ctx1) {$ctx1.fill(self,"uses:instanceVariableNames:",{aTraitCompositionDescription:aTraitCompositionDescription,aCollection:aCollection,metaclass:metaclass},$globals.Metaclass)});
  2526. //>>excludeEnd("ctx");
  2527. },
  2528. //>>excludeStart("ide", pragmas.excludeIdeData);
  2529. args: ["aTraitCompositionDescription", "aCollection"],
  2530. source: "uses: aTraitCompositionDescription instanceVariableNames: aCollection\x0a\x09| metaclass |\x0a\x09metaclass := self instanceVariableNames: aCollection.\x0a\x09metaclass setTraitComposition: aTraitCompositionDescription asTraitComposition.\x0a\x09^ metaclass",
  2531. referencedClasses: [],
  2532. //>>excludeEnd("ide");
  2533. messageSends: ["instanceVariableNames:", "setTraitComposition:", "asTraitComposition"]
  2534. }),
  2535. $globals.Metaclass);
  2536. $core.addClass("Trait", $globals.BehaviorBody, [], "Kernel-Classes");
  2537. $core.addMethod(
  2538. $core.method({
  2539. selector: "-",
  2540. protocol: "composition",
  2541. fn: function (anArray){
  2542. var self=this;
  2543. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2544. return $core.withContext(function($ctx1) {
  2545. //>>excludeEnd("ctx");
  2546. return $recv(self._asTraitTransformation()).__minus(anArray);
  2547. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2548. }, function($ctx1) {$ctx1.fill(self,"-",{anArray:anArray},$globals.Trait)});
  2549. //>>excludeEnd("ctx");
  2550. },
  2551. //>>excludeStart("ide", pragmas.excludeIdeData);
  2552. args: ["anArray"],
  2553. source: "- anArray\x0a\x09^ self asTraitTransformation - anArray",
  2554. referencedClasses: [],
  2555. //>>excludeEnd("ide");
  2556. messageSends: ["-", "asTraitTransformation"]
  2557. }),
  2558. $globals.Trait);
  2559. $core.addMethod(
  2560. $core.method({
  2561. selector: "@",
  2562. protocol: "composition",
  2563. fn: function (anArrayOfAssociations){
  2564. var self=this;
  2565. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2566. return $core.withContext(function($ctx1) {
  2567. //>>excludeEnd("ctx");
  2568. return $recv(self._asTraitTransformation()).__at(anArrayOfAssociations);
  2569. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2570. }, function($ctx1) {$ctx1.fill(self,"@",{anArrayOfAssociations:anArrayOfAssociations},$globals.Trait)});
  2571. //>>excludeEnd("ctx");
  2572. },
  2573. //>>excludeStart("ide", pragmas.excludeIdeData);
  2574. args: ["anArrayOfAssociations"],
  2575. source: "@ anArrayOfAssociations\x0a\x09^ self asTraitTransformation @ anArrayOfAssociations",
  2576. referencedClasses: [],
  2577. //>>excludeEnd("ide");
  2578. messageSends: ["@", "asTraitTransformation"]
  2579. }),
  2580. $globals.Trait);
  2581. $core.addMethod(
  2582. $core.method({
  2583. selector: "asJavaScriptSource",
  2584. protocol: "converting",
  2585. fn: function (){
  2586. var self=this;
  2587. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2588. return $core.withContext(function($ctx1) {
  2589. //>>excludeEnd("ctx");
  2590. return "$globals.".__comma(self._name());
  2591. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2592. }, function($ctx1) {$ctx1.fill(self,"asJavaScriptSource",{},$globals.Trait)});
  2593. //>>excludeEnd("ctx");
  2594. },
  2595. //>>excludeStart("ide", pragmas.excludeIdeData);
  2596. args: [],
  2597. source: "asJavaScriptSource\x0a\x09^ '$globals.', self name",
  2598. referencedClasses: [],
  2599. //>>excludeEnd("ide");
  2600. messageSends: [",", "name"]
  2601. }),
  2602. $globals.Trait);
  2603. $core.addMethod(
  2604. $core.method({
  2605. selector: "asTraitComposition",
  2606. protocol: "converting",
  2607. fn: function (){
  2608. var self=this;
  2609. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2610. return $core.withContext(function($ctx1) {
  2611. //>>excludeEnd("ctx");
  2612. return $recv(self._asTraitTransformation())._asTraitComposition();
  2613. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2614. }, function($ctx1) {$ctx1.fill(self,"asTraitComposition",{},$globals.Trait)});
  2615. //>>excludeEnd("ctx");
  2616. },
  2617. //>>excludeStart("ide", pragmas.excludeIdeData);
  2618. args: [],
  2619. source: "asTraitComposition\x0a\x09^ self asTraitTransformation asTraitComposition",
  2620. referencedClasses: [],
  2621. //>>excludeEnd("ide");
  2622. messageSends: ["asTraitComposition", "asTraitTransformation"]
  2623. }),
  2624. $globals.Trait);
  2625. $core.addMethod(
  2626. $core.method({
  2627. selector: "asTraitTransformation",
  2628. protocol: "converting",
  2629. fn: function (){
  2630. var self=this;
  2631. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2632. return $core.withContext(function($ctx1) {
  2633. //>>excludeEnd("ctx");
  2634. return $recv($globals.TraitTransformation)._on_(self);
  2635. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2636. }, function($ctx1) {$ctx1.fill(self,"asTraitTransformation",{},$globals.Trait)});
  2637. //>>excludeEnd("ctx");
  2638. },
  2639. //>>excludeStart("ide", pragmas.excludeIdeData);
  2640. args: [],
  2641. source: "asTraitTransformation\x0a\x09^ TraitTransformation on: self",
  2642. referencedClasses: ["TraitTransformation"],
  2643. //>>excludeEnd("ide");
  2644. messageSends: ["on:"]
  2645. }),
  2646. $globals.Trait);
  2647. $core.addMethod(
  2648. $core.method({
  2649. selector: "category",
  2650. protocol: "accessing",
  2651. fn: function (){
  2652. var self=this;
  2653. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2654. return $core.withContext(function($ctx1) {
  2655. //>>excludeEnd("ctx");
  2656. var $1,$receiver;
  2657. $1=self._package();
  2658. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2659. $ctx1.sendIdx["package"]=1;
  2660. //>>excludeEnd("ctx");
  2661. if(($receiver = $1) == null || $receiver.a$nil){
  2662. return "Unclassified";
  2663. } else {
  2664. return $recv(self._package())._name();
  2665. }
  2666. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2667. }, function($ctx1) {$ctx1.fill(self,"category",{},$globals.Trait)});
  2668. //>>excludeEnd("ctx");
  2669. },
  2670. //>>excludeStart("ide", pragmas.excludeIdeData);
  2671. args: [],
  2672. source: "category\x0a\x09^ self package ifNil: [ 'Unclassified' ] ifNotNil: [ self package name ]",
  2673. referencedClasses: [],
  2674. //>>excludeEnd("ide");
  2675. messageSends: ["ifNil:ifNotNil:", "package", "name"]
  2676. }),
  2677. $globals.Trait);
  2678. $core.addMethod(
  2679. $core.method({
  2680. selector: "classTag",
  2681. protocol: "accessing",
  2682. fn: function (){
  2683. var self=this;
  2684. return "trait";
  2685. },
  2686. //>>excludeStart("ide", pragmas.excludeIdeData);
  2687. args: [],
  2688. source: "classTag\x0a\x09^ 'trait'",
  2689. referencedClasses: [],
  2690. //>>excludeEnd("ide");
  2691. messageSends: []
  2692. }),
  2693. $globals.Trait);
  2694. $core.addMethod(
  2695. $core.method({
  2696. selector: "definition",
  2697. protocol: "accessing",
  2698. fn: function (){
  2699. var self=this;
  2700. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2701. return $core.withContext(function($ctx1) {
  2702. //>>excludeEnd("ctx");
  2703. var $1;
  2704. return $recv($globals.String)._streamContents_((function(stream){
  2705. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2706. return $core.withContext(function($ctx2) {
  2707. //>>excludeEnd("ctx");
  2708. $recv(stream)._write_("Trait named: ");
  2709. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2710. $ctx2.sendIdx["write:"]=1;
  2711. //>>excludeEnd("ctx");
  2712. $recv(stream)._printSymbol_(self._name());
  2713. $recv(stream)._lf();
  2714. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2715. $ctx2.sendIdx["lf"]=1;
  2716. //>>excludeEnd("ctx");
  2717. $recv(stream)._write_($recv(self._traitCompositionDefinition())._ifNotEmpty_((function(tcd){
  2718. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2719. return $core.withContext(function($ctx3) {
  2720. //>>excludeEnd("ctx");
  2721. $1=$recv($globals.String)._tab();
  2722. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2723. $ctx3.sendIdx["tab"]=1;
  2724. //>>excludeEnd("ctx");
  2725. return [$1,"uses: ",tcd,$recv($globals.String)._lf()];
  2726. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2727. }, function($ctx3) {$ctx3.fillBlock({tcd:tcd},$ctx2,2)});
  2728. //>>excludeEnd("ctx");
  2729. })));
  2730. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2731. $ctx2.sendIdx["write:"]=2;
  2732. //>>excludeEnd("ctx");
  2733. $recv(stream)._tab();
  2734. $recv(stream)._write_("package: ");
  2735. return $recv(stream)._print_(self._category());
  2736. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2737. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)});
  2738. //>>excludeEnd("ctx");
  2739. }));
  2740. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2741. }, function($ctx1) {$ctx1.fill(self,"definition",{},$globals.Trait)});
  2742. //>>excludeEnd("ctx");
  2743. },
  2744. //>>excludeStart("ide", pragmas.excludeIdeData);
  2745. args: [],
  2746. source: "definition\x0a\x09^ String streamContents: [ :stream | stream\x0a\x09\x09write: 'Trait named: '; printSymbol: self name; lf;\x0a\x09\x09write: (self traitCompositionDefinition ifNotEmpty: [ :tcd | { String tab. 'uses: '. tcd. String lf }]);\x0a\x09\x09tab; write: 'package: '; print: self category ]",
  2747. referencedClasses: ["String"],
  2748. //>>excludeEnd("ide");
  2749. messageSends: ["streamContents:", "write:", "printSymbol:", "name", "lf", "ifNotEmpty:", "traitCompositionDefinition", "tab", "print:", "category"]
  2750. }),
  2751. $globals.Trait);
  2752. $core.addMethod(
  2753. $core.method({
  2754. selector: "package",
  2755. protocol: "accessing",
  2756. fn: function (){
  2757. var self=this;
  2758. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2759. return $core.withContext(function($ctx1) {
  2760. //>>excludeEnd("ctx");
  2761. return self._basicAt_("pkg");
  2762. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2763. }, function($ctx1) {$ctx1.fill(self,"package",{},$globals.Trait)});
  2764. //>>excludeEnd("ctx");
  2765. },
  2766. //>>excludeStart("ide", pragmas.excludeIdeData);
  2767. args: [],
  2768. source: "package\x0a\x09^ self basicAt: 'pkg'",
  2769. referencedClasses: [],
  2770. //>>excludeEnd("ide");
  2771. messageSends: ["basicAt:"]
  2772. }),
  2773. $globals.Trait);
  2774. $core.addMethod(
  2775. $core.method({
  2776. selector: "package:",
  2777. protocol: "accessing",
  2778. fn: function (aPackage){
  2779. var self=this;
  2780. var oldPackage;
  2781. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2782. return $core.withContext(function($ctx1) {
  2783. //>>excludeEnd("ctx");
  2784. var $2,$1,$3,$4,$6,$5;
  2785. $2=self._package();
  2786. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2787. $ctx1.sendIdx["package"]=1;
  2788. //>>excludeEnd("ctx");
  2789. $1=$recv($2).__eq(aPackage);
  2790. if($core.assert($1)){
  2791. return self;
  2792. }
  2793. oldPackage=self._package();
  2794. self._basicAt_put_("pkg",aPackage);
  2795. $3=$recv(oldPackage)._organization();
  2796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2797. $ctx1.sendIdx["organization"]=1;
  2798. //>>excludeEnd("ctx");
  2799. $recv($3)._removeElement_(self);
  2800. $recv($recv(aPackage)._organization())._addElement_(self);
  2801. $4=$recv($globals.SystemAnnouncer)._current();
  2802. $6=$recv($globals.ClassMoved)._new();
  2803. $recv($6)._theClass_(self);
  2804. $recv($6)._oldPackage_(oldPackage);
  2805. $5=$recv($6)._yourself();
  2806. $recv($4)._announce_($5);
  2807. return self;
  2808. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2809. }, function($ctx1) {$ctx1.fill(self,"package:",{aPackage:aPackage,oldPackage:oldPackage},$globals.Trait)});
  2810. //>>excludeEnd("ctx");
  2811. },
  2812. //>>excludeStart("ide", pragmas.excludeIdeData);
  2813. args: ["aPackage"],
  2814. 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)",
  2815. referencedClasses: ["SystemAnnouncer", "ClassMoved"],
  2816. //>>excludeEnd("ide");
  2817. messageSends: ["ifTrue:", "=", "package", "basicAt:put:", "removeElement:", "organization", "addElement:", "announce:", "current", "theClass:", "new", "oldPackage:", "yourself"]
  2818. }),
  2819. $globals.Trait);
  2820. $core.addMethod(
  2821. $core.method({
  2822. selector: "theMetaClass",
  2823. protocol: "accessing",
  2824. fn: function (){
  2825. var self=this;
  2826. return nil;
  2827. },
  2828. //>>excludeStart("ide", pragmas.excludeIdeData);
  2829. args: [],
  2830. source: "theMetaClass\x0a\x09^ nil",
  2831. referencedClasses: [],
  2832. //>>excludeEnd("ide");
  2833. messageSends: []
  2834. }),
  2835. $globals.Trait);
  2836. $core.addMethod(
  2837. $core.method({
  2838. selector: "theNonMetaClass",
  2839. protocol: "accessing",
  2840. fn: function (){
  2841. var self=this;
  2842. return self;
  2843. },
  2844. //>>excludeStart("ide", pragmas.excludeIdeData);
  2845. args: [],
  2846. source: "theNonMetaClass\x0a\x09^ self",
  2847. referencedClasses: [],
  2848. //>>excludeEnd("ide");
  2849. messageSends: []
  2850. }),
  2851. $globals.Trait);
  2852. $core.addMethod(
  2853. $core.method({
  2854. selector: "traitUsers",
  2855. protocol: "accessing",
  2856. fn: function (){
  2857. var self=this;
  2858. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2859. return $core.withContext(function($ctx1) {
  2860. //>>excludeEnd("ctx");
  2861. return $recv(self._basicAt_("traitUsers"))._copy();
  2862. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2863. }, function($ctx1) {$ctx1.fill(self,"traitUsers",{},$globals.Trait)});
  2864. //>>excludeEnd("ctx");
  2865. },
  2866. //>>excludeStart("ide", pragmas.excludeIdeData);
  2867. args: [],
  2868. source: "traitUsers\x0a\x09^ (self basicAt: 'traitUsers') copy",
  2869. referencedClasses: [],
  2870. //>>excludeEnd("ide");
  2871. messageSends: ["copy", "basicAt:"]
  2872. }),
  2873. $globals.Trait);
  2874. $core.addMethod(
  2875. $core.method({
  2876. selector: "named:package:",
  2877. protocol: "instance creation",
  2878. fn: function (aString,anotherString){
  2879. var self=this;
  2880. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2881. return $core.withContext(function($ctx1) {
  2882. //>>excludeEnd("ctx");
  2883. return $recv($recv($globals.ClassBuilder)._new())._addTraitNamed_package_(aString,anotherString);
  2884. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2885. }, function($ctx1) {$ctx1.fill(self,"named:package:",{aString:aString,anotherString:anotherString},$globals.Trait.a$cls)});
  2886. //>>excludeEnd("ctx");
  2887. },
  2888. //>>excludeStart("ide", pragmas.excludeIdeData);
  2889. args: ["aString", "anotherString"],
  2890. source: "named: aString package: anotherString\x0a\x09^ ClassBuilder new addTraitNamed: aString package: anotherString",
  2891. referencedClasses: ["ClassBuilder"],
  2892. //>>excludeEnd("ide");
  2893. messageSends: ["addTraitNamed:package:", "new"]
  2894. }),
  2895. $globals.Trait.a$cls);
  2896. $core.addMethod(
  2897. $core.method({
  2898. selector: "named:uses:package:",
  2899. protocol: "instance creation",
  2900. fn: function (aString,aTraitCompositionDescription,anotherString){
  2901. var self=this;
  2902. var trait;
  2903. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2904. return $core.withContext(function($ctx1) {
  2905. //>>excludeEnd("ctx");
  2906. trait=self._named_package_(aString,anotherString);
  2907. $recv(trait)._setTraitComposition_($recv(aTraitCompositionDescription)._asTraitComposition());
  2908. return trait;
  2909. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2910. }, function($ctx1) {$ctx1.fill(self,"named:uses:package:",{aString:aString,aTraitCompositionDescription:aTraitCompositionDescription,anotherString:anotherString,trait:trait},$globals.Trait.a$cls)});
  2911. //>>excludeEnd("ctx");
  2912. },
  2913. //>>excludeStart("ide", pragmas.excludeIdeData);
  2914. args: ["aString", "aTraitCompositionDescription", "anotherString"],
  2915. source: "named: aString uses: aTraitCompositionDescription package: anotherString\x0a\x09| trait |\x0a\x09trait := self named: aString package: anotherString.\x0a\x09trait setTraitComposition: aTraitCompositionDescription asTraitComposition.\x0a\x09^ trait",
  2916. referencedClasses: [],
  2917. //>>excludeEnd("ide");
  2918. messageSends: ["named:package:", "setTraitComposition:", "asTraitComposition"]
  2919. }),
  2920. $globals.Trait.a$cls);
  2921. $core.addClass("ClassBuilder", $globals.Object, [], "Kernel-Classes");
  2922. //>>excludeStart("ide", pragmas.excludeIdeData);
  2923. $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:`.";
  2924. //>>excludeEnd("ide");
  2925. $core.addMethod(
  2926. $core.method({
  2927. selector: "addSubclassOf:named:instanceVariableNames:package:",
  2928. protocol: "class definition",
  2929. fn: function (aClass,className,aCollection,packageName){
  2930. var self=this;
  2931. var theClass,thePackage;
  2932. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2933. return $core.withContext(function($ctx1) {
  2934. //>>excludeEnd("ctx");
  2935. var $1,$2,$3,$receiver;
  2936. theClass=$recv($recv($globals.Smalltalk)._globals())._at_(className);
  2937. thePackage=$recv($globals.Package)._named_(packageName);
  2938. $1=theClass;
  2939. if(($receiver = $1) == null || $receiver.a$nil){
  2940. $1;
  2941. } else {
  2942. $recv(theClass)._package_(thePackage);
  2943. $2=$recv($recv(theClass)._superclass()).__eq_eq(aClass);
  2944. if(!$core.assert($2)){
  2945. return self._migrateClassNamed_superclass_instanceVariableNames_package_(className,aClass,aCollection,packageName);
  2946. }
  2947. }
  2948. $3=self._basicAddSubclassOf_named_instanceVariableNames_package_(aClass,className,aCollection,packageName);
  2949. $recv($3)._recompile();
  2950. return $recv($3)._yourself();
  2951. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2952. }, function($ctx1) {$ctx1.fill(self,"addSubclassOf:named:instanceVariableNames:package:",{aClass:aClass,className:className,aCollection:aCollection,packageName:packageName,theClass:theClass,thePackage:thePackage},$globals.ClassBuilder)});
  2953. //>>excludeEnd("ctx");
  2954. },
  2955. //>>excludeStart("ide", pragmas.excludeIdeData);
  2956. args: ["aClass", "className", "aCollection", "packageName"],
  2957. 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\x0a\x09\x09\x09ifFalse: [ ^ 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) recompile; yourself",
  2958. referencedClasses: ["Smalltalk", "Package"],
  2959. //>>excludeEnd("ide");
  2960. messageSends: ["at:", "globals", "named:", "ifNotNil:", "package:", "ifFalse:", "==", "superclass", "migrateClassNamed:superclass:instanceVariableNames:package:", "recompile", "basicAddSubclassOf:named:instanceVariableNames:package:", "yourself"]
  2961. }),
  2962. $globals.ClassBuilder);
  2963. $core.addMethod(
  2964. $core.method({
  2965. selector: "addTraitNamed:package:",
  2966. protocol: "class definition",
  2967. fn: function (traitName,packageName){
  2968. var self=this;
  2969. var theTrait,thePackage;
  2970. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2971. return $core.withContext(function($ctx1) {
  2972. //>>excludeEnd("ctx");
  2973. var $1,$2,$receiver;
  2974. theTrait=$recv($recv($globals.Smalltalk)._globals())._at_(traitName);
  2975. thePackage=$recv($globals.Package)._named_(packageName);
  2976. $1=theTrait;
  2977. if(($receiver = $1) == null || $receiver.a$nil){
  2978. $1;
  2979. } else {
  2980. $2=theTrait;
  2981. $recv($2)._package_(thePackage);
  2982. $recv($2)._recompile();
  2983. return $recv($2)._yourself();
  2984. }
  2985. return self._basicAddTraitNamed_package_(traitName,packageName);
  2986. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2987. }, function($ctx1) {$ctx1.fill(self,"addTraitNamed:package:",{traitName:traitName,packageName:packageName,theTrait:theTrait,thePackage:thePackage},$globals.ClassBuilder)});
  2988. //>>excludeEnd("ctx");
  2989. },
  2990. //>>excludeStart("ide", pragmas.excludeIdeData);
  2991. args: ["traitName", "packageName"],
  2992. source: "addTraitNamed: traitName package: packageName\x0a\x09| theTrait thePackage |\x0a\x09\x0a\x09theTrait := Smalltalk globals at: traitName.\x0a\x09thePackage := Package named: packageName.\x0a\x09\x0a\x09theTrait ifNotNil: [ ^ theTrait package: thePackage; recompile; yourself ].\x0a\x09\x09\x0a\x09^ self\x0a\x09\x09basicAddTraitNamed: traitName\x0a\x09\x09package: packageName",
  2993. referencedClasses: ["Smalltalk", "Package"],
  2994. //>>excludeEnd("ide");
  2995. messageSends: ["at:", "globals", "named:", "ifNotNil:", "package:", "recompile", "yourself", "basicAddTraitNamed:package:"]
  2996. }),
  2997. $globals.ClassBuilder);
  2998. $core.addMethod(
  2999. $core.method({
  3000. selector: "basicAddSubclassOf:named:instanceVariableNames:package:",
  3001. protocol: "private",
  3002. fn: function (aClass,aString,aCollection,packageName){
  3003. var self=this;
  3004. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3005. return $core.withContext(function($ctx1) {
  3006. //>>excludeEnd("ctx");
  3007. return $core.addClass(aString, aClass, aCollection, packageName);
  3008. ;
  3009. return self;
  3010. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3011. }, function($ctx1) {$ctx1.fill(self,"basicAddSubclassOf:named:instanceVariableNames:package:",{aClass:aClass,aString:aString,aCollection:aCollection,packageName:packageName},$globals.ClassBuilder)});
  3012. //>>excludeEnd("ctx");
  3013. },
  3014. //>>excludeStart("ide", pragmas.excludeIdeData);
  3015. args: ["aClass", "aString", "aCollection", "packageName"],
  3016. source: "basicAddSubclassOf: aClass named: aString instanceVariableNames: aCollection package: packageName\x0a\x09<inlineJS: '\x0a\x09\x09return $core.addClass(aString, aClass, aCollection, packageName);\x0a\x09'>",
  3017. referencedClasses: [],
  3018. //>>excludeEnd("ide");
  3019. messageSends: []
  3020. }),
  3021. $globals.ClassBuilder);
  3022. $core.addMethod(
  3023. $core.method({
  3024. selector: "basicAddTraitNamed:package:",
  3025. protocol: "private",
  3026. fn: function (aString,anotherString){
  3027. var self=this;
  3028. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3029. return $core.withContext(function($ctx1) {
  3030. //>>excludeEnd("ctx");
  3031. return $core.addTrait(aString, anotherString);
  3032. return self;
  3033. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3034. }, function($ctx1) {$ctx1.fill(self,"basicAddTraitNamed:package:",{aString:aString,anotherString:anotherString},$globals.ClassBuilder)});
  3035. //>>excludeEnd("ctx");
  3036. },
  3037. //>>excludeStart("ide", pragmas.excludeIdeData);
  3038. args: ["aString", "anotherString"],
  3039. source: "basicAddTraitNamed: aString package: anotherString\x0a\x09<inlineJS: 'return $core.addTrait(aString, anotherString)'>",
  3040. referencedClasses: [],
  3041. //>>excludeEnd("ide");
  3042. messageSends: []
  3043. }),
  3044. $globals.ClassBuilder);
  3045. $core.addMethod(
  3046. $core.method({
  3047. selector: "basicClass:instanceVariableNames:",
  3048. protocol: "private",
  3049. fn: function (aClass,aString){
  3050. var self=this;
  3051. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3052. return $core.withContext(function($ctx1) {
  3053. //>>excludeEnd("ctx");
  3054. self._basicClass_instanceVariables_(aClass,self._instanceVariableNamesFor_(aString));
  3055. return self;
  3056. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3057. }, function($ctx1) {$ctx1.fill(self,"basicClass:instanceVariableNames:",{aClass:aClass,aString:aString},$globals.ClassBuilder)});
  3058. //>>excludeEnd("ctx");
  3059. },
  3060. //>>excludeStart("ide", pragmas.excludeIdeData);
  3061. args: ["aClass", "aString"],
  3062. source: "basicClass: aClass instanceVariableNames: aString\x0a\x09self basicClass: aClass instanceVariables: (self instanceVariableNamesFor: aString)",
  3063. referencedClasses: [],
  3064. //>>excludeEnd("ide");
  3065. messageSends: ["basicClass:instanceVariables:", "instanceVariableNamesFor:"]
  3066. }),
  3067. $globals.ClassBuilder);
  3068. $core.addMethod(
  3069. $core.method({
  3070. selector: "basicClass:instanceVariables:",
  3071. protocol: "private",
  3072. fn: function (aClass,aCollection){
  3073. var self=this;
  3074. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3075. return $core.withContext(function($ctx1) {
  3076. //>>excludeEnd("ctx");
  3077. var $1;
  3078. $1=$recv(aClass)._isMetaclass();
  3079. if(!$core.assert($1)){
  3080. self._error_($recv($recv(aClass)._name()).__comma(" is not a metaclass"));
  3081. }
  3082. $recv(aClass)._basicAt_put_("iVarNames",aCollection);
  3083. return self;
  3084. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3085. }, function($ctx1) {$ctx1.fill(self,"basicClass:instanceVariables:",{aClass:aClass,aCollection:aCollection},$globals.ClassBuilder)});
  3086. //>>excludeEnd("ctx");
  3087. },
  3088. //>>excludeStart("ide", pragmas.excludeIdeData);
  3089. args: ["aClass", "aCollection"],
  3090. source: "basicClass: aClass instanceVariables: aCollection\x0a\x0a\x09aClass isMetaclass ifFalse: [ self error: aClass name, ' is not a metaclass' ].\x0a\x09aClass basicAt: 'iVarNames' put: aCollection",
  3091. referencedClasses: [],
  3092. //>>excludeEnd("ide");
  3093. messageSends: ["ifFalse:", "isMetaclass", "error:", ",", "name", "basicAt:put:"]
  3094. }),
  3095. $globals.ClassBuilder);
  3096. $core.addMethod(
  3097. $core.method({
  3098. selector: "basicRemoveClass:",
  3099. protocol: "private",
  3100. fn: function (aClass){
  3101. var self=this;
  3102. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3103. return $core.withContext(function($ctx1) {
  3104. //>>excludeEnd("ctx");
  3105. $core.removeClass(aClass);
  3106. return self;
  3107. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3108. }, function($ctx1) {$ctx1.fill(self,"basicRemoveClass:",{aClass:aClass},$globals.ClassBuilder)});
  3109. //>>excludeEnd("ctx");
  3110. },
  3111. //>>excludeStart("ide", pragmas.excludeIdeData);
  3112. args: ["aClass"],
  3113. source: "basicRemoveClass: aClass\x0a\x09<inlineJS: '$core.removeClass(aClass)'>",
  3114. referencedClasses: [],
  3115. //>>excludeEnd("ide");
  3116. messageSends: []
  3117. }),
  3118. $globals.ClassBuilder);
  3119. $core.addMethod(
  3120. $core.method({
  3121. selector: "basicRenameClass:to:",
  3122. protocol: "private",
  3123. fn: function (aClass,aString){
  3124. var self=this;
  3125. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3126. return $core.withContext(function($ctx1) {
  3127. //>>excludeEnd("ctx");
  3128. $globals[aString] = aClass;
  3129. delete $globals[aClass.className];
  3130. aClass.className = aString;
  3131. ;
  3132. return self;
  3133. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3134. }, function($ctx1) {$ctx1.fill(self,"basicRenameClass:to:",{aClass:aClass,aString:aString},$globals.ClassBuilder)});
  3135. //>>excludeEnd("ctx");
  3136. },
  3137. //>>excludeStart("ide", pragmas.excludeIdeData);
  3138. args: ["aClass", "aString"],
  3139. source: "basicRenameClass: aClass to: aString\x0a\x09<inlineJS: '\x0a\x09\x09$globals[aString] = aClass;\x0a\x09\x09delete $globals[aClass.className];\x0a\x09\x09aClass.className = aString;\x0a\x09'>",
  3140. referencedClasses: [],
  3141. //>>excludeEnd("ide");
  3142. messageSends: []
  3143. }),
  3144. $globals.ClassBuilder);
  3145. $core.addMethod(
  3146. $core.method({
  3147. selector: "basicSwapClassNames:with:",
  3148. protocol: "private",
  3149. fn: function (aClass,anotherClass){
  3150. var self=this;
  3151. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3152. return $core.withContext(function($ctx1) {
  3153. //>>excludeEnd("ctx");
  3154. var tmp = aClass.className;
  3155. aClass.className = anotherClass.className;
  3156. anotherClass.className = tmp;
  3157. ;
  3158. return self;
  3159. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3160. }, function($ctx1) {$ctx1.fill(self,"basicSwapClassNames:with:",{aClass:aClass,anotherClass:anotherClass},$globals.ClassBuilder)});
  3161. //>>excludeEnd("ctx");
  3162. },
  3163. //>>excludeStart("ide", pragmas.excludeIdeData);
  3164. args: ["aClass", "anotherClass"],
  3165. source: "basicSwapClassNames: aClass with: anotherClass\x0a\x09<inlineJS: '\x0a\x09\x09var tmp = aClass.className;\x0a\x09\x09aClass.className = anotherClass.className;\x0a\x09\x09anotherClass.className = tmp;\x0a\x09'>",
  3166. referencedClasses: [],
  3167. //>>excludeEnd("ide");
  3168. messageSends: []
  3169. }),
  3170. $globals.ClassBuilder);
  3171. $core.addMethod(
  3172. $core.method({
  3173. selector: "class:instanceVariableNames:",
  3174. protocol: "class definition",
  3175. fn: function (aClass,ivarNames){
  3176. var self=this;
  3177. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3178. return $core.withContext(function($ctx1) {
  3179. //>>excludeEnd("ctx");
  3180. var $1,$3,$2;
  3181. self._basicClass_instanceVariableNames_(aClass,ivarNames);
  3182. $1=$recv($globals.SystemAnnouncer)._current();
  3183. $3=$recv($globals.ClassDefinitionChanged)._new();
  3184. $recv($3)._theClass_(aClass);
  3185. $2=$recv($3)._yourself();
  3186. $recv($1)._announce_($2);
  3187. return self;
  3188. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3189. }, function($ctx1) {$ctx1.fill(self,"class:instanceVariableNames:",{aClass:aClass,ivarNames:ivarNames},$globals.ClassBuilder)});
  3190. //>>excludeEnd("ctx");
  3191. },
  3192. //>>excludeStart("ide", pragmas.excludeIdeData);
  3193. args: ["aClass", "ivarNames"],
  3194. source: "class: aClass instanceVariableNames: ivarNames\x0a\x09self basicClass: aClass instanceVariableNames: ivarNames.\x0a\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (ClassDefinitionChanged new\x0a\x09\x09\x09theClass: aClass;\x0a\x09\x09\x09yourself)",
  3195. referencedClasses: ["SystemAnnouncer", "ClassDefinitionChanged"],
  3196. //>>excludeEnd("ide");
  3197. messageSends: ["basicClass:instanceVariableNames:", "announce:", "current", "theClass:", "new", "yourself"]
  3198. }),
  3199. $globals.ClassBuilder);
  3200. $core.addMethod(
  3201. $core.method({
  3202. selector: "copyClass:named:",
  3203. protocol: "copying",
  3204. fn: function (aClass,className){
  3205. var self=this;
  3206. var newClass;
  3207. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3208. return $core.withContext(function($ctx1) {
  3209. //>>excludeEnd("ctx");
  3210. var $1,$3,$2;
  3211. newClass=self._addSubclassOf_named_instanceVariableNames_package_($recv(aClass)._superclass(),className,$recv(aClass)._instanceVariableNames(),$recv($recv(aClass)._package())._name());
  3212. self._copyClass_to_(aClass,newClass);
  3213. $1=$recv($globals.SystemAnnouncer)._current();
  3214. $3=$recv($globals.ClassAdded)._new();
  3215. $recv($3)._theClass_(newClass);
  3216. $2=$recv($3)._yourself();
  3217. $recv($1)._announce_($2);
  3218. return newClass;
  3219. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3220. }, function($ctx1) {$ctx1.fill(self,"copyClass:named:",{aClass:aClass,className:className,newClass:newClass},$globals.ClassBuilder)});
  3221. //>>excludeEnd("ctx");
  3222. },
  3223. //>>excludeStart("ide", pragmas.excludeIdeData);
  3224. args: ["aClass", "className"],
  3225. 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",
  3226. referencedClasses: ["SystemAnnouncer", "ClassAdded"],
  3227. //>>excludeEnd("ide");
  3228. messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "superclass", "instanceVariableNames", "name", "package", "copyClass:to:", "announce:", "current", "theClass:", "new", "yourself"]
  3229. }),
  3230. $globals.ClassBuilder);
  3231. $core.addMethod(
  3232. $core.method({
  3233. selector: "copyClass:to:",
  3234. protocol: "copying",
  3235. fn: function (aClass,anotherClass){
  3236. var self=this;
  3237. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3238. return $core.withContext(function($ctx1) {
  3239. //>>excludeEnd("ctx");
  3240. var $1,$3,$2,$4,$5,$6,$7,$8,$10,$9,$12,$11,$14,$15,$13,$16,$17,$18,$19;
  3241. $recv(anotherClass)._comment_($recv(aClass)._comment());
  3242. $1=$recv(aClass)._methodDictionary();
  3243. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3244. $ctx1.sendIdx["methodDictionary"]=1;
  3245. //>>excludeEnd("ctx");
  3246. $recv($1)._valuesDo_((function(each){
  3247. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3248. return $core.withContext(function($ctx2) {
  3249. //>>excludeEnd("ctx");
  3250. $3=$recv(each)._methodClass();
  3251. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3252. $ctx2.sendIdx["methodClass"]=1;
  3253. //>>excludeEnd("ctx");
  3254. $2=$recv($3).__eq(aClass);
  3255. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3256. $ctx2.sendIdx["="]=1;
  3257. //>>excludeEnd("ctx");
  3258. if($core.assert($2)){
  3259. $4=$recv($globals.Compiler)._new();
  3260. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3261. $ctx2.sendIdx["new"]=1;
  3262. //>>excludeEnd("ctx");
  3263. $5=$recv(each)._source();
  3264. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3265. $ctx2.sendIdx["source"]=1;
  3266. //>>excludeEnd("ctx");
  3267. $6=$recv(each)._protocol();
  3268. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3269. $ctx2.sendIdx["protocol"]=1;
  3270. //>>excludeEnd("ctx");
  3271. return $recv($4)._install_forClass_protocol_($5,anotherClass,$6);
  3272. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3273. $ctx2.sendIdx["install:forClass:protocol:"]=1;
  3274. //>>excludeEnd("ctx");
  3275. }
  3276. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3277. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3278. //>>excludeEnd("ctx");
  3279. }));
  3280. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3281. $ctx1.sendIdx["valuesDo:"]=1;
  3282. //>>excludeEnd("ctx");
  3283. $7=$recv(aClass)._traitComposition();
  3284. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3285. $ctx1.sendIdx["traitComposition"]=1;
  3286. //>>excludeEnd("ctx");
  3287. $recv(anotherClass)._setTraitComposition_($7);
  3288. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3289. $ctx1.sendIdx["setTraitComposition:"]=1;
  3290. //>>excludeEnd("ctx");
  3291. $8=$recv(anotherClass)._class();
  3292. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3293. $ctx1.sendIdx["class"]=1;
  3294. //>>excludeEnd("ctx");
  3295. $10=$recv(aClass)._class();
  3296. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3297. $ctx1.sendIdx["class"]=2;
  3298. //>>excludeEnd("ctx");
  3299. $9=$recv($10)._instanceVariableNames();
  3300. self._basicClass_instanceVariables_($8,$9);
  3301. $12=$recv(aClass)._class();
  3302. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3303. $ctx1.sendIdx["class"]=3;
  3304. //>>excludeEnd("ctx");
  3305. $11=$recv($12)._methodDictionary();
  3306. $recv($11)._valuesDo_((function(each){
  3307. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3308. return $core.withContext(function($ctx2) {
  3309. //>>excludeEnd("ctx");
  3310. $14=$recv(each)._methodClass();
  3311. $15=$recv(aClass)._class();
  3312. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3313. $ctx2.sendIdx["class"]=4;
  3314. //>>excludeEnd("ctx");
  3315. $13=$recv($14).__eq($15);
  3316. if($core.assert($13)){
  3317. $16=$recv($globals.Compiler)._new();
  3318. $17=$recv(each)._source();
  3319. $18=$recv(anotherClass)._class();
  3320. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3321. $ctx2.sendIdx["class"]=5;
  3322. //>>excludeEnd("ctx");
  3323. return $recv($16)._install_forClass_protocol_($17,$18,$recv(each)._protocol());
  3324. }
  3325. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3326. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
  3327. //>>excludeEnd("ctx");
  3328. }));
  3329. $19=$recv(anotherClass)._class();
  3330. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3331. $ctx1.sendIdx["class"]=6;
  3332. //>>excludeEnd("ctx");
  3333. $recv($19)._setTraitComposition_($recv($recv(aClass)._class())._traitComposition());
  3334. return self;
  3335. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3336. }, function($ctx1) {$ctx1.fill(self,"copyClass:to:",{aClass:aClass,anotherClass:anotherClass},$globals.ClassBuilder)});
  3337. //>>excludeEnd("ctx");
  3338. },
  3339. //>>excludeStart("ide", pragmas.excludeIdeData);
  3340. args: ["aClass", "anotherClass"],
  3341. source: "copyClass: aClass to: anotherClass\x0a\x0a\x09anotherClass comment: aClass comment.\x0a\x0a\x09aClass methodDictionary valuesDo: [ :each |\x0a\x09\x09each methodClass = aClass ifTrue: [\x0a\x09\x09\x09Compiler new install: each source forClass: anotherClass protocol: each protocol ] ].\x0a\x09anotherClass setTraitComposition: aClass traitComposition.\x0a\x0a\x09self basicClass: anotherClass class instanceVariables: aClass class instanceVariableNames.\x0a\x0a\x09aClass class methodDictionary valuesDo: [ :each |\x0a\x09\x09each methodClass = aClass class ifTrue: [\x0a\x09\x09\x09Compiler new install: each source forClass: anotherClass class protocol: each protocol ] ].\x0a\x09anotherClass class setTraitComposition: aClass class traitComposition",
  3342. referencedClasses: ["Compiler"],
  3343. //>>excludeEnd("ide");
  3344. messageSends: ["comment:", "comment", "valuesDo:", "methodDictionary", "ifTrue:", "=", "methodClass", "install:forClass:protocol:", "new", "source", "protocol", "setTraitComposition:", "traitComposition", "basicClass:instanceVariables:", "class", "instanceVariableNames"]
  3345. }),
  3346. $globals.ClassBuilder);
  3347. $core.addMethod(
  3348. $core.method({
  3349. selector: "installMethod:forClass:protocol:",
  3350. protocol: "method definition",
  3351. fn: function (aCompiledMethod,aBehavior,aString){
  3352. var self=this;
  3353. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3354. return $core.withContext(function($ctx1) {
  3355. //>>excludeEnd("ctx");
  3356. $recv(aCompiledMethod)._protocol_(aString);
  3357. $recv(aBehavior)._addCompiledMethod_(aCompiledMethod);
  3358. return aCompiledMethod;
  3359. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3360. }, function($ctx1) {$ctx1.fill(self,"installMethod:forClass:protocol:",{aCompiledMethod:aCompiledMethod,aBehavior:aBehavior,aString:aString},$globals.ClassBuilder)});
  3361. //>>excludeEnd("ctx");
  3362. },
  3363. //>>excludeStart("ide", pragmas.excludeIdeData);
  3364. args: ["aCompiledMethod", "aBehavior", "aString"],
  3365. source: "installMethod: aCompiledMethod forClass: aBehavior protocol: aString\x0a\x09aCompiledMethod protocol: aString.\x0a\x09aBehavior addCompiledMethod: aCompiledMethod.\x0a\x09^ aCompiledMethod",
  3366. referencedClasses: [],
  3367. //>>excludeEnd("ide");
  3368. messageSends: ["protocol:", "addCompiledMethod:"]
  3369. }),
  3370. $globals.ClassBuilder);
  3371. $core.addMethod(
  3372. $core.method({
  3373. selector: "instanceVariableNamesFor:",
  3374. protocol: "accessing",
  3375. fn: function (aString){
  3376. var self=this;
  3377. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3378. return $core.withContext(function($ctx1) {
  3379. //>>excludeEnd("ctx");
  3380. return $recv($recv(aString)._tokenize_(" "))._reject_((function(each){
  3381. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3382. return $core.withContext(function($ctx2) {
  3383. //>>excludeEnd("ctx");
  3384. return $recv(each)._isEmpty();
  3385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3386. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3387. //>>excludeEnd("ctx");
  3388. }));
  3389. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3390. }, function($ctx1) {$ctx1.fill(self,"instanceVariableNamesFor:",{aString:aString},$globals.ClassBuilder)});
  3391. //>>excludeEnd("ctx");
  3392. },
  3393. //>>excludeStart("ide", pragmas.excludeIdeData);
  3394. args: ["aString"],
  3395. source: "instanceVariableNamesFor: aString\x0a\x09^ (aString tokenize: ' ') reject: [ :each | each isEmpty ]",
  3396. referencedClasses: [],
  3397. //>>excludeEnd("ide");
  3398. messageSends: ["reject:", "tokenize:", "isEmpty"]
  3399. }),
  3400. $globals.ClassBuilder);
  3401. $core.addMethod(
  3402. $core.method({
  3403. selector: "migrateClass:superclass:",
  3404. protocol: "class migration",
  3405. fn: function (aClass,anotherClass){
  3406. var self=this;
  3407. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3408. return $core.withContext(function($ctx1) {
  3409. //>>excludeEnd("ctx");
  3410. var $1;
  3411. $1=$recv(aClass)._name();
  3412. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3413. $ctx1.sendIdx["name"]=1;
  3414. //>>excludeEnd("ctx");
  3415. return self._migrateClassNamed_superclass_instanceVariableNames_package_($1,anotherClass,$recv(aClass)._instanceVariableNames(),$recv($recv(aClass)._package())._name());
  3416. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3417. }, function($ctx1) {$ctx1.fill(self,"migrateClass:superclass:",{aClass:aClass,anotherClass:anotherClass},$globals.ClassBuilder)});
  3418. //>>excludeEnd("ctx");
  3419. },
  3420. //>>excludeStart("ide", pragmas.excludeIdeData);
  3421. args: ["aClass", "anotherClass"],
  3422. 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",
  3423. referencedClasses: [],
  3424. //>>excludeEnd("ide");
  3425. messageSends: ["migrateClassNamed:superclass:instanceVariableNames:package:", "name", "instanceVariableNames", "package"]
  3426. }),
  3427. $globals.ClassBuilder);
  3428. $core.addMethod(
  3429. $core.method({
  3430. selector: "migrateClassNamed:superclass:instanceVariableNames:package:",
  3431. protocol: "class migration",
  3432. fn: function (className,aClass,aCollection,packageName){
  3433. var self=this;
  3434. var oldClass,newClass,tmp;
  3435. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3436. return $core.withContext(function($ctx1) {
  3437. //>>excludeEnd("ctx");
  3438. var $1,$2,$4,$3;
  3439. tmp="new*".__comma(className);
  3440. oldClass=$recv($recv($globals.Smalltalk)._globals())._at_(className);
  3441. newClass=self._addSubclassOf_named_instanceVariableNames_package_(aClass,tmp,aCollection,packageName);
  3442. self._basicSwapClassNames_with_(oldClass,newClass);
  3443. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3444. $ctx1.sendIdx["basicSwapClassNames:with:"]=1;
  3445. //>>excludeEnd("ctx");
  3446. $recv((function(){
  3447. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3448. return $core.withContext(function($ctx2) {
  3449. //>>excludeEnd("ctx");
  3450. return self._copyClass_to_(oldClass,newClass);
  3451. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3452. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  3453. //>>excludeEnd("ctx");
  3454. }))._on_do_($globals.Error,(function(exception){
  3455. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3456. return $core.withContext(function($ctx2) {
  3457. //>>excludeEnd("ctx");
  3458. self._basicSwapClassNames_with_(oldClass,newClass);
  3459. $1=self._basicRemoveClass_(newClass);
  3460. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3461. $ctx2.sendIdx["basicRemoveClass:"]=1;
  3462. //>>excludeEnd("ctx");
  3463. $1;
  3464. return $recv(exception)._resignal();
  3465. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3466. }, function($ctx2) {$ctx2.fillBlock({exception:exception},$ctx1,2)});
  3467. //>>excludeEnd("ctx");
  3468. }));
  3469. self._rawRenameClass_to_(oldClass,tmp);
  3470. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3471. $ctx1.sendIdx["rawRenameClass:to:"]=1;
  3472. //>>excludeEnd("ctx");
  3473. self._rawRenameClass_to_(newClass,className);
  3474. $recv($recv(oldClass)._subclasses())._do_((function(each){
  3475. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3476. return $core.withContext(function($ctx2) {
  3477. //>>excludeEnd("ctx");
  3478. return self._migrateClass_superclass_(each,newClass);
  3479. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3480. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
  3481. //>>excludeEnd("ctx");
  3482. }));
  3483. self._basicRemoveClass_(oldClass);
  3484. $2=$recv($globals.SystemAnnouncer)._current();
  3485. $4=$recv($globals.ClassMigrated)._new();
  3486. $recv($4)._theClass_(newClass);
  3487. $recv($4)._oldClass_(oldClass);
  3488. $3=$recv($4)._yourself();
  3489. $recv($2)._announce_($3);
  3490. return newClass;
  3491. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3492. }, 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)});
  3493. //>>excludeEnd("ctx");
  3494. },
  3495. //>>excludeStart("ide", pragmas.excludeIdeData);
  3496. args: ["className", "aClass", "aCollection", "packageName"],
  3497. source: "migrateClassNamed: className superclass: aClass instanceVariableNames: aCollection package: packageName\x0a\x09| oldClass newClass tmp |\x0a\x09\x0a\x09tmp := 'new*', className.\x0a\x09oldClass := Smalltalk globals at: className.\x0a\x09\x0a\x09newClass := self\x0a\x09\x09addSubclassOf: aClass\x0a\x09\x09named: tmp\x0a\x09\x09instanceVariableNames: aCollection\x0a\x09\x09package: packageName.\x0a\x0a\x09self basicSwapClassNames: oldClass with: newClass.\x0a\x0a\x09[ self copyClass: oldClass to: newClass ]\x0a\x09\x09on: Error\x0a\x09\x09do: [ :exception |\x0a\x09\x09\x09self\x0a\x09\x09\x09\x09basicSwapClassNames: oldClass with: newClass;\x0a\x09\x09\x09\x09basicRemoveClass: newClass.\x0a\x09\x09\x09\x09exception resignal ].\x0a\x0a\x09self\x0a\x09\x09rawRenameClass: oldClass to: tmp;\x0a\x09\x09rawRenameClass: newClass to: className.\x0a\x0a\x09oldClass subclasses \x0a\x09\x09do: [ :each | self migrateClass: each superclass: newClass ].\x0a\x0a\x09self basicRemoveClass: oldClass.\x0a\x09\x0a\x09SystemAnnouncer current announce: (ClassMigrated new\x0a\x09\x09theClass: newClass;\x0a\x09\x09oldClass: oldClass;\x0a\x09\x09yourself).\x0a\x09\x0a\x09^ newClass",
  3498. referencedClasses: ["Smalltalk", "Error", "SystemAnnouncer", "ClassMigrated"],
  3499. //>>excludeEnd("ide");
  3500. messageSends: [",", "at:", "globals", "addSubclassOf:named:instanceVariableNames:package:", "basicSwapClassNames:with:", "on:do:", "copyClass:to:", "basicRemoveClass:", "resignal", "rawRenameClass:to:", "do:", "subclasses", "migrateClass:superclass:", "announce:", "current", "theClass:", "new", "oldClass:", "yourself"]
  3501. }),
  3502. $globals.ClassBuilder);
  3503. $core.addMethod(
  3504. $core.method({
  3505. selector: "rawRenameClass:to:",
  3506. protocol: "private",
  3507. fn: function (aClass,aString){
  3508. var self=this;
  3509. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3510. return $core.withContext(function($ctx1) {
  3511. //>>excludeEnd("ctx");
  3512. $globals[aString] = aClass;
  3513. ;
  3514. return self;
  3515. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3516. }, function($ctx1) {$ctx1.fill(self,"rawRenameClass:to:",{aClass:aClass,aString:aString},$globals.ClassBuilder)});
  3517. //>>excludeEnd("ctx");
  3518. },
  3519. //>>excludeStart("ide", pragmas.excludeIdeData);
  3520. args: ["aClass", "aString"],
  3521. source: "rawRenameClass: aClass to: aString\x0a\x09<inlineJS: '\x0a\x09\x09$globals[aString] = aClass;\x0a\x09'>",
  3522. referencedClasses: [],
  3523. //>>excludeEnd("ide");
  3524. messageSends: []
  3525. }),
  3526. $globals.ClassBuilder);
  3527. $core.addMethod(
  3528. $core.method({
  3529. selector: "renameClass:to:",
  3530. protocol: "class migration",
  3531. fn: function (aClass,className){
  3532. var self=this;
  3533. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3534. return $core.withContext(function($ctx1) {
  3535. //>>excludeEnd("ctx");
  3536. var $1,$3,$2;
  3537. self._basicRenameClass_to_(aClass,className);
  3538. $recv(aClass)._recompile();
  3539. $1=$recv($globals.SystemAnnouncer)._current();
  3540. $3=$recv($globals.ClassRenamed)._new();
  3541. $recv($3)._theClass_(aClass);
  3542. $2=$recv($3)._yourself();
  3543. $recv($1)._announce_($2);
  3544. return self;
  3545. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3546. }, function($ctx1) {$ctx1.fill(self,"renameClass:to:",{aClass:aClass,className:className},$globals.ClassBuilder)});
  3547. //>>excludeEnd("ctx");
  3548. },
  3549. //>>excludeStart("ide", pragmas.excludeIdeData);
  3550. args: ["aClass", "className"],
  3551. 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)",
  3552. referencedClasses: ["SystemAnnouncer", "ClassRenamed"],
  3553. //>>excludeEnd("ide");
  3554. messageSends: ["basicRenameClass:to:", "recompile", "announce:", "current", "theClass:", "new", "yourself"]
  3555. }),
  3556. $globals.ClassBuilder);
  3557. $core.addMethod(
  3558. $core.method({
  3559. selector: "setupClass:",
  3560. protocol: "public",
  3561. fn: function (aClass){
  3562. var self=this;
  3563. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3564. return $core.withContext(function($ctx1) {
  3565. //>>excludeEnd("ctx");
  3566. self._deprecatedAPI_("Classes are now auto-inited.");
  3567. return self;
  3568. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3569. }, function($ctx1) {$ctx1.fill(self,"setupClass:",{aClass:aClass},$globals.ClassBuilder)});
  3570. //>>excludeEnd("ctx");
  3571. },
  3572. //>>excludeStart("ide", pragmas.excludeIdeData);
  3573. args: ["aClass"],
  3574. source: "setupClass: aClass\x0a\x09self deprecatedAPI: 'Classes are now auto-inited.'",
  3575. referencedClasses: [],
  3576. //>>excludeEnd("ide");
  3577. messageSends: ["deprecatedAPI:"]
  3578. }),
  3579. $globals.ClassBuilder);
  3580. $core.addMethod(
  3581. $core.method({
  3582. selector: "superclass:subclass:",
  3583. protocol: "class definition",
  3584. fn: function (aClass,className){
  3585. var self=this;
  3586. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3587. return $core.withContext(function($ctx1) {
  3588. //>>excludeEnd("ctx");
  3589. return self._superclass_subclass_instanceVariableNames_package_(aClass,className,"",nil);
  3590. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3591. }, function($ctx1) {$ctx1.fill(self,"superclass:subclass:",{aClass:aClass,className:className},$globals.ClassBuilder)});
  3592. //>>excludeEnd("ctx");
  3593. },
  3594. //>>excludeStart("ide", pragmas.excludeIdeData);
  3595. args: ["aClass", "className"],
  3596. source: "superclass: aClass subclass: className\x0a\x09^ self superclass: aClass subclass: className instanceVariableNames: '' package: nil",
  3597. referencedClasses: [],
  3598. //>>excludeEnd("ide");
  3599. messageSends: ["superclass:subclass:instanceVariableNames:package:"]
  3600. }),
  3601. $globals.ClassBuilder);
  3602. $core.addMethod(
  3603. $core.method({
  3604. selector: "superclass:subclass:instanceVariableNames:package:",
  3605. protocol: "class definition",
  3606. fn: function (aClass,className,ivarNames,packageName){
  3607. var self=this;
  3608. var newClass;
  3609. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3610. return $core.withContext(function($ctx1) {
  3611. //>>excludeEnd("ctx");
  3612. var $1,$2,$3,$5,$4,$receiver;
  3613. $1=self._instanceVariableNamesFor_(ivarNames);
  3614. if(($receiver = packageName) == null || $receiver.a$nil){
  3615. $2="unclassified";
  3616. } else {
  3617. $2=packageName;
  3618. }
  3619. newClass=self._addSubclassOf_named_instanceVariableNames_package_(aClass,className,$1,$2);
  3620. $3=$recv($globals.SystemAnnouncer)._current();
  3621. $5=$recv($globals.ClassAdded)._new();
  3622. $recv($5)._theClass_(newClass);
  3623. $4=$recv($5)._yourself();
  3624. $recv($3)._announce_($4);
  3625. return newClass;
  3626. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3627. }, function($ctx1) {$ctx1.fill(self,"superclass:subclass:instanceVariableNames:package:",{aClass:aClass,className:className,ivarNames:ivarNames,packageName:packageName,newClass:newClass},$globals.ClassBuilder)});
  3628. //>>excludeEnd("ctx");
  3629. },
  3630. //>>excludeStart("ide", pragmas.excludeIdeData);
  3631. args: ["aClass", "className", "ivarNames", "packageName"],
  3632. 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\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (ClassAdded new\x0a\x09\x09\x09theClass: newClass;\x0a\x09\x09\x09yourself).\x0a\x09\x0a\x09^ newClass",
  3633. referencedClasses: ["SystemAnnouncer", "ClassAdded"],
  3634. //>>excludeEnd("ide");
  3635. messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "instanceVariableNamesFor:", "ifNil:", "announce:", "current", "theClass:", "new", "yourself"]
  3636. }),
  3637. $globals.ClassBuilder);
  3638. $core.addClass("ClassSorterNode", $globals.Object, ["theClass", "level", "nodes"], "Kernel-Classes");
  3639. //>>excludeStart("ide", pragmas.excludeIdeData);
  3640. $globals.ClassSorterNode.comment="I provide an algorithm for sorting classes alphabetically.\x0a\x0aSee [Issue #143](https://lolg.it/amber/amber/issues/143).";
  3641. //>>excludeEnd("ide");
  3642. $core.addMethod(
  3643. $core.method({
  3644. selector: "getNodesFrom:",
  3645. protocol: "accessing",
  3646. fn: function (aCollection){
  3647. var self=this;
  3648. var children,others;
  3649. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3650. return $core.withContext(function($ctx1) {
  3651. //>>excludeEnd("ctx");
  3652. var $1;
  3653. children=[];
  3654. others=[];
  3655. $recv(aCollection)._do_((function(each){
  3656. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3657. return $core.withContext(function($ctx2) {
  3658. //>>excludeEnd("ctx");
  3659. $1=$recv($recv(each)._superclass()).__eq(self._theClass());
  3660. if($core.assert($1)){
  3661. return $recv(children)._add_(each);
  3662. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3663. $ctx2.sendIdx["add:"]=1;
  3664. //>>excludeEnd("ctx");
  3665. } else {
  3666. return $recv(others)._add_(each);
  3667. }
  3668. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3669. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3670. //>>excludeEnd("ctx");
  3671. }));
  3672. self["@nodes"]=$recv(children)._collect_((function(each){
  3673. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3674. return $core.withContext(function($ctx2) {
  3675. //>>excludeEnd("ctx");
  3676. return $recv($globals.ClassSorterNode)._on_classes_level_(each,others,$recv(self._level()).__plus((1)));
  3677. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3678. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)});
  3679. //>>excludeEnd("ctx");
  3680. }));
  3681. return self;
  3682. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3683. }, function($ctx1) {$ctx1.fill(self,"getNodesFrom:",{aCollection:aCollection,children:children,others:others},$globals.ClassSorterNode)});
  3684. //>>excludeEnd("ctx");
  3685. },
  3686. //>>excludeStart("ide", pragmas.excludeIdeData);
  3687. args: ["aCollection"],
  3688. 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 ]",
  3689. referencedClasses: ["ClassSorterNode"],
  3690. //>>excludeEnd("ide");
  3691. messageSends: ["do:", "ifTrue:ifFalse:", "=", "superclass", "theClass", "add:", "collect:", "on:classes:level:", "+", "level"]
  3692. }),
  3693. $globals.ClassSorterNode);
  3694. $core.addMethod(
  3695. $core.method({
  3696. selector: "level",
  3697. protocol: "accessing",
  3698. fn: function (){
  3699. var self=this;
  3700. return self["@level"];
  3701. },
  3702. //>>excludeStart("ide", pragmas.excludeIdeData);
  3703. args: [],
  3704. source: "level\x0a\x09^ level",
  3705. referencedClasses: [],
  3706. //>>excludeEnd("ide");
  3707. messageSends: []
  3708. }),
  3709. $globals.ClassSorterNode);
  3710. $core.addMethod(
  3711. $core.method({
  3712. selector: "level:",
  3713. protocol: "accessing",
  3714. fn: function (anInteger){
  3715. var self=this;
  3716. self["@level"]=anInteger;
  3717. return self;
  3718. },
  3719. //>>excludeStart("ide", pragmas.excludeIdeData);
  3720. args: ["anInteger"],
  3721. source: "level: anInteger\x0a\x09level := anInteger",
  3722. referencedClasses: [],
  3723. //>>excludeEnd("ide");
  3724. messageSends: []
  3725. }),
  3726. $globals.ClassSorterNode);
  3727. $core.addMethod(
  3728. $core.method({
  3729. selector: "nodes",
  3730. protocol: "accessing",
  3731. fn: function (){
  3732. var self=this;
  3733. return self["@nodes"];
  3734. },
  3735. //>>excludeStart("ide", pragmas.excludeIdeData);
  3736. args: [],
  3737. source: "nodes\x0a\x09^ nodes",
  3738. referencedClasses: [],
  3739. //>>excludeEnd("ide");
  3740. messageSends: []
  3741. }),
  3742. $globals.ClassSorterNode);
  3743. $core.addMethod(
  3744. $core.method({
  3745. selector: "theClass",
  3746. protocol: "accessing",
  3747. fn: function (){
  3748. var self=this;
  3749. return self["@theClass"];
  3750. },
  3751. //>>excludeStart("ide", pragmas.excludeIdeData);
  3752. args: [],
  3753. source: "theClass\x0a\x09^ theClass",
  3754. referencedClasses: [],
  3755. //>>excludeEnd("ide");
  3756. messageSends: []
  3757. }),
  3758. $globals.ClassSorterNode);
  3759. $core.addMethod(
  3760. $core.method({
  3761. selector: "theClass:",
  3762. protocol: "accessing",
  3763. fn: function (aClass){
  3764. var self=this;
  3765. self["@theClass"]=aClass;
  3766. return self;
  3767. },
  3768. //>>excludeStart("ide", pragmas.excludeIdeData);
  3769. args: ["aClass"],
  3770. source: "theClass: aClass\x0a\x09theClass := aClass",
  3771. referencedClasses: [],
  3772. //>>excludeEnd("ide");
  3773. messageSends: []
  3774. }),
  3775. $globals.ClassSorterNode);
  3776. $core.addMethod(
  3777. $core.method({
  3778. selector: "traverseClassesWith:",
  3779. protocol: "visiting",
  3780. fn: function (aCollection){
  3781. var self=this;
  3782. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3783. return $core.withContext(function($ctx1) {
  3784. //>>excludeEnd("ctx");
  3785. var $1,$3,$2;
  3786. $1=self._theClass();
  3787. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3788. $ctx1.sendIdx["theClass"]=1;
  3789. //>>excludeEnd("ctx");
  3790. $recv(aCollection)._add_($1);
  3791. $recv($recv(self._nodes())._sorted_((function(a,b){
  3792. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3793. return $core.withContext(function($ctx2) {
  3794. //>>excludeEnd("ctx");
  3795. $3=$recv(a)._theClass();
  3796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3797. $ctx2.sendIdx["theClass"]=2;
  3798. //>>excludeEnd("ctx");
  3799. $2=$recv($3)._name();
  3800. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3801. $ctx2.sendIdx["name"]=1;
  3802. //>>excludeEnd("ctx");
  3803. return $recv($2).__lt_eq($recv($recv(b)._theClass())._name());
  3804. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3805. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,1)});
  3806. //>>excludeEnd("ctx");
  3807. })))._do_((function(aNode){
  3808. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3809. return $core.withContext(function($ctx2) {
  3810. //>>excludeEnd("ctx");
  3811. return $recv(aNode)._traverseClassesWith_(aCollection);
  3812. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3813. }, function($ctx2) {$ctx2.fillBlock({aNode:aNode},$ctx1,2)});
  3814. //>>excludeEnd("ctx");
  3815. }));
  3816. return self;
  3817. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3818. }, function($ctx1) {$ctx1.fill(self,"traverseClassesWith:",{aCollection:aCollection},$globals.ClassSorterNode)});
  3819. //>>excludeEnd("ctx");
  3820. },
  3821. //>>excludeStart("ide", pragmas.excludeIdeData);
  3822. args: ["aCollection"],
  3823. 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 ].",
  3824. referencedClasses: [],
  3825. //>>excludeEnd("ide");
  3826. messageSends: ["add:", "theClass", "do:", "sorted:", "nodes", "<=", "name", "traverseClassesWith:"]
  3827. }),
  3828. $globals.ClassSorterNode);
  3829. $core.addMethod(
  3830. $core.method({
  3831. selector: "on:classes:level:",
  3832. protocol: "instance creation",
  3833. fn: function (aClass,aCollection,anInteger){
  3834. var self=this;
  3835. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3836. return $core.withContext(function($ctx1) {
  3837. //>>excludeEnd("ctx");
  3838. var $1;
  3839. $1=self._new();
  3840. $recv($1)._theClass_(aClass);
  3841. $recv($1)._level_(anInteger);
  3842. $recv($1)._getNodesFrom_(aCollection);
  3843. return $recv($1)._yourself();
  3844. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3845. }, function($ctx1) {$ctx1.fill(self,"on:classes:level:",{aClass:aClass,aCollection:aCollection,anInteger:anInteger},$globals.ClassSorterNode.a$cls)});
  3846. //>>excludeEnd("ctx");
  3847. },
  3848. //>>excludeStart("ide", pragmas.excludeIdeData);
  3849. args: ["aClass", "aCollection", "anInteger"],
  3850. 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",
  3851. referencedClasses: [],
  3852. //>>excludeEnd("ide");
  3853. messageSends: ["theClass:", "new", "level:", "getNodesFrom:", "yourself"]
  3854. }),
  3855. $globals.ClassSorterNode.a$cls);
  3856. $core.addClass("TraitTransformation", $globals.Object, ["trait", "aliases", "exclusions"], "Kernel-Classes");
  3857. //>>excludeStart("ide", pragmas.excludeIdeData);
  3858. $globals.TraitTransformation.comment="I am a single step in trait composition.\x0a\x0aI represent one trait including its aliases and exclusions.";
  3859. //>>excludeEnd("ide");
  3860. $core.addMethod(
  3861. $core.method({
  3862. selector: "-",
  3863. protocol: "composition",
  3864. fn: function (anArray){
  3865. var self=this;
  3866. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3867. return $core.withContext(function($ctx1) {
  3868. //>>excludeEnd("ctx");
  3869. var $1;
  3870. $1=self._copy();
  3871. $recv($1)._addExclusions_(anArray);
  3872. return $recv($1)._yourself();
  3873. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3874. }, function($ctx1) {$ctx1.fill(self,"-",{anArray:anArray},$globals.TraitTransformation)});
  3875. //>>excludeEnd("ctx");
  3876. },
  3877. //>>excludeStart("ide", pragmas.excludeIdeData);
  3878. args: ["anArray"],
  3879. source: "- anArray\x0a\x09^ self copy addExclusions: anArray; yourself",
  3880. referencedClasses: [],
  3881. //>>excludeEnd("ide");
  3882. messageSends: ["addExclusions:", "copy", "yourself"]
  3883. }),
  3884. $globals.TraitTransformation);
  3885. $core.addMethod(
  3886. $core.method({
  3887. selector: "@",
  3888. protocol: "composition",
  3889. fn: function (anArrayOfAssociations){
  3890. var self=this;
  3891. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3892. return $core.withContext(function($ctx1) {
  3893. //>>excludeEnd("ctx");
  3894. var $1;
  3895. $1=self._copy();
  3896. $recv($1)._addAliases_(anArrayOfAssociations);
  3897. return $recv($1)._yourself();
  3898. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3899. }, function($ctx1) {$ctx1.fill(self,"@",{anArrayOfAssociations:anArrayOfAssociations},$globals.TraitTransformation)});
  3900. //>>excludeEnd("ctx");
  3901. },
  3902. //>>excludeStart("ide", pragmas.excludeIdeData);
  3903. args: ["anArrayOfAssociations"],
  3904. source: "@ anArrayOfAssociations\x0a\x09^ self copy addAliases: anArrayOfAssociations; yourself",
  3905. referencedClasses: [],
  3906. //>>excludeEnd("ide");
  3907. messageSends: ["addAliases:", "copy", "yourself"]
  3908. }),
  3909. $globals.TraitTransformation);
  3910. $core.addMethod(
  3911. $core.method({
  3912. selector: "addAliases:",
  3913. protocol: "accessing",
  3914. fn: function (anArrayOfAssociations){
  3915. var self=this;
  3916. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3917. return $core.withContext(function($ctx1) {
  3918. //>>excludeEnd("ctx");
  3919. $recv(anArrayOfAssociations)._do_((function(each){
  3920. var key;
  3921. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3922. return $core.withContext(function($ctx2) {
  3923. //>>excludeEnd("ctx");
  3924. key=$recv(each)._key();
  3925. key;
  3926. return $recv(self["@aliases"])._at_ifPresent_ifAbsent_(key,(function(){
  3927. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3928. return $core.withContext(function($ctx3) {
  3929. //>>excludeEnd("ctx");
  3930. return self._error_("Cannot use same alias name twice.");
  3931. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3932. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  3933. //>>excludeEnd("ctx");
  3934. }),(function(){
  3935. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3936. return $core.withContext(function($ctx3) {
  3937. //>>excludeEnd("ctx");
  3938. return $recv(self["@aliases"])._at_put_(key,$recv(each)._value());
  3939. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3940. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)});
  3941. //>>excludeEnd("ctx");
  3942. }));
  3943. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3944. }, function($ctx2) {$ctx2.fillBlock({each:each,key:key},$ctx1,1)});
  3945. //>>excludeEnd("ctx");
  3946. }));
  3947. return anArrayOfAssociations;
  3948. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3949. }, function($ctx1) {$ctx1.fill(self,"addAliases:",{anArrayOfAssociations:anArrayOfAssociations},$globals.TraitTransformation)});
  3950. //>>excludeEnd("ctx");
  3951. },
  3952. //>>excludeStart("ide", pragmas.excludeIdeData);
  3953. args: ["anArrayOfAssociations"],
  3954. source: "addAliases: anArrayOfAssociations\x0a\x09anArrayOfAssociations do: [ :each |\x0a\x09\x09| key |\x0a\x09\x09key := each key.\x0a\x09\x09aliases at: key\x0a\x09\x09\x09ifPresent: [ self error: 'Cannot use same alias name twice.' ]\x0a\x09\x09\x09ifAbsent: [ aliases at: key put: each value ] ].\x0a\x09^ anArrayOfAssociations",
  3955. referencedClasses: [],
  3956. //>>excludeEnd("ide");
  3957. messageSends: ["do:", "key", "at:ifPresent:ifAbsent:", "error:", "at:put:", "value"]
  3958. }),
  3959. $globals.TraitTransformation);
  3960. $core.addMethod(
  3961. $core.method({
  3962. selector: "addExclusions:",
  3963. protocol: "accessing",
  3964. fn: function (anArray){
  3965. var self=this;
  3966. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3967. return $core.withContext(function($ctx1) {
  3968. //>>excludeEnd("ctx");
  3969. $recv(self["@exclusions"])._addAll_(anArray);
  3970. return anArray;
  3971. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3972. }, function($ctx1) {$ctx1.fill(self,"addExclusions:",{anArray:anArray},$globals.TraitTransformation)});
  3973. //>>excludeEnd("ctx");
  3974. },
  3975. //>>excludeStart("ide", pragmas.excludeIdeData);
  3976. args: ["anArray"],
  3977. source: "addExclusions: anArray\x0a\x09exclusions addAll: anArray.\x0a\x09^ anArray",
  3978. referencedClasses: [],
  3979. //>>excludeEnd("ide");
  3980. messageSends: ["addAll:"]
  3981. }),
  3982. $globals.TraitTransformation);
  3983. $core.addMethod(
  3984. $core.method({
  3985. selector: "aliases",
  3986. protocol: "accessing",
  3987. fn: function (){
  3988. var self=this;
  3989. return self["@aliases"];
  3990. },
  3991. //>>excludeStart("ide", pragmas.excludeIdeData);
  3992. args: [],
  3993. source: "aliases\x0a\x09^ aliases",
  3994. referencedClasses: [],
  3995. //>>excludeEnd("ide");
  3996. messageSends: []
  3997. }),
  3998. $globals.TraitTransformation);
  3999. $core.addMethod(
  4000. $core.method({
  4001. selector: "asJavaScriptObject",
  4002. protocol: "converting",
  4003. fn: function (){
  4004. var self=this;
  4005. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4006. return $core.withContext(function($ctx1) {
  4007. //>>excludeEnd("ctx");
  4008. return $globals.HashedCollection._newFromPairs_(["trait",self._trait(),"aliases",self._aliases(),"exclusions",$recv($recv(self._exclusions())._asArray())._sorted()]);
  4009. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4010. }, function($ctx1) {$ctx1.fill(self,"asJavaScriptObject",{},$globals.TraitTransformation)});
  4011. //>>excludeEnd("ctx");
  4012. },
  4013. //>>excludeStart("ide", pragmas.excludeIdeData);
  4014. args: [],
  4015. source: "asJavaScriptObject\x0a\x09^ #{\x0a\x09\x09'trait' -> self trait.\x0a\x09\x09'aliases' -> self aliases.\x0a\x09\x09'exclusions' -> self exclusions asArray sorted }",
  4016. referencedClasses: [],
  4017. //>>excludeEnd("ide");
  4018. messageSends: ["trait", "aliases", "sorted", "asArray", "exclusions"]
  4019. }),
  4020. $globals.TraitTransformation);
  4021. $core.addMethod(
  4022. $core.method({
  4023. selector: "asJavaScriptSource",
  4024. protocol: "converting",
  4025. fn: function (){
  4026. var self=this;
  4027. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4028. return $core.withContext(function($ctx1) {
  4029. //>>excludeEnd("ctx");
  4030. var $2,$3,$1;
  4031. return $recv($globals.String)._streamContents_((function(str){
  4032. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4033. return $core.withContext(function($ctx2) {
  4034. //>>excludeEnd("ctx");
  4035. $2=$recv(self._trait())._asJavaScriptSource();
  4036. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4037. $ctx2.sendIdx["asJavaScriptSource"]=1;
  4038. //>>excludeEnd("ctx");
  4039. $3=$recv(self._aliases())._ifNotEmpty_((function(al){
  4040. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4041. return $core.withContext(function($ctx3) {
  4042. //>>excludeEnd("ctx");
  4043. return [", aliases: ",$recv(al)._asJSONString()];
  4044. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4045. }, function($ctx3) {$ctx3.fillBlock({al:al},$ctx2,2)});
  4046. //>>excludeEnd("ctx");
  4047. }));
  4048. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4049. $ctx2.sendIdx["ifNotEmpty:"]=1;
  4050. //>>excludeEnd("ctx");
  4051. $1=["{trait: ",$2,$3,$recv(self._exclusions())._ifNotEmpty_((function(ex){
  4052. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4053. return $core.withContext(function($ctx3) {
  4054. //>>excludeEnd("ctx");
  4055. return [", exclusions: ",$recv($recv($recv(ex)._asArray())._sorted())._asJavaScriptSource()];
  4056. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4057. }, function($ctx3) {$ctx3.fillBlock({ex:ex},$ctx2,3)});
  4058. //>>excludeEnd("ctx");
  4059. })),"}"];
  4060. return $recv(str)._write_($1);
  4061. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4062. }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1,1)});
  4063. //>>excludeEnd("ctx");
  4064. }));
  4065. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4066. }, function($ctx1) {$ctx1.fill(self,"asJavaScriptSource",{},$globals.TraitTransformation)});
  4067. //>>excludeEnd("ctx");
  4068. },
  4069. //>>excludeStart("ide", pragmas.excludeIdeData);
  4070. args: [],
  4071. source: "asJavaScriptSource\x0a\x09^ String streamContents: [ :str | str write: {\x0a\x09\x09'{trait: '. self trait asJavaScriptSource.\x0a\x09\x09self aliases ifNotEmpty: [ :al |\x0a\x09\x09\x09{', aliases: '. al asJSONString} ].\x0a\x09\x09self exclusions ifNotEmpty: [ :ex |\x0a\x09\x09\x09{', exclusions: '. ex asArray sorted asJavaScriptSource} ].\x0a\x09\x09'}' } ]",
  4072. referencedClasses: ["String"],
  4073. //>>excludeEnd("ide");
  4074. messageSends: ["streamContents:", "write:", "asJavaScriptSource", "trait", "ifNotEmpty:", "aliases", "asJSONString", "exclusions", "sorted", "asArray"]
  4075. }),
  4076. $globals.TraitTransformation);
  4077. $core.addMethod(
  4078. $core.method({
  4079. selector: "asTraitComposition",
  4080. protocol: "converting",
  4081. fn: function (){
  4082. var self=this;
  4083. return [self];
  4084. },
  4085. //>>excludeStart("ide", pragmas.excludeIdeData);
  4086. args: [],
  4087. source: "asTraitComposition\x0a\x09^ { self }",
  4088. referencedClasses: [],
  4089. //>>excludeEnd("ide");
  4090. messageSends: []
  4091. }),
  4092. $globals.TraitTransformation);
  4093. $core.addMethod(
  4094. $core.method({
  4095. selector: "asTraitTransformation",
  4096. protocol: "converting",
  4097. fn: function (){
  4098. var self=this;
  4099. return self;
  4100. },
  4101. //>>excludeStart("ide", pragmas.excludeIdeData);
  4102. args: [],
  4103. source: "asTraitTransformation\x0a\x09^ self",
  4104. referencedClasses: [],
  4105. //>>excludeEnd("ide");
  4106. messageSends: []
  4107. }),
  4108. $globals.TraitTransformation);
  4109. $core.addMethod(
  4110. $core.method({
  4111. selector: "definition",
  4112. protocol: "accessing",
  4113. fn: function (){
  4114. var self=this;
  4115. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4116. return $core.withContext(function($ctx1) {
  4117. //>>excludeEnd("ctx");
  4118. return $recv($globals.String)._streamContents_((function(str){
  4119. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4120. return $core.withContext(function($ctx2) {
  4121. //>>excludeEnd("ctx");
  4122. $recv(str)._print_(self._trait());
  4123. $recv(self._aliases())._ifNotEmpty_((function(al){
  4124. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4125. return $core.withContext(function($ctx3) {
  4126. //>>excludeEnd("ctx");
  4127. $recv(str)._write_(" @ {");
  4128. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4129. $ctx3.sendIdx["write:"]=1;
  4130. //>>excludeEnd("ctx");
  4131. $recv($recv(al)._associations())._do_separatedBy_((function(each){
  4132. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4133. return $core.withContext(function($ctx4) {
  4134. //>>excludeEnd("ctx");
  4135. $recv(str)._printSymbol_($recv(each)._key());
  4136. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4137. $ctx4.sendIdx["printSymbol:"]=1;
  4138. //>>excludeEnd("ctx");
  4139. $recv(str)._write_(" -> ");
  4140. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4141. $ctx4.sendIdx["write:"]=2;
  4142. //>>excludeEnd("ctx");
  4143. return $recv(str)._printSymbol_($recv(each)._value());
  4144. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4145. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3,3)});
  4146. //>>excludeEnd("ctx");
  4147. }),(function(){
  4148. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4149. return $core.withContext(function($ctx4) {
  4150. //>>excludeEnd("ctx");
  4151. return $recv(str)._write_(". ");
  4152. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4153. $ctx4.sendIdx["write:"]=3;
  4154. //>>excludeEnd("ctx");
  4155. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4156. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,4)});
  4157. //>>excludeEnd("ctx");
  4158. }));
  4159. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4160. $ctx3.sendIdx["do:separatedBy:"]=1;
  4161. //>>excludeEnd("ctx");
  4162. return $recv(str)._write_("}");
  4163. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4164. $ctx3.sendIdx["write:"]=4;
  4165. //>>excludeEnd("ctx");
  4166. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4167. }, function($ctx3) {$ctx3.fillBlock({al:al},$ctx2,2)});
  4168. //>>excludeEnd("ctx");
  4169. }));
  4170. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4171. $ctx2.sendIdx["ifNotEmpty:"]=1;
  4172. //>>excludeEnd("ctx");
  4173. return $recv(self._exclusions())._ifNotEmpty_((function(ex){
  4174. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4175. return $core.withContext(function($ctx3) {
  4176. //>>excludeEnd("ctx");
  4177. $recv(str)._write_(" - #(");
  4178. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4179. $ctx3.sendIdx["write:"]=5;
  4180. //>>excludeEnd("ctx");
  4181. $recv($recv($recv(ex)._asArray())._sorted())._do_separatedBy_((function(each){
  4182. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4183. return $core.withContext(function($ctx4) {
  4184. //>>excludeEnd("ctx");
  4185. return $recv(str)._write_($recv($recv(each)._symbolPrintString())._allButFirst());
  4186. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4187. $ctx4.sendIdx["write:"]=6;
  4188. //>>excludeEnd("ctx");
  4189. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4190. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3,6)});
  4191. //>>excludeEnd("ctx");
  4192. }),(function(){
  4193. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4194. return $core.withContext(function($ctx4) {
  4195. //>>excludeEnd("ctx");
  4196. return $recv(str)._space();
  4197. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4198. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,7)});
  4199. //>>excludeEnd("ctx");
  4200. }));
  4201. return $recv(str)._write_(")");
  4202. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4203. }, function($ctx3) {$ctx3.fillBlock({ex:ex},$ctx2,5)});
  4204. //>>excludeEnd("ctx");
  4205. }));
  4206. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4207. }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1,1)});
  4208. //>>excludeEnd("ctx");
  4209. }));
  4210. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4211. }, function($ctx1) {$ctx1.fill(self,"definition",{},$globals.TraitTransformation)});
  4212. //>>excludeEnd("ctx");
  4213. },
  4214. //>>excludeStart("ide", pragmas.excludeIdeData);
  4215. args: [],
  4216. source: "definition\x0a\x09^ String streamContents: [ :str |\x0a\x09\x09str print: self trait.\x0a\x09\x09self aliases ifNotEmpty: [ :al |\x0a\x09\x09\x09str write: ' @ {'.\x0a\x09\x09\x09al associations\x0a\x09\x09\x09\x09do: [ :each | str printSymbol: each key; write: ' -> '; printSymbol: each value ]\x0a\x09\x09\x09\x09separatedBy: [ str write: '. ' ].\x0a\x09\x09\x09str write: '}' ].\x0a\x09\x09self exclusions ifNotEmpty: [ :ex |\x0a\x09\x09\x09str write: ' - #('.\x0a\x09\x09\x09ex asArray sorted \x0a\x09\x09\x09\x09do: [ :each | str write: each symbolPrintString allButFirst ]\x0a\x09\x09\x09\x09separatedBy: [ str space ].\x0a\x09\x09\x09str write: ')' ] ]",
  4217. referencedClasses: ["String"],
  4218. //>>excludeEnd("ide");
  4219. messageSends: ["streamContents:", "print:", "trait", "ifNotEmpty:", "aliases", "write:", "do:separatedBy:", "associations", "printSymbol:", "key", "value", "exclusions", "sorted", "asArray", "allButFirst", "symbolPrintString", "space"]
  4220. }),
  4221. $globals.TraitTransformation);
  4222. $core.addMethod(
  4223. $core.method({
  4224. selector: "exclusions",
  4225. protocol: "accessing",
  4226. fn: function (){
  4227. var self=this;
  4228. return self["@exclusions"];
  4229. },
  4230. //>>excludeStart("ide", pragmas.excludeIdeData);
  4231. args: [],
  4232. source: "exclusions\x0a\x09^ exclusions",
  4233. referencedClasses: [],
  4234. //>>excludeEnd("ide");
  4235. messageSends: []
  4236. }),
  4237. $globals.TraitTransformation);
  4238. $core.addMethod(
  4239. $core.method({
  4240. selector: "initialize",
  4241. protocol: "initialization",
  4242. fn: function (){
  4243. var self=this;
  4244. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4245. return $core.withContext(function($ctx1) {
  4246. //>>excludeEnd("ctx");
  4247. (
  4248. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4249. $ctx1.supercall = true,
  4250. //>>excludeEnd("ctx");
  4251. ($globals.TraitTransformation.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($recv(self), []));
  4252. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4253. $ctx1.supercall = false;
  4254. //>>excludeEnd("ctx");;
  4255. self["@aliases"]=$globals.HashedCollection._newFromPairs_([]);
  4256. self["@exclusions"]=$recv($globals.Set)._new();
  4257. self["@trait"]=nil;
  4258. return self;
  4259. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4260. }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.TraitTransformation)});
  4261. //>>excludeEnd("ctx");
  4262. },
  4263. //>>excludeStart("ide", pragmas.excludeIdeData);
  4264. args: [],
  4265. source: "initialize\x0a\x09super initialize.\x0a\x0a\x09aliases := #{}.\x0a\x09exclusions := Set new.\x0a\x09trait := nil",
  4266. referencedClasses: ["Set"],
  4267. //>>excludeEnd("ide");
  4268. messageSends: ["initialize", "new"]
  4269. }),
  4270. $globals.TraitTransformation);
  4271. $core.addMethod(
  4272. $core.method({
  4273. selector: "postCopy",
  4274. protocol: "copying",
  4275. fn: function (){
  4276. var self=this;
  4277. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4278. return $core.withContext(function($ctx1) {
  4279. //>>excludeEnd("ctx");
  4280. self["@aliases"]=$recv(self["@aliases"])._copy();
  4281. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4282. $ctx1.sendIdx["copy"]=1;
  4283. //>>excludeEnd("ctx");
  4284. self["@exclusions"]=$recv(self["@exclusions"])._copy();
  4285. return self;
  4286. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4287. }, function($ctx1) {$ctx1.fill(self,"postCopy",{},$globals.TraitTransformation)});
  4288. //>>excludeEnd("ctx");
  4289. },
  4290. //>>excludeStart("ide", pragmas.excludeIdeData);
  4291. args: [],
  4292. source: "postCopy\x0a\x09aliases := aliases copy.\x0a\x09exclusions := exclusions copy",
  4293. referencedClasses: [],
  4294. //>>excludeEnd("ide");
  4295. messageSends: ["copy"]
  4296. }),
  4297. $globals.TraitTransformation);
  4298. $core.addMethod(
  4299. $core.method({
  4300. selector: "trait",
  4301. protocol: "accessing",
  4302. fn: function (){
  4303. var self=this;
  4304. return self["@trait"];
  4305. },
  4306. //>>excludeStart("ide", pragmas.excludeIdeData);
  4307. args: [],
  4308. source: "trait\x0a\x09^ trait",
  4309. referencedClasses: [],
  4310. //>>excludeEnd("ide");
  4311. messageSends: []
  4312. }),
  4313. $globals.TraitTransformation);
  4314. $core.addMethod(
  4315. $core.method({
  4316. selector: "trait:",
  4317. protocol: "accessing",
  4318. fn: function (anObject){
  4319. var self=this;
  4320. self["@trait"]=anObject;
  4321. return self;
  4322. },
  4323. //>>excludeStart("ide", pragmas.excludeIdeData);
  4324. args: ["anObject"],
  4325. source: "trait: anObject\x0a\x09trait := anObject",
  4326. referencedClasses: [],
  4327. //>>excludeEnd("ide");
  4328. messageSends: []
  4329. }),
  4330. $globals.TraitTransformation);
  4331. $core.addMethod(
  4332. $core.method({
  4333. selector: "fromJSON:",
  4334. protocol: "instance creation",
  4335. fn: function (aJSObject){
  4336. var self=this;
  4337. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4338. return $core.withContext(function($ctx1) {
  4339. //>>excludeEnd("ctx");
  4340. var $1,$4,$3,$2;
  4341. $1=(
  4342. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4343. $ctx1.supercall = true,
  4344. //>>excludeEnd("ctx");
  4345. ($globals.TraitTransformation.a$cls.superclass||$boot.nilAsClass).fn.prototype._new.apply($recv(self), []));
  4346. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4347. $ctx1.supercall = false;
  4348. //>>excludeEnd("ctx");;
  4349. $recv($1)._trait_($recv(aJSObject)._at_("trait"));
  4350. $4=$recv(aJSObject)._at_ifAbsent_("aliases",(function(){
  4351. return $globals.HashedCollection._newFromPairs_([]);
  4352. }));
  4353. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4354. $ctx1.sendIdx["at:ifAbsent:"]=1;
  4355. //>>excludeEnd("ctx");
  4356. $3=$recv($globals.Smalltalk)._readJSObject_($4);
  4357. $2=$recv($3)._associations();
  4358. $recv($1)._addAliases_($2);
  4359. $recv($1)._addExclusions_($recv(aJSObject)._at_ifAbsent_("exclusions",(function(){
  4360. return [];
  4361. })));
  4362. return $recv($1)._yourself();
  4363. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4364. }, function($ctx1) {$ctx1.fill(self,"fromJSON:",{aJSObject:aJSObject},$globals.TraitTransformation.a$cls)});
  4365. //>>excludeEnd("ctx");
  4366. },
  4367. //>>excludeStart("ide", pragmas.excludeIdeData);
  4368. args: ["aJSObject"],
  4369. source: "fromJSON: aJSObject\x0a\x09^ super new\x0a\x09\x09trait: (aJSObject at: #trait);\x0a\x09\x09addAliases: (Smalltalk readJSObject: (aJSObject at: #aliases ifAbsent: [#{}])) associations;\x0a\x09\x09addExclusions: (aJSObject at: #exclusions ifAbsent: [#()]);\x0a\x09\x09yourself",
  4370. referencedClasses: ["Smalltalk"],
  4371. //>>excludeEnd("ide");
  4372. messageSends: ["trait:", "new", "at:", "addAliases:", "associations", "readJSObject:", "at:ifAbsent:", "addExclusions:", "yourself"]
  4373. }),
  4374. $globals.TraitTransformation.a$cls);
  4375. $core.addMethod(
  4376. $core.method({
  4377. selector: "on:",
  4378. protocol: "instance creation",
  4379. fn: function (aTrait){
  4380. var self=this;
  4381. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4382. return $core.withContext(function($ctx1) {
  4383. //>>excludeEnd("ctx");
  4384. var $1;
  4385. $1=(
  4386. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4387. $ctx1.supercall = true,
  4388. //>>excludeEnd("ctx");
  4389. ($globals.TraitTransformation.a$cls.superclass||$boot.nilAsClass).fn.prototype._new.apply($recv(self), []));
  4390. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4391. $ctx1.supercall = false;
  4392. //>>excludeEnd("ctx");;
  4393. $recv($1)._trait_(aTrait);
  4394. return $recv($1)._yourself();
  4395. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4396. }, function($ctx1) {$ctx1.fill(self,"on:",{aTrait:aTrait},$globals.TraitTransformation.a$cls)});
  4397. //>>excludeEnd("ctx");
  4398. },
  4399. //>>excludeStart("ide", pragmas.excludeIdeData);
  4400. args: ["aTrait"],
  4401. source: "on: aTrait\x0a\x09^ super new trait: aTrait; yourself",
  4402. referencedClasses: [],
  4403. //>>excludeEnd("ide");
  4404. messageSends: ["trait:", "new", "yourself"]
  4405. }),
  4406. $globals.TraitTransformation.a$cls);
  4407. $core.addMethod(
  4408. $core.method({
  4409. selector: "asTraitComposition",
  4410. protocol: "*Kernel-Classes",
  4411. fn: function (){
  4412. var self=this;
  4413. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4414. return $core.withContext(function($ctx1) {
  4415. //>>excludeEnd("ctx");
  4416. return self._collect_((function(each){
  4417. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4418. return $core.withContext(function($ctx2) {
  4419. //>>excludeEnd("ctx");
  4420. return $recv(each)._asTraitTransformation();
  4421. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4422. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  4423. //>>excludeEnd("ctx");
  4424. }));
  4425. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4426. }, function($ctx1) {$ctx1.fill(self,"asTraitComposition",{},$globals.Array)});
  4427. //>>excludeEnd("ctx");
  4428. },
  4429. //>>excludeStart("ide", pragmas.excludeIdeData);
  4430. args: [],
  4431. source: "asTraitComposition\x0a\x09\x22not implemented yet, noop atm\x22\x0a\x09^ self collect: [ :each | each asTraitTransformation ]",
  4432. referencedClasses: [],
  4433. //>>excludeEnd("ide");
  4434. messageSends: ["collect:", "asTraitTransformation"]
  4435. }),
  4436. $globals.Array);
  4437. $core.addMethod(
  4438. $core.method({
  4439. selector: "subclass:",
  4440. protocol: "*Kernel-Classes",
  4441. fn: function (aString){
  4442. var self=this;
  4443. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4444. return $core.withContext(function($ctx1) {
  4445. //>>excludeEnd("ctx");
  4446. return self._subclass_instanceVariableNames_package_(aString,"",nil);
  4447. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4448. }, function($ctx1) {$ctx1.fill(self,"subclass:",{aString:aString},$globals.UndefinedObject)});
  4449. //>>excludeEnd("ctx");
  4450. },
  4451. //>>excludeStart("ide", pragmas.excludeIdeData);
  4452. args: ["aString"],
  4453. source: "subclass: aString \x0a\x09\x22Kept for file-in compatibility.\x22\x0a\x09^ self subclass: aString instanceVariableNames: '' package: nil",
  4454. referencedClasses: [],
  4455. //>>excludeEnd("ide");
  4456. messageSends: ["subclass:instanceVariableNames:package:"]
  4457. }),
  4458. $globals.UndefinedObject);
  4459. $core.addMethod(
  4460. $core.method({
  4461. selector: "subclass:instanceVariableNames:",
  4462. protocol: "*Kernel-Classes",
  4463. fn: function (aString,anotherString){
  4464. var self=this;
  4465. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4466. return $core.withContext(function($ctx1) {
  4467. //>>excludeEnd("ctx");
  4468. return self._subclass_instanceVariableNames_package_(aString,anotherString,nil);
  4469. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4470. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:",{aString:aString,anotherString:anotherString},$globals.UndefinedObject)});
  4471. //>>excludeEnd("ctx");
  4472. },
  4473. //>>excludeStart("ide", pragmas.excludeIdeData);
  4474. args: ["aString", "anotherString"],
  4475. source: "subclass: aString instanceVariableNames: anotherString\x0a\x09\x22Kept for file-in compatibility.\x22\x0a\x09^ self subclass: aString instanceVariableNames: anotherString package: nil",
  4476. referencedClasses: [],
  4477. //>>excludeEnd("ide");
  4478. messageSends: ["subclass:instanceVariableNames:package:"]
  4479. }),
  4480. $globals.UndefinedObject);
  4481. $core.addMethod(
  4482. $core.method({
  4483. selector: "subclass:instanceVariableNames:category:",
  4484. protocol: "*Kernel-Classes",
  4485. fn: function (aString,aString2,aString3){
  4486. var self=this;
  4487. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4488. return $core.withContext(function($ctx1) {
  4489. //>>excludeEnd("ctx");
  4490. return self._subclass_instanceVariableNames_package_(aString,aString2,aString3);
  4491. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4492. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:category:",{aString:aString,aString2:aString2,aString3:aString3},$globals.UndefinedObject)});
  4493. //>>excludeEnd("ctx");
  4494. },
  4495. //>>excludeStart("ide", pragmas.excludeIdeData);
  4496. args: ["aString", "aString2", "aString3"],
  4497. source: "subclass: aString instanceVariableNames: aString2 category: aString3\x0a\x09\x22Kept for file-in compatibility.\x22\x0a\x09^ self subclass: aString instanceVariableNames: aString2 package: aString3",
  4498. referencedClasses: [],
  4499. //>>excludeEnd("ide");
  4500. messageSends: ["subclass:instanceVariableNames:package:"]
  4501. }),
  4502. $globals.UndefinedObject);
  4503. $core.addMethod(
  4504. $core.method({
  4505. selector: "subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:",
  4506. protocol: "*Kernel-Classes",
  4507. fn: function (aString,aString2,classVars,pools,aString3){
  4508. var self=this;
  4509. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4510. return $core.withContext(function($ctx1) {
  4511. //>>excludeEnd("ctx");
  4512. return self._subclass_instanceVariableNames_package_(aString,aString2,aString3);
  4513. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4514. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:",{aString:aString,aString2:aString2,classVars:classVars,pools:pools,aString3:aString3},$globals.UndefinedObject)});
  4515. //>>excludeEnd("ctx");
  4516. },
  4517. //>>excludeStart("ide", pragmas.excludeIdeData);
  4518. args: ["aString", "aString2", "classVars", "pools", "aString3"],
  4519. 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",
  4520. referencedClasses: [],
  4521. //>>excludeEnd("ide");
  4522. messageSends: ["subclass:instanceVariableNames:package:"]
  4523. }),
  4524. $globals.UndefinedObject);
  4525. $core.addMethod(
  4526. $core.method({
  4527. selector: "subclass:instanceVariableNames:package:",
  4528. protocol: "*Kernel-Classes",
  4529. fn: function (aString,aString2,aString3){
  4530. var self=this;
  4531. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4532. return $core.withContext(function($ctx1) {
  4533. //>>excludeEnd("ctx");
  4534. return $recv($recv($globals.ClassBuilder)._new())._superclass_subclass_instanceVariableNames_package_(self,$recv(aString)._asString(),aString2,aString3);
  4535. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4536. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:package:",{aString:aString,aString2:aString2,aString3:aString3},$globals.UndefinedObject)});
  4537. //>>excludeEnd("ctx");
  4538. },
  4539. //>>excludeStart("ide", pragmas.excludeIdeData);
  4540. args: ["aString", "aString2", "aString3"],
  4541. source: "subclass: aString instanceVariableNames: aString2 package: aString3\x0a\x09^ ClassBuilder new\x0a\x09\x09superclass: self subclass: aString asString instanceVariableNames: aString2 package: aString3",
  4542. referencedClasses: ["ClassBuilder"],
  4543. //>>excludeEnd("ide");
  4544. messageSends: ["superclass:subclass:instanceVariableNames:package:", "new", "asString"]
  4545. }),
  4546. $globals.UndefinedObject);
  4547. $core.addMethod(
  4548. $core.method({
  4549. selector: "subclass:uses:",
  4550. protocol: "*Kernel-Classes",
  4551. fn: function (aString,aTraitCompositionDescription){
  4552. var self=this;
  4553. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4554. return $core.withContext(function($ctx1) {
  4555. //>>excludeEnd("ctx");
  4556. return self._subclass_uses_instanceVariableNames_package_(aString,aTraitCompositionDescription,"",nil);
  4557. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4558. }, function($ctx1) {$ctx1.fill(self,"subclass:uses:",{aString:aString,aTraitCompositionDescription:aTraitCompositionDescription},$globals.UndefinedObject)});
  4559. //>>excludeEnd("ctx");
  4560. },
  4561. //>>excludeStart("ide", pragmas.excludeIdeData);
  4562. args: ["aString", "aTraitCompositionDescription"],
  4563. source: "subclass: aString uses: aTraitCompositionDescription \x0a\x09\x22Kept for file-in compatibility.\x22\x0a\x09^ self subclass: aString uses: aTraitCompositionDescription instanceVariableNames: '' package: nil",
  4564. referencedClasses: [],
  4565. //>>excludeEnd("ide");
  4566. messageSends: ["subclass:uses:instanceVariableNames:package:"]
  4567. }),
  4568. $globals.UndefinedObject);
  4569. $core.addMethod(
  4570. $core.method({
  4571. selector: "subclass:uses:instanceVariableNames:",
  4572. protocol: "*Kernel-Classes",
  4573. fn: function (aString,aTraitCompositionDescription,anotherString){
  4574. var self=this;
  4575. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4576. return $core.withContext(function($ctx1) {
  4577. //>>excludeEnd("ctx");
  4578. return self._subclass_uses_instanceVariableNames_package_(aString,aTraitCompositionDescription,anotherString,nil);
  4579. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4580. }, function($ctx1) {$ctx1.fill(self,"subclass:uses:instanceVariableNames:",{aString:aString,aTraitCompositionDescription:aTraitCompositionDescription,anotherString:anotherString},$globals.UndefinedObject)});
  4581. //>>excludeEnd("ctx");
  4582. },
  4583. //>>excludeStart("ide", pragmas.excludeIdeData);
  4584. args: ["aString", "aTraitCompositionDescription", "anotherString"],
  4585. source: "subclass: aString uses: aTraitCompositionDescription instanceVariableNames: anotherString\x0a\x09\x22Kept for file-in compatibility.\x22\x0a\x09^ self subclass: aString uses: aTraitCompositionDescription instanceVariableNames: anotherString package: nil",
  4586. referencedClasses: [],
  4587. //>>excludeEnd("ide");
  4588. messageSends: ["subclass:uses:instanceVariableNames:package:"]
  4589. }),
  4590. $globals.UndefinedObject);
  4591. $core.addMethod(
  4592. $core.method({
  4593. selector: "subclass:uses:instanceVariableNames:category:",
  4594. protocol: "*Kernel-Classes",
  4595. fn: function (aString,aTraitCompositionDescription,aString2,aString3){
  4596. var self=this;
  4597. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4598. return $core.withContext(function($ctx1) {
  4599. //>>excludeEnd("ctx");
  4600. return self._subclass_uses_instanceVariableNames_package_(aString,aTraitCompositionDescription,aString2,aString3);
  4601. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4602. }, function($ctx1) {$ctx1.fill(self,"subclass:uses:instanceVariableNames:category:",{aString:aString,aTraitCompositionDescription:aTraitCompositionDescription,aString2:aString2,aString3:aString3},$globals.UndefinedObject)});
  4603. //>>excludeEnd("ctx");
  4604. },
  4605. //>>excludeStart("ide", pragmas.excludeIdeData);
  4606. args: ["aString", "aTraitCompositionDescription", "aString2", "aString3"],
  4607. source: "subclass: aString uses: aTraitCompositionDescription instanceVariableNames: aString2 category: aString3\x0a\x09\x22Kept for file-in compatibility.\x22\x0a\x09^ self subclass: aString uses: aTraitCompositionDescription instanceVariableNames: aString2 package: aString3",
  4608. referencedClasses: [],
  4609. //>>excludeEnd("ide");
  4610. messageSends: ["subclass:uses:instanceVariableNames:package:"]
  4611. }),
  4612. $globals.UndefinedObject);
  4613. $core.addMethod(
  4614. $core.method({
  4615. selector: "subclass:uses:instanceVariableNames:classVariableNames:poolDictionaries:category:",
  4616. protocol: "*Kernel-Classes",
  4617. fn: function (aString,aTraitCompositionDescription,aString2,classVars,pools,aString3){
  4618. var self=this;
  4619. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4620. return $core.withContext(function($ctx1) {
  4621. //>>excludeEnd("ctx");
  4622. return self._subclass_uses_instanceVariableNames_package_(aString,aTraitCompositionDescription,aString2,aString3);
  4623. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4624. }, function($ctx1) {$ctx1.fill(self,"subclass:uses:instanceVariableNames:classVariableNames:poolDictionaries:category:",{aString:aString,aTraitCompositionDescription:aTraitCompositionDescription,aString2:aString2,classVars:classVars,pools:pools,aString3:aString3},$globals.UndefinedObject)});
  4625. //>>excludeEnd("ctx");
  4626. },
  4627. //>>excludeStart("ide", pragmas.excludeIdeData);
  4628. args: ["aString", "aTraitCompositionDescription", "aString2", "classVars", "pools", "aString3"],
  4629. source: "subclass: aString uses: aTraitCompositionDescription 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 uses: aTraitCompositionDescription instanceVariableNames: aString2 package: aString3",
  4630. referencedClasses: [],
  4631. //>>excludeEnd("ide");
  4632. messageSends: ["subclass:uses:instanceVariableNames:package:"]
  4633. }),
  4634. $globals.UndefinedObject);
  4635. $core.addMethod(
  4636. $core.method({
  4637. selector: "subclass:uses:instanceVariableNames:package:",
  4638. protocol: "*Kernel-Classes",
  4639. fn: function (aString,aTraitCompositionDescription,aString2,aString3){
  4640. var self=this;
  4641. var cls;
  4642. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4643. return $core.withContext(function($ctx1) {
  4644. //>>excludeEnd("ctx");
  4645. cls=self._subclass_instanceVariableNames_package_(aString,aString2,aString3);
  4646. $recv(cls)._setTraitComposition_($recv(aTraitCompositionDescription)._asTraitComposition());
  4647. return cls;
  4648. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4649. }, function($ctx1) {$ctx1.fill(self,"subclass:uses:instanceVariableNames:package:",{aString:aString,aTraitCompositionDescription:aTraitCompositionDescription,aString2:aString2,aString3:aString3,cls:cls},$globals.UndefinedObject)});
  4650. //>>excludeEnd("ctx");
  4651. },
  4652. //>>excludeStart("ide", pragmas.excludeIdeData);
  4653. args: ["aString", "aTraitCompositionDescription", "aString2", "aString3"],
  4654. source: "subclass: aString uses: aTraitCompositionDescription instanceVariableNames: aString2 package: aString3\x0a\x09| cls |\x0a\x09cls := self subclass: aString instanceVariableNames: aString2 package: aString3.\x0a\x09cls setTraitComposition: aTraitCompositionDescription asTraitComposition.\x0a\x09^ cls",
  4655. referencedClasses: [],
  4656. //>>excludeEnd("ide");
  4657. messageSends: ["subclass:instanceVariableNames:package:", "setTraitComposition:", "asTraitComposition"]
  4658. }),
  4659. $globals.UndefinedObject);
  4660. });