Kernel-Classes.js 178 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873
  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.isNil){
  65. $6;
  66. } else {
  67. self._removeProtocolIfEmpty_($recv(oldMethod)._protocol());
  68. }
  69. $7=oldMethod;
  70. if(($receiver = $7) == null || $receiver.isNil){
  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.isNil){
  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.isNil){
  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.isNil){
  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.isNil){
  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.isNil){
  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.isNil){
  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(".klass");
  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, '.klass'",
  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.isNil){
  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.klass)});
  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.klass);
  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.klass)});
  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.klass);
  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.isNil){
  2940. $1;
  2941. } else {
  2942. $recv(theClass)._package_(thePackage);
  2943. $2=$recv($recv(theClass)._superclass()).__eq_eq(aClass);
  2944. if($core.assert($2)){
  2945. $3=theClass;
  2946. $recv($3)._recompile();
  2947. return $recv($3)._yourself();
  2948. } else {
  2949. return self._migrateClassNamed_superclass_instanceVariableNames_package_(className,aClass,aCollection,packageName);
  2950. }
  2951. }
  2952. return self._basicAddSubclassOf_named_instanceVariableNames_package_(aClass,className,aCollection,packageName);
  2953. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2954. }, function($ctx1) {$ctx1.fill(self,"addSubclassOf:named:instanceVariableNames:package:",{aClass:aClass,className:className,aCollection:aCollection,packageName:packageName,theClass:theClass,thePackage:thePackage},$globals.ClassBuilder)});
  2955. //>>excludeEnd("ctx");
  2956. },
  2957. //>>excludeStart("ide", pragmas.excludeIdeData);
  2958. args: ["aClass", "className", "aCollection", "packageName"],
  2959. 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\x09ifTrue: [ ^ theClass recompile; yourself ] ].\x0a\x09\x09\x0a\x09^ self\x0a\x09\x09basicAddSubclassOf: aClass\x0a\x09\x09named: className\x0a\x09\x09instanceVariableNames: aCollection\x0a\x09\x09package: packageName",
  2960. referencedClasses: ["Smalltalk", "Package"],
  2961. //>>excludeEnd("ide");
  2962. messageSends: ["at:", "globals", "named:", "ifNotNil:", "package:", "ifFalse:ifTrue:", "==", "superclass", "migrateClassNamed:superclass:instanceVariableNames:package:", "recompile", "yourself", "basicAddSubclassOf:named:instanceVariableNames:package:"]
  2963. }),
  2964. $globals.ClassBuilder);
  2965. $core.addMethod(
  2966. $core.method({
  2967. selector: "addTraitNamed:package:",
  2968. protocol: "class definition",
  2969. fn: function (traitName,packageName){
  2970. var self=this;
  2971. var theTrait,thePackage;
  2972. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2973. return $core.withContext(function($ctx1) {
  2974. //>>excludeEnd("ctx");
  2975. var $1,$2,$receiver;
  2976. theTrait=$recv($recv($globals.Smalltalk)._globals())._at_(traitName);
  2977. thePackage=$recv($globals.Package)._named_(packageName);
  2978. $1=theTrait;
  2979. if(($receiver = $1) == null || $receiver.isNil){
  2980. $1;
  2981. } else {
  2982. $2=theTrait;
  2983. $recv($2)._package_(thePackage);
  2984. $recv($2)._recompile();
  2985. return $recv($2)._yourself();
  2986. }
  2987. return self._basicAddTraitNamed_package_(traitName,packageName);
  2988. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2989. }, function($ctx1) {$ctx1.fill(self,"addTraitNamed:package:",{traitName:traitName,packageName:packageName,theTrait:theTrait,thePackage:thePackage},$globals.ClassBuilder)});
  2990. //>>excludeEnd("ctx");
  2991. },
  2992. //>>excludeStart("ide", pragmas.excludeIdeData);
  2993. args: ["traitName", "packageName"],
  2994. 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",
  2995. referencedClasses: ["Smalltalk", "Package"],
  2996. //>>excludeEnd("ide");
  2997. messageSends: ["at:", "globals", "named:", "ifNotNil:", "package:", "recompile", "yourself", "basicAddTraitNamed:package:"]
  2998. }),
  2999. $globals.ClassBuilder);
  3000. $core.addMethod(
  3001. $core.method({
  3002. selector: "basicAddSubclassOf:named:instanceVariableNames:package:",
  3003. protocol: "private",
  3004. fn: function (aClass,aString,aCollection,packageName){
  3005. var self=this;
  3006. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3007. return $core.withContext(function($ctx1) {
  3008. //>>excludeEnd("ctx");
  3009. return $core.addClass(aString, aClass, aCollection, packageName);
  3010. ;
  3011. return self;
  3012. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3013. }, function($ctx1) {$ctx1.fill(self,"basicAddSubclassOf:named:instanceVariableNames:package:",{aClass:aClass,aString:aString,aCollection:aCollection,packageName:packageName},$globals.ClassBuilder)});
  3014. //>>excludeEnd("ctx");
  3015. },
  3016. //>>excludeStart("ide", pragmas.excludeIdeData);
  3017. args: ["aClass", "aString", "aCollection", "packageName"],
  3018. source: "basicAddSubclassOf: aClass named: aString instanceVariableNames: aCollection package: packageName\x0a\x09<inlineJS: '\x0a\x09\x09return $core.addClass(aString, aClass, aCollection, packageName);\x0a\x09'>",
  3019. referencedClasses: [],
  3020. //>>excludeEnd("ide");
  3021. messageSends: []
  3022. }),
  3023. $globals.ClassBuilder);
  3024. $core.addMethod(
  3025. $core.method({
  3026. selector: "basicAddTraitNamed:package:",
  3027. protocol: "private",
  3028. fn: function (aString,anotherString){
  3029. var self=this;
  3030. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3031. return $core.withContext(function($ctx1) {
  3032. //>>excludeEnd("ctx");
  3033. return $core.addTrait(aString, anotherString);
  3034. return self;
  3035. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3036. }, function($ctx1) {$ctx1.fill(self,"basicAddTraitNamed:package:",{aString:aString,anotherString:anotherString},$globals.ClassBuilder)});
  3037. //>>excludeEnd("ctx");
  3038. },
  3039. //>>excludeStart("ide", pragmas.excludeIdeData);
  3040. args: ["aString", "anotherString"],
  3041. source: "basicAddTraitNamed: aString package: anotherString\x0a\x09<inlineJS: 'return $core.addTrait(aString, anotherString)'>",
  3042. referencedClasses: [],
  3043. //>>excludeEnd("ide");
  3044. messageSends: []
  3045. }),
  3046. $globals.ClassBuilder);
  3047. $core.addMethod(
  3048. $core.method({
  3049. selector: "basicClass:instanceVariableNames:",
  3050. protocol: "private",
  3051. fn: function (aClass,aString){
  3052. var self=this;
  3053. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3054. return $core.withContext(function($ctx1) {
  3055. //>>excludeEnd("ctx");
  3056. self._basicClass_instanceVariables_(aClass,self._instanceVariableNamesFor_(aString));
  3057. return self;
  3058. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3059. }, function($ctx1) {$ctx1.fill(self,"basicClass:instanceVariableNames:",{aClass:aClass,aString:aString},$globals.ClassBuilder)});
  3060. //>>excludeEnd("ctx");
  3061. },
  3062. //>>excludeStart("ide", pragmas.excludeIdeData);
  3063. args: ["aClass", "aString"],
  3064. source: "basicClass: aClass instanceVariableNames: aString\x0a\x09self basicClass: aClass instanceVariables: (self instanceVariableNamesFor: aString)",
  3065. referencedClasses: [],
  3066. //>>excludeEnd("ide");
  3067. messageSends: ["basicClass:instanceVariables:", "instanceVariableNamesFor:"]
  3068. }),
  3069. $globals.ClassBuilder);
  3070. $core.addMethod(
  3071. $core.method({
  3072. selector: "basicClass:instanceVariables:",
  3073. protocol: "private",
  3074. fn: function (aClass,aCollection){
  3075. var self=this;
  3076. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3077. return $core.withContext(function($ctx1) {
  3078. //>>excludeEnd("ctx");
  3079. var $1;
  3080. $1=$recv(aClass)._isMetaclass();
  3081. if(!$core.assert($1)){
  3082. self._error_($recv($recv(aClass)._name()).__comma(" is not a metaclass"));
  3083. }
  3084. $recv(aClass)._basicAt_put_("iVarNames",aCollection);
  3085. return self;
  3086. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3087. }, function($ctx1) {$ctx1.fill(self,"basicClass:instanceVariables:",{aClass:aClass,aCollection:aCollection},$globals.ClassBuilder)});
  3088. //>>excludeEnd("ctx");
  3089. },
  3090. //>>excludeStart("ide", pragmas.excludeIdeData);
  3091. args: ["aClass", "aCollection"],
  3092. source: "basicClass: aClass instanceVariables: aCollection\x0a\x0a\x09aClass isMetaclass ifFalse: [ self error: aClass name, ' is not a metaclass' ].\x0a\x09aClass basicAt: 'iVarNames' put: aCollection",
  3093. referencedClasses: [],
  3094. //>>excludeEnd("ide");
  3095. messageSends: ["ifFalse:", "isMetaclass", "error:", ",", "name", "basicAt:put:"]
  3096. }),
  3097. $globals.ClassBuilder);
  3098. $core.addMethod(
  3099. $core.method({
  3100. selector: "basicRemoveClass:",
  3101. protocol: "private",
  3102. fn: function (aClass){
  3103. var self=this;
  3104. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3105. return $core.withContext(function($ctx1) {
  3106. //>>excludeEnd("ctx");
  3107. $core.removeClass(aClass);
  3108. return self;
  3109. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3110. }, function($ctx1) {$ctx1.fill(self,"basicRemoveClass:",{aClass:aClass},$globals.ClassBuilder)});
  3111. //>>excludeEnd("ctx");
  3112. },
  3113. //>>excludeStart("ide", pragmas.excludeIdeData);
  3114. args: ["aClass"],
  3115. source: "basicRemoveClass: aClass\x0a\x09<inlineJS: '$core.removeClass(aClass)'>",
  3116. referencedClasses: [],
  3117. //>>excludeEnd("ide");
  3118. messageSends: []
  3119. }),
  3120. $globals.ClassBuilder);
  3121. $core.addMethod(
  3122. $core.method({
  3123. selector: "basicRenameClass:to:",
  3124. protocol: "private",
  3125. fn: function (aClass,aString){
  3126. var self=this;
  3127. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3128. return $core.withContext(function($ctx1) {
  3129. //>>excludeEnd("ctx");
  3130. $globals[aString] = aClass;
  3131. delete $globals[aClass.className];
  3132. aClass.className = aString;
  3133. ;
  3134. return self;
  3135. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3136. }, function($ctx1) {$ctx1.fill(self,"basicRenameClass:to:",{aClass:aClass,aString:aString},$globals.ClassBuilder)});
  3137. //>>excludeEnd("ctx");
  3138. },
  3139. //>>excludeStart("ide", pragmas.excludeIdeData);
  3140. args: ["aClass", "aString"],
  3141. 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'>",
  3142. referencedClasses: [],
  3143. //>>excludeEnd("ide");
  3144. messageSends: []
  3145. }),
  3146. $globals.ClassBuilder);
  3147. $core.addMethod(
  3148. $core.method({
  3149. selector: "basicSwapClassNames:with:",
  3150. protocol: "private",
  3151. fn: function (aClass,anotherClass){
  3152. var self=this;
  3153. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3154. return $core.withContext(function($ctx1) {
  3155. //>>excludeEnd("ctx");
  3156. var tmp = aClass.className;
  3157. aClass.className = anotherClass.className;
  3158. anotherClass.className = tmp;
  3159. ;
  3160. return self;
  3161. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3162. }, function($ctx1) {$ctx1.fill(self,"basicSwapClassNames:with:",{aClass:aClass,anotherClass:anotherClass},$globals.ClassBuilder)});
  3163. //>>excludeEnd("ctx");
  3164. },
  3165. //>>excludeStart("ide", pragmas.excludeIdeData);
  3166. args: ["aClass", "anotherClass"],
  3167. 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'>",
  3168. referencedClasses: [],
  3169. //>>excludeEnd("ide");
  3170. messageSends: []
  3171. }),
  3172. $globals.ClassBuilder);
  3173. $core.addMethod(
  3174. $core.method({
  3175. selector: "class:instanceVariableNames:",
  3176. protocol: "class definition",
  3177. fn: function (aClass,ivarNames){
  3178. var self=this;
  3179. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3180. return $core.withContext(function($ctx1) {
  3181. //>>excludeEnd("ctx");
  3182. var $1,$3,$2;
  3183. self._basicClass_instanceVariableNames_(aClass,ivarNames);
  3184. $1=$recv($globals.SystemAnnouncer)._current();
  3185. $3=$recv($globals.ClassDefinitionChanged)._new();
  3186. $recv($3)._theClass_(aClass);
  3187. $2=$recv($3)._yourself();
  3188. $recv($1)._announce_($2);
  3189. return self;
  3190. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3191. }, function($ctx1) {$ctx1.fill(self,"class:instanceVariableNames:",{aClass:aClass,ivarNames:ivarNames},$globals.ClassBuilder)});
  3192. //>>excludeEnd("ctx");
  3193. },
  3194. //>>excludeStart("ide", pragmas.excludeIdeData);
  3195. args: ["aClass", "ivarNames"],
  3196. 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)",
  3197. referencedClasses: ["SystemAnnouncer", "ClassDefinitionChanged"],
  3198. //>>excludeEnd("ide");
  3199. messageSends: ["basicClass:instanceVariableNames:", "announce:", "current", "theClass:", "new", "yourself"]
  3200. }),
  3201. $globals.ClassBuilder);
  3202. $core.addMethod(
  3203. $core.method({
  3204. selector: "copyClass:named:",
  3205. protocol: "copying",
  3206. fn: function (aClass,className){
  3207. var self=this;
  3208. var newClass;
  3209. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3210. return $core.withContext(function($ctx1) {
  3211. //>>excludeEnd("ctx");
  3212. var $1,$3,$2;
  3213. newClass=self._addSubclassOf_named_instanceVariableNames_package_($recv(aClass)._superclass(),className,$recv(aClass)._instanceVariableNames(),$recv($recv(aClass)._package())._name());
  3214. self._copyClass_to_(aClass,newClass);
  3215. $1=$recv($globals.SystemAnnouncer)._current();
  3216. $3=$recv($globals.ClassAdded)._new();
  3217. $recv($3)._theClass_(newClass);
  3218. $2=$recv($3)._yourself();
  3219. $recv($1)._announce_($2);
  3220. return newClass;
  3221. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3222. }, function($ctx1) {$ctx1.fill(self,"copyClass:named:",{aClass:aClass,className:className,newClass:newClass},$globals.ClassBuilder)});
  3223. //>>excludeEnd("ctx");
  3224. },
  3225. //>>excludeStart("ide", pragmas.excludeIdeData);
  3226. args: ["aClass", "className"],
  3227. 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",
  3228. referencedClasses: ["SystemAnnouncer", "ClassAdded"],
  3229. //>>excludeEnd("ide");
  3230. messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "superclass", "instanceVariableNames", "name", "package", "copyClass:to:", "announce:", "current", "theClass:", "new", "yourself"]
  3231. }),
  3232. $globals.ClassBuilder);
  3233. $core.addMethod(
  3234. $core.method({
  3235. selector: "copyClass:to:",
  3236. protocol: "copying",
  3237. fn: function (aClass,anotherClass){
  3238. var self=this;
  3239. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3240. return $core.withContext(function($ctx1) {
  3241. //>>excludeEnd("ctx");
  3242. var $1,$3,$2,$4,$5,$6,$7,$8,$10,$9,$12,$11,$14,$15,$13,$16,$17,$18,$19;
  3243. $recv(anotherClass)._comment_($recv(aClass)._comment());
  3244. $1=$recv(aClass)._methodDictionary();
  3245. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3246. $ctx1.sendIdx["methodDictionary"]=1;
  3247. //>>excludeEnd("ctx");
  3248. $recv($1)._valuesDo_((function(each){
  3249. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3250. return $core.withContext(function($ctx2) {
  3251. //>>excludeEnd("ctx");
  3252. $3=$recv(each)._methodClass();
  3253. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3254. $ctx2.sendIdx["methodClass"]=1;
  3255. //>>excludeEnd("ctx");
  3256. $2=$recv($3).__eq(aClass);
  3257. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3258. $ctx2.sendIdx["="]=1;
  3259. //>>excludeEnd("ctx");
  3260. if($core.assert($2)){
  3261. $4=$recv($globals.Compiler)._new();
  3262. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3263. $ctx2.sendIdx["new"]=1;
  3264. //>>excludeEnd("ctx");
  3265. $5=$recv(each)._source();
  3266. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3267. $ctx2.sendIdx["source"]=1;
  3268. //>>excludeEnd("ctx");
  3269. $6=$recv(each)._protocol();
  3270. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3271. $ctx2.sendIdx["protocol"]=1;
  3272. //>>excludeEnd("ctx");
  3273. return $recv($4)._install_forClass_protocol_($5,anotherClass,$6);
  3274. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3275. $ctx2.sendIdx["install:forClass:protocol:"]=1;
  3276. //>>excludeEnd("ctx");
  3277. }
  3278. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3279. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3280. //>>excludeEnd("ctx");
  3281. }));
  3282. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3283. $ctx1.sendIdx["valuesDo:"]=1;
  3284. //>>excludeEnd("ctx");
  3285. $7=$recv(aClass)._traitComposition();
  3286. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3287. $ctx1.sendIdx["traitComposition"]=1;
  3288. //>>excludeEnd("ctx");
  3289. $recv(anotherClass)._setTraitComposition_($7);
  3290. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3291. $ctx1.sendIdx["setTraitComposition:"]=1;
  3292. //>>excludeEnd("ctx");
  3293. $8=$recv(anotherClass)._class();
  3294. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3295. $ctx1.sendIdx["class"]=1;
  3296. //>>excludeEnd("ctx");
  3297. $10=$recv(aClass)._class();
  3298. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3299. $ctx1.sendIdx["class"]=2;
  3300. //>>excludeEnd("ctx");
  3301. $9=$recv($10)._instanceVariableNames();
  3302. self._basicClass_instanceVariables_($8,$9);
  3303. $12=$recv(aClass)._class();
  3304. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3305. $ctx1.sendIdx["class"]=3;
  3306. //>>excludeEnd("ctx");
  3307. $11=$recv($12)._methodDictionary();
  3308. $recv($11)._valuesDo_((function(each){
  3309. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3310. return $core.withContext(function($ctx2) {
  3311. //>>excludeEnd("ctx");
  3312. $14=$recv(each)._methodClass();
  3313. $15=$recv(aClass)._class();
  3314. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3315. $ctx2.sendIdx["class"]=4;
  3316. //>>excludeEnd("ctx");
  3317. $13=$recv($14).__eq($15);
  3318. if($core.assert($13)){
  3319. $16=$recv($globals.Compiler)._new();
  3320. $17=$recv(each)._source();
  3321. $18=$recv(anotherClass)._class();
  3322. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3323. $ctx2.sendIdx["class"]=5;
  3324. //>>excludeEnd("ctx");
  3325. return $recv($16)._install_forClass_protocol_($17,$18,$recv(each)._protocol());
  3326. }
  3327. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3328. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
  3329. //>>excludeEnd("ctx");
  3330. }));
  3331. $19=$recv(anotherClass)._class();
  3332. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3333. $ctx1.sendIdx["class"]=6;
  3334. //>>excludeEnd("ctx");
  3335. $recv($19)._setTraitComposition_($recv($recv(aClass)._class())._traitComposition());
  3336. return self;
  3337. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3338. }, function($ctx1) {$ctx1.fill(self,"copyClass:to:",{aClass:aClass,anotherClass:anotherClass},$globals.ClassBuilder)});
  3339. //>>excludeEnd("ctx");
  3340. },
  3341. //>>excludeStart("ide", pragmas.excludeIdeData);
  3342. args: ["aClass", "anotherClass"],
  3343. 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",
  3344. referencedClasses: ["Compiler"],
  3345. //>>excludeEnd("ide");
  3346. messageSends: ["comment:", "comment", "valuesDo:", "methodDictionary", "ifTrue:", "=", "methodClass", "install:forClass:protocol:", "new", "source", "protocol", "setTraitComposition:", "traitComposition", "basicClass:instanceVariables:", "class", "instanceVariableNames"]
  3347. }),
  3348. $globals.ClassBuilder);
  3349. $core.addMethod(
  3350. $core.method({
  3351. selector: "installMethod:forClass:protocol:",
  3352. protocol: "method definition",
  3353. fn: function (aCompiledMethod,aBehavior,aString){
  3354. var self=this;
  3355. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3356. return $core.withContext(function($ctx1) {
  3357. //>>excludeEnd("ctx");
  3358. $recv(aCompiledMethod)._protocol_(aString);
  3359. $recv(aBehavior)._addCompiledMethod_(aCompiledMethod);
  3360. return aCompiledMethod;
  3361. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3362. }, function($ctx1) {$ctx1.fill(self,"installMethod:forClass:protocol:",{aCompiledMethod:aCompiledMethod,aBehavior:aBehavior,aString:aString},$globals.ClassBuilder)});
  3363. //>>excludeEnd("ctx");
  3364. },
  3365. //>>excludeStart("ide", pragmas.excludeIdeData);
  3366. args: ["aCompiledMethod", "aBehavior", "aString"],
  3367. source: "installMethod: aCompiledMethod forClass: aBehavior protocol: aString\x0a\x09aCompiledMethod protocol: aString.\x0a\x09aBehavior addCompiledMethod: aCompiledMethod.\x0a\x09^ aCompiledMethod",
  3368. referencedClasses: [],
  3369. //>>excludeEnd("ide");
  3370. messageSends: ["protocol:", "addCompiledMethod:"]
  3371. }),
  3372. $globals.ClassBuilder);
  3373. $core.addMethod(
  3374. $core.method({
  3375. selector: "instanceVariableNamesFor:",
  3376. protocol: "accessing",
  3377. fn: function (aString){
  3378. var self=this;
  3379. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3380. return $core.withContext(function($ctx1) {
  3381. //>>excludeEnd("ctx");
  3382. return $recv($recv(aString)._tokenize_(" "))._reject_((function(each){
  3383. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3384. return $core.withContext(function($ctx2) {
  3385. //>>excludeEnd("ctx");
  3386. return $recv(each)._isEmpty();
  3387. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3388. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3389. //>>excludeEnd("ctx");
  3390. }));
  3391. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3392. }, function($ctx1) {$ctx1.fill(self,"instanceVariableNamesFor:",{aString:aString},$globals.ClassBuilder)});
  3393. //>>excludeEnd("ctx");
  3394. },
  3395. //>>excludeStart("ide", pragmas.excludeIdeData);
  3396. args: ["aString"],
  3397. source: "instanceVariableNamesFor: aString\x0a\x09^ (aString tokenize: ' ') reject: [ :each | each isEmpty ]",
  3398. referencedClasses: [],
  3399. //>>excludeEnd("ide");
  3400. messageSends: ["reject:", "tokenize:", "isEmpty"]
  3401. }),
  3402. $globals.ClassBuilder);
  3403. $core.addMethod(
  3404. $core.method({
  3405. selector: "migrateClass:superclass:",
  3406. protocol: "class migration",
  3407. fn: function (aClass,anotherClass){
  3408. var self=this;
  3409. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3410. return $core.withContext(function($ctx1) {
  3411. //>>excludeEnd("ctx");
  3412. var $1;
  3413. $1=$recv(aClass)._name();
  3414. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3415. $ctx1.sendIdx["name"]=1;
  3416. //>>excludeEnd("ctx");
  3417. return self._migrateClassNamed_superclass_instanceVariableNames_package_($1,anotherClass,$recv(aClass)._instanceVariableNames(),$recv($recv(aClass)._package())._name());
  3418. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3419. }, function($ctx1) {$ctx1.fill(self,"migrateClass:superclass:",{aClass:aClass,anotherClass:anotherClass},$globals.ClassBuilder)});
  3420. //>>excludeEnd("ctx");
  3421. },
  3422. //>>excludeStart("ide", pragmas.excludeIdeData);
  3423. args: ["aClass", "anotherClass"],
  3424. 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",
  3425. referencedClasses: [],
  3426. //>>excludeEnd("ide");
  3427. messageSends: ["migrateClassNamed:superclass:instanceVariableNames:package:", "name", "instanceVariableNames", "package"]
  3428. }),
  3429. $globals.ClassBuilder);
  3430. $core.addMethod(
  3431. $core.method({
  3432. selector: "migrateClassNamed:superclass:instanceVariableNames:package:",
  3433. protocol: "class migration",
  3434. fn: function (className,aClass,aCollection,packageName){
  3435. var self=this;
  3436. var oldClass,newClass,tmp;
  3437. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3438. return $core.withContext(function($ctx1) {
  3439. //>>excludeEnd("ctx");
  3440. var $1,$2,$4,$3;
  3441. tmp="new*".__comma(className);
  3442. oldClass=$recv($recv($globals.Smalltalk)._globals())._at_(className);
  3443. newClass=self._addSubclassOf_named_instanceVariableNames_package_(aClass,tmp,aCollection,packageName);
  3444. self._basicSwapClassNames_with_(oldClass,newClass);
  3445. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3446. $ctx1.sendIdx["basicSwapClassNames:with:"]=1;
  3447. //>>excludeEnd("ctx");
  3448. $recv((function(){
  3449. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3450. return $core.withContext(function($ctx2) {
  3451. //>>excludeEnd("ctx");
  3452. return self._copyClass_to_(oldClass,newClass);
  3453. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3454. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  3455. //>>excludeEnd("ctx");
  3456. }))._on_do_($globals.Error,(function(exception){
  3457. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3458. return $core.withContext(function($ctx2) {
  3459. //>>excludeEnd("ctx");
  3460. self._basicSwapClassNames_with_(oldClass,newClass);
  3461. $1=self._basicRemoveClass_(newClass);
  3462. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3463. $ctx2.sendIdx["basicRemoveClass:"]=1;
  3464. //>>excludeEnd("ctx");
  3465. $1;
  3466. return $recv(exception)._resignal();
  3467. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3468. }, function($ctx2) {$ctx2.fillBlock({exception:exception},$ctx1,2)});
  3469. //>>excludeEnd("ctx");
  3470. }));
  3471. self._rawRenameClass_to_(oldClass,tmp);
  3472. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3473. $ctx1.sendIdx["rawRenameClass:to:"]=1;
  3474. //>>excludeEnd("ctx");
  3475. self._rawRenameClass_to_(newClass,className);
  3476. $recv($recv(oldClass)._subclasses())._do_((function(each){
  3477. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3478. return $core.withContext(function($ctx2) {
  3479. //>>excludeEnd("ctx");
  3480. return self._migrateClass_superclass_(each,newClass);
  3481. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3482. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
  3483. //>>excludeEnd("ctx");
  3484. }));
  3485. self._basicRemoveClass_(oldClass);
  3486. $2=$recv($globals.SystemAnnouncer)._current();
  3487. $4=$recv($globals.ClassMigrated)._new();
  3488. $recv($4)._theClass_(newClass);
  3489. $recv($4)._oldClass_(oldClass);
  3490. $3=$recv($4)._yourself();
  3491. $recv($2)._announce_($3);
  3492. return newClass;
  3493. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3494. }, 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)});
  3495. //>>excludeEnd("ctx");
  3496. },
  3497. //>>excludeStart("ide", pragmas.excludeIdeData);
  3498. args: ["className", "aClass", "aCollection", "packageName"],
  3499. 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",
  3500. referencedClasses: ["Smalltalk", "Error", "SystemAnnouncer", "ClassMigrated"],
  3501. //>>excludeEnd("ide");
  3502. 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"]
  3503. }),
  3504. $globals.ClassBuilder);
  3505. $core.addMethod(
  3506. $core.method({
  3507. selector: "rawRenameClass:to:",
  3508. protocol: "private",
  3509. fn: function (aClass,aString){
  3510. var self=this;
  3511. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3512. return $core.withContext(function($ctx1) {
  3513. //>>excludeEnd("ctx");
  3514. $globals[aString] = aClass;
  3515. ;
  3516. return self;
  3517. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3518. }, function($ctx1) {$ctx1.fill(self,"rawRenameClass:to:",{aClass:aClass,aString:aString},$globals.ClassBuilder)});
  3519. //>>excludeEnd("ctx");
  3520. },
  3521. //>>excludeStart("ide", pragmas.excludeIdeData);
  3522. args: ["aClass", "aString"],
  3523. source: "rawRenameClass: aClass to: aString\x0a\x09<inlineJS: '\x0a\x09\x09$globals[aString] = aClass;\x0a\x09'>",
  3524. referencedClasses: [],
  3525. //>>excludeEnd("ide");
  3526. messageSends: []
  3527. }),
  3528. $globals.ClassBuilder);
  3529. $core.addMethod(
  3530. $core.method({
  3531. selector: "renameClass:to:",
  3532. protocol: "class migration",
  3533. fn: function (aClass,className){
  3534. var self=this;
  3535. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3536. return $core.withContext(function($ctx1) {
  3537. //>>excludeEnd("ctx");
  3538. var $1,$3,$2;
  3539. self._basicRenameClass_to_(aClass,className);
  3540. $recv(aClass)._recompile();
  3541. $1=$recv($globals.SystemAnnouncer)._current();
  3542. $3=$recv($globals.ClassRenamed)._new();
  3543. $recv($3)._theClass_(aClass);
  3544. $2=$recv($3)._yourself();
  3545. $recv($1)._announce_($2);
  3546. return self;
  3547. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3548. }, function($ctx1) {$ctx1.fill(self,"renameClass:to:",{aClass:aClass,className:className},$globals.ClassBuilder)});
  3549. //>>excludeEnd("ctx");
  3550. },
  3551. //>>excludeStart("ide", pragmas.excludeIdeData);
  3552. args: ["aClass", "className"],
  3553. 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)",
  3554. referencedClasses: ["SystemAnnouncer", "ClassRenamed"],
  3555. //>>excludeEnd("ide");
  3556. messageSends: ["basicRenameClass:to:", "recompile", "announce:", "current", "theClass:", "new", "yourself"]
  3557. }),
  3558. $globals.ClassBuilder);
  3559. $core.addMethod(
  3560. $core.method({
  3561. selector: "setupClass:",
  3562. protocol: "public",
  3563. fn: function (aClass){
  3564. var self=this;
  3565. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3566. return $core.withContext(function($ctx1) {
  3567. //>>excludeEnd("ctx");
  3568. self._deprecatedAPI_("Classes are now auto-inited.");
  3569. return self;
  3570. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3571. }, function($ctx1) {$ctx1.fill(self,"setupClass:",{aClass:aClass},$globals.ClassBuilder)});
  3572. //>>excludeEnd("ctx");
  3573. },
  3574. //>>excludeStart("ide", pragmas.excludeIdeData);
  3575. args: ["aClass"],
  3576. source: "setupClass: aClass\x0a\x09self deprecatedAPI: 'Classes are now auto-inited.'",
  3577. referencedClasses: [],
  3578. //>>excludeEnd("ide");
  3579. messageSends: ["deprecatedAPI:"]
  3580. }),
  3581. $globals.ClassBuilder);
  3582. $core.addMethod(
  3583. $core.method({
  3584. selector: "superclass:subclass:",
  3585. protocol: "class definition",
  3586. fn: function (aClass,className){
  3587. var self=this;
  3588. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3589. return $core.withContext(function($ctx1) {
  3590. //>>excludeEnd("ctx");
  3591. return self._superclass_subclass_instanceVariableNames_package_(aClass,className,"",nil);
  3592. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3593. }, function($ctx1) {$ctx1.fill(self,"superclass:subclass:",{aClass:aClass,className:className},$globals.ClassBuilder)});
  3594. //>>excludeEnd("ctx");
  3595. },
  3596. //>>excludeStart("ide", pragmas.excludeIdeData);
  3597. args: ["aClass", "className"],
  3598. source: "superclass: aClass subclass: className\x0a\x09^ self superclass: aClass subclass: className instanceVariableNames: '' package: nil",
  3599. referencedClasses: [],
  3600. //>>excludeEnd("ide");
  3601. messageSends: ["superclass:subclass:instanceVariableNames:package:"]
  3602. }),
  3603. $globals.ClassBuilder);
  3604. $core.addMethod(
  3605. $core.method({
  3606. selector: "superclass:subclass:instanceVariableNames:package:",
  3607. protocol: "class definition",
  3608. fn: function (aClass,className,ivarNames,packageName){
  3609. var self=this;
  3610. var newClass;
  3611. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3612. return $core.withContext(function($ctx1) {
  3613. //>>excludeEnd("ctx");
  3614. var $1,$2,$3,$5,$4,$receiver;
  3615. $1=self._instanceVariableNamesFor_(ivarNames);
  3616. if(($receiver = packageName) == null || $receiver.isNil){
  3617. $2="unclassified";
  3618. } else {
  3619. $2=packageName;
  3620. }
  3621. newClass=self._addSubclassOf_named_instanceVariableNames_package_(aClass,className,$1,$2);
  3622. $3=$recv($globals.SystemAnnouncer)._current();
  3623. $5=$recv($globals.ClassAdded)._new();
  3624. $recv($5)._theClass_(newClass);
  3625. $4=$recv($5)._yourself();
  3626. $recv($3)._announce_($4);
  3627. return newClass;
  3628. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3629. }, function($ctx1) {$ctx1.fill(self,"superclass:subclass:instanceVariableNames:package:",{aClass:aClass,className:className,ivarNames:ivarNames,packageName:packageName,newClass:newClass},$globals.ClassBuilder)});
  3630. //>>excludeEnd("ctx");
  3631. },
  3632. //>>excludeStart("ide", pragmas.excludeIdeData);
  3633. args: ["aClass", "className", "ivarNames", "packageName"],
  3634. 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",
  3635. referencedClasses: ["SystemAnnouncer", "ClassAdded"],
  3636. //>>excludeEnd("ide");
  3637. messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "instanceVariableNamesFor:", "ifNil:", "announce:", "current", "theClass:", "new", "yourself"]
  3638. }),
  3639. $globals.ClassBuilder);
  3640. $core.addClass("ClassSorterNode", $globals.Object, ["theClass", "level", "nodes"], "Kernel-Classes");
  3641. //>>excludeStart("ide", pragmas.excludeIdeData);
  3642. $globals.ClassSorterNode.comment="I provide an algorithm for sorting classes alphabetically.\x0a\x0aSee [Issue #143](https://lolg.it/amber/amber/issues/143).";
  3643. //>>excludeEnd("ide");
  3644. $core.addMethod(
  3645. $core.method({
  3646. selector: "getNodesFrom:",
  3647. protocol: "accessing",
  3648. fn: function (aCollection){
  3649. var self=this;
  3650. var children,others;
  3651. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3652. return $core.withContext(function($ctx1) {
  3653. //>>excludeEnd("ctx");
  3654. var $1;
  3655. children=[];
  3656. others=[];
  3657. $recv(aCollection)._do_((function(each){
  3658. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3659. return $core.withContext(function($ctx2) {
  3660. //>>excludeEnd("ctx");
  3661. $1=$recv($recv(each)._superclass()).__eq(self._theClass());
  3662. if($core.assert($1)){
  3663. return $recv(children)._add_(each);
  3664. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3665. $ctx2.sendIdx["add:"]=1;
  3666. //>>excludeEnd("ctx");
  3667. } else {
  3668. return $recv(others)._add_(each);
  3669. }
  3670. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3671. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3672. //>>excludeEnd("ctx");
  3673. }));
  3674. self["@nodes"]=$recv(children)._collect_((function(each){
  3675. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3676. return $core.withContext(function($ctx2) {
  3677. //>>excludeEnd("ctx");
  3678. return $recv($globals.ClassSorterNode)._on_classes_level_(each,others,$recv(self._level()).__plus((1)));
  3679. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3680. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)});
  3681. //>>excludeEnd("ctx");
  3682. }));
  3683. return self;
  3684. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3685. }, function($ctx1) {$ctx1.fill(self,"getNodesFrom:",{aCollection:aCollection,children:children,others:others},$globals.ClassSorterNode)});
  3686. //>>excludeEnd("ctx");
  3687. },
  3688. //>>excludeStart("ide", pragmas.excludeIdeData);
  3689. args: ["aCollection"],
  3690. 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 ]",
  3691. referencedClasses: ["ClassSorterNode"],
  3692. //>>excludeEnd("ide");
  3693. messageSends: ["do:", "ifTrue:ifFalse:", "=", "superclass", "theClass", "add:", "collect:", "on:classes:level:", "+", "level"]
  3694. }),
  3695. $globals.ClassSorterNode);
  3696. $core.addMethod(
  3697. $core.method({
  3698. selector: "level",
  3699. protocol: "accessing",
  3700. fn: function (){
  3701. var self=this;
  3702. return self["@level"];
  3703. },
  3704. //>>excludeStart("ide", pragmas.excludeIdeData);
  3705. args: [],
  3706. source: "level\x0a\x09^ level",
  3707. referencedClasses: [],
  3708. //>>excludeEnd("ide");
  3709. messageSends: []
  3710. }),
  3711. $globals.ClassSorterNode);
  3712. $core.addMethod(
  3713. $core.method({
  3714. selector: "level:",
  3715. protocol: "accessing",
  3716. fn: function (anInteger){
  3717. var self=this;
  3718. self["@level"]=anInteger;
  3719. return self;
  3720. },
  3721. //>>excludeStart("ide", pragmas.excludeIdeData);
  3722. args: ["anInteger"],
  3723. source: "level: anInteger\x0a\x09level := anInteger",
  3724. referencedClasses: [],
  3725. //>>excludeEnd("ide");
  3726. messageSends: []
  3727. }),
  3728. $globals.ClassSorterNode);
  3729. $core.addMethod(
  3730. $core.method({
  3731. selector: "nodes",
  3732. protocol: "accessing",
  3733. fn: function (){
  3734. var self=this;
  3735. return self["@nodes"];
  3736. },
  3737. //>>excludeStart("ide", pragmas.excludeIdeData);
  3738. args: [],
  3739. source: "nodes\x0a\x09^ nodes",
  3740. referencedClasses: [],
  3741. //>>excludeEnd("ide");
  3742. messageSends: []
  3743. }),
  3744. $globals.ClassSorterNode);
  3745. $core.addMethod(
  3746. $core.method({
  3747. selector: "theClass",
  3748. protocol: "accessing",
  3749. fn: function (){
  3750. var self=this;
  3751. return self["@theClass"];
  3752. },
  3753. //>>excludeStart("ide", pragmas.excludeIdeData);
  3754. args: [],
  3755. source: "theClass\x0a\x09^ theClass",
  3756. referencedClasses: [],
  3757. //>>excludeEnd("ide");
  3758. messageSends: []
  3759. }),
  3760. $globals.ClassSorterNode);
  3761. $core.addMethod(
  3762. $core.method({
  3763. selector: "theClass:",
  3764. protocol: "accessing",
  3765. fn: function (aClass){
  3766. var self=this;
  3767. self["@theClass"]=aClass;
  3768. return self;
  3769. },
  3770. //>>excludeStart("ide", pragmas.excludeIdeData);
  3771. args: ["aClass"],
  3772. source: "theClass: aClass\x0a\x09theClass := aClass",
  3773. referencedClasses: [],
  3774. //>>excludeEnd("ide");
  3775. messageSends: []
  3776. }),
  3777. $globals.ClassSorterNode);
  3778. $core.addMethod(
  3779. $core.method({
  3780. selector: "traverseClassesWith:",
  3781. protocol: "visiting",
  3782. fn: function (aCollection){
  3783. var self=this;
  3784. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3785. return $core.withContext(function($ctx1) {
  3786. //>>excludeEnd("ctx");
  3787. var $1,$3,$2;
  3788. $1=self._theClass();
  3789. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3790. $ctx1.sendIdx["theClass"]=1;
  3791. //>>excludeEnd("ctx");
  3792. $recv(aCollection)._add_($1);
  3793. $recv($recv(self._nodes())._sorted_((function(a,b){
  3794. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3795. return $core.withContext(function($ctx2) {
  3796. //>>excludeEnd("ctx");
  3797. $3=$recv(a)._theClass();
  3798. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3799. $ctx2.sendIdx["theClass"]=2;
  3800. //>>excludeEnd("ctx");
  3801. $2=$recv($3)._name();
  3802. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3803. $ctx2.sendIdx["name"]=1;
  3804. //>>excludeEnd("ctx");
  3805. return $recv($2).__lt_eq($recv($recv(b)._theClass())._name());
  3806. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3807. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,1)});
  3808. //>>excludeEnd("ctx");
  3809. })))._do_((function(aNode){
  3810. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3811. return $core.withContext(function($ctx2) {
  3812. //>>excludeEnd("ctx");
  3813. return $recv(aNode)._traverseClassesWith_(aCollection);
  3814. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3815. }, function($ctx2) {$ctx2.fillBlock({aNode:aNode},$ctx1,2)});
  3816. //>>excludeEnd("ctx");
  3817. }));
  3818. return self;
  3819. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3820. }, function($ctx1) {$ctx1.fill(self,"traverseClassesWith:",{aCollection:aCollection},$globals.ClassSorterNode)});
  3821. //>>excludeEnd("ctx");
  3822. },
  3823. //>>excludeStart("ide", pragmas.excludeIdeData);
  3824. args: ["aCollection"],
  3825. 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 ].",
  3826. referencedClasses: [],
  3827. //>>excludeEnd("ide");
  3828. messageSends: ["add:", "theClass", "do:", "sorted:", "nodes", "<=", "name", "traverseClassesWith:"]
  3829. }),
  3830. $globals.ClassSorterNode);
  3831. $core.addMethod(
  3832. $core.method({
  3833. selector: "on:classes:level:",
  3834. protocol: "instance creation",
  3835. fn: function (aClass,aCollection,anInteger){
  3836. var self=this;
  3837. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3838. return $core.withContext(function($ctx1) {
  3839. //>>excludeEnd("ctx");
  3840. var $1;
  3841. $1=self._new();
  3842. $recv($1)._theClass_(aClass);
  3843. $recv($1)._level_(anInteger);
  3844. $recv($1)._getNodesFrom_(aCollection);
  3845. return $recv($1)._yourself();
  3846. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3847. }, function($ctx1) {$ctx1.fill(self,"on:classes:level:",{aClass:aClass,aCollection:aCollection,anInteger:anInteger},$globals.ClassSorterNode.klass)});
  3848. //>>excludeEnd("ctx");
  3849. },
  3850. //>>excludeStart("ide", pragmas.excludeIdeData);
  3851. args: ["aClass", "aCollection", "anInteger"],
  3852. 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",
  3853. referencedClasses: [],
  3854. //>>excludeEnd("ide");
  3855. messageSends: ["theClass:", "new", "level:", "getNodesFrom:", "yourself"]
  3856. }),
  3857. $globals.ClassSorterNode.klass);
  3858. $core.addClass("TraitTransformation", $globals.Object, ["trait", "aliases", "exclusions"], "Kernel-Classes");
  3859. //>>excludeStart("ide", pragmas.excludeIdeData);
  3860. $globals.TraitTransformation.comment="I am a single step in trait composition.\x0a\x0aI represent one trait including its aliases and exclusions.";
  3861. //>>excludeEnd("ide");
  3862. $core.addMethod(
  3863. $core.method({
  3864. selector: "-",
  3865. protocol: "composition",
  3866. fn: function (anArray){
  3867. var self=this;
  3868. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3869. return $core.withContext(function($ctx1) {
  3870. //>>excludeEnd("ctx");
  3871. var $1;
  3872. $1=self._copy();
  3873. $recv($1)._addExclusions_(anArray);
  3874. return $recv($1)._yourself();
  3875. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3876. }, function($ctx1) {$ctx1.fill(self,"-",{anArray:anArray},$globals.TraitTransformation)});
  3877. //>>excludeEnd("ctx");
  3878. },
  3879. //>>excludeStart("ide", pragmas.excludeIdeData);
  3880. args: ["anArray"],
  3881. source: "- anArray\x0a\x09^ self copy addExclusions: anArray; yourself",
  3882. referencedClasses: [],
  3883. //>>excludeEnd("ide");
  3884. messageSends: ["addExclusions:", "copy", "yourself"]
  3885. }),
  3886. $globals.TraitTransformation);
  3887. $core.addMethod(
  3888. $core.method({
  3889. selector: "@",
  3890. protocol: "composition",
  3891. fn: function (anArrayOfAssociations){
  3892. var self=this;
  3893. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3894. return $core.withContext(function($ctx1) {
  3895. //>>excludeEnd("ctx");
  3896. var $1;
  3897. $1=self._copy();
  3898. $recv($1)._addAliases_(anArrayOfAssociations);
  3899. return $recv($1)._yourself();
  3900. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3901. }, function($ctx1) {$ctx1.fill(self,"@",{anArrayOfAssociations:anArrayOfAssociations},$globals.TraitTransformation)});
  3902. //>>excludeEnd("ctx");
  3903. },
  3904. //>>excludeStart("ide", pragmas.excludeIdeData);
  3905. args: ["anArrayOfAssociations"],
  3906. source: "@ anArrayOfAssociations\x0a\x09^ self copy addAliases: anArrayOfAssociations; yourself",
  3907. referencedClasses: [],
  3908. //>>excludeEnd("ide");
  3909. messageSends: ["addAliases:", "copy", "yourself"]
  3910. }),
  3911. $globals.TraitTransformation);
  3912. $core.addMethod(
  3913. $core.method({
  3914. selector: "addAliases:",
  3915. protocol: "accessing",
  3916. fn: function (anArrayOfAssociations){
  3917. var self=this;
  3918. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3919. return $core.withContext(function($ctx1) {
  3920. //>>excludeEnd("ctx");
  3921. $recv(anArrayOfAssociations)._do_((function(each){
  3922. var key;
  3923. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3924. return $core.withContext(function($ctx2) {
  3925. //>>excludeEnd("ctx");
  3926. key=$recv(each)._key();
  3927. key;
  3928. return $recv(self["@aliases"])._at_ifPresent_ifAbsent_(key,(function(){
  3929. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3930. return $core.withContext(function($ctx3) {
  3931. //>>excludeEnd("ctx");
  3932. return self._error_("Cannot use same alias name twice.");
  3933. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3934. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  3935. //>>excludeEnd("ctx");
  3936. }),(function(){
  3937. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3938. return $core.withContext(function($ctx3) {
  3939. //>>excludeEnd("ctx");
  3940. return $recv(self["@aliases"])._at_put_(key,$recv(each)._value());
  3941. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3942. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)});
  3943. //>>excludeEnd("ctx");
  3944. }));
  3945. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3946. }, function($ctx2) {$ctx2.fillBlock({each:each,key:key},$ctx1,1)});
  3947. //>>excludeEnd("ctx");
  3948. }));
  3949. return anArrayOfAssociations;
  3950. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3951. }, function($ctx1) {$ctx1.fill(self,"addAliases:",{anArrayOfAssociations:anArrayOfAssociations},$globals.TraitTransformation)});
  3952. //>>excludeEnd("ctx");
  3953. },
  3954. //>>excludeStart("ide", pragmas.excludeIdeData);
  3955. args: ["anArrayOfAssociations"],
  3956. 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",
  3957. referencedClasses: [],
  3958. //>>excludeEnd("ide");
  3959. messageSends: ["do:", "key", "at:ifPresent:ifAbsent:", "error:", "at:put:", "value"]
  3960. }),
  3961. $globals.TraitTransformation);
  3962. $core.addMethod(
  3963. $core.method({
  3964. selector: "addExclusions:",
  3965. protocol: "accessing",
  3966. fn: function (anArray){
  3967. var self=this;
  3968. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3969. return $core.withContext(function($ctx1) {
  3970. //>>excludeEnd("ctx");
  3971. $recv(self["@exclusions"])._addAll_(anArray);
  3972. return anArray;
  3973. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3974. }, function($ctx1) {$ctx1.fill(self,"addExclusions:",{anArray:anArray},$globals.TraitTransformation)});
  3975. //>>excludeEnd("ctx");
  3976. },
  3977. //>>excludeStart("ide", pragmas.excludeIdeData);
  3978. args: ["anArray"],
  3979. source: "addExclusions: anArray\x0a\x09exclusions addAll: anArray.\x0a\x09^ anArray",
  3980. referencedClasses: [],
  3981. //>>excludeEnd("ide");
  3982. messageSends: ["addAll:"]
  3983. }),
  3984. $globals.TraitTransformation);
  3985. $core.addMethod(
  3986. $core.method({
  3987. selector: "aliases",
  3988. protocol: "accessing",
  3989. fn: function (){
  3990. var self=this;
  3991. return self["@aliases"];
  3992. },
  3993. //>>excludeStart("ide", pragmas.excludeIdeData);
  3994. args: [],
  3995. source: "aliases\x0a\x09^ aliases",
  3996. referencedClasses: [],
  3997. //>>excludeEnd("ide");
  3998. messageSends: []
  3999. }),
  4000. $globals.TraitTransformation);
  4001. $core.addMethod(
  4002. $core.method({
  4003. selector: "asJavaScriptObject",
  4004. protocol: "converting",
  4005. fn: function (){
  4006. var self=this;
  4007. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4008. return $core.withContext(function($ctx1) {
  4009. //>>excludeEnd("ctx");
  4010. return $globals.HashedCollection._newFromPairs_(["trait",self._trait(),"aliases",self._aliases(),"exclusions",$recv($recv(self._exclusions())._asArray())._sorted()]);
  4011. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4012. }, function($ctx1) {$ctx1.fill(self,"asJavaScriptObject",{},$globals.TraitTransformation)});
  4013. //>>excludeEnd("ctx");
  4014. },
  4015. //>>excludeStart("ide", pragmas.excludeIdeData);
  4016. args: [],
  4017. source: "asJavaScriptObject\x0a\x09^ #{\x0a\x09\x09'trait' -> self trait.\x0a\x09\x09'aliases' -> self aliases.\x0a\x09\x09'exclusions' -> self exclusions asArray sorted }",
  4018. referencedClasses: [],
  4019. //>>excludeEnd("ide");
  4020. messageSends: ["trait", "aliases", "sorted", "asArray", "exclusions"]
  4021. }),
  4022. $globals.TraitTransformation);
  4023. $core.addMethod(
  4024. $core.method({
  4025. selector: "asJavaScriptSource",
  4026. protocol: "converting",
  4027. fn: function (){
  4028. var self=this;
  4029. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4030. return $core.withContext(function($ctx1) {
  4031. //>>excludeEnd("ctx");
  4032. var $2,$3,$1;
  4033. return $recv($globals.String)._streamContents_((function(str){
  4034. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4035. return $core.withContext(function($ctx2) {
  4036. //>>excludeEnd("ctx");
  4037. $2=$recv(self._trait())._asJavaScriptSource();
  4038. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4039. $ctx2.sendIdx["asJavaScriptSource"]=1;
  4040. //>>excludeEnd("ctx");
  4041. $3=$recv(self._aliases())._ifNotEmpty_((function(al){
  4042. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4043. return $core.withContext(function($ctx3) {
  4044. //>>excludeEnd("ctx");
  4045. return [", aliases: ",$recv(al)._asJSONString()];
  4046. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4047. }, function($ctx3) {$ctx3.fillBlock({al:al},$ctx2,2)});
  4048. //>>excludeEnd("ctx");
  4049. }));
  4050. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4051. $ctx2.sendIdx["ifNotEmpty:"]=1;
  4052. //>>excludeEnd("ctx");
  4053. $1=["{trait: ",$2,$3,$recv(self._exclusions())._ifNotEmpty_((function(ex){
  4054. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4055. return $core.withContext(function($ctx3) {
  4056. //>>excludeEnd("ctx");
  4057. return [", exclusions: ",$recv($recv($recv(ex)._asArray())._sorted())._asJavaScriptSource()];
  4058. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4059. }, function($ctx3) {$ctx3.fillBlock({ex:ex},$ctx2,3)});
  4060. //>>excludeEnd("ctx");
  4061. })),"}"];
  4062. return $recv(str)._write_($1);
  4063. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4064. }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1,1)});
  4065. //>>excludeEnd("ctx");
  4066. }));
  4067. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4068. }, function($ctx1) {$ctx1.fill(self,"asJavaScriptSource",{},$globals.TraitTransformation)});
  4069. //>>excludeEnd("ctx");
  4070. },
  4071. //>>excludeStart("ide", pragmas.excludeIdeData);
  4072. args: [],
  4073. 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'}' } ]",
  4074. referencedClasses: ["String"],
  4075. //>>excludeEnd("ide");
  4076. messageSends: ["streamContents:", "write:", "asJavaScriptSource", "trait", "ifNotEmpty:", "aliases", "asJSONString", "exclusions", "sorted", "asArray"]
  4077. }),
  4078. $globals.TraitTransformation);
  4079. $core.addMethod(
  4080. $core.method({
  4081. selector: "asTraitComposition",
  4082. protocol: "converting",
  4083. fn: function (){
  4084. var self=this;
  4085. return [self];
  4086. },
  4087. //>>excludeStart("ide", pragmas.excludeIdeData);
  4088. args: [],
  4089. source: "asTraitComposition\x0a\x09^ { self }",
  4090. referencedClasses: [],
  4091. //>>excludeEnd("ide");
  4092. messageSends: []
  4093. }),
  4094. $globals.TraitTransformation);
  4095. $core.addMethod(
  4096. $core.method({
  4097. selector: "asTraitTransformation",
  4098. protocol: "converting",
  4099. fn: function (){
  4100. var self=this;
  4101. return self;
  4102. },
  4103. //>>excludeStart("ide", pragmas.excludeIdeData);
  4104. args: [],
  4105. source: "asTraitTransformation\x0a\x09^ self",
  4106. referencedClasses: [],
  4107. //>>excludeEnd("ide");
  4108. messageSends: []
  4109. }),
  4110. $globals.TraitTransformation);
  4111. $core.addMethod(
  4112. $core.method({
  4113. selector: "definition",
  4114. protocol: "accessing",
  4115. fn: function (){
  4116. var self=this;
  4117. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4118. return $core.withContext(function($ctx1) {
  4119. //>>excludeEnd("ctx");
  4120. return $recv($globals.String)._streamContents_((function(str){
  4121. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4122. return $core.withContext(function($ctx2) {
  4123. //>>excludeEnd("ctx");
  4124. $recv(str)._print_(self._trait());
  4125. $recv(self._aliases())._ifNotEmpty_((function(al){
  4126. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4127. return $core.withContext(function($ctx3) {
  4128. //>>excludeEnd("ctx");
  4129. $recv(str)._write_(" @ {");
  4130. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4131. $ctx3.sendIdx["write:"]=1;
  4132. //>>excludeEnd("ctx");
  4133. $recv($recv(al)._associations())._do_separatedBy_((function(each){
  4134. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4135. return $core.withContext(function($ctx4) {
  4136. //>>excludeEnd("ctx");
  4137. $recv(str)._printSymbol_($recv(each)._key());
  4138. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4139. $ctx4.sendIdx["printSymbol:"]=1;
  4140. //>>excludeEnd("ctx");
  4141. $recv(str)._write_(" -> ");
  4142. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4143. $ctx4.sendIdx["write:"]=2;
  4144. //>>excludeEnd("ctx");
  4145. return $recv(str)._printSymbol_($recv(each)._value());
  4146. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4147. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3,3)});
  4148. //>>excludeEnd("ctx");
  4149. }),(function(){
  4150. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4151. return $core.withContext(function($ctx4) {
  4152. //>>excludeEnd("ctx");
  4153. return $recv(str)._write_(". ");
  4154. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4155. $ctx4.sendIdx["write:"]=3;
  4156. //>>excludeEnd("ctx");
  4157. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4158. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,4)});
  4159. //>>excludeEnd("ctx");
  4160. }));
  4161. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4162. $ctx3.sendIdx["do:separatedBy:"]=1;
  4163. //>>excludeEnd("ctx");
  4164. return $recv(str)._write_("}");
  4165. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4166. $ctx3.sendIdx["write:"]=4;
  4167. //>>excludeEnd("ctx");
  4168. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4169. }, function($ctx3) {$ctx3.fillBlock({al:al},$ctx2,2)});
  4170. //>>excludeEnd("ctx");
  4171. }));
  4172. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4173. $ctx2.sendIdx["ifNotEmpty:"]=1;
  4174. //>>excludeEnd("ctx");
  4175. return $recv(self._exclusions())._ifNotEmpty_((function(ex){
  4176. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4177. return $core.withContext(function($ctx3) {
  4178. //>>excludeEnd("ctx");
  4179. $recv(str)._write_(" - #(");
  4180. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4181. $ctx3.sendIdx["write:"]=5;
  4182. //>>excludeEnd("ctx");
  4183. $recv($recv($recv(ex)._asArray())._sorted())._do_separatedBy_((function(each){
  4184. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4185. return $core.withContext(function($ctx4) {
  4186. //>>excludeEnd("ctx");
  4187. return $recv(str)._write_($recv($recv(each)._symbolPrintString())._allButFirst());
  4188. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4189. $ctx4.sendIdx["write:"]=6;
  4190. //>>excludeEnd("ctx");
  4191. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4192. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3,6)});
  4193. //>>excludeEnd("ctx");
  4194. }),(function(){
  4195. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4196. return $core.withContext(function($ctx4) {
  4197. //>>excludeEnd("ctx");
  4198. return $recv(str)._space();
  4199. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4200. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,7)});
  4201. //>>excludeEnd("ctx");
  4202. }));
  4203. return $recv(str)._write_(")");
  4204. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4205. }, function($ctx3) {$ctx3.fillBlock({ex:ex},$ctx2,5)});
  4206. //>>excludeEnd("ctx");
  4207. }));
  4208. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4209. }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1,1)});
  4210. //>>excludeEnd("ctx");
  4211. }));
  4212. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4213. }, function($ctx1) {$ctx1.fill(self,"definition",{},$globals.TraitTransformation)});
  4214. //>>excludeEnd("ctx");
  4215. },
  4216. //>>excludeStart("ide", pragmas.excludeIdeData);
  4217. args: [],
  4218. 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: ')' ] ]",
  4219. referencedClasses: ["String"],
  4220. //>>excludeEnd("ide");
  4221. messageSends: ["streamContents:", "print:", "trait", "ifNotEmpty:", "aliases", "write:", "do:separatedBy:", "associations", "printSymbol:", "key", "value", "exclusions", "sorted", "asArray", "allButFirst", "symbolPrintString", "space"]
  4222. }),
  4223. $globals.TraitTransformation);
  4224. $core.addMethod(
  4225. $core.method({
  4226. selector: "exclusions",
  4227. protocol: "accessing",
  4228. fn: function (){
  4229. var self=this;
  4230. return self["@exclusions"];
  4231. },
  4232. //>>excludeStart("ide", pragmas.excludeIdeData);
  4233. args: [],
  4234. source: "exclusions\x0a\x09^ exclusions",
  4235. referencedClasses: [],
  4236. //>>excludeEnd("ide");
  4237. messageSends: []
  4238. }),
  4239. $globals.TraitTransformation);
  4240. $core.addMethod(
  4241. $core.method({
  4242. selector: "initialize",
  4243. protocol: "initialization",
  4244. fn: function (){
  4245. var self=this;
  4246. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4247. return $core.withContext(function($ctx1) {
  4248. //>>excludeEnd("ctx");
  4249. (
  4250. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4251. $ctx1.supercall = true,
  4252. //>>excludeEnd("ctx");
  4253. ($globals.TraitTransformation.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($recv(self), []));
  4254. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4255. $ctx1.supercall = false;
  4256. //>>excludeEnd("ctx");;
  4257. self["@aliases"]=$globals.HashedCollection._newFromPairs_([]);
  4258. self["@exclusions"]=$recv($globals.Set)._new();
  4259. self["@trait"]=nil;
  4260. return self;
  4261. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4262. }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.TraitTransformation)});
  4263. //>>excludeEnd("ctx");
  4264. },
  4265. //>>excludeStart("ide", pragmas.excludeIdeData);
  4266. args: [],
  4267. source: "initialize\x0a\x09super initialize.\x0a\x0a\x09aliases := #{}.\x0a\x09exclusions := Set new.\x0a\x09trait := nil",
  4268. referencedClasses: ["Set"],
  4269. //>>excludeEnd("ide");
  4270. messageSends: ["initialize", "new"]
  4271. }),
  4272. $globals.TraitTransformation);
  4273. $core.addMethod(
  4274. $core.method({
  4275. selector: "postCopy",
  4276. protocol: "copying",
  4277. fn: function (){
  4278. var self=this;
  4279. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4280. return $core.withContext(function($ctx1) {
  4281. //>>excludeEnd("ctx");
  4282. self["@aliases"]=$recv(self["@aliases"])._copy();
  4283. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4284. $ctx1.sendIdx["copy"]=1;
  4285. //>>excludeEnd("ctx");
  4286. self["@exclusions"]=$recv(self["@exclusions"])._copy();
  4287. return self;
  4288. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4289. }, function($ctx1) {$ctx1.fill(self,"postCopy",{},$globals.TraitTransformation)});
  4290. //>>excludeEnd("ctx");
  4291. },
  4292. //>>excludeStart("ide", pragmas.excludeIdeData);
  4293. args: [],
  4294. source: "postCopy\x0a\x09aliases := aliases copy.\x0a\x09exclusions := exclusions copy",
  4295. referencedClasses: [],
  4296. //>>excludeEnd("ide");
  4297. messageSends: ["copy"]
  4298. }),
  4299. $globals.TraitTransformation);
  4300. $core.addMethod(
  4301. $core.method({
  4302. selector: "trait",
  4303. protocol: "accessing",
  4304. fn: function (){
  4305. var self=this;
  4306. return self["@trait"];
  4307. },
  4308. //>>excludeStart("ide", pragmas.excludeIdeData);
  4309. args: [],
  4310. source: "trait\x0a\x09^ trait",
  4311. referencedClasses: [],
  4312. //>>excludeEnd("ide");
  4313. messageSends: []
  4314. }),
  4315. $globals.TraitTransformation);
  4316. $core.addMethod(
  4317. $core.method({
  4318. selector: "trait:",
  4319. protocol: "accessing",
  4320. fn: function (anObject){
  4321. var self=this;
  4322. self["@trait"]=anObject;
  4323. return self;
  4324. },
  4325. //>>excludeStart("ide", pragmas.excludeIdeData);
  4326. args: ["anObject"],
  4327. source: "trait: anObject\x0a\x09trait := anObject",
  4328. referencedClasses: [],
  4329. //>>excludeEnd("ide");
  4330. messageSends: []
  4331. }),
  4332. $globals.TraitTransformation);
  4333. $core.addMethod(
  4334. $core.method({
  4335. selector: "fromJSON:",
  4336. protocol: "instance creation",
  4337. fn: function (aJSObject){
  4338. var self=this;
  4339. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4340. return $core.withContext(function($ctx1) {
  4341. //>>excludeEnd("ctx");
  4342. var $1,$4,$3,$2;
  4343. $1=(
  4344. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4345. $ctx1.supercall = true,
  4346. //>>excludeEnd("ctx");
  4347. ($globals.TraitTransformation.klass.superclass||$boot.nilAsClass).fn.prototype._new.apply($recv(self), []));
  4348. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4349. $ctx1.supercall = false;
  4350. //>>excludeEnd("ctx");;
  4351. $recv($1)._trait_($recv(aJSObject)._at_("trait"));
  4352. $4=$recv(aJSObject)._at_ifAbsent_("aliases",(function(){
  4353. return $globals.HashedCollection._newFromPairs_([]);
  4354. }));
  4355. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4356. $ctx1.sendIdx["at:ifAbsent:"]=1;
  4357. //>>excludeEnd("ctx");
  4358. $3=$recv($globals.Smalltalk)._readJSObject_($4);
  4359. $2=$recv($3)._associations();
  4360. $recv($1)._addAliases_($2);
  4361. $recv($1)._addExclusions_($recv(aJSObject)._at_ifAbsent_("exclusions",(function(){
  4362. return [];
  4363. })));
  4364. return $recv($1)._yourself();
  4365. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4366. }, function($ctx1) {$ctx1.fill(self,"fromJSON:",{aJSObject:aJSObject},$globals.TraitTransformation.klass)});
  4367. //>>excludeEnd("ctx");
  4368. },
  4369. //>>excludeStart("ide", pragmas.excludeIdeData);
  4370. args: ["aJSObject"],
  4371. 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",
  4372. referencedClasses: ["Smalltalk"],
  4373. //>>excludeEnd("ide");
  4374. messageSends: ["trait:", "new", "at:", "addAliases:", "associations", "readJSObject:", "at:ifAbsent:", "addExclusions:", "yourself"]
  4375. }),
  4376. $globals.TraitTransformation.klass);
  4377. $core.addMethod(
  4378. $core.method({
  4379. selector: "on:",
  4380. protocol: "instance creation",
  4381. fn: function (aTrait){
  4382. var self=this;
  4383. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4384. return $core.withContext(function($ctx1) {
  4385. //>>excludeEnd("ctx");
  4386. var $1;
  4387. $1=(
  4388. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4389. $ctx1.supercall = true,
  4390. //>>excludeEnd("ctx");
  4391. ($globals.TraitTransformation.klass.superclass||$boot.nilAsClass).fn.prototype._new.apply($recv(self), []));
  4392. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4393. $ctx1.supercall = false;
  4394. //>>excludeEnd("ctx");;
  4395. $recv($1)._trait_(aTrait);
  4396. return $recv($1)._yourself();
  4397. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4398. }, function($ctx1) {$ctx1.fill(self,"on:",{aTrait:aTrait},$globals.TraitTransformation.klass)});
  4399. //>>excludeEnd("ctx");
  4400. },
  4401. //>>excludeStart("ide", pragmas.excludeIdeData);
  4402. args: ["aTrait"],
  4403. source: "on: aTrait\x0a\x09^ super new trait: aTrait; yourself",
  4404. referencedClasses: [],
  4405. //>>excludeEnd("ide");
  4406. messageSends: ["trait:", "new", "yourself"]
  4407. }),
  4408. $globals.TraitTransformation.klass);
  4409. $core.addMethod(
  4410. $core.method({
  4411. selector: "asTraitComposition",
  4412. protocol: "*Kernel-Classes",
  4413. fn: function (){
  4414. var self=this;
  4415. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4416. return $core.withContext(function($ctx1) {
  4417. //>>excludeEnd("ctx");
  4418. return self._collect_((function(each){
  4419. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4420. return $core.withContext(function($ctx2) {
  4421. //>>excludeEnd("ctx");
  4422. return $recv(each)._asTraitTransformation();
  4423. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4424. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  4425. //>>excludeEnd("ctx");
  4426. }));
  4427. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4428. }, function($ctx1) {$ctx1.fill(self,"asTraitComposition",{},$globals.Array)});
  4429. //>>excludeEnd("ctx");
  4430. },
  4431. //>>excludeStart("ide", pragmas.excludeIdeData);
  4432. args: [],
  4433. source: "asTraitComposition\x0a\x09\x22not implemented yet, noop atm\x22\x0a\x09^ self collect: [ :each | each asTraitTransformation ]",
  4434. referencedClasses: [],
  4435. //>>excludeEnd("ide");
  4436. messageSends: ["collect:", "asTraitTransformation"]
  4437. }),
  4438. $globals.Array);
  4439. $core.addMethod(
  4440. $core.method({
  4441. selector: "subclass:",
  4442. protocol: "*Kernel-Classes",
  4443. fn: function (aString){
  4444. var self=this;
  4445. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4446. return $core.withContext(function($ctx1) {
  4447. //>>excludeEnd("ctx");
  4448. return self._subclass_instanceVariableNames_package_(aString,"",nil);
  4449. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4450. }, function($ctx1) {$ctx1.fill(self,"subclass:",{aString:aString},$globals.UndefinedObject)});
  4451. //>>excludeEnd("ctx");
  4452. },
  4453. //>>excludeStart("ide", pragmas.excludeIdeData);
  4454. args: ["aString"],
  4455. source: "subclass: aString \x0a\x09\x22Kept for file-in compatibility.\x22\x0a\x09^ self subclass: aString instanceVariableNames: '' package: nil",
  4456. referencedClasses: [],
  4457. //>>excludeEnd("ide");
  4458. messageSends: ["subclass:instanceVariableNames:package:"]
  4459. }),
  4460. $globals.UndefinedObject);
  4461. $core.addMethod(
  4462. $core.method({
  4463. selector: "subclass:instanceVariableNames:",
  4464. protocol: "*Kernel-Classes",
  4465. fn: function (aString,anotherString){
  4466. var self=this;
  4467. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4468. return $core.withContext(function($ctx1) {
  4469. //>>excludeEnd("ctx");
  4470. return self._subclass_instanceVariableNames_package_(aString,anotherString,nil);
  4471. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4472. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:",{aString:aString,anotherString:anotherString},$globals.UndefinedObject)});
  4473. //>>excludeEnd("ctx");
  4474. },
  4475. //>>excludeStart("ide", pragmas.excludeIdeData);
  4476. args: ["aString", "anotherString"],
  4477. source: "subclass: aString instanceVariableNames: anotherString\x0a\x09\x22Kept for file-in compatibility.\x22\x0a\x09^ self subclass: aString instanceVariableNames: anotherString package: nil",
  4478. referencedClasses: [],
  4479. //>>excludeEnd("ide");
  4480. messageSends: ["subclass:instanceVariableNames:package:"]
  4481. }),
  4482. $globals.UndefinedObject);
  4483. $core.addMethod(
  4484. $core.method({
  4485. selector: "subclass:instanceVariableNames:category:",
  4486. protocol: "*Kernel-Classes",
  4487. fn: function (aString,aString2,aString3){
  4488. var self=this;
  4489. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4490. return $core.withContext(function($ctx1) {
  4491. //>>excludeEnd("ctx");
  4492. return self._subclass_instanceVariableNames_package_(aString,aString2,aString3);
  4493. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4494. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:category:",{aString:aString,aString2:aString2,aString3:aString3},$globals.UndefinedObject)});
  4495. //>>excludeEnd("ctx");
  4496. },
  4497. //>>excludeStart("ide", pragmas.excludeIdeData);
  4498. args: ["aString", "aString2", "aString3"],
  4499. source: "subclass: aString instanceVariableNames: aString2 category: aString3\x0a\x09\x22Kept for file-in compatibility.\x22\x0a\x09^ self subclass: aString instanceVariableNames: aString2 package: aString3",
  4500. referencedClasses: [],
  4501. //>>excludeEnd("ide");
  4502. messageSends: ["subclass:instanceVariableNames:package:"]
  4503. }),
  4504. $globals.UndefinedObject);
  4505. $core.addMethod(
  4506. $core.method({
  4507. selector: "subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:",
  4508. protocol: "*Kernel-Classes",
  4509. fn: function (aString,aString2,classVars,pools,aString3){
  4510. var self=this;
  4511. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4512. return $core.withContext(function($ctx1) {
  4513. //>>excludeEnd("ctx");
  4514. return self._subclass_instanceVariableNames_package_(aString,aString2,aString3);
  4515. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4516. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:",{aString:aString,aString2:aString2,classVars:classVars,pools:pools,aString3:aString3},$globals.UndefinedObject)});
  4517. //>>excludeEnd("ctx");
  4518. },
  4519. //>>excludeStart("ide", pragmas.excludeIdeData);
  4520. args: ["aString", "aString2", "classVars", "pools", "aString3"],
  4521. 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",
  4522. referencedClasses: [],
  4523. //>>excludeEnd("ide");
  4524. messageSends: ["subclass:instanceVariableNames:package:"]
  4525. }),
  4526. $globals.UndefinedObject);
  4527. $core.addMethod(
  4528. $core.method({
  4529. selector: "subclass:instanceVariableNames:package:",
  4530. protocol: "*Kernel-Classes",
  4531. fn: function (aString,aString2,aString3){
  4532. var self=this;
  4533. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4534. return $core.withContext(function($ctx1) {
  4535. //>>excludeEnd("ctx");
  4536. return $recv($recv($globals.ClassBuilder)._new())._superclass_subclass_instanceVariableNames_package_(self,$recv(aString)._asString(),aString2,aString3);
  4537. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4538. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:package:",{aString:aString,aString2:aString2,aString3:aString3},$globals.UndefinedObject)});
  4539. //>>excludeEnd("ctx");
  4540. },
  4541. //>>excludeStart("ide", pragmas.excludeIdeData);
  4542. args: ["aString", "aString2", "aString3"],
  4543. source: "subclass: aString instanceVariableNames: aString2 package: aString3\x0a\x09^ ClassBuilder new\x0a\x09\x09superclass: self subclass: aString asString instanceVariableNames: aString2 package: aString3",
  4544. referencedClasses: ["ClassBuilder"],
  4545. //>>excludeEnd("ide");
  4546. messageSends: ["superclass:subclass:instanceVariableNames:package:", "new", "asString"]
  4547. }),
  4548. $globals.UndefinedObject);
  4549. $core.addMethod(
  4550. $core.method({
  4551. selector: "subclass:uses:",
  4552. protocol: "*Kernel-Classes",
  4553. fn: function (aString,aTraitCompositionDescription){
  4554. var self=this;
  4555. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4556. return $core.withContext(function($ctx1) {
  4557. //>>excludeEnd("ctx");
  4558. return self._subclass_uses_instanceVariableNames_package_(aString,aTraitCompositionDescription,"",nil);
  4559. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4560. }, function($ctx1) {$ctx1.fill(self,"subclass:uses:",{aString:aString,aTraitCompositionDescription:aTraitCompositionDescription},$globals.UndefinedObject)});
  4561. //>>excludeEnd("ctx");
  4562. },
  4563. //>>excludeStart("ide", pragmas.excludeIdeData);
  4564. args: ["aString", "aTraitCompositionDescription"],
  4565. source: "subclass: aString uses: aTraitCompositionDescription \x0a\x09\x22Kept for file-in compatibility.\x22\x0a\x09^ self subclass: aString uses: aTraitCompositionDescription instanceVariableNames: '' package: nil",
  4566. referencedClasses: [],
  4567. //>>excludeEnd("ide");
  4568. messageSends: ["subclass:uses:instanceVariableNames:package:"]
  4569. }),
  4570. $globals.UndefinedObject);
  4571. $core.addMethod(
  4572. $core.method({
  4573. selector: "subclass:uses:instanceVariableNames:",
  4574. protocol: "*Kernel-Classes",
  4575. fn: function (aString,aTraitCompositionDescription,anotherString){
  4576. var self=this;
  4577. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4578. return $core.withContext(function($ctx1) {
  4579. //>>excludeEnd("ctx");
  4580. return self._subclass_uses_instanceVariableNames_package_(aString,aTraitCompositionDescription,anotherString,nil);
  4581. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4582. }, function($ctx1) {$ctx1.fill(self,"subclass:uses:instanceVariableNames:",{aString:aString,aTraitCompositionDescription:aTraitCompositionDescription,anotherString:anotherString},$globals.UndefinedObject)});
  4583. //>>excludeEnd("ctx");
  4584. },
  4585. //>>excludeStart("ide", pragmas.excludeIdeData);
  4586. args: ["aString", "aTraitCompositionDescription", "anotherString"],
  4587. 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",
  4588. referencedClasses: [],
  4589. //>>excludeEnd("ide");
  4590. messageSends: ["subclass:uses:instanceVariableNames:package:"]
  4591. }),
  4592. $globals.UndefinedObject);
  4593. $core.addMethod(
  4594. $core.method({
  4595. selector: "subclass:uses:instanceVariableNames:category:",
  4596. protocol: "*Kernel-Classes",
  4597. fn: function (aString,aTraitCompositionDescription,aString2,aString3){
  4598. var self=this;
  4599. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4600. return $core.withContext(function($ctx1) {
  4601. //>>excludeEnd("ctx");
  4602. return self._subclass_uses_instanceVariableNames_package_(aString,aTraitCompositionDescription,aString2,aString3);
  4603. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4604. }, function($ctx1) {$ctx1.fill(self,"subclass:uses:instanceVariableNames:category:",{aString:aString,aTraitCompositionDescription:aTraitCompositionDescription,aString2:aString2,aString3:aString3},$globals.UndefinedObject)});
  4605. //>>excludeEnd("ctx");
  4606. },
  4607. //>>excludeStart("ide", pragmas.excludeIdeData);
  4608. args: ["aString", "aTraitCompositionDescription", "aString2", "aString3"],
  4609. 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",
  4610. referencedClasses: [],
  4611. //>>excludeEnd("ide");
  4612. messageSends: ["subclass:uses:instanceVariableNames:package:"]
  4613. }),
  4614. $globals.UndefinedObject);
  4615. $core.addMethod(
  4616. $core.method({
  4617. selector: "subclass:uses:instanceVariableNames:classVariableNames:poolDictionaries:category:",
  4618. protocol: "*Kernel-Classes",
  4619. fn: function (aString,aTraitCompositionDescription,aString2,classVars,pools,aString3){
  4620. var self=this;
  4621. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4622. return $core.withContext(function($ctx1) {
  4623. //>>excludeEnd("ctx");
  4624. return self._subclass_uses_instanceVariableNames_package_(aString,aTraitCompositionDescription,aString2,aString3);
  4625. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4626. }, 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)});
  4627. //>>excludeEnd("ctx");
  4628. },
  4629. //>>excludeStart("ide", pragmas.excludeIdeData);
  4630. args: ["aString", "aTraitCompositionDescription", "aString2", "classVars", "pools", "aString3"],
  4631. 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",
  4632. referencedClasses: [],
  4633. //>>excludeEnd("ide");
  4634. messageSends: ["subclass:uses:instanceVariableNames:package:"]
  4635. }),
  4636. $globals.UndefinedObject);
  4637. $core.addMethod(
  4638. $core.method({
  4639. selector: "subclass:uses:instanceVariableNames:package:",
  4640. protocol: "*Kernel-Classes",
  4641. fn: function (aString,aTraitCompositionDescription,aString2,aString3){
  4642. var self=this;
  4643. var cls;
  4644. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4645. return $core.withContext(function($ctx1) {
  4646. //>>excludeEnd("ctx");
  4647. cls=self._subclass_instanceVariableNames_package_(aString,aString2,aString3);
  4648. $recv(cls)._setTraitComposition_($recv(aTraitCompositionDescription)._asTraitComposition());
  4649. return cls;
  4650. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4651. }, function($ctx1) {$ctx1.fill(self,"subclass:uses:instanceVariableNames:package:",{aString:aString,aTraitCompositionDescription:aTraitCompositionDescription,aString2:aString2,aString3:aString3,cls:cls},$globals.UndefinedObject)});
  4652. //>>excludeEnd("ctx");
  4653. },
  4654. //>>excludeStart("ide", pragmas.excludeIdeData);
  4655. args: ["aString", "aTraitCompositionDescription", "aString2", "aString3"],
  4656. 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",
  4657. referencedClasses: [],
  4658. //>>excludeEnd("ide");
  4659. messageSends: ["subclass:instanceVariableNames:package:", "setTraitComposition:", "asTraitComposition"]
  4660. }),
  4661. $globals.UndefinedObject);
  4662. });