1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663 |
- define(["amber/boot", "require", "amber/core/Kernel-Collections", "amber/core/Kernel-Helpers", "amber/core/Kernel-Objects"], function($boot,requirejs){"use strict";
- var $core=$boot.api,nil=$boot.nilAsValue,$nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;
- var $pkg = $core.addPackage("Kernel-Classes");
- $pkg.transport = {"type":"amd","amdNamespace":"amber/core"};
- $core.addClass("Behavior", $globals.Object, "Kernel-Classes");
- $core.setSlots($globals.Behavior, ["organization", "slots", "fn", "superclass"]);
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $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.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "allSelectors",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "allSelectors\x0a\x09^ self allSuperclasses\x0a\x09\x09inject: self selectors\x0a\x09\x09into: [ :acc :each | acc addAll: each selectors; yourself ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["inject:into:", "allSuperclasses", "selectors", "addAll:", "yourself"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self._allSuperclasses())._inject_into_([$self._selectors()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["selectors"]=1
- //>>excludeEnd("ctx");
- ][0],(function(acc,each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $recv(acc)._addAll_($recv(each)._selectors());
- return $recv(acc)._yourself();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({acc:acc,each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"allSelectors",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "allSubclasses",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- 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 ] ]",
- referencedClasses: ["Array"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["streamContents:", "allSubclassesDo:", "nextPut:"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($globals.Array)._streamContents_((function(str){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $self._allSubclassesDo_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- return $recv(str)._nextPut_(each);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"allSubclasses",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "allSubclassesDo:",
- protocol: "enumerating",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aBlock"],
- 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})'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["$core.traverseClassTree(self, function(subclass) {\x0a\x09if (subclass !== self) aBlock._value_(subclass);\x0a})"]]],
- messageSends: []
- }, function ($methodClass){ return function (aBlock){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $core.traverseClassTree(self, function(subclass) {
- if (subclass !== self) aBlock._value_(subclass);
- });
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"allSubclassesDo:",{aBlock:aBlock})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "allSuperclasses",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "allSuperclasses\x0a\x09\x0a\x09self superclass ifNil: [ ^ #() ].\x0a\x09\x0a\x09^ self superclass allSuperclasses copyWithFirst: self superclass",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifNil:", "superclass", "copyWithFirst:", "allSuperclasses"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=[$self._superclass()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["superclass"]=1
- //>>excludeEnd("ctx");
- ][0];
- if($1 == null || $1.a$nil){
- return [];
- } else {
- $1;
- }
- return $recv($recv([$self._superclass()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["superclass"]=2
- //>>excludeEnd("ctx");
- ][0])._allSuperclasses())._copyWithFirst_($self._superclass());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"allSuperclasses",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "alternateConstructorViaSelector:",
- protocol: "instance creation",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aSelector"],
- source: "alternateConstructorViaSelector: aSelector\x0a\x09^ BlockClosure\x0a\x09\x09javaScriptConstructorFor: self prototype\x0a\x09\x09initializingVia: (self >> aSelector) fn",
- referencedClasses: ["BlockClosure"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["javaScriptConstructorFor:initializingVia:", "prototype", "fn", ">>"]
- }, function ($methodClass){ return function (aSelector){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($globals.BlockClosure)._javaScriptConstructorFor_initializingVia_($self._prototype(),$recv($self.__gt_gt(aSelector))._fn());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"alternateConstructorViaSelector:",{aSelector:aSelector})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "applySuperConstructorOn:withArguments:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anObject", "anArray"],
- source: "applySuperConstructorOn: anObject withArguments: anArray\x0a\x09<inlineJS: '\x0a\x09\x09Object.getPrototypeOf($self.fn.prototype).constructor\x0a\x09\x09.apply(anObject, anArray)\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09Object.getPrototypeOf($self.fn.prototype).constructor\x0a\x09\x09.apply(anObject, anArray)\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (anObject,anArray){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- Object.getPrototypeOf($self.fn.prototype).constructor
- .apply(anObject, anArray)
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"applySuperConstructorOn:withArguments:",{anObject:anObject,anArray:anArray})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "basicNew",
- protocol: "instance creation",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "basicNew\x0a\x09<inlineJS: 'return new self.fn()'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["return new self.fn()"]]],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return new self.fn();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"basicNew",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "basicOrganization",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "basicOrganization\x0a\x09^ organization",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return $self.organization;
- }; }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "basicOrganization:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClassOrganizer"],
- source: "basicOrganization: aClassOrganizer\x0a\x09organization := aClassOrganizer",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (aClassOrganizer){
- var self=this,$self=this;
- $self.organization=aClassOrganizer;
- return self;
- }; }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "beJavaScriptSubclassOf:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aJavaScriptFunction"],
- source: "beJavaScriptSubclassOf: aJavaScriptFunction\x0a\x09\x22Reparent the JS constructor's prototype to aJavaScriptFunction's one,\x0a\x09plus bookkeeping. That way I stay part of (simulated) Smalltalk hierarchy,\x0a\x09but my instances will physically be instanceof aJavaScriptFunction.\x22\x0a\x0a\x09self makeJavaScriptConstructorSubclassOf: aJavaScriptFunction.\x0a\x09Smalltalk core detachClass: self",
- referencedClasses: ["Smalltalk"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["makeJavaScriptConstructorSubclassOf:", "detachClass:", "core"]
- }, function ($methodClass){ return function (aJavaScriptFunction){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $self._makeJavaScriptConstructorSubclassOf_(aJavaScriptFunction);
- $recv($recv($globals.Smalltalk)._core())._detachClass_(self);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"beJavaScriptSubclassOf:",{aJavaScriptFunction:aJavaScriptFunction})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "canUnderstand:",
- protocol: "testing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aSelector"],
- source: "canUnderstand: aSelector\x0a\x09^ (self lookupSelector: aSelector) notNil",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["notNil", "lookupSelector:"]
- }, function ($methodClass){ return function (aSelector){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self._lookupSelector_(aSelector))._notNil();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"canUnderstand:",{aSelector:aSelector})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "includesBehavior:",
- protocol: "testing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass"],
- source: "includesBehavior: aClass\x0a\x09^ self == aClass or: [\x0a\x09\x09\x09self inheritsFrom: aClass ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["or:", "==", "inheritsFrom:"]
- }, function ($methodClass){ return function (aClass){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- if($core.assert($self.__eq_eq(aClass))){
- return true;
- } else {
- return $self._inheritsFrom_(aClass);
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"includesBehavior:",{aClass:aClass})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "inheritsFrom:",
- protocol: "testing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass"],
- source: "inheritsFrom: aClass\x0a\x09^ self superclass\x0a\x09\x09ifNil: [ false ]\x0a\x09\x09ifNotNil: [ :superClass | superClass includesBehavior: aClass ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifNil:ifNotNil:", "superclass", "includesBehavior:"]
- }, function ($methodClass){ return function (aClass){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$self._superclass();
- if($1 == null || $1.a$nil){
- return false;
- } else {
- var superClass;
- superClass=$1;
- return $recv(superClass)._includesBehavior_(aClass);
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"inheritsFrom:",{aClass:aClass})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "isBehavior",
- protocol: "testing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "isBehavior\x0a\x09^ true",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return true;
- }; }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "javaScriptConstructor",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "javaScriptConstructor\x0a\x09\x22Answer the JS constructor used to instantiate. See kernel-language.js\x22\x0a\x09\x0a\x09^ fn",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return $self.fn;
- }; }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "javaScriptConstructor:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aJavaScriptFunction"],
- 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\x09Smalltalk core setClassConstructor: self to: aJavaScriptFunction",
- referencedClasses: ["Smalltalk"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["setClassConstructor:to:", "core"]
- }, function ($methodClass){ return function (aJavaScriptFunction){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv($recv($globals.Smalltalk)._core())._setClassConstructor_to_(self,aJavaScriptFunction);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"javaScriptConstructor:",{aJavaScriptFunction:aJavaScriptFunction})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "javascriptConstructor",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "javascriptConstructor\x0a\x09self deprecatedAPI: 'Use #javaScriptConstructor instead.'.\x0a\x09^ self javaScriptConstructor",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["deprecatedAPI:", "javaScriptConstructor"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $self._deprecatedAPI_("Use #javaScriptConstructor instead.");
- return $self._javaScriptConstructor();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"javascriptConstructor",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "javascriptConstructor:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aJavaScriptFunction"],
- source: "javascriptConstructor: aJavaScriptFunction\x0a\x09self deprecatedAPI: 'Use #javaScriptConstructor: instead.'.\x0a\x09^ self javaScriptConstructor: aJavaScriptFunction",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["deprecatedAPI:", "javaScriptConstructor:"]
- }, function ($methodClass){ return function (aJavaScriptFunction){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $self._deprecatedAPI_("Use #javaScriptConstructor: instead.");
- return $self._javaScriptConstructor_(aJavaScriptFunction);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"javascriptConstructor:",{aJavaScriptFunction:aJavaScriptFunction})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "lookupSelector:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["selector"],
- 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<inlineJS: 'return $self.methods[selector]'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["return $self.methods[selector]"]]],
- messageSends: []
- }, function ($methodClass){ return function (selector){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $self.methods[selector];
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"lookupSelector:",{selector:selector})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "makeJavaScriptConstructorSubclassOf:",
- protocol: "private",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["javaScriptClass"],
- source: "makeJavaScriptConstructorSubclassOf: javaScriptClass\x0a\x09<inlineJS: '\x0a\x09\x09Object.setPrototypeOf($self.fn.prototype, javaScriptClass.prototype);\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09Object.setPrototypeOf($self.fn.prototype, javaScriptClass.prototype);\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (javaScriptClass){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- Object.setPrototypeOf($self.fn.prototype, javaScriptClass.prototype);
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"makeJavaScriptConstructorSubclassOf:",{javaScriptClass:javaScriptClass})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "new",
- protocol: "instance creation",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "new\x0a\x09^ self basicNew initialize",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["initialize", "basicNew"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self._basicNew())._initialize();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"new",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "prototype",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "prototype\x0a\x09^ self javaScriptConstructor prototype",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["prototype", "javaScriptConstructor"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self._javaScriptConstructor())._prototype();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"prototype",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "slots",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "slots\x0a\x09^ slots",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return $self.slots;
- }; }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "subclasses",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "subclasses\x0a\x09self subclassResponsibility",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["subclassResponsibility"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $self._subclassResponsibility();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"subclasses",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "superPrototype",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "superPrototype\x0a\x09<inlineJS: 'return Object.getPrototypeOf($self.fn.prototype)'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["return Object.getPrototypeOf($self.fn.prototype)"]]],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return Object.getPrototypeOf($self.fn.prototype);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"superPrototype",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "superclass",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "superclass\x0a\x09^ superclass",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return $self.superclass;
- }; }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "theMetaClass",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "theMetaClass\x0a\x09self subclassResponsibility",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["subclassResponsibility"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $self._subclassResponsibility();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"theMetaClass",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "theNonMetaClass",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "theNonMetaClass\x0a\x09self subclassResponsibility",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["subclassResponsibility"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $self._subclassResponsibility();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"theNonMetaClass",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "withAllSubclasses",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "withAllSubclasses\x0a\x09^ self allSubclasses copyWithFirst: self",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["copyWithFirst:", "allSubclasses"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self._allSubclasses())._copyWithFirst_(self);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"withAllSubclasses",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Behavior);
- $core.addClass("Class", $globals.Behavior, "Kernel-Classes");
- $core.setSlots($globals.Class, ["package", "subclasses"]);
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $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.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "basicPackage:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage"],
- source: "basicPackage: aPackage\x0a\x09package := aPackage",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (aPackage){
- var self=this,$self=this;
- $self.package=aPackage;
- return self;
- }; }),
- $globals.Class);
- $core.addMethod(
- $core.method({
- selector: "classTag",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- 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'",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return "class";
- }; }),
- $globals.Class);
- $core.addMethod(
- $core.method({
- selector: "definition",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- 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: {'slots: {'. ('. ' join: (self instanceVariableNames collect: #symbolPrintString)). '}'}; lf;\x0a\x09\x09tab; write: 'package: '; print: self category ]",
- referencedClasses: ["String"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["streamContents:", "print:", "superclass", "write:", "printSymbol:", "name", "lf", "ifNotEmpty:", "traitCompositionDefinition", "tab", "join:", "collect:", "instanceVariableNames", "category"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($globals.String)._streamContents_((function(stream){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- [$recv(stream)._print_($self._superclass())
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["print:"]=1
- //>>excludeEnd("ctx");
- ][0];
- [$recv(stream)._write_(" subclass: ")
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["write:"]=1
- //>>excludeEnd("ctx");
- ][0];
- $recv(stream)._printSymbol_($self._name());
- [$recv(stream)._lf()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["lf"]=1
- //>>excludeEnd("ctx");
- ][0];
- [$recv(stream)._write_($recv($self._traitCompositionDefinition())._ifNotEmpty_((function(tcd){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- return [[$recv($globals.String)._tab()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx3.sendIdx["tab"]=1
- //>>excludeEnd("ctx");
- ][0],"uses: ",tcd,[$recv($globals.String)._lf()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx3.sendIdx["lf"]=2
- //>>excludeEnd("ctx");
- ][0]];
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({tcd:tcd},$ctx2,2)});
- //>>excludeEnd("ctx");
- })))
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["write:"]=2
- //>>excludeEnd("ctx");
- ][0];
- [$recv(stream)._tab()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["tab"]=2
- //>>excludeEnd("ctx");
- ][0];
- [$recv(stream)._write_(["slots: {",". "._join_($recv($self._instanceVariableNames())._collect_("symbolPrintString")),"}"])
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["write:"]=3
- //>>excludeEnd("ctx");
- ][0];
- $recv(stream)._lf();
- $recv(stream)._tab();
- $recv(stream)._write_("package: ");
- return $recv(stream)._print_($self._category());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"definition",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Class);
- $core.addMethod(
- $core.method({
- selector: "includingPossibleMetaDo:",
- protocol: "enumerating",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aBlock"],
- source: "includingPossibleMetaDo: aBlock\x0a\x0a\x09aBlock value: self.\x0a\x09aBlock value: self theMetaClass",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["value:", "theMetaClass"]
- }, function ($methodClass){ return function (aBlock){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- [$recv(aBlock)._value_(self)
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["value:"]=1
- //>>excludeEnd("ctx");
- ][0];
- $recv(aBlock)._value_($self._theMetaClass());
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"includingPossibleMetaDo:",{aBlock:aBlock})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Class);
- $core.addMethod(
- $core.method({
- selector: "isClass",
- protocol: "testing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "isClass\x0a\x09^ true",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return true;
- }; }),
- $globals.Class);
- $core.addMethod(
- $core.method({
- selector: "package",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "package\x0a\x09^ package",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return $self.package;
- }; }),
- $globals.Class);
- $core.addMethod(
- $core.method({
- selector: "provided",
- protocol: "converting",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "provided\x0a\x09\x22Returns JS proxy that allows to access 'static API', as in\x0a\x09 Number provided EPSILON\x0a\x09that forwards to (wrapped JS) constructor function.\x22\x0a\x09\x0a\x09^ self javaScriptConstructor provided",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["provided", "javaScriptConstructor"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self._javaScriptConstructor())._provided();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"provided",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Class);
- $core.addMethod(
- $core.method({
- selector: "rename:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "rename: aString\x0a\x09ClassBuilder new renameClass: self to: aString",
- referencedClasses: ["ClassBuilder"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["renameClass:to:", "new"]
- }, function ($methodClass){ return function (aString){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv($recv($globals.ClassBuilder)._new())._renameClass_to_(self,aString);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"rename:",{aString:aString})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Class);
- $core.addMethod(
- $core.method({
- selector: "subclasses",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "subclasses\x0a\x09^ subclasses copy",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["copy"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self.subclasses)._copy();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"subclasses",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Class);
- $core.addMethod(
- $core.method({
- selector: "theMetaClass",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "theMetaClass\x0a\x09^ self class",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["class"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $self._class();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"theMetaClass",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Class);
- $core.addClass("Metaclass", $globals.Behavior, "Kernel-Classes");
- $core.setSlots($globals.Metaclass, ["instanceClass"]);
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $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.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "asJavaScriptSource",
- protocol: "converting",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "asJavaScriptSource\x0a\x09^ '$globals.', self instanceClass name, '.a$cls'",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: [",", "name", "instanceClass"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return [$recv("$globals.".__comma($recv($self._instanceClass())._name())).__comma(".a$cls")
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx[","]=1
- //>>excludeEnd("ctx");
- ][0];
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"asJavaScriptSource",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Metaclass);
- $core.addMethod(
- $core.method({
- selector: "definition",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- 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: {'slots: {'. ('. ' join: (self instanceVariableNames collect: #symbolPrintString)). '}'} ]",
- referencedClasses: ["String"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["streamContents:", "print:", "write:", "ifEmpty:ifNotEmpty:", "traitCompositionDefinition", "lf", "tab", "join:", "collect:", "instanceVariableNames"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($globals.String)._streamContents_((function(stream){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $recv(stream)._print_(self);
- [$recv(stream)._write_($recv($self._traitCompositionDefinition())._ifEmpty_ifNotEmpty_((function(){
- return " ";
- }),(function(tcd){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- return [[$recv($globals.String)._lf()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx3.sendIdx["lf"]=1
- //>>excludeEnd("ctx");
- ][0],[$recv($globals.String)._tab()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx3.sendIdx["tab"]=1
- //>>excludeEnd("ctx");
- ][0],"uses: ",tcd,$recv($globals.String)._lf(),$recv($globals.String)._tab()];
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({tcd:tcd},$ctx2,3)});
- //>>excludeEnd("ctx");
- })))
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["write:"]=1
- //>>excludeEnd("ctx");
- ][0];
- return $recv(stream)._write_(["slots: {",". "._join_($recv($self._instanceVariableNames())._collect_("symbolPrintString")),"}"]);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"definition",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Metaclass);
- $core.addMethod(
- $core.method({
- selector: "instanceClass",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "instanceClass\x0a\x09^ instanceClass",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return $self.instanceClass;
- }; }),
- $globals.Metaclass);
- $core.addMethod(
- $core.method({
- selector: "instanceVariableNames:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "instanceVariableNames: aString\x0a\x09\x22Kept for file-in compatibility.\x22\x0a\x09^ self slots: aString instanceVariablesStringAsSlotList",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["slots:", "instanceVariablesStringAsSlotList"]
- }, function ($methodClass){ return function (aString){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $self._slots_($recv(aString)._instanceVariablesStringAsSlotList());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"instanceVariableNames:",{aString:aString})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Metaclass);
- $core.addMethod(
- $core.method({
- selector: "isMetaclass",
- protocol: "testing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "isMetaclass\x0a\x09^ true",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return true;
- }; }),
- $globals.Metaclass);
- $core.addMethod(
- $core.method({
- selector: "name",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "name\x0a\x09^ self instanceClass name, ' class'",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: [",", "name", "instanceClass"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($recv($self._instanceClass())._name()).__comma(" class");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"name",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Metaclass);
- $core.addMethod(
- $core.method({
- selector: "package",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "package\x0a\x09^ self instanceClass package",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["package", "instanceClass"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self._instanceClass())._package();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"package",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Metaclass);
- $core.addMethod(
- $core.method({
- selector: "slots:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aCollection"],
- source: "slots: aCollection\x0a\x09ClassBuilder new\x0a\x09\x09class: self slots: aCollection.\x0a\x09^ self",
- referencedClasses: ["ClassBuilder"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["class:slots:", "new"]
- }, function ($methodClass){ return function (aCollection){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv($recv($globals.ClassBuilder)._new())._class_slots_(self,aCollection);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"slots:",{aCollection:aCollection})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Metaclass);
- $core.addMethod(
- $core.method({
- selector: "subclasses",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "subclasses\x0a\x09^ Smalltalk core metaSubclasses: self",
- referencedClasses: ["Smalltalk"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["metaSubclasses:", "core"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($recv($globals.Smalltalk)._core())._metaSubclasses_(self);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"subclasses",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Metaclass);
- $core.addMethod(
- $core.method({
- selector: "theMetaClass",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "theMetaClass\x0a\x09^ self",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return self;
- }; }),
- $globals.Metaclass);
- $core.addMethod(
- $core.method({
- selector: "theNonMetaClass",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "theNonMetaClass\x0a\x09^ self instanceClass",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["instanceClass"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $self._instanceClass();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"theNonMetaClass",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Metaclass);
- $core.addMethod(
- $core.method({
- selector: "uses:instanceVariableNames:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aTraitCompositionDescription", "aString"],
- source: "uses: aTraitCompositionDescription instanceVariableNames: aString\x0a\x09\x22Kept for file-in compatibility.\x22\x0a\x09^ self uses: aTraitCompositionDescription slots: aString instanceVariablesStringAsSlotList",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["uses:slots:", "instanceVariablesStringAsSlotList"]
- }, function ($methodClass){ return function (aTraitCompositionDescription,aString){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $self._uses_slots_(aTraitCompositionDescription,$recv(aString)._instanceVariablesStringAsSlotList());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"uses:instanceVariableNames:",{aTraitCompositionDescription:aTraitCompositionDescription,aString:aString})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Metaclass);
- $core.addMethod(
- $core.method({
- selector: "uses:slots:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aTraitCompositionDescription", "aCollection"],
- source: "uses: aTraitCompositionDescription slots: aCollection\x0a\x09self\x0a\x09\x09slots: aCollection;\x0a\x09\x09setTraitComposition: aTraitCompositionDescription asTraitComposition.\x0a\x09^ self",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["slots:", "setTraitComposition:", "asTraitComposition"]
- }, function ($methodClass){ return function (aTraitCompositionDescription,aCollection){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $self._slots_(aCollection);
- $self._setTraitComposition_($recv(aTraitCompositionDescription)._asTraitComposition());
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"uses:slots:",{aTraitCompositionDescription:aTraitCompositionDescription,aCollection:aCollection})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Metaclass);
- $core.addClass("ClassBuilder", $globals.Object, "Kernel-Classes");
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $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:`.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "addSubclassOf:named:instanceVariableNames:package:",
- protocol: "class definition",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass", "className", "aCollection", "packageName"],
- source: "addSubclassOf: aClass named: className instanceVariableNames: aCollection package: packageName\x0a\x09self deprecatedAPI: 'Use #addSubclass:named:slots:package: instead.'.\x0a\x09^ self\x0a\x09\x09addSubclassOf: aClass\x0a\x09\x09named: className\x0a\x09\x09slots: aCollection\x0a\x09\x09package: packageName",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["deprecatedAPI:", "addSubclassOf:named:slots:package:"]
- }, function ($methodClass){ return function (aClass,className,aCollection,packageName){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $self._deprecatedAPI_("Use #addSubclass:named:slots:package: instead.");
- return $self._addSubclassOf_named_slots_package_(aClass,className,aCollection,packageName);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"addSubclassOf:named:instanceVariableNames:package:",{aClass:aClass,className:className,aCollection:aCollection,packageName:packageName})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.ClassBuilder);
- $core.addMethod(
- $core.method({
- selector: "addSubclassOf:named:slots:package:",
- protocol: "class definition",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass", "className", "aCollection", "packageName"],
- source: "addSubclassOf: aClass named: className slots: 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\x09slots: aCollection\x0a\x09\x09\x09\x09package: packageName ] ].\x0a\x09\x09\x0a\x09^ (self\x0a\x09\x09basicAddSubclassOf: aClass\x0a\x09\x09named: className\x0a\x09\x09slots: aCollection\x0a\x09\x09package: packageName) recompile; yourself",
- referencedClasses: ["Smalltalk", "Package"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["at:", "globals", "named:", "ifNotNil:", "package:", "ifFalse:", "==", "superclass", "migrateClassNamed:superclass:slots:package:", "recompile", "basicAddSubclassOf:named:slots:package:", "yourself"]
- }, function ($methodClass){ return function (aClass,className,aCollection,packageName){
- var self=this,$self=this;
- var theClass,thePackage;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2;
- theClass=$recv($recv($globals.Smalltalk)._globals())._at_(className);
- thePackage=$recv($globals.Package)._named_(packageName);
- $1=theClass;
- if($1 == null || $1.a$nil){
- $1;
- } else {
- $recv(theClass)._package_(thePackage);
- if(!$core.assert($recv($recv(theClass)._superclass()).__eq_eq(aClass))){
- return $self._migrateClassNamed_superclass_slots_package_(className,aClass,aCollection,packageName);
- }
- }
- $2=$self._basicAddSubclassOf_named_slots_package_(aClass,className,aCollection,packageName);
- $recv($2)._recompile();
- return $recv($2)._yourself();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"addSubclassOf:named:slots:package:",{aClass:aClass,className:className,aCollection:aCollection,packageName:packageName,theClass:theClass,thePackage:thePackage})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.ClassBuilder);
- $core.addMethod(
- $core.method({
- selector: "addTraitNamed:package:",
- protocol: "class definition",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["traitName", "packageName"],
- 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\x09theTrait := self\x0a\x09\x09basicAddTraitNamed: traitName\x0a\x09\x09package: packageName.\x0a\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (ClassAdded new\x0a\x09\x09\x09theClass: theTrait;\x0a\x09\x09\x09yourself).\x0a\x09\x0a\x09^ theTrait",
- referencedClasses: ["Smalltalk", "Package", "SystemAnnouncer", "ClassAdded"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["at:", "globals", "named:", "ifNotNil:", "package:", "recompile", "yourself", "basicAddTraitNamed:package:", "announce:", "current", "theClass:", "new"]
- }, function ($methodClass){ return function (traitName,packageName){
- var self=this,$self=this;
- var theTrait,thePackage;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2,$3,$4;
- theTrait=$recv($recv($globals.Smalltalk)._globals())._at_(traitName);
- thePackage=$recv($globals.Package)._named_(packageName);
- $1=theTrait;
- if($1 == null || $1.a$nil){
- $1;
- } else {
- $2=theTrait;
- $recv($2)._package_(thePackage);
- $recv($2)._recompile();
- return [$recv($2)._yourself()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["yourself"]=1
- //>>excludeEnd("ctx");
- ][0];
- }
- theTrait=$self._basicAddTraitNamed_package_(traitName,packageName);
- $3=$recv($globals.SystemAnnouncer)._current();
- $4=$recv($globals.ClassAdded)._new();
- $recv($4)._theClass_(theTrait);
- $recv($3)._announce_($recv($4)._yourself());
- return theTrait;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"addTraitNamed:package:",{traitName:traitName,packageName:packageName,theTrait:theTrait,thePackage:thePackage})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.ClassBuilder);
- $core.addMethod(
- $core.method({
- selector: "basicAddSubclassOf:named:slots:package:",
- protocol: "private",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass", "aString", "aCollection", "packageName"],
- source: "basicAddSubclassOf: aClass named: aString slots: aCollection package: packageName\x0a\x09<inlineJS: '\x0a\x09\x09var klass = $core.addClass(aString, aClass, packageName);\x0a\x09\x09$core.setSlots(klass, aCollection);\x0a\x09\x09return klass;\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09var klass = $core.addClass(aString, aClass, packageName);\x0a\x09\x09$core.setSlots(klass, aCollection);\x0a\x09\x09return klass;\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (aClass,aString,aCollection,packageName){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var klass = $core.addClass(aString, aClass, packageName);
- $core.setSlots(klass, aCollection);
- return klass;
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"basicAddSubclassOf:named:slots:package:",{aClass:aClass,aString:aString,aCollection:aCollection,packageName:packageName})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.ClassBuilder);
- $core.addMethod(
- $core.method({
- selector: "basicAddTraitNamed:package:",
- protocol: "private",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString", "anotherString"],
- source: "basicAddTraitNamed: aString package: anotherString\x0a\x09<inlineJS: 'return $core.addTrait(aString, anotherString)'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["return $core.addTrait(aString, anotherString)"]]],
- messageSends: []
- }, function ($methodClass){ return function (aString,anotherString){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $core.addTrait(aString, anotherString);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"basicAddTraitNamed:package:",{aString:aString,anotherString:anotherString})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.ClassBuilder);
- $core.addMethod(
- $core.method({
- selector: "basicClass:slots:",
- protocol: "private",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass", "aCollection"],
- source: "basicClass: aClass slots: aCollection\x0a\x0a\x09aClass isMetaclass ifFalse: [ self error: aClass name, ' is not a metaclass' ].\x0a\x09Smalltalk core setSlots: aClass to: aCollection",
- referencedClasses: ["Smalltalk"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifFalse:", "isMetaclass", "error:", ",", "name", "setSlots:to:", "core"]
- }, function ($methodClass){ return function (aClass,aCollection){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- if(!$core.assert($recv(aClass)._isMetaclass())){
- $self._error_($recv($recv(aClass)._name()).__comma(" is not a metaclass"));
- }
- $recv($recv($globals.Smalltalk)._core())._setSlots_to_(aClass,aCollection);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"basicClass:slots:",{aClass:aClass,aCollection:aCollection})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.ClassBuilder);
- $core.addMethod(
- $core.method({
- selector: "basicRemoveClass:",
- protocol: "private",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass"],
- source: "basicRemoveClass: aClass\x0a\x09<inlineJS: '$core.removeClass(aClass)'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["$core.removeClass(aClass)"]]],
- messageSends: []
- }, function ($methodClass){ return function (aClass){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $core.removeClass(aClass);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"basicRemoveClass:",{aClass:aClass})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.ClassBuilder);
- $core.addMethod(
- $core.method({
- selector: "basicRenameClass:to:",
- protocol: "private",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass", "aString"],
- source: "basicRenameClass: aClass to: aString\x0a\x09<inlineJS: '\x0a\x09\x09$globals[aString] = aClass;\x0a\x09\x09delete $globals[aClass.name];\x0a\x09\x09aClass.name = aString;\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09$globals[aString] = aClass;\x0a\x09\x09delete $globals[aClass.name];\x0a\x09\x09aClass.name = aString;\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (aClass,aString){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $globals[aString] = aClass;
- delete $globals[aClass.name];
- aClass.name = aString;
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"basicRenameClass:to:",{aClass:aClass,aString:aString})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.ClassBuilder);
- $core.addMethod(
- $core.method({
- selector: "basicSwapClassNames:with:",
- protocol: "private",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass", "anotherClass"],
- source: "basicSwapClassNames: aClass with: anotherClass\x0a\x09<inlineJS: '\x0a\x09\x09var tmp = aClass.name;\x0a\x09\x09aClass.name = anotherClass.name;\x0a\x09\x09anotherClass.name = tmp;\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09var tmp = aClass.name;\x0a\x09\x09aClass.name = anotherClass.name;\x0a\x09\x09anotherClass.name = tmp;\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (aClass,anotherClass){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var tmp = aClass.name;
- aClass.name = anotherClass.name;
- anotherClass.name = tmp;
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"basicSwapClassNames:with:",{aClass:aClass,anotherClass:anotherClass})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.ClassBuilder);
- $core.addMethod(
- $core.method({
- selector: "class:slots:",
- protocol: "class definition",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass", "aCollection"],
- source: "class: aClass slots: aCollection\x0a\x09self basicClass: aClass slots: aCollection.\x0a\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (ClassDefinitionChanged new\x0a\x09\x09\x09theClass: aClass;\x0a\x09\x09\x09yourself)",
- referencedClasses: ["SystemAnnouncer", "ClassDefinitionChanged"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["basicClass:slots:", "announce:", "current", "theClass:", "new", "yourself"]
- }, function ($methodClass){ return function (aClass,aCollection){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2;
- $self._basicClass_slots_(aClass,aCollection);
- $1=$recv($globals.SystemAnnouncer)._current();
- $2=$recv($globals.ClassDefinitionChanged)._new();
- $recv($2)._theClass_(aClass);
- $recv($1)._announce_($recv($2)._yourself());
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"class:slots:",{aClass:aClass,aCollection:aCollection})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.ClassBuilder);
- $core.addMethod(
- $core.method({
- selector: "copyClass:named:",
- protocol: "copying",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass", "className"],
- source: "copyClass: aClass named: className\x0a\x09| newClass |\x0a\x0a\x09newClass := self\x0a\x09\x09addSubclassOf: aClass superclass\x0a\x09\x09named: className\x0a\x09\x09slots: aClass slots copy\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",
- referencedClasses: ["SystemAnnouncer", "ClassAdded"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["addSubclassOf:named:slots:package:", "superclass", "copy", "slots", "name", "package", "copyClass:to:", "announce:", "current", "theClass:", "new", "yourself"]
- }, function ($methodClass){ return function (aClass,className){
- var self=this,$self=this;
- var newClass;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2;
- newClass=$self._addSubclassOf_named_slots_package_($recv(aClass)._superclass(),className,$recv($recv(aClass)._slots())._copy(),$recv($recv(aClass)._package())._name());
- $self._copyClass_to_(aClass,newClass);
- $1=$recv($globals.SystemAnnouncer)._current();
- $2=$recv($globals.ClassAdded)._new();
- $recv($2)._theClass_(newClass);
- $recv($1)._announce_($recv($2)._yourself());
- return newClass;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"copyClass:named:",{aClass:aClass,className:className,newClass:newClass})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.ClassBuilder);
- $core.addMethod(
- $core.method({
- selector: "copyClass:to:",
- protocol: "copying",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass", "anotherClass"],
- source: "copyClass: aClass to: anotherClass\x0a\x0a\x09anotherClass comment: aClass comment.\x0a\x0a\x09aClass methodDictionary valuesDo: [ :each |\x0a\x09\x09each origin = 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 slots: aClass class slots copy.\x0a\x0a\x09aClass class methodDictionary valuesDo: [ :each |\x0a\x09\x09each origin = aClass class ifTrue: [\x0a\x09\x09\x09Compiler new install: each source forClass: anotherClass class protocol: each protocol ] ].\x0a\x09anotherClass class setTraitComposition: aClass class traitComposition",
- referencedClasses: ["Compiler"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["comment:", "comment", "valuesDo:", "methodDictionary", "ifTrue:", "=", "origin", "install:forClass:protocol:", "new", "source", "protocol", "setTraitComposition:", "traitComposition", "basicClass:slots:", "class", "copy", "slots"]
- }, function ($methodClass){ return function (aClass,anotherClass){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv(anotherClass)._comment_($recv(aClass)._comment());
- [$recv([$recv(aClass)._methodDictionary()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["methodDictionary"]=1
- //>>excludeEnd("ctx");
- ][0])._valuesDo_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- if($core.assert([$recv([$recv(each)._origin()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["origin"]=1
- //>>excludeEnd("ctx");
- ][0]).__eq(aClass)
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["="]=1
- //>>excludeEnd("ctx");
- ][0])){
- return [$recv([$recv($globals.Compiler)._new()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["new"]=1
- //>>excludeEnd("ctx");
- ][0])._install_forClass_protocol_([$recv(each)._source()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["source"]=1
- //>>excludeEnd("ctx");
- ][0],anotherClass,[$recv(each)._protocol()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["protocol"]=1
- //>>excludeEnd("ctx");
- ][0])
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["install:forClass:protocol:"]=1
- //>>excludeEnd("ctx");
- ][0];
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- }))
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["valuesDo:"]=1
- //>>excludeEnd("ctx");
- ][0];
- [$recv(anotherClass)._setTraitComposition_([$recv(aClass)._traitComposition()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["traitComposition"]=1
- //>>excludeEnd("ctx");
- ][0])
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["setTraitComposition:"]=1
- //>>excludeEnd("ctx");
- ][0];
- $self._basicClass_slots_([$recv(anotherClass)._class()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["class"]=1
- //>>excludeEnd("ctx");
- ][0],$recv($recv([$recv(aClass)._class()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["class"]=2
- //>>excludeEnd("ctx");
- ][0])._slots())._copy());
- $recv($recv([$recv(aClass)._class()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["class"]=3
- //>>excludeEnd("ctx");
- ][0])._methodDictionary())._valuesDo_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- if($core.assert($recv($recv(each)._origin()).__eq([$recv(aClass)._class()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["class"]=4
- //>>excludeEnd("ctx");
- ][0]))){
- return $recv($recv($globals.Compiler)._new())._install_forClass_protocol_($recv(each)._source(),[$recv(anotherClass)._class()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["class"]=5
- //>>excludeEnd("ctx");
- ][0],$recv(each)._protocol());
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
- //>>excludeEnd("ctx");
- }));
- $recv([$recv(anotherClass)._class()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["class"]=6
- //>>excludeEnd("ctx");
- ][0])._setTraitComposition_($recv($recv(aClass)._class())._traitComposition());
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"copyClass:to:",{aClass:aClass,anotherClass:anotherClass})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.ClassBuilder);
- $core.addMethod(
- $core.method({
- selector: "migrateClass:superclass:",
- protocol: "class migration",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass", "anotherClass"],
- source: "migrateClass: aClass superclass: anotherClass\x0a\x09^ self\x0a\x09\x09migrateClassNamed: aClass name\x0a\x09\x09superclass: anotherClass\x0a\x09\x09slots: aClass slots\x0a\x09\x09package: aClass package name",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["migrateClassNamed:superclass:slots:package:", "name", "slots", "package"]
- }, function ($methodClass){ return function (aClass,anotherClass){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $self._migrateClassNamed_superclass_slots_package_([$recv(aClass)._name()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["name"]=1
- //>>excludeEnd("ctx");
- ][0],anotherClass,$recv(aClass)._slots(),$recv($recv(aClass)._package())._name());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"migrateClass:superclass:",{aClass:aClass,anotherClass:anotherClass})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.ClassBuilder);
- $core.addMethod(
- $core.method({
- selector: "migrateClassNamed:superclass:instanceVariableNames:package:",
- protocol: "class migration",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["className", "aClass", "aCollection", "packageName"],
- source: "migrateClassNamed: className superclass: aClass instanceVariableNames: aCollection package: packageName\x0a\x09self deprecatedAPI: 'Use #migrateClassNamed:superclass:slots:package: instead.'.\x0a\x09^ self\x0a\x09\x09migrateClassNamed: className\x0a\x09\x09superclass: aClass\x0a\x09\x09slots: aCollection\x0a\x09\x09package: packageName",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["deprecatedAPI:", "migrateClassNamed:superclass:slots:package:"]
- }, function ($methodClass){ return function (className,aClass,aCollection,packageName){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $self._deprecatedAPI_("Use #migrateClassNamed:superclass:slots:package: instead.");
- return $self._migrateClassNamed_superclass_slots_package_(className,aClass,aCollection,packageName);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"migrateClassNamed:superclass:instanceVariableNames:package:",{className:className,aClass:aClass,aCollection:aCollection,packageName:packageName})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.ClassBuilder);
- $core.addMethod(
- $core.method({
- selector: "migrateClassNamed:superclass:slots:package:",
- protocol: "class migration",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["className", "aClass", "aCollection", "packageName"],
- source: "migrateClassNamed: className superclass: aClass slots: 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\x09slots: 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\x09SystemAnnouncer current announce: (ClassRenamed new\x0a\x09\x09\x09\x09\x09theClass: oldClass;\x0a\x09\x09\x09\x09\x09yourself).\x0a\x09\x09\x09\x09exception pass ].\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",
- referencedClasses: ["Smalltalk", "Error", "SystemAnnouncer", "ClassRenamed", "ClassMigrated"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: [",", "at:", "globals", "addSubclassOf:named:slots:package:", "basicSwapClassNames:with:", "on:do:", "copyClass:to:", "basicRemoveClass:", "announce:", "current", "theClass:", "new", "yourself", "pass", "rawRenameClass:to:", "do:", "subclasses", "migrateClass:superclass:", "oldClass:"]
- }, function ($methodClass){ return function (className,aClass,aCollection,packageName){
- var self=this,$self=this;
- var oldClass,newClass,tmp;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2,$3,$4;
- tmp="new*".__comma(className);
- oldClass=$recv($recv($globals.Smalltalk)._globals())._at_(className);
- newClass=$self._addSubclassOf_named_slots_package_(aClass,tmp,aCollection,packageName);
- [$self._basicSwapClassNames_with_(oldClass,newClass)
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["basicSwapClassNames:with:"]=1
- //>>excludeEnd("ctx");
- ][0];
- $recv((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $self._copyClass_to_(oldClass,newClass);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
- //>>excludeEnd("ctx");
- }))._on_do_($globals.Error,(function(exception){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $self._basicSwapClassNames_with_(oldClass,newClass);
- [$self._basicRemoveClass_(newClass)
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["basicRemoveClass:"]=1
- //>>excludeEnd("ctx");
- ][0];
- $1=[$recv($globals.SystemAnnouncer)._current()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["current"]=1
- //>>excludeEnd("ctx");
- ][0];
- $2=[$recv($globals.ClassRenamed)._new()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["new"]=1
- //>>excludeEnd("ctx");
- ][0];
- [$recv($2)._theClass_(oldClass)
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["theClass:"]=1
- //>>excludeEnd("ctx");
- ][0];
- [$recv($1)._announce_([$recv($2)._yourself()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["yourself"]=1
- //>>excludeEnd("ctx");
- ][0])
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["announce:"]=1
- //>>excludeEnd("ctx");
- ][0];
- return $recv(exception)._pass();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({exception:exception},$ctx1,2)});
- //>>excludeEnd("ctx");
- }));
- [$self._rawRenameClass_to_(oldClass,tmp)
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["rawRenameClass:to:"]=1
- //>>excludeEnd("ctx");
- ][0];
- $self._rawRenameClass_to_(newClass,className);
- $recv($recv(oldClass)._subclasses())._do_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $self._migrateClass_superclass_(each,newClass);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
- //>>excludeEnd("ctx");
- }));
- $self._basicRemoveClass_(oldClass);
- $3=$recv($globals.SystemAnnouncer)._current();
- $4=$recv($globals.ClassMigrated)._new();
- $recv($4)._theClass_(newClass);
- $recv($4)._oldClass_(oldClass);
- $recv($3)._announce_($recv($4)._yourself());
- return newClass;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"migrateClassNamed:superclass:slots:package:",{className:className,aClass:aClass,aCollection:aCollection,packageName:packageName,oldClass:oldClass,newClass:newClass,tmp:tmp})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.ClassBuilder);
- $core.addMethod(
- $core.method({
- selector: "rawRenameClass:to:",
- protocol: "private",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass", "aString"],
- source: "rawRenameClass: aClass to: aString\x0a\x09<inlineJS: '\x0a\x09\x09$globals[aString] = aClass;\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09$globals[aString] = aClass;\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (aClass,aString){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $globals[aString] = aClass;
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"rawRenameClass:to:",{aClass:aClass,aString:aString})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.ClassBuilder);
- $core.addMethod(
- $core.method({
- selector: "renameClass:to:",
- protocol: "class migration",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass", "className"],
- 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)",
- referencedClasses: ["SystemAnnouncer", "ClassRenamed"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["basicRenameClass:to:", "recompile", "announce:", "current", "theClass:", "new", "yourself"]
- }, function ($methodClass){ return function (aClass,className){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2;
- $self._basicRenameClass_to_(aClass,className);
- $recv(aClass)._recompile();
- $1=$recv($globals.SystemAnnouncer)._current();
- $2=$recv($globals.ClassRenamed)._new();
- $recv($2)._theClass_(aClass);
- $recv($1)._announce_($recv($2)._yourself());
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"renameClass:to:",{aClass:aClass,className:className})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.ClassBuilder);
- $core.addMethod(
- $core.method({
- selector: "superclass:subclass:",
- protocol: "class definition",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass", "className"],
- source: "superclass: aClass subclass: className\x0a\x09^ self superclass: aClass subclass: className slots: #() package: nil",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["superclass:subclass:slots:package:"]
- }, function ($methodClass){ return function (aClass,className){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $self._superclass_subclass_slots_package_(aClass,className,[],nil);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"superclass:subclass:",{aClass:aClass,className:className})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.ClassBuilder);
- $core.addMethod(
- $core.method({
- selector: "superclass:subclass:slots:package:",
- protocol: "class definition",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass", "className", "aCollection", "packageName"],
- source: "superclass: aClass subclass: className slots: aCollection package: packageName\x0a\x09| newClass |\x0a\x09\x0a\x09newClass := self addSubclassOf: aClass\x0a\x09\x09named: className slots: aCollection\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",
- referencedClasses: ["SystemAnnouncer", "ClassAdded"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["addSubclassOf:named:slots:package:", "ifNil:", "announce:", "current", "theClass:", "new", "yourself"]
- }, function ($methodClass){ return function (aClass,className,aCollection,packageName){
- var self=this,$self=this;
- var newClass;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2,$3;
- if(packageName == null || packageName.a$nil){
- $1="unclassified";
- } else {
- $1=packageName;
- }
- newClass=$self._addSubclassOf_named_slots_package_(aClass,className,aCollection,$1);
- $2=$recv($globals.SystemAnnouncer)._current();
- $3=$recv($globals.ClassAdded)._new();
- $recv($3)._theClass_(newClass);
- $recv($2)._announce_($recv($3)._yourself());
- return newClass;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"superclass:subclass:slots:package:",{aClass:aClass,className:className,aCollection:aCollection,packageName:packageName,newClass:newClass})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.ClassBuilder);
- $core.addMethod(
- $core.method({
- selector: "sortClasses:",
- protocol: "as yet unclassified",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aCollection"],
- source: "sortClasses: aCollection\x0a\x09| root members |\x0a\x09root := {nil. {}}.\x0a\x09members := HashedCollection new.\x0a\x09aCollection do: [ :each | members at: each name put: {each. {}} ].\x0a\x09(aCollection asArray sorted: [ :a :b | a name <= b name ]) do: [ :each |\x0a\x09\x09| target |\x0a\x09\x09target := members\x0a\x09\x09\x09at: (each superclass ifNotNil: [ :superklass | superklass name ])\x0a\x09\x09\x09ifAbsent: [ root ].\x0a\x09\x09target second add: (members at: each name) ].\x0a\x09^ root second",
- referencedClasses: ["HashedCollection"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["new", "do:", "at:put:", "name", "sorted:", "asArray", "<=", "at:ifAbsent:", "ifNotNil:", "superclass", "add:", "second", "at:"]
- }, function ($methodClass){ return function (aCollection){
- var self=this,$self=this;
- var root,members;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2,$3;
- root=[nil,[]];
- members=$recv($globals.HashedCollection)._new();
- [$recv(aCollection)._do_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(members)._at_put_([$recv(each)._name()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["name"]=1
- //>>excludeEnd("ctx");
- ][0],[each,[]]);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- }))
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["do:"]=1
- //>>excludeEnd("ctx");
- ][0];
- $recv($recv($recv(aCollection)._asArray())._sorted_((function(a,b){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv([$recv(a)._name()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["name"]=2
- //>>excludeEnd("ctx");
- ][0]).__lt_eq([$recv(b)._name()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["name"]=3
- //>>excludeEnd("ctx");
- ][0]);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,2)});
- //>>excludeEnd("ctx");
- })))._do_((function(each){
- var target;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $1=members;
- $2=$recv(each)._superclass();
- if($2 == null || $2.a$nil){
- $3=$2;
- } else {
- var superklass;
- superklass=$2;
- $3=[$recv(superklass)._name()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["name"]=4
- //>>excludeEnd("ctx");
- ][0];
- }
- target=$recv($1)._at_ifAbsent_($3,(function(){
- return root;
- }));
- return $recv([$recv(target)._second()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["second"]=1
- //>>excludeEnd("ctx");
- ][0])._add_($recv(members)._at_($recv(each)._name()));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each,target:target},$ctx1,3)});
- //>>excludeEnd("ctx");
- }));
- return $recv(root)._second();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"sortClasses:",{aCollection:aCollection,root:root,members:members})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.ClassBuilder.a$cls);
- $core.addTrait("TBehaviorDefaults", "Kernel-Classes");
- $core.addMethod(
- $core.method({
- selector: "allSubclassesDo:",
- protocol: "enumerating",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aBlock"],
- source: "allSubclassesDo: aBlock\x0a\x09\x22Default for non-classes; to be able to send #allSubclassesDo: to any class / trait.\x22",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (aBlock){
- var self=this,$self=this;
- return self;
- }; }),
- $globals.TBehaviorDefaults);
- $core.addMethod(
- $core.method({
- selector: "includingPossibleMetaDo:",
- protocol: "enumerating",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aBlock"],
- source: "includingPossibleMetaDo: aBlock\x0a\x09\x22Default for non-classes.\x22\x0a\x09aBlock value: self",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["value:"]
- }, function ($methodClass){ return function (aBlock){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv(aBlock)._value_(self);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"includingPossibleMetaDo:",{aBlock:aBlock})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorDefaults);
- $core.addMethod(
- $core.method({
- selector: "name",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "name\x0a\x09^ nil",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return nil;
- }; }),
- $globals.TBehaviorDefaults);
- $core.addMethod(
- $core.method({
- selector: "printOn:",
- protocol: "printing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aStream"],
- source: "printOn: aStream\x0a\x09self name\x0a\x09\x09ifNil: [ super printOn: aStream ]\x0a\x09\x09ifNotNil: [ :name | aStream nextPutAll: name ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifNil:ifNotNil:", "name", "printOn:", "nextPutAll:"]
- }, function ($methodClass){ return function (aStream){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$self._name();
- if($1 == null || $1.a$nil){
- [(
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- ($methodClass.superclass||$boot.nilAsClass).fn.prototype._printOn_.call($self,aStream))
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.supercall = false
- //>>excludeEnd("ctx");
- ][0];
- } else {
- var name;
- name=$1;
- $recv(aStream)._nextPutAll_(name);
- }
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorDefaults);
- $core.addMethod(
- $core.method({
- selector: "slots",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "slots\x0a\x09\x22Default for non-classes; to be able to send #slots to any class / trait.\x22\x0a\x09^ #()",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return [];
- }; }),
- $globals.TBehaviorDefaults);
- $core.addMethod(
- $core.method({
- selector: "superclass",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "superclass\x0a\x09\x22Default for non-classes; to be able to send #superclass to any class / trait.\x22\x0a\x09^ nil",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return nil;
- }; }),
- $globals.TBehaviorDefaults);
- $core.addMethod(
- $core.method({
- selector: "traitUsers",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "traitUsers\x0a\x09\x22Default for non-traits; to be able to send #traitUsers to any class / trait\x22\x0a\x09^ #()",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return [];
- }; }),
- $globals.TBehaviorDefaults);
- $core.addTrait("TBehaviorProvider", "Kernel-Classes");
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $globals.TBehaviorProvider.comment="I have method dictionary, slots and organization.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: ">>",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: ">> aString\x0a\x09^ self methodAt: aString",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["methodAt:"]
- }, function ($methodClass){ return function (aString){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $self._methodAt_(aString);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,">>",{aString:aString})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "addCompiledMethod:",
- protocol: "compiling",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aMethod"],
- 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\x09self basicAddCompiledMethod: aMethod.\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",
- referencedClasses: ["MethodAdded", "MethodModified", "SystemAnnouncer"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["at:ifAbsent:", "methodDictionary", "selector", "basicAddCompiledMethod:", "ifNil:ifNotNil:", "method:", "new", "yourself", "oldMethod:", "announce:", "current"]
- }, function ($methodClass){ return function (aMethod){
- var self=this,$self=this;
- var oldMethod,announcement;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2,$3;
- oldMethod=$recv($self._methodDictionary())._at_ifAbsent_($recv(aMethod)._selector(),(function(){
- return nil;
- }));
- $self._basicAddCompiledMethod_(aMethod);
- $1=oldMethod;
- if($1 == null || $1.a$nil){
- $2=[$recv($globals.MethodAdded)._new()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["new"]=1
- //>>excludeEnd("ctx");
- ][0];
- [$recv($2)._method_(aMethod)
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["method:"]=1
- //>>excludeEnd("ctx");
- ][0];
- announcement=[$recv($2)._yourself()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["yourself"]=1
- //>>excludeEnd("ctx");
- ][0];
- } else {
- $3=$recv($globals.MethodModified)._new();
- $recv($3)._oldMethod_(oldMethod);
- $recv($3)._method_(aMethod);
- announcement=$recv($3)._yourself();
- }
- $recv($recv($globals.SystemAnnouncer)._current())._announce_(announcement);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"addCompiledMethod:",{aMethod:aMethod,oldMethod:oldMethod,announcement:announcement})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "allInstanceVariableNames",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "allInstanceVariableNames\x0a\x09^ self allSlots select: #isString",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["select:", "allSlots"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self._allSlots())._select_("isString");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"allInstanceVariableNames",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "allSlotNames",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "allSlotNames\x0a\x09^ self allSlots",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["allSlots"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $self._allSlots();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"allSlotNames",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "allSlots",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "allSlots\x0a\x09| result |\x0a\x09result := self slots copy.\x0a\x09self superclass ifNotNil: [ :s | result addAll: s allSlots ].\x0a\x09^ result",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["copy", "slots", "ifNotNil:", "superclass", "addAll:", "allSlots"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- var result;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- result=$recv($self._slots())._copy();
- $1=$self._superclass();
- if($1 == null || $1.a$nil){
- $1;
- } else {
- var s;
- s=$1;
- $recv(result)._addAll_($recv(s)._allSlots());
- }
- return result;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"allSlots",{result:result})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "basicAddCompiledMethod:",
- protocol: "private",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aMethod"],
- source: "basicAddCompiledMethod: aMethod\x0a\x09<inlineJS: '$core.addMethod(aMethod, self)'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["$core.addMethod(aMethod, self)"]]],
- messageSends: []
- }, function ($methodClass){ return function (aMethod){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $core.addMethod(aMethod, self);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"basicAddCompiledMethod:",{aMethod:aMethod})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "basicRemoveCompiledMethod:",
- protocol: "private",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aMethod"],
- source: "basicRemoveCompiledMethod: aMethod\x0a\x09<inlineJS: '$core.removeMethod(aMethod,self)'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["$core.removeMethod(aMethod,self)"]]],
- messageSends: []
- }, function ($methodClass){ return function (aMethod){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $core.removeMethod(aMethod,self);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"basicRemoveCompiledMethod:",{aMethod:aMethod})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "compile:protocol:",
- protocol: "compiling",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString", "anotherString"],
- source: "compile: aString protocol: anotherString\x0a\x09^ Compiler new\x0a\x09\x09install: aString\x0a\x09\x09forClass: self\x0a\x09\x09protocol: anotherString",
- referencedClasses: ["Compiler"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["install:forClass:protocol:", "new"]
- }, function ($methodClass){ return function (aString,anotherString){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($recv($globals.Compiler)._new())._install_forClass_protocol_(aString,self,anotherString);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"compile:protocol:",{aString:aString,anotherString:anotherString})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "includesSelector:",
- protocol: "testing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "includesSelector: aString\x0a\x09^ self methodDictionary includesKey: aString",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["includesKey:", "methodDictionary"]
- }, function ($methodClass){ return function (aString){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self._methodDictionary())._includesKey_(aString);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"includesSelector:",{aString:aString})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "instanceVariableNames",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "instanceVariableNames\x0a\x09^ self slots select: #isString",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["select:", "slots"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self._slots())._select_("isString");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"instanceVariableNames",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "methodAt:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "methodAt: aString\x0a\x09^ self methodDictionary at: aString",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["at:", "methodDictionary"]
- }, function ($methodClass){ return function (aString){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self._methodDictionary())._at_(aString);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"methodAt:",{aString:aString})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "methodDictionary",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- 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'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["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"]]],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var dict = $globals.HashedCollection._new();
- var methods = self.methods;
- Object.keys(methods).forEach(function(i) {
- if(methods[i].selector) {
- dict._at_put_(methods[i].selector, methods[i]);
- }
- });
- return dict;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"methodDictionary",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "methodOrganizationEnter:andLeave:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aMethod", "oldMethod"],
- source: "methodOrganizationEnter: aMethod andLeave: oldMethod\x0a\x09aMethod ifNotNil: [\x0a\x09\x09self organization addElement: aMethod protocol ].\x0a\x09\x0a\x09oldMethod ifNotNil: [\x0a\x09\x09self removeProtocolIfEmpty: oldMethod protocol ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifNotNil:", "addElement:", "organization", "protocol", "removeProtocolIfEmpty:"]
- }, function ($methodClass){ return function (aMethod,oldMethod){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- if(aMethod == null || aMethod.a$nil){
- aMethod;
- } else {
- $recv($self._organization())._addElement_([$recv(aMethod)._protocol()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["protocol"]=1
- //>>excludeEnd("ctx");
- ][0]);
- }
- if(oldMethod == null || oldMethod.a$nil){
- oldMethod;
- } else {
- $self._removeProtocolIfEmpty_($recv(oldMethod)._protocol());
- }
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"methodOrganizationEnter:andLeave:",{aMethod:aMethod,oldMethod:oldMethod})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "methodTemplate",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- 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' ]",
- referencedClasses: ["String"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["streamContents:", "write:", "lf", "tab"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($globals.String)._streamContents_((function(stream){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- [$recv(stream)._write_("messageSelectorAndArgumentNames")
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["write:"]=1
- //>>excludeEnd("ctx");
- ][0];
- [$recv(stream)._lf()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["lf"]=1
- //>>excludeEnd("ctx");
- ][0];
- [$recv(stream)._tab()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["tab"]=1
- //>>excludeEnd("ctx");
- ][0];
- [$recv(stream)._write_("\x22comment stating purpose of message\x22")
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["write:"]=2
- //>>excludeEnd("ctx");
- ][0];
- [$recv(stream)._lf()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["lf"]=2
- //>>excludeEnd("ctx");
- ][0];
- [$recv(stream)._lf()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["lf"]=3
- //>>excludeEnd("ctx");
- ][0];
- [$recv(stream)._tab()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["tab"]=2
- //>>excludeEnd("ctx");
- ][0];
- [$recv(stream)._write_("| temporary variable names |")
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["write:"]=3
- //>>excludeEnd("ctx");
- ][0];
- $recv(stream)._lf();
- $recv(stream)._tab();
- return $recv(stream)._write_("statements");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"methodTemplate",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "methods",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "methods\x0a\x09^ self methodDictionary values",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["values", "methodDictionary"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self._methodDictionary())._values();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"methods",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "methodsInProtocol:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "methodsInProtocol: aString\x0a\x09^ self methods select: [ :each | each protocol = aString ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["select:", "methods", "=", "protocol"]
- }, function ($methodClass){ return function (aString){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self._methods())._select_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv($recv(each)._protocol()).__eq(aString);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"methodsInProtocol:",{aString:aString})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "organization",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "organization\x0a\x09^ self basicOrganization ifNil: [\x0a\x09\x09self basicOrganization: (ClassOrganizer on: self).\x0a\x09\x09self basicOrganization ]",
- referencedClasses: ["ClassOrganizer"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifNil:", "basicOrganization", "basicOrganization:", "on:"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=[$self._basicOrganization()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["basicOrganization"]=1
- //>>excludeEnd("ctx");
- ][0];
- if($1 == null || $1.a$nil){
- $self._basicOrganization_($recv($globals.ClassOrganizer)._on_(self));
- return $self._basicOrganization();
- } else {
- return $1;
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"organization",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "ownMethods",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- 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 ]",
- referencedClasses: ["OrderedCollection"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["sorted:", "inject:into:", "ownProtocols", "new", ",", "ownMethodsInProtocol:", "<=", "selector"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($recv($self._ownProtocols())._inject_into_($recv($globals.OrderedCollection)._new(),(function(acc,each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(acc).__comma($self._ownMethodsInProtocol_(each));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({acc:acc,each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- })))._sorted_((function(a,b){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv([$recv(a)._selector()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["selector"]=1
- //>>excludeEnd("ctx");
- ][0]).__lt_eq($recv(b)._selector());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,2)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"ownMethods",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "ownMethodsInProtocol:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "ownMethodsInProtocol: aString\x0a\x09^ (self methodsInProtocol: aString) select: [ :each | each origin = self ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["select:", "methodsInProtocol:", "=", "origin"]
- }, function ($methodClass){ return function (aString){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self._methodsInProtocol_(aString))._select_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv($recv(each)._origin()).__eq(self);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"ownMethodsInProtocol:",{aString:aString})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "ownProtocols",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- 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*' ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["reject:", "protocols", "match:"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self._protocols())._reject_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(each)._match_("^\x5c*");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"ownProtocols",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "packageOfProtocol:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- 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 ]",
- referencedClasses: ["Package"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifFalse:", "beginsWith:", "package", "named:ifAbsent:", "allButFirst"]
- }, function ($methodClass){ return function (aString){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- if(!$core.assert($recv(aString)._beginsWith_("*"))){
- return $self._package();
- }
- return $recv($globals.Package)._named_ifAbsent_($recv(aString)._allButFirst(),(function(){
- return nil;
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"packageOfProtocol:",{aString:aString})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "protocols",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "protocols\x0a\x09^ self organization elements asArray sorted",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["sorted", "asArray", "elements", "organization"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($recv($recv($self._organization())._elements())._asArray())._sorted();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"protocols",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "protocolsDo:",
- protocol: "enumerating",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aBlock"],
- 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) ]",
- referencedClasses: ["HashedCollection", "Array"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["new", "valuesDo:", "methodDictionary", "add:", "at:ifAbsentPut:", "protocol", "do:", "protocols", "value:value:", "at:"]
- }, function ($methodClass){ return function (aBlock){
- var self=this,$self=this;
- var methodsByProtocol;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- methodsByProtocol=[$recv($globals.HashedCollection)._new()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["new"]=1
- //>>excludeEnd("ctx");
- ][0];
- $recv($self._methodDictionary())._valuesDo_((function(m){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv($recv(methodsByProtocol)._at_ifAbsentPut_($recv(m)._protocol(),(function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- return $recv($globals.Array)._new();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
- //>>excludeEnd("ctx");
- })))._add_(m);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({m:m},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- $recv($self._protocols())._do_((function(protocol){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(aBlock)._value_value_(protocol,$recv(methodsByProtocol)._at_(protocol));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({protocol:protocol},$ctx1,3)});
- //>>excludeEnd("ctx");
- }));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"protocolsDo:",{aBlock:aBlock,methodsByProtocol:methodsByProtocol})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "recompile",
- protocol: "compiling",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "recompile\x0a\x09^ Compiler new recompile: self",
- referencedClasses: ["Compiler"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["recompile:", "new"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($recv($globals.Compiler)._new())._recompile_(self);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"recompile",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "removeCompiledMethod:",
- protocol: "compiling",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aMethod"],
- source: "removeCompiledMethod: aMethod\x0a\x09self basicRemoveCompiledMethod: aMethod.\x0a\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (MethodRemoved new\x0a\x09\x09\x09method: aMethod;\x0a\x09\x09\x09yourself)",
- referencedClasses: ["SystemAnnouncer", "MethodRemoved"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["basicRemoveCompiledMethod:", "announce:", "current", "method:", "new", "yourself"]
- }, function ($methodClass){ return function (aMethod){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2;
- $self._basicRemoveCompiledMethod_(aMethod);
- $1=$recv($globals.SystemAnnouncer)._current();
- $2=$recv($globals.MethodRemoved)._new();
- $recv($2)._method_(aMethod);
- $recv($1)._announce_($recv($2)._yourself());
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"removeCompiledMethod:",{aMethod:aMethod})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "removeProtocolIfEmpty:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "removeProtocolIfEmpty: aString\x0a\x09self methods\x0a\x09\x09detect: [ :each | each protocol = aString ]\x0a\x09\x09ifNone: [ self organization removeElement: aString ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["detect:ifNone:", "methods", "=", "protocol", "removeElement:", "organization"]
- }, function ($methodClass){ return function (aString){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv($self._methods())._detect_ifNone_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv($recv(each)._protocol()).__eq(aString);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- }),(function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv($self._organization())._removeElement_(aString);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
- //>>excludeEnd("ctx");
- }));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"removeProtocolIfEmpty:",{aString:aString})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "selectors",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "selectors\x0a\x09^ self methodDictionary keys",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["keys", "methodDictionary"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self._methodDictionary())._keys();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"selectors",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "setTraitComposition:",
- protocol: "compiling",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aTraitComposition"],
- source: "setTraitComposition: aTraitComposition\x0a\x09<inlineJS: '$core.setTraitComposition(aTraitComposition._asJavaScriptObject(), self)'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["$core.setTraitComposition(aTraitComposition._asJavaScriptObject(), self)"]]],
- messageSends: []
- }, function ($methodClass){ return function (aTraitComposition){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $core.setTraitComposition(aTraitComposition._asJavaScriptObject(), self);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"setTraitComposition:",{aTraitComposition:aTraitComposition})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "slotNames",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "slotNames\x0a\x09^ self slots",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["slots"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $self._slots();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"slotNames",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "traitComposition",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "traitComposition\x0a\x09^ (self basicAt: 'traitComposition')\x0a\x09\x09ifNil: [ #() ]\x0a\x09\x09ifNotNil: [ :aCollection | aCollection collect: [ :each | TraitTransformation fromJSON: each ] ]",
- referencedClasses: ["TraitTransformation"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifNil:ifNotNil:", "basicAt:", "collect:", "fromJSON:"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$self._basicAt_("traitComposition");
- if($1 == null || $1.a$nil){
- return [];
- } else {
- var aCollection;
- aCollection=$1;
- return $recv(aCollection)._collect_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv($globals.TraitTransformation)._fromJSON_(each);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
- //>>excludeEnd("ctx");
- }));
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"traitComposition",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addMethod(
- $core.method({
- selector: "traitCompositionDefinition",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- 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: '}' ] ]",
- referencedClasses: ["String"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifNotEmpty:", "traitComposition", "streamContents:", "write:", "do:separatedBy:", "definition"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self._traitComposition())._ifNotEmpty_((function(traitComposition){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv($globals.String)._streamContents_((function(str){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- [$recv(str)._write_("{")
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx3.sendIdx["write:"]=1
- //>>excludeEnd("ctx");
- ][0];
- $recv(traitComposition)._do_separatedBy_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx4) {
- //>>excludeEnd("ctx");
- return [$recv(str)._write_($recv(each)._definition())
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx4.sendIdx["write:"]=2
- //>>excludeEnd("ctx");
- ][0];
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3,3)});
- //>>excludeEnd("ctx");
- }),(function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx4) {
- //>>excludeEnd("ctx");
- return [$recv(str)._write_(". ")
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx4.sendIdx["write:"]=3
- //>>excludeEnd("ctx");
- ][0];
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx4) {$ctx4.fillBlock({},$ctx3,4)});
- //>>excludeEnd("ctx");
- }));
- return $recv(str)._write_("}");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({str:str},$ctx2,2)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({traitComposition:traitComposition},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"traitCompositionDefinition",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TBehaviorProvider);
- $core.addTrait("TMasterBehavior", "Kernel-Classes");
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $globals.TMasterBehavior.comment="I am the behavior on the instance-side of the browser.\x0a\x0aI define things like package, category, name, comment etc.\x0aas opposed to derived behaviors (metaclass, class trait, ...)\x0athat relate to me.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "asJavaScriptSource",
- protocol: "converting",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "asJavaScriptSource\x0a\x09^ '$globals.', self name",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: [",", "name"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return "$globals.".__comma($self._name());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"asJavaScriptSource",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TMasterBehavior);
- $core.addMethod(
- $core.method({
- selector: "browse",
- protocol: "browsing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "browse\x0a\x09Finder findClass: self",
- referencedClasses: ["Finder"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["findClass:"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv($globals.Finder)._findClass_(self);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"browse",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TMasterBehavior);
- $core.addMethod(
- $core.method({
- selector: "category",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "category\x0a\x09^ self package ifNil: [ 'Unclassified' ] ifNotNil: [ self package name ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifNil:ifNotNil:", "package", "name"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=[$self._package()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["package"]=1
- //>>excludeEnd("ctx");
- ][0];
- if($1 == null || $1.a$nil){
- return "Unclassified";
- } else {
- return $recv($self._package())._name();
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"category",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TMasterBehavior);
- $core.addMethod(
- $core.method({
- selector: "classTag",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "classTag\x0a\x09\x22Every master behavior should define a class tag.\x22\x0a\x09^ self subclassResponsibility",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["subclassResponsibility"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $self._subclassResponsibility();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"classTag",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TMasterBehavior);
- $core.addMethod(
- $core.method({
- selector: "comment",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "comment\x0a\x09^ (self basicAt: 'comment') ifNil: [ '' ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifNil:", "basicAt:"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$self._basicAt_("comment");
- if($1 == null || $1.a$nil){
- return "";
- } else {
- return $1;
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"comment",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TMasterBehavior);
- $core.addMethod(
- $core.method({
- selector: "comment:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- 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)",
- referencedClasses: ["SystemAnnouncer", "ClassCommentChanged"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["basicAt:put:", "announce:", "current", "theClass:", "new", "yourself"]
- }, function ($methodClass){ return function (aString){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2;
- $self._basicAt_put_("comment",aString);
- $1=$recv($globals.SystemAnnouncer)._current();
- $2=$recv($globals.ClassCommentChanged)._new();
- $recv($2)._theClass_(self);
- $recv($1)._announce_($recv($2)._yourself());
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"comment:",{aString:aString})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TMasterBehavior);
- $core.addMethod(
- $core.method({
- selector: "definedMethods",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "definedMethods\x0a\x09\x22Answers methods of me and derived 'meta' part if present\x22\x0a\x09| methods |\x0a\x09methods := self methods.\x0a\x09self theMetaClass\x0a\x09\x09ifNil: [ ^ methods ]\x0a\x09\x09ifNotNil: [ :meta | ^ methods, meta methods ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["methods", "ifNil:ifNotNil:", "theMetaClass", ","]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- var methods;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- methods=[$self._methods()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["methods"]=1
- //>>excludeEnd("ctx");
- ][0];
- $1=$self._theMetaClass();
- if($1 == null || $1.a$nil){
- return methods;
- } else {
- var meta;
- meta=$1;
- return $recv(methods).__comma($recv(meta)._methods());
- }
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"definedMethods",{methods:methods})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TMasterBehavior);
- $core.addMethod(
- $core.method({
- selector: "enterOrganization",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "enterOrganization\x0a\x09Smalltalk ifNotNil: [\x0a\x09\x09(self basicAt: 'category')\x0a\x09\x09\x09ifNil: [ self basicPackage: nil ]\x0a\x09\x09\x09ifNotNil: [ :category |\x0a\x09\x09\x09\x09\x22Amber has 1-1 correspondence between cat and pkg, atm\x22\x0a\x09\x09\x09\x09self basicPackage: (Package named: category).\x0a\x09\x09\x09\x09self package organization addElement: self ] ]",
- referencedClasses: ["Smalltalk", "Package"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifNotNil:", "ifNil:ifNotNil:", "basicAt:", "basicPackage:", "named:", "addElement:", "organization", "package"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2;
- $1=$globals.Smalltalk;
- if($1 == null || $1.a$nil){
- $1;
- } else {
- $2=$self._basicAt_("category");
- if($2 == null || $2.a$nil){
- [$self._basicPackage_(nil)
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["basicPackage:"]=1
- //>>excludeEnd("ctx");
- ][0];
- } else {
- var category;
- category=$2;
- $self._basicPackage_($recv($globals.Package)._named_(category));
- $recv($recv($self._package())._organization())._addElement_(self);
- }
- }
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"enterOrganization",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TMasterBehavior);
- $core.addMethod(
- $core.method({
- selector: "leaveOrganization",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "leaveOrganization\x0a\x09Smalltalk ifNotNil: [\x0a\x09\x09self package organization removeElement: self ]",
- referencedClasses: ["Smalltalk"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifNotNil:", "removeElement:", "organization", "package"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$globals.Smalltalk;
- if($1 == null || $1.a$nil){
- $1;
- } else {
- $recv($recv($self._package())._organization())._removeElement_(self);
- }
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"leaveOrganization",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TMasterBehavior);
- $core.addMethod(
- $core.method({
- selector: "name",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "name\x0a\x09<inlineJS: 'return self.name'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["return self.name"]]],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return self.name;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"name",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TMasterBehavior);
- $core.addMethod(
- $core.method({
- selector: "package:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage"],
- source: "package: aPackage\x0a\x09| oldPackage |\x0a\x09\x0a\x09self package = aPackage ifTrue: [ ^ self ].\x0a\x09\x0a\x09oldPackage := self package.\x0a\x09\x0a\x09self\x0a\x09\x09leaveOrganization;\x0a\x09\x09basicAt: 'category' put: aPackage name;\x0a\x09\x09enterOrganization.\x0a\x0a\x09SystemAnnouncer current announce: (ClassMoved new\x0a\x09\x09theClass: self;\x0a\x09\x09oldPackage: oldPackage;\x0a\x09\x09yourself)",
- referencedClasses: ["SystemAnnouncer", "ClassMoved"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifTrue:", "=", "package", "leaveOrganization", "basicAt:put:", "name", "enterOrganization", "announce:", "current", "theClass:", "new", "oldPackage:", "yourself"]
- }, function ($methodClass){ return function (aPackage){
- var self=this,$self=this;
- var oldPackage;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2;
- if($core.assert($recv([$self._package()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["package"]=1
- //>>excludeEnd("ctx");
- ][0]).__eq(aPackage))){
- return self;
- }
- oldPackage=$self._package();
- $self._leaveOrganization();
- $self._basicAt_put_("category",$recv(aPackage)._name());
- $self._enterOrganization();
- $1=$recv($globals.SystemAnnouncer)._current();
- $2=$recv($globals.ClassMoved)._new();
- $recv($2)._theClass_(self);
- $recv($2)._oldPackage_(oldPackage);
- $recv($1)._announce_($recv($2)._yourself());
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"package:",{aPackage:aPackage,oldPackage:oldPackage})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TMasterBehavior);
- $core.addMethod(
- $core.method({
- selector: "theNonMetaClass",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "theNonMetaClass\x0a\x09^ self",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return self;
- }; }),
- $globals.TMasterBehavior);
- $core.addClass("Trait", $globals.Object, "Kernel-Classes");
- $core.setSlots($globals.Trait, ["organization", "package", "traitUsers"]);
- $core.addMethod(
- $core.method({
- selector: "-",
- protocol: "composition",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anArray"],
- source: "- anArray\x0a\x09^ self asTraitTransformation - anArray",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["-", "asTraitTransformation"]
- }, function ($methodClass){ return function (anArray){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self._asTraitTransformation()).__minus(anArray);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"-",{anArray:anArray})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Trait);
- $core.addMethod(
- $core.method({
- selector: "@",
- protocol: "composition",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anArrayOfAssociations"],
- source: "@ anArrayOfAssociations\x0a\x09^ self asTraitTransformation @ anArrayOfAssociations",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["@", "asTraitTransformation"]
- }, function ($methodClass){ return function (anArrayOfAssociations){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self._asTraitTransformation()).__at(anArrayOfAssociations);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"@",{anArrayOfAssociations:anArrayOfAssociations})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Trait);
- $core.addMethod(
- $core.method({
- selector: "asTraitComposition",
- protocol: "converting",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "asTraitComposition\x0a\x09^ self asTraitTransformation asTraitComposition",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["asTraitComposition", "asTraitTransformation"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self._asTraitTransformation())._asTraitComposition();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"asTraitComposition",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Trait);
- $core.addMethod(
- $core.method({
- selector: "asTraitTransformation",
- protocol: "converting",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "asTraitTransformation\x0a\x09^ TraitTransformation on: self",
- referencedClasses: ["TraitTransformation"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["on:"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($globals.TraitTransformation)._on_(self);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"asTraitTransformation",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Trait);
- $core.addMethod(
- $core.method({
- selector: "basicOrganization",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "basicOrganization\x0a\x09^ organization",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return $self.organization;
- }; }),
- $globals.Trait);
- $core.addMethod(
- $core.method({
- selector: "basicOrganization:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClassOrganizer"],
- source: "basicOrganization: aClassOrganizer\x0a\x09organization := aClassOrganizer",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (aClassOrganizer){
- var self=this,$self=this;
- $self.organization=aClassOrganizer;
- return self;
- }; }),
- $globals.Trait);
- $core.addMethod(
- $core.method({
- selector: "basicPackage:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage"],
- source: "basicPackage: aPackage\x0a\x09package := aPackage",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (aPackage){
- var self=this,$self=this;
- $self.package=aPackage;
- return self;
- }; }),
- $globals.Trait);
- $core.addMethod(
- $core.method({
- selector: "classTag",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "classTag\x0a\x09^ 'trait'",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return "trait";
- }; }),
- $globals.Trait);
- $core.addMethod(
- $core.method({
- selector: "definition",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- 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 ]",
- referencedClasses: ["String"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["streamContents:", "write:", "printSymbol:", "name", "lf", "ifNotEmpty:", "traitCompositionDefinition", "tab", "print:", "category"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($globals.String)._streamContents_((function(stream){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- [$recv(stream)._write_("Trait named: ")
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["write:"]=1
- //>>excludeEnd("ctx");
- ][0];
- $recv(stream)._printSymbol_($self._name());
- [$recv(stream)._lf()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["lf"]=1
- //>>excludeEnd("ctx");
- ][0];
- [$recv(stream)._write_($recv($self._traitCompositionDefinition())._ifNotEmpty_((function(tcd){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- return [[$recv($globals.String)._tab()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx3.sendIdx["tab"]=1
- //>>excludeEnd("ctx");
- ][0],"uses: ",tcd,$recv($globals.String)._lf()];
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({tcd:tcd},$ctx2,2)});
- //>>excludeEnd("ctx");
- })))
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["write:"]=2
- //>>excludeEnd("ctx");
- ][0];
- $recv(stream)._tab();
- $recv(stream)._write_("package: ");
- return $recv(stream)._print_($self._category());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"definition",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Trait);
- $core.addMethod(
- $core.method({
- selector: "package",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "package\x0a\x09^ package",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return $self.package;
- }; }),
- $globals.Trait);
- $core.addMethod(
- $core.method({
- selector: "theMetaClass",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "theMetaClass\x0a\x09^ nil",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return nil;
- }; }),
- $globals.Trait);
- $core.addMethod(
- $core.method({
- selector: "traitUsers",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "traitUsers\x0a\x09^ traitUsers copy",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["copy"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self.traitUsers)._copy();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"traitUsers",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Trait);
- $core.addMethod(
- $core.method({
- selector: "named:package:",
- protocol: "instance creation",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString", "anotherString"],
- source: "named: aString package: anotherString\x0a\x09^ ClassBuilder new addTraitNamed: aString package: anotherString",
- referencedClasses: ["ClassBuilder"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["addTraitNamed:package:", "new"]
- }, function ($methodClass){ return function (aString,anotherString){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($recv($globals.ClassBuilder)._new())._addTraitNamed_package_(aString,anotherString);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"named:package:",{aString:aString,anotherString:anotherString})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Trait.a$cls);
- $core.addMethod(
- $core.method({
- selector: "named:uses:package:",
- protocol: "instance creation",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString", "aTraitCompositionDescription", "anotherString"],
- 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",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["named:package:", "setTraitComposition:", "asTraitComposition"]
- }, function ($methodClass){ return function (aString,aTraitCompositionDescription,anotherString){
- var self=this,$self=this;
- var trait;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- trait=$self._named_package_(aString,anotherString);
- $recv(trait)._setTraitComposition_($recv(aTraitCompositionDescription)._asTraitComposition());
- return trait;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"named:uses:package:",{aString:aString,aTraitCompositionDescription:aTraitCompositionDescription,anotherString:anotherString,trait:trait})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Trait.a$cls);
- $core.addClass("TraitTransformation", $globals.Object, "Kernel-Classes");
- $core.setSlots($globals.TraitTransformation, ["trait", "aliases", "exclusions"]);
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $globals.TraitTransformation.comment="I am a single step in trait composition.\x0a\x0aI represent one trait including its aliases and exclusions.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "-",
- protocol: "composition",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anArray"],
- source: "- anArray\x0a\x09^ self copy addExclusions: anArray; yourself",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["addExclusions:", "copy", "yourself"]
- }, function ($methodClass){ return function (anArray){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$self._copy();
- $recv($1)._addExclusions_(anArray);
- return $recv($1)._yourself();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"-",{anArray:anArray})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TraitTransformation);
- $core.addMethod(
- $core.method({
- selector: "@",
- protocol: "composition",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anArrayOfAssociations"],
- source: "@ anArrayOfAssociations\x0a\x09^ self copy addAliases: anArrayOfAssociations; yourself",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["addAliases:", "copy", "yourself"]
- }, function ($methodClass){ return function (anArrayOfAssociations){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$self._copy();
- $recv($1)._addAliases_(anArrayOfAssociations);
- return $recv($1)._yourself();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"@",{anArrayOfAssociations:anArrayOfAssociations})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TraitTransformation);
- $core.addMethod(
- $core.method({
- selector: "addAliases:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anArrayOfAssociations"],
- 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",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["do:", "key", "at:ifPresent:ifAbsent:", "error:", "at:put:", "value"]
- }, function ($methodClass){ return function (anArrayOfAssociations){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv(anArrayOfAssociations)._do_((function(each){
- var key;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- key=$recv(each)._key();
- return $recv($self.aliases)._at_ifPresent_ifAbsent_(key,(function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- return $self._error_("Cannot use same alias name twice.");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
- //>>excludeEnd("ctx");
- }),(function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- return $recv($self.aliases)._at_put_(key,$recv(each)._value());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each,key:key},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- return anArrayOfAssociations;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"addAliases:",{anArrayOfAssociations:anArrayOfAssociations})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TraitTransformation);
- $core.addMethod(
- $core.method({
- selector: "addExclusions:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anArray"],
- source: "addExclusions: anArray\x0a\x09exclusions addAll: anArray.\x0a\x09^ anArray",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["addAll:"]
- }, function ($methodClass){ return function (anArray){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv($self.exclusions)._addAll_(anArray);
- return anArray;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"addExclusions:",{anArray:anArray})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TraitTransformation);
- $core.addMethod(
- $core.method({
- selector: "aliases",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "aliases\x0a\x09^ aliases",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return $self.aliases;
- }; }),
- $globals.TraitTransformation);
- $core.addMethod(
- $core.method({
- selector: "asJavaScriptObject",
- protocol: "converting",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "asJavaScriptObject\x0a\x09^ #{\x0a\x09\x09'trait' -> self trait.\x0a\x09\x09'aliases' -> self aliases.\x0a\x09\x09'exclusions' -> self exclusions asArray sorted }",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["trait", "aliases", "sorted", "asArray", "exclusions"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $globals.HashedCollection._newFromPairs_(["trait",$self._trait(),"aliases",$self._aliases(),"exclusions",$recv($recv($self._exclusions())._asArray())._sorted()]);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"asJavaScriptObject",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TraitTransformation);
- $core.addMethod(
- $core.method({
- selector: "asJavaScriptSource",
- protocol: "converting",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- 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'}' } ]",
- referencedClasses: ["String"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["streamContents:", "write:", "asJavaScriptSource", "trait", "ifNotEmpty:", "aliases", "asJSONString", "exclusions", "sorted", "asArray"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($globals.String)._streamContents_((function(str){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(str)._write_(["{trait: ",[$recv($self._trait())._asJavaScriptSource()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["asJavaScriptSource"]=1
- //>>excludeEnd("ctx");
- ][0],[$recv($self._aliases())._ifNotEmpty_((function(al){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- return [", aliases: ",$recv(al)._asJSONString()];
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({al:al},$ctx2,2)});
- //>>excludeEnd("ctx");
- }))
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["ifNotEmpty:"]=1
- //>>excludeEnd("ctx");
- ][0],$recv($self._exclusions())._ifNotEmpty_((function(ex){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- return [", exclusions: ",$recv($recv($recv(ex)._asArray())._sorted())._asJavaScriptSource()];
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({ex:ex},$ctx2,3)});
- //>>excludeEnd("ctx");
- })),"}"]);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"asJavaScriptSource",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TraitTransformation);
- $core.addMethod(
- $core.method({
- selector: "asTraitComposition",
- protocol: "converting",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "asTraitComposition\x0a\x09^ { self }",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return [self];
- }; }),
- $globals.TraitTransformation);
- $core.addMethod(
- $core.method({
- selector: "asTraitTransformation",
- protocol: "converting",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "asTraitTransformation\x0a\x09^ self",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return self;
- }; }),
- $globals.TraitTransformation);
- $core.addMethod(
- $core.method({
- selector: "definition",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- 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: ')' ] ]",
- referencedClasses: ["String"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["streamContents:", "print:", "trait", "ifNotEmpty:", "aliases", "write:", "do:separatedBy:", "associations", "printSymbol:", "key", "value", "exclusions", "sorted", "asArray", "allButFirst", "symbolPrintString", "space"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($globals.String)._streamContents_((function(str){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $recv(str)._print_($self._trait());
- [$recv($self._aliases())._ifNotEmpty_((function(al){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- [$recv(str)._write_(" @ {")
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx3.sendIdx["write:"]=1
- //>>excludeEnd("ctx");
- ][0];
- [$recv($recv(al)._associations())._do_separatedBy_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx4) {
- //>>excludeEnd("ctx");
- [$recv(str)._printSymbol_($recv(each)._key())
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx4.sendIdx["printSymbol:"]=1
- //>>excludeEnd("ctx");
- ][0];
- [$recv(str)._write_(" -> ")
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx4.sendIdx["write:"]=2
- //>>excludeEnd("ctx");
- ][0];
- return $recv(str)._printSymbol_($recv(each)._value());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3,3)});
- //>>excludeEnd("ctx");
- }),(function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx4) {
- //>>excludeEnd("ctx");
- return [$recv(str)._write_(". ")
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx4.sendIdx["write:"]=3
- //>>excludeEnd("ctx");
- ][0];
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx4) {$ctx4.fillBlock({},$ctx3,4)});
- //>>excludeEnd("ctx");
- }))
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx3.sendIdx["do:separatedBy:"]=1
- //>>excludeEnd("ctx");
- ][0];
- return [$recv(str)._write_("}")
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx3.sendIdx["write:"]=4
- //>>excludeEnd("ctx");
- ][0];
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({al:al},$ctx2,2)});
- //>>excludeEnd("ctx");
- }))
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["ifNotEmpty:"]=1
- //>>excludeEnd("ctx");
- ][0];
- return $recv($self._exclusions())._ifNotEmpty_((function(ex){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- [$recv(str)._write_(" - #(")
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx3.sendIdx["write:"]=5
- //>>excludeEnd("ctx");
- ][0];
- $recv($recv($recv(ex)._asArray())._sorted())._do_separatedBy_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx4) {
- //>>excludeEnd("ctx");
- return [$recv(str)._write_($recv($recv(each)._symbolPrintString())._allButFirst())
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx4.sendIdx["write:"]=6
- //>>excludeEnd("ctx");
- ][0];
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3,6)});
- //>>excludeEnd("ctx");
- }),(function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx4) {
- //>>excludeEnd("ctx");
- return $recv(str)._space();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx4) {$ctx4.fillBlock({},$ctx3,7)});
- //>>excludeEnd("ctx");
- }));
- return $recv(str)._write_(")");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({ex:ex},$ctx2,5)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"definition",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TraitTransformation);
- $core.addMethod(
- $core.method({
- selector: "exclusions",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "exclusions\x0a\x09^ exclusions",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return $self.exclusions;
- }; }),
- $globals.TraitTransformation);
- $core.addMethod(
- $core.method({
- selector: "initialize",
- protocol: "initialization",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "initialize\x0a\x09super initialize.\x0a\x0a\x09aliases := #{}.\x0a\x09exclusions := Set new.\x0a\x09trait := nil",
- referencedClasses: ["Set"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["initialize", "new"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- [(
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- ($methodClass.superclass||$boot.nilAsClass).fn.prototype._initialize.call($self))
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.supercall = false
- //>>excludeEnd("ctx");
- ][0];
- $self.aliases=$globals.HashedCollection._newFromPairs_([]);
- $self.exclusions=$recv($globals.Set)._new();
- $self.trait=nil;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"initialize",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TraitTransformation);
- $core.addMethod(
- $core.method({
- selector: "postCopy",
- protocol: "copying",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "postCopy\x0a\x09aliases := aliases copy.\x0a\x09exclusions := exclusions copy",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["copy"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $self.aliases=[$recv($self.aliases)._copy()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["copy"]=1
- //>>excludeEnd("ctx");
- ][0];
- $self.exclusions=$recv($self.exclusions)._copy();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"postCopy",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TraitTransformation);
- $core.addMethod(
- $core.method({
- selector: "trait",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "trait\x0a\x09^ trait",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return $self.trait;
- }; }),
- $globals.TraitTransformation);
- $core.addMethod(
- $core.method({
- selector: "trait:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anObject"],
- source: "trait: anObject\x0a\x09trait := anObject",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (anObject){
- var self=this,$self=this;
- $self.trait=anObject;
- return self;
- }; }),
- $globals.TraitTransformation);
- $core.addMethod(
- $core.method({
- selector: "fromJSON:",
- protocol: "instance creation",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aJSObject"],
- 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",
- referencedClasses: ["Smalltalk"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["trait:", "new", "at:", "addAliases:", "associations", "readJSObject:", "at:ifAbsent:", "addExclusions:", "yourself"]
- }, function ($methodClass){ return function (aJSObject){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=[(
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- ($methodClass.superclass||$boot.nilAsClass).fn.prototype._new.call($self))
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.supercall = false
- //>>excludeEnd("ctx");
- ][0];
- $recv($1)._trait_($recv(aJSObject)._at_("trait"));
- $recv($1)._addAliases_($recv($recv($globals.Smalltalk)._readJSObject_([$recv(aJSObject)._at_ifAbsent_("aliases",(function(){
- return $globals.HashedCollection._newFromPairs_([]);
- }))
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["at:ifAbsent:"]=1
- //>>excludeEnd("ctx");
- ][0]))._associations());
- $recv($1)._addExclusions_($recv(aJSObject)._at_ifAbsent_("exclusions",(function(){
- return [];
- })));
- return $recv($1)._yourself();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"fromJSON:",{aJSObject:aJSObject})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TraitTransformation.a$cls);
- $core.addMethod(
- $core.method({
- selector: "on:",
- protocol: "instance creation",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aTrait"],
- source: "on: aTrait\x0a\x09^ super new trait: aTrait; yourself",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["trait:", "new", "yourself"]
- }, function ($methodClass){ return function (aTrait){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=[(
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- ($methodClass.superclass||$boot.nilAsClass).fn.prototype._new.call($self))
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.supercall = false
- //>>excludeEnd("ctx");
- ][0];
- $recv($1)._trait_(aTrait);
- return $recv($1)._yourself();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"on:",{aTrait:aTrait})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TraitTransformation.a$cls);
- $core.setTraitComposition([{trait: $globals.TBehaviorDefaults}, {trait: $globals.TBehaviorProvider}], $globals.Behavior);
- $core.setTraitComposition([{trait: $globals.TMasterBehavior}, {trait: $globals.TSubclassable}], $globals.Class);
- $core.setTraitComposition([{trait: $globals.TBehaviorDefaults}, {trait: $globals.TBehaviorProvider}, {trait: $globals.TMasterBehavior}], $globals.Trait);
- $core.addMethod(
- $core.method({
- selector: "asTraitComposition",
- protocol: "*Kernel-Classes",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "asTraitComposition\x0a\x09\x22not implemented yet, noop atm\x22\x0a\x09^ self collect: [ :each | each asTraitTransformation ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["collect:", "asTraitTransformation"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $self._collect_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(each)._asTraitTransformation();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"asTraitComposition",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Array);
- $core.addMethod(
- $core.method({
- selector: "instanceVariablesStringAsSlotList",
- protocol: "*Kernel-Classes",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "instanceVariablesStringAsSlotList\x0a\x09^ (self tokenize: ' ') reject: [ :each | each isEmpty ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["reject:", "tokenize:", "isEmpty"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self._tokenize_(" "))._reject_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(each)._isEmpty();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"instanceVariablesStringAsSlotList",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.String);
- });
|