Kernel-Infrastructure.js 202 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783
  1. define("amber_core/Kernel-Infrastructure", ["amber/boot", "amber_core/Kernel-Objects", "amber_core/Kernel-Collections"], function($boot){
  2. var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
  3. $core.addPackage('Kernel-Infrastructure');
  4. $core.packages["Kernel-Infrastructure"].innerEval = function (expr) { return eval(expr); };
  5. $core.packages["Kernel-Infrastructure"].transport = {"type":"amd","amdNamespace":"amber_core"};
  6. $core.addClass('ConsoleErrorHandler', $globals.Object, [], 'Kernel-Infrastructure');
  7. //>>excludeStart("ide", pragmas.excludeIdeData);
  8. $globals.ConsoleErrorHandler.comment="I am manage Smalltalk errors, displaying the stack in the console.";
  9. //>>excludeEnd("ide");
  10. $core.addMethod(
  11. $core.method({
  12. selector: "handleError:",
  13. protocol: 'error handling',
  14. fn: function (anError){
  15. var self=this;
  16. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  17. return $core.withContext(function($ctx1) {
  18. //>>excludeEnd("ctx");
  19. var $1,$receiver;
  20. $1=$recv(anError)._context();
  21. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  22. $ctx1.sendIdx["context"]=1;
  23. //>>excludeEnd("ctx");
  24. if(($receiver = $1) == null || $receiver.isNil){
  25. $1;
  26. } else {
  27. self._logErrorContext_($recv(anError)._context());
  28. };
  29. self._logError_(anError);
  30. return self;
  31. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  32. }, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},$globals.ConsoleErrorHandler)});
  33. //>>excludeEnd("ctx");
  34. },
  35. //>>excludeStart("ide", pragmas.excludeIdeData);
  36. args: ["anError"],
  37. source: "handleError: anError\x0a\x09anError context ifNotNil: [ self logErrorContext: anError context ].\x0a\x09self logError: anError",
  38. referencedClasses: [],
  39. //>>excludeEnd("ide");
  40. messageSends: ["ifNotNil:", "context", "logErrorContext:", "logError:"]
  41. }),
  42. $globals.ConsoleErrorHandler);
  43. $core.addMethod(
  44. $core.method({
  45. selector: "log:",
  46. protocol: 'private',
  47. fn: function (aString){
  48. var self=this;
  49. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  50. return $core.withContext(function($ctx1) {
  51. //>>excludeEnd("ctx");
  52. $recv(console)._log_(aString);
  53. return self;
  54. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  55. }, function($ctx1) {$ctx1.fill(self,"log:",{aString:aString},$globals.ConsoleErrorHandler)});
  56. //>>excludeEnd("ctx");
  57. },
  58. //>>excludeStart("ide", pragmas.excludeIdeData);
  59. args: ["aString"],
  60. source: "log: aString\x0a\x09console log: aString",
  61. referencedClasses: [],
  62. //>>excludeEnd("ide");
  63. messageSends: ["log:"]
  64. }),
  65. $globals.ConsoleErrorHandler);
  66. $core.addMethod(
  67. $core.method({
  68. selector: "logContext:",
  69. protocol: 'private',
  70. fn: function (aContext){
  71. var self=this;
  72. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  73. return $core.withContext(function($ctx1) {
  74. //>>excludeEnd("ctx");
  75. var $1,$receiver;
  76. $1=$recv(aContext)._home();
  77. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  78. $ctx1.sendIdx["home"]=1;
  79. //>>excludeEnd("ctx");
  80. if(($receiver = $1) == null || $receiver.isNil){
  81. $1;
  82. } else {
  83. self._logContext_($recv(aContext)._home());
  84. };
  85. self._log_($recv(aContext)._asString());
  86. return self;
  87. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  88. }, function($ctx1) {$ctx1.fill(self,"logContext:",{aContext:aContext},$globals.ConsoleErrorHandler)});
  89. //>>excludeEnd("ctx");
  90. },
  91. //>>excludeStart("ide", pragmas.excludeIdeData);
  92. args: ["aContext"],
  93. source: "logContext: aContext\x0a\x09aContext home ifNotNil: [\x0a\x09\x09self logContext: aContext home ].\x0a\x09self log: aContext asString",
  94. referencedClasses: [],
  95. //>>excludeEnd("ide");
  96. messageSends: ["ifNotNil:", "home", "logContext:", "log:", "asString"]
  97. }),
  98. $globals.ConsoleErrorHandler);
  99. $core.addMethod(
  100. $core.method({
  101. selector: "logError:",
  102. protocol: 'private',
  103. fn: function (anError){
  104. var self=this;
  105. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  106. return $core.withContext(function($ctx1) {
  107. //>>excludeEnd("ctx");
  108. self._log_($recv(anError)._messageText());
  109. return self;
  110. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  111. }, function($ctx1) {$ctx1.fill(self,"logError:",{anError:anError},$globals.ConsoleErrorHandler)});
  112. //>>excludeEnd("ctx");
  113. },
  114. //>>excludeStart("ide", pragmas.excludeIdeData);
  115. args: ["anError"],
  116. source: "logError: anError\x0a\x09self log: anError messageText",
  117. referencedClasses: [],
  118. //>>excludeEnd("ide");
  119. messageSends: ["log:", "messageText"]
  120. }),
  121. $globals.ConsoleErrorHandler);
  122. $core.addMethod(
  123. $core.method({
  124. selector: "logErrorContext:",
  125. protocol: 'private',
  126. fn: function (aContext){
  127. var self=this;
  128. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  129. return $core.withContext(function($ctx1) {
  130. //>>excludeEnd("ctx");
  131. var $1,$receiver;
  132. if(($receiver = aContext) == null || $receiver.isNil){
  133. aContext;
  134. } else {
  135. $1=$recv(aContext)._home();
  136. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  137. $ctx1.sendIdx["home"]=1;
  138. //>>excludeEnd("ctx");
  139. if(($receiver = $1) == null || $receiver.isNil){
  140. $1;
  141. } else {
  142. self._logContext_($recv(aContext)._home());
  143. };
  144. };
  145. return self;
  146. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  147. }, function($ctx1) {$ctx1.fill(self,"logErrorContext:",{aContext:aContext},$globals.ConsoleErrorHandler)});
  148. //>>excludeEnd("ctx");
  149. },
  150. //>>excludeStart("ide", pragmas.excludeIdeData);
  151. args: ["aContext"],
  152. source: "logErrorContext: aContext\x0a\x09aContext ifNotNil: [\x0a\x09\x09aContext home ifNotNil: [\x0a\x09\x09\x09self logContext: aContext home ]]",
  153. referencedClasses: [],
  154. //>>excludeEnd("ide");
  155. messageSends: ["ifNotNil:", "home", "logContext:"]
  156. }),
  157. $globals.ConsoleErrorHandler);
  158. $globals.ConsoleErrorHandler.klass.iVarNames = ['current'];
  159. $core.addMethod(
  160. $core.method({
  161. selector: "initialize",
  162. protocol: 'initialization',
  163. fn: function (){
  164. var self=this;
  165. function $ErrorHandler(){return $globals.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  166. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  167. return $core.withContext(function($ctx1) {
  168. //>>excludeEnd("ctx");
  169. $recv($ErrorHandler())._registerIfNone_(self._new());
  170. return self;
  171. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  172. }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.ConsoleErrorHandler.klass)});
  173. //>>excludeEnd("ctx");
  174. },
  175. //>>excludeStart("ide", pragmas.excludeIdeData);
  176. args: [],
  177. source: "initialize\x0a\x09ErrorHandler registerIfNone: self new",
  178. referencedClasses: ["ErrorHandler"],
  179. //>>excludeEnd("ide");
  180. messageSends: ["registerIfNone:", "new"]
  181. }),
  182. $globals.ConsoleErrorHandler.klass);
  183. $core.addClass('InterfacingObject', $globals.Object, [], 'Kernel-Infrastructure');
  184. //>>excludeStart("ide", pragmas.excludeIdeData);
  185. $globals.InterfacingObject.comment="I am superclass of all object that interface with user or environment. `Widget` and a few other classes are subclasses of me. I delegate all of the above APIs to `PlatformInterface`.\x0a\x0a## API\x0a\x0a self alert: 'Hey, there is a problem'.\x0a self confirm: 'Affirmative?'.\x0a self prompt: 'Your name:'.\x0a\x0a self ajax: #{\x0a 'url' -> '/patch.js'. 'type' -> 'GET'. dataType->'script'\x0a }.";
  186. //>>excludeEnd("ide");
  187. $core.addMethod(
  188. $core.method({
  189. selector: "ajax:",
  190. protocol: 'actions',
  191. fn: function (anObject){
  192. var self=this;
  193. function $PlatformInterface(){return $globals.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  194. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  195. return $core.withContext(function($ctx1) {
  196. //>>excludeEnd("ctx");
  197. var $1;
  198. $1=$recv($PlatformInterface())._ajax_(anObject);
  199. return $1;
  200. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  201. }, function($ctx1) {$ctx1.fill(self,"ajax:",{anObject:anObject},$globals.InterfacingObject)});
  202. //>>excludeEnd("ctx");
  203. },
  204. //>>excludeStart("ide", pragmas.excludeIdeData);
  205. args: ["anObject"],
  206. source: "ajax: anObject\x0a\x09^ PlatformInterface ajax: anObject",
  207. referencedClasses: ["PlatformInterface"],
  208. //>>excludeEnd("ide");
  209. messageSends: ["ajax:"]
  210. }),
  211. $globals.InterfacingObject);
  212. $core.addMethod(
  213. $core.method({
  214. selector: "alert:",
  215. protocol: 'actions',
  216. fn: function (aString){
  217. var self=this;
  218. function $PlatformInterface(){return $globals.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  219. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  220. return $core.withContext(function($ctx1) {
  221. //>>excludeEnd("ctx");
  222. var $1;
  223. $1=$recv($PlatformInterface())._alert_(aString);
  224. return $1;
  225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  226. }, function($ctx1) {$ctx1.fill(self,"alert:",{aString:aString},$globals.InterfacingObject)});
  227. //>>excludeEnd("ctx");
  228. },
  229. //>>excludeStart("ide", pragmas.excludeIdeData);
  230. args: ["aString"],
  231. source: "alert: aString\x0a\x09^ PlatformInterface alert: aString",
  232. referencedClasses: ["PlatformInterface"],
  233. //>>excludeEnd("ide");
  234. messageSends: ["alert:"]
  235. }),
  236. $globals.InterfacingObject);
  237. $core.addMethod(
  238. $core.method({
  239. selector: "confirm:",
  240. protocol: 'actions',
  241. fn: function (aString){
  242. var self=this;
  243. function $PlatformInterface(){return $globals.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  244. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  245. return $core.withContext(function($ctx1) {
  246. //>>excludeEnd("ctx");
  247. var $1;
  248. $1=$recv($PlatformInterface())._confirm_(aString);
  249. return $1;
  250. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  251. }, function($ctx1) {$ctx1.fill(self,"confirm:",{aString:aString},$globals.InterfacingObject)});
  252. //>>excludeEnd("ctx");
  253. },
  254. //>>excludeStart("ide", pragmas.excludeIdeData);
  255. args: ["aString"],
  256. source: "confirm: aString\x0a\x09^ PlatformInterface confirm: aString",
  257. referencedClasses: ["PlatformInterface"],
  258. //>>excludeEnd("ide");
  259. messageSends: ["confirm:"]
  260. }),
  261. $globals.InterfacingObject);
  262. $core.addMethod(
  263. $core.method({
  264. selector: "prompt:",
  265. protocol: 'actions',
  266. fn: function (aString){
  267. var self=this;
  268. function $PlatformInterface(){return $globals.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  269. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  270. return $core.withContext(function($ctx1) {
  271. //>>excludeEnd("ctx");
  272. var $1;
  273. $1=$recv($PlatformInterface())._prompt_(aString);
  274. return $1;
  275. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  276. }, function($ctx1) {$ctx1.fill(self,"prompt:",{aString:aString},$globals.InterfacingObject)});
  277. //>>excludeEnd("ctx");
  278. },
  279. //>>excludeStart("ide", pragmas.excludeIdeData);
  280. args: ["aString"],
  281. source: "prompt: aString\x0a\x09^ PlatformInterface prompt: aString",
  282. referencedClasses: ["PlatformInterface"],
  283. //>>excludeEnd("ide");
  284. messageSends: ["prompt:"]
  285. }),
  286. $globals.InterfacingObject);
  287. $core.addMethod(
  288. $core.method({
  289. selector: "prompt:default:",
  290. protocol: 'actions',
  291. fn: function (aString,defaultString){
  292. var self=this;
  293. function $PlatformInterface(){return $globals.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  294. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  295. return $core.withContext(function($ctx1) {
  296. //>>excludeEnd("ctx");
  297. var $1;
  298. $1=$recv($PlatformInterface())._prompt_default_(aString,defaultString);
  299. return $1;
  300. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  301. }, function($ctx1) {$ctx1.fill(self,"prompt:default:",{aString:aString,defaultString:defaultString},$globals.InterfacingObject)});
  302. //>>excludeEnd("ctx");
  303. },
  304. //>>excludeStart("ide", pragmas.excludeIdeData);
  305. args: ["aString", "defaultString"],
  306. source: "prompt: aString default: defaultString\x0a\x09^ PlatformInterface prompt: aString default: defaultString",
  307. referencedClasses: ["PlatformInterface"],
  308. //>>excludeEnd("ide");
  309. messageSends: ["prompt:default:"]
  310. }),
  311. $globals.InterfacingObject);
  312. $core.addClass('Environment', $globals.InterfacingObject, [], 'Kernel-Infrastructure');
  313. //>>excludeStart("ide", pragmas.excludeIdeData);
  314. $globals.Environment.comment="I provide an unified entry point to manipulate Amber packages, classes and methods.\x0a\x0aTypical use cases include IDEs, remote access and restricting browsing.";
  315. //>>excludeEnd("ide");
  316. $core.addMethod(
  317. $core.method({
  318. selector: "addInstVarNamed:to:",
  319. protocol: 'compiling',
  320. fn: function (aString,aClass){
  321. var self=this;
  322. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  323. return $core.withContext(function($ctx1) {
  324. //>>excludeEnd("ctx");
  325. var $1,$2,$3,$4,$5;
  326. $1=self._classBuilder();
  327. $2=$recv(aClass)._superclass();
  328. $3=$recv(aClass)._name();
  329. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  330. $ctx1.sendIdx["name"]=1;
  331. //>>excludeEnd("ctx");
  332. $4=$recv($recv(aClass)._instanceVariableNames())._copy();
  333. $recv($4)._add_(aString);
  334. $5=$recv($4)._yourself();
  335. $recv($1)._addSubclassOf_named_instanceVariableNames_package_($2,$3,$5,$recv($recv(aClass)._package())._name());
  336. return self;
  337. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  338. }, function($ctx1) {$ctx1.fill(self,"addInstVarNamed:to:",{aString:aString,aClass:aClass},$globals.Environment)});
  339. //>>excludeEnd("ctx");
  340. },
  341. //>>excludeStart("ide", pragmas.excludeIdeData);
  342. args: ["aString", "aClass"],
  343. source: "addInstVarNamed: aString to: aClass\x0a\x09self classBuilder\x0a\x09\x09addSubclassOf: aClass superclass \x0a\x09\x09named: aClass name \x0a\x09\x09instanceVariableNames: (aClass instanceVariableNames copy add: aString; yourself)\x0a\x09\x09package: aClass package name",
  344. referencedClasses: [],
  345. //>>excludeEnd("ide");
  346. messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "classBuilder", "superclass", "name", "add:", "copy", "instanceVariableNames", "yourself", "package"]
  347. }),
  348. $globals.Environment);
  349. $core.addMethod(
  350. $core.method({
  351. selector: "allSelectors",
  352. protocol: 'accessing',
  353. fn: function (){
  354. var self=this;
  355. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  356. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  357. return $core.withContext(function($ctx1) {
  358. //>>excludeEnd("ctx");
  359. var $1;
  360. $1=$recv($recv($Smalltalk())._core())._allSelectors();
  361. return $1;
  362. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  363. }, function($ctx1) {$ctx1.fill(self,"allSelectors",{},$globals.Environment)});
  364. //>>excludeEnd("ctx");
  365. },
  366. //>>excludeStart("ide", pragmas.excludeIdeData);
  367. args: [],
  368. source: "allSelectors\x0a\x09^ Smalltalk core allSelectors",
  369. referencedClasses: ["Smalltalk"],
  370. //>>excludeEnd("ide");
  371. messageSends: ["allSelectors", "core"]
  372. }),
  373. $globals.Environment);
  374. $core.addMethod(
  375. $core.method({
  376. selector: "availableClassNames",
  377. protocol: 'accessing',
  378. fn: function (){
  379. var self=this;
  380. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  381. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  382. return $core.withContext(function($ctx1) {
  383. //>>excludeEnd("ctx");
  384. var $1;
  385. $1=$recv($recv($Smalltalk())._classes())._collect_((function(each){
  386. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  387. return $core.withContext(function($ctx2) {
  388. //>>excludeEnd("ctx");
  389. return $recv(each)._name();
  390. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  391. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  392. //>>excludeEnd("ctx");
  393. }));
  394. return $1;
  395. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  396. }, function($ctx1) {$ctx1.fill(self,"availableClassNames",{},$globals.Environment)});
  397. //>>excludeEnd("ctx");
  398. },
  399. //>>excludeStart("ide", pragmas.excludeIdeData);
  400. args: [],
  401. source: "availableClassNames\x0a\x09^ Smalltalk classes \x0a\x09\x09collect: [ :each | each name ]",
  402. referencedClasses: ["Smalltalk"],
  403. //>>excludeEnd("ide");
  404. messageSends: ["collect:", "classes", "name"]
  405. }),
  406. $globals.Environment);
  407. $core.addMethod(
  408. $core.method({
  409. selector: "availablePackageNames",
  410. protocol: 'accessing',
  411. fn: function (){
  412. var self=this;
  413. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  414. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  415. return $core.withContext(function($ctx1) {
  416. //>>excludeEnd("ctx");
  417. var $1;
  418. $1=$recv($recv($Smalltalk())._packages())._collect_((function(each){
  419. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  420. return $core.withContext(function($ctx2) {
  421. //>>excludeEnd("ctx");
  422. return $recv(each)._name();
  423. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  424. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  425. //>>excludeEnd("ctx");
  426. }));
  427. return $1;
  428. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  429. }, function($ctx1) {$ctx1.fill(self,"availablePackageNames",{},$globals.Environment)});
  430. //>>excludeEnd("ctx");
  431. },
  432. //>>excludeStart("ide", pragmas.excludeIdeData);
  433. args: [],
  434. source: "availablePackageNames\x0a\x09^ Smalltalk packages \x0a\x09\x09collect: [ :each | each name ]",
  435. referencedClasses: ["Smalltalk"],
  436. //>>excludeEnd("ide");
  437. messageSends: ["collect:", "packages", "name"]
  438. }),
  439. $globals.Environment);
  440. $core.addMethod(
  441. $core.method({
  442. selector: "availableProtocolsFor:",
  443. protocol: 'accessing',
  444. fn: function (aClass){
  445. var self=this;
  446. var protocols;
  447. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  448. return $core.withContext(function($ctx1) {
  449. //>>excludeEnd("ctx");
  450. var $1,$2,$receiver;
  451. protocols=$recv(aClass)._protocols();
  452. $1=$recv(aClass)._superclass();
  453. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  454. $ctx1.sendIdx["superclass"]=1;
  455. //>>excludeEnd("ctx");
  456. if(($receiver = $1) == null || $receiver.isNil){
  457. $1;
  458. } else {
  459. $recv(protocols)._addAll_(self._availableProtocolsFor_($recv(aClass)._superclass()));
  460. };
  461. $2=$recv($recv($recv(protocols)._asSet())._asArray())._sort();
  462. return $2;
  463. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  464. }, function($ctx1) {$ctx1.fill(self,"availableProtocolsFor:",{aClass:aClass,protocols:protocols},$globals.Environment)});
  465. //>>excludeEnd("ctx");
  466. },
  467. //>>excludeStart("ide", pragmas.excludeIdeData);
  468. args: ["aClass"],
  469. source: "availableProtocolsFor: aClass\x0a\x09| protocols |\x0a\x09\x0a\x09protocols := aClass protocols.\x0a\x09aClass superclass ifNotNil: [ protocols addAll: (self availableProtocolsFor: aClass superclass) ].\x0a\x09^ protocols asSet asArray sort",
  470. referencedClasses: [],
  471. //>>excludeEnd("ide");
  472. messageSends: ["protocols", "ifNotNil:", "superclass", "addAll:", "availableProtocolsFor:", "sort", "asArray", "asSet"]
  473. }),
  474. $globals.Environment);
  475. $core.addMethod(
  476. $core.method({
  477. selector: "classBuilder",
  478. protocol: 'accessing',
  479. fn: function (){
  480. var self=this;
  481. function $ClassBuilder(){return $globals.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  482. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  483. return $core.withContext(function($ctx1) {
  484. //>>excludeEnd("ctx");
  485. var $1;
  486. $1=$recv($ClassBuilder())._new();
  487. return $1;
  488. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  489. }, function($ctx1) {$ctx1.fill(self,"classBuilder",{},$globals.Environment)});
  490. //>>excludeEnd("ctx");
  491. },
  492. //>>excludeStart("ide", pragmas.excludeIdeData);
  493. args: [],
  494. source: "classBuilder\x0a\x09^ ClassBuilder new",
  495. referencedClasses: ["ClassBuilder"],
  496. //>>excludeEnd("ide");
  497. messageSends: ["new"]
  498. }),
  499. $globals.Environment);
  500. $core.addMethod(
  501. $core.method({
  502. selector: "classNamed:",
  503. protocol: 'accessing',
  504. fn: function (aString){
  505. var self=this;
  506. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  507. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  508. return $core.withContext(function($ctx1) {
  509. //>>excludeEnd("ctx");
  510. var $2,$1,$receiver;
  511. $2=$recv($recv($Smalltalk())._globals())._at_($recv(aString)._asSymbol());
  512. if(($receiver = $2) == null || $receiver.isNil){
  513. $1=self._error_("Invalid class name");
  514. } else {
  515. $1=$2;
  516. };
  517. return $1;
  518. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  519. }, function($ctx1) {$ctx1.fill(self,"classNamed:",{aString:aString},$globals.Environment)});
  520. //>>excludeEnd("ctx");
  521. },
  522. //>>excludeStart("ide", pragmas.excludeIdeData);
  523. args: ["aString"],
  524. source: "classNamed: aString\x0a\x09^ (Smalltalk globals at: aString asSymbol)\x0a\x09\x09ifNil: [ self error: 'Invalid class name' ]",
  525. referencedClasses: ["Smalltalk"],
  526. //>>excludeEnd("ide");
  527. messageSends: ["ifNil:", "at:", "globals", "asSymbol", "error:"]
  528. }),
  529. $globals.Environment);
  530. $core.addMethod(
  531. $core.method({
  532. selector: "classes",
  533. protocol: 'accessing',
  534. fn: function (){
  535. var self=this;
  536. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  537. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  538. return $core.withContext(function($ctx1) {
  539. //>>excludeEnd("ctx");
  540. var $1;
  541. $1=$recv($Smalltalk())._classes();
  542. return $1;
  543. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  544. }, function($ctx1) {$ctx1.fill(self,"classes",{},$globals.Environment)});
  545. //>>excludeEnd("ctx");
  546. },
  547. //>>excludeStart("ide", pragmas.excludeIdeData);
  548. args: [],
  549. source: "classes\x0a\x09^ Smalltalk classes",
  550. referencedClasses: ["Smalltalk"],
  551. //>>excludeEnd("ide");
  552. messageSends: ["classes"]
  553. }),
  554. $globals.Environment);
  555. $core.addMethod(
  556. $core.method({
  557. selector: "commitPackage:onSuccess:onError:",
  558. protocol: 'actions',
  559. fn: function (aPackage,aBlock,anotherBlock){
  560. var self=this;
  561. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  562. return $core.withContext(function($ctx1) {
  563. //>>excludeEnd("ctx");
  564. $recv($recv(aPackage)._transport())._commitOnSuccess_onError_(aBlock,anotherBlock);
  565. return self;
  566. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  567. }, function($ctx1) {$ctx1.fill(self,"commitPackage:onSuccess:onError:",{aPackage:aPackage,aBlock:aBlock,anotherBlock:anotherBlock},$globals.Environment)});
  568. //>>excludeEnd("ctx");
  569. },
  570. //>>excludeStart("ide", pragmas.excludeIdeData);
  571. args: ["aPackage", "aBlock", "anotherBlock"],
  572. source: "commitPackage: aPackage onSuccess: aBlock onError: anotherBlock\x0a\x09aPackage transport\x0a\x09\x09commitOnSuccess: aBlock\x0a\x09\x09onError: anotherBlock",
  573. referencedClasses: [],
  574. //>>excludeEnd("ide");
  575. messageSends: ["commitOnSuccess:onError:", "transport"]
  576. }),
  577. $globals.Environment);
  578. $core.addMethod(
  579. $core.method({
  580. selector: "compileClassComment:for:",
  581. protocol: 'compiling',
  582. fn: function (aString,aClass){
  583. var self=this;
  584. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  585. return $core.withContext(function($ctx1) {
  586. //>>excludeEnd("ctx");
  587. $recv(aClass)._comment_(aString);
  588. return self;
  589. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  590. }, function($ctx1) {$ctx1.fill(self,"compileClassComment:for:",{aString:aString,aClass:aClass},$globals.Environment)});
  591. //>>excludeEnd("ctx");
  592. },
  593. //>>excludeStart("ide", pragmas.excludeIdeData);
  594. args: ["aString", "aClass"],
  595. source: "compileClassComment: aString for: aClass\x0a\x09aClass comment: aString",
  596. referencedClasses: [],
  597. //>>excludeEnd("ide");
  598. messageSends: ["comment:"]
  599. }),
  600. $globals.Environment);
  601. $core.addMethod(
  602. $core.method({
  603. selector: "compileClassDefinition:",
  604. protocol: 'compiling',
  605. fn: function (aString){
  606. var self=this;
  607. function $DoIt(){return $globals.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
  608. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  609. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  610. return $core.withContext(function($ctx1) {
  611. //>>excludeEnd("ctx");
  612. $recv((function(){
  613. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  614. return $core.withContext(function($ctx2) {
  615. //>>excludeEnd("ctx");
  616. return self._evaluate_for_(aString,$recv($DoIt())._new());
  617. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  618. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  619. //>>excludeEnd("ctx");
  620. }))._on_do_($Error(),(function(error){
  621. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  622. return $core.withContext(function($ctx2) {
  623. //>>excludeEnd("ctx");
  624. return self._alert_($recv(error)._messageText());
  625. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  626. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1,2)});
  627. //>>excludeEnd("ctx");
  628. }));
  629. return self;
  630. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  631. }, function($ctx1) {$ctx1.fill(self,"compileClassDefinition:",{aString:aString},$globals.Environment)});
  632. //>>excludeEnd("ctx");
  633. },
  634. //>>excludeStart("ide", pragmas.excludeIdeData);
  635. args: ["aString"],
  636. source: "compileClassDefinition: aString\x0a\x09[ self evaluate: aString for: DoIt new ]\x0a\x09\x09on: Error\x0a\x09\x09do: [ :error | self alert: error messageText ]",
  637. referencedClasses: ["DoIt", "Error"],
  638. //>>excludeEnd("ide");
  639. messageSends: ["on:do:", "evaluate:for:", "new", "alert:", "messageText"]
  640. }),
  641. $globals.Environment);
  642. $core.addMethod(
  643. $core.method({
  644. selector: "compileMethod:for:protocol:",
  645. protocol: 'compiling',
  646. fn: function (sourceCode,class_,protocol){
  647. var self=this;
  648. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  649. return $core.withContext(function($ctx1) {
  650. //>>excludeEnd("ctx");
  651. var $1;
  652. $1=$recv(class_)._compile_protocol_(sourceCode,protocol);
  653. return $1;
  654. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  655. }, function($ctx1) {$ctx1.fill(self,"compileMethod:for:protocol:",{sourceCode:sourceCode,class_:class_,protocol:protocol},$globals.Environment)});
  656. //>>excludeEnd("ctx");
  657. },
  658. //>>excludeStart("ide", pragmas.excludeIdeData);
  659. args: ["sourceCode", "class", "protocol"],
  660. source: "compileMethod: sourceCode for: class protocol: protocol\x0a\x09^ class\x0a\x09\x09compile: sourceCode\x0a\x09\x09protocol: protocol",
  661. referencedClasses: [],
  662. //>>excludeEnd("ide");
  663. messageSends: ["compile:protocol:"]
  664. }),
  665. $globals.Environment);
  666. $core.addMethod(
  667. $core.method({
  668. selector: "copyClass:to:",
  669. protocol: 'actions',
  670. fn: function (aClass,aClassName){
  671. var self=this;
  672. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  673. function $ClassBuilder(){return $globals.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  674. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  675. return $core.withContext(function($ctx1) {
  676. //>>excludeEnd("ctx");
  677. var $1,$2,$receiver;
  678. $1=$recv($recv($Smalltalk())._globals())._at_(aClassName);
  679. if(($receiver = $1) == null || $receiver.isNil){
  680. $1;
  681. } else {
  682. $2=$recv("A class named ".__comma(aClassName)).__comma(" already exists");
  683. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  684. $ctx1.sendIdx[","]=1;
  685. //>>excludeEnd("ctx");
  686. self._error_($2);
  687. };
  688. $recv($recv($ClassBuilder())._new())._copyClass_named_(aClass,aClassName);
  689. return self;
  690. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  691. }, function($ctx1) {$ctx1.fill(self,"copyClass:to:",{aClass:aClass,aClassName:aClassName},$globals.Environment)});
  692. //>>excludeEnd("ctx");
  693. },
  694. //>>excludeStart("ide", pragmas.excludeIdeData);
  695. args: ["aClass", "aClassName"],
  696. source: "copyClass: aClass to: aClassName\x0a\x09(Smalltalk globals at: aClassName)\x0a\x09\x09ifNotNil: [ self error: 'A class named ', aClassName, ' already exists' ].\x0a\x09\x09\x0a\x09ClassBuilder new copyClass: aClass named: aClassName",
  697. referencedClasses: ["Smalltalk", "ClassBuilder"],
  698. //>>excludeEnd("ide");
  699. messageSends: ["ifNotNil:", "at:", "globals", "error:", ",", "copyClass:named:", "new"]
  700. }),
  701. $globals.Environment);
  702. $core.addMethod(
  703. $core.method({
  704. selector: "doItReceiver",
  705. protocol: 'accessing',
  706. fn: function (){
  707. var self=this;
  708. function $DoIt(){return $globals.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
  709. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  710. return $core.withContext(function($ctx1) {
  711. //>>excludeEnd("ctx");
  712. var $1;
  713. $1=$recv($DoIt())._new();
  714. return $1;
  715. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  716. }, function($ctx1) {$ctx1.fill(self,"doItReceiver",{},$globals.Environment)});
  717. //>>excludeEnd("ctx");
  718. },
  719. //>>excludeStart("ide", pragmas.excludeIdeData);
  720. args: [],
  721. source: "doItReceiver\x0a\x09^ DoIt new",
  722. referencedClasses: ["DoIt"],
  723. //>>excludeEnd("ide");
  724. messageSends: ["new"]
  725. }),
  726. $globals.Environment);
  727. $core.addMethod(
  728. $core.method({
  729. selector: "evaluate:for:",
  730. protocol: 'evaluating',
  731. fn: function (aString,anObject){
  732. var self=this;
  733. function $Evaluator(){return $globals.Evaluator||(typeof Evaluator=="undefined"?nil:Evaluator)}
  734. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  735. return $core.withContext(function($ctx1) {
  736. //>>excludeEnd("ctx");
  737. var $1;
  738. $1=$recv($Evaluator())._evaluate_for_(aString,anObject);
  739. return $1;
  740. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  741. }, function($ctx1) {$ctx1.fill(self,"evaluate:for:",{aString:aString,anObject:anObject},$globals.Environment)});
  742. //>>excludeEnd("ctx");
  743. },
  744. //>>excludeStart("ide", pragmas.excludeIdeData);
  745. args: ["aString", "anObject"],
  746. source: "evaluate: aString for: anObject\x0a\x09^ Evaluator evaluate: aString for: anObject",
  747. referencedClasses: ["Evaluator"],
  748. //>>excludeEnd("ide");
  749. messageSends: ["evaluate:for:"]
  750. }),
  751. $globals.Environment);
  752. $core.addMethod(
  753. $core.method({
  754. selector: "evaluate:on:do:",
  755. protocol: 'error handling',
  756. fn: function (aBlock,anErrorClass,exceptionBlock){
  757. var self=this;
  758. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  759. return $core.withContext(function($ctx1) {
  760. //>>excludeEnd("ctx");
  761. var $1;
  762. $recv(aBlock)._tryCatch_((function(exception){
  763. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  764. return $core.withContext(function($ctx2) {
  765. //>>excludeEnd("ctx");
  766. $1=$recv(exception)._isKindOf_(self._classNamed_($recv(anErrorClass)._name()));
  767. if($core.assert($1)){
  768. return $recv(exceptionBlock)._value_(exception);
  769. } else {
  770. return $recv(exception)._resignal();
  771. };
  772. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  773. }, function($ctx2) {$ctx2.fillBlock({exception:exception},$ctx1,1)});
  774. //>>excludeEnd("ctx");
  775. }));
  776. return self;
  777. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  778. }, function($ctx1) {$ctx1.fill(self,"evaluate:on:do:",{aBlock:aBlock,anErrorClass:anErrorClass,exceptionBlock:exceptionBlock},$globals.Environment)});
  779. //>>excludeEnd("ctx");
  780. },
  781. //>>excludeStart("ide", pragmas.excludeIdeData);
  782. args: ["aBlock", "anErrorClass", "exceptionBlock"],
  783. source: "evaluate: aBlock on: anErrorClass do: exceptionBlock\x0a\x09\x22Evaluate a block and catch exceptions happening on the environment stack\x22\x0a\x09\x0a\x09aBlock tryCatch: [ :exception | \x0a\x09\x09(exception isKindOf: (self classNamed: anErrorClass name))\x0a\x09\x09\x09ifTrue: [ exceptionBlock value: exception ]\x0a \x09\x09\x09ifFalse: [ exception resignal ] ]",
  784. referencedClasses: [],
  785. //>>excludeEnd("ide");
  786. messageSends: ["tryCatch:", "ifTrue:ifFalse:", "isKindOf:", "classNamed:", "name", "value:", "resignal"]
  787. }),
  788. $globals.Environment);
  789. $core.addMethod(
  790. $core.method({
  791. selector: "inspect:",
  792. protocol: 'actions',
  793. fn: function (anObject){
  794. var self=this;
  795. function $Inspector(){return $globals.Inspector||(typeof Inspector=="undefined"?nil:Inspector)}
  796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  797. return $core.withContext(function($ctx1) {
  798. //>>excludeEnd("ctx");
  799. $recv($Inspector())._inspect_(anObject);
  800. return self;
  801. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  802. }, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},$globals.Environment)});
  803. //>>excludeEnd("ctx");
  804. },
  805. //>>excludeStart("ide", pragmas.excludeIdeData);
  806. args: ["anObject"],
  807. source: "inspect: anObject\x0a\x09Inspector inspect: anObject",
  808. referencedClasses: ["Inspector"],
  809. //>>excludeEnd("ide");
  810. messageSends: ["inspect:"]
  811. }),
  812. $globals.Environment);
  813. $core.addMethod(
  814. $core.method({
  815. selector: "moveClass:toPackage:",
  816. protocol: 'actions',
  817. fn: function (aClass,aPackageName){
  818. var self=this;
  819. var package_;
  820. function $Package(){return $globals.Package||(typeof Package=="undefined"?nil:Package)}
  821. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  822. return $core.withContext(function($ctx1) {
  823. //>>excludeEnd("ctx");
  824. var $1,$2,$receiver;
  825. package_=$recv($Package())._named_(aPackageName);
  826. $1=package_;
  827. if(($receiver = $1) == null || $receiver.isNil){
  828. self._error_("Invalid package name");
  829. } else {
  830. $1;
  831. };
  832. $2=$recv(package_).__eq_eq($recv(aClass)._package());
  833. if($core.assert($2)){
  834. return self;
  835. };
  836. $recv(aClass)._package_(package_);
  837. return self;
  838. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  839. }, function($ctx1) {$ctx1.fill(self,"moveClass:toPackage:",{aClass:aClass,aPackageName:aPackageName,package_:package_},$globals.Environment)});
  840. //>>excludeEnd("ctx");
  841. },
  842. //>>excludeStart("ide", pragmas.excludeIdeData);
  843. args: ["aClass", "aPackageName"],
  844. source: "moveClass: aClass toPackage: aPackageName\x0a\x09| package |\x0a\x09\x0a\x09package := Package named: aPackageName.\x0a\x09package ifNil: [ self error: 'Invalid package name' ].\x0a\x09package == aClass package ifTrue: [ ^ self ].\x0a\x09\x0a\x09aClass package: package",
  845. referencedClasses: ["Package"],
  846. //>>excludeEnd("ide");
  847. messageSends: ["named:", "ifNil:", "error:", "ifTrue:", "==", "package", "package:"]
  848. }),
  849. $globals.Environment);
  850. $core.addMethod(
  851. $core.method({
  852. selector: "moveMethod:toClass:",
  853. protocol: 'actions',
  854. fn: function (aMethod,aClassName){
  855. var self=this;
  856. var destinationClass;
  857. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  858. return $core.withContext(function($ctx1) {
  859. //>>excludeEnd("ctx");
  860. var $2,$3,$1,$5,$4;
  861. destinationClass=self._classNamed_(aClassName);
  862. $2=destinationClass;
  863. $3=$recv(aMethod)._methodClass();
  864. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  865. $ctx1.sendIdx["methodClass"]=1;
  866. //>>excludeEnd("ctx");
  867. $1=$recv($2).__eq_eq($3);
  868. if($core.assert($1)){
  869. return self;
  870. };
  871. $5=$recv(aMethod)._methodClass();
  872. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  873. $ctx1.sendIdx["methodClass"]=2;
  874. //>>excludeEnd("ctx");
  875. $4=$recv($5)._isMetaclass();
  876. if($core.assert($4)){
  877. destinationClass=$recv(destinationClass)._class();
  878. destinationClass;
  879. };
  880. $recv(destinationClass)._compile_protocol_($recv(aMethod)._source(),$recv(aMethod)._protocol());
  881. $recv($recv(aMethod)._methodClass())._removeCompiledMethod_(aMethod);
  882. return self;
  883. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  884. }, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:",{aMethod:aMethod,aClassName:aClassName,destinationClass:destinationClass},$globals.Environment)});
  885. //>>excludeEnd("ctx");
  886. },
  887. //>>excludeStart("ide", pragmas.excludeIdeData);
  888. args: ["aMethod", "aClassName"],
  889. source: "moveMethod: aMethod toClass: aClassName\x0a\x09| destinationClass |\x0a\x09\x0a\x09destinationClass := self classNamed: aClassName.\x0a\x09destinationClass == aMethod methodClass ifTrue: [ ^ self ].\x0a\x09\x0a\x09aMethod methodClass isMetaclass ifTrue: [ \x0a\x09\x09destinationClass := destinationClass class ].\x0a\x09\x0a\x09destinationClass \x0a\x09\x09compile: aMethod source\x0a\x09\x09protocol: aMethod protocol.\x0a\x09aMethod methodClass \x0a\x09\x09removeCompiledMethod: aMethod",
  890. referencedClasses: [],
  891. //>>excludeEnd("ide");
  892. messageSends: ["classNamed:", "ifTrue:", "==", "methodClass", "isMetaclass", "class", "compile:protocol:", "source", "protocol", "removeCompiledMethod:"]
  893. }),
  894. $globals.Environment);
  895. $core.addMethod(
  896. $core.method({
  897. selector: "moveMethod:toProtocol:",
  898. protocol: 'actions',
  899. fn: function (aMethod,aProtocol){
  900. var self=this;
  901. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  902. return $core.withContext(function($ctx1) {
  903. //>>excludeEnd("ctx");
  904. $recv(aMethod)._protocol_(aProtocol);
  905. return self;
  906. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  907. }, function($ctx1) {$ctx1.fill(self,"moveMethod:toProtocol:",{aMethod:aMethod,aProtocol:aProtocol},$globals.Environment)});
  908. //>>excludeEnd("ctx");
  909. },
  910. //>>excludeStart("ide", pragmas.excludeIdeData);
  911. args: ["aMethod", "aProtocol"],
  912. source: "moveMethod: aMethod toProtocol: aProtocol\x0a\x09aMethod protocol: aProtocol",
  913. referencedClasses: [],
  914. //>>excludeEnd("ide");
  915. messageSends: ["protocol:"]
  916. }),
  917. $globals.Environment);
  918. $core.addMethod(
  919. $core.method({
  920. selector: "packages",
  921. protocol: 'accessing',
  922. fn: function (){
  923. var self=this;
  924. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  925. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  926. return $core.withContext(function($ctx1) {
  927. //>>excludeEnd("ctx");
  928. var $1;
  929. $1=$recv($Smalltalk())._packages();
  930. return $1;
  931. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  932. }, function($ctx1) {$ctx1.fill(self,"packages",{},$globals.Environment)});
  933. //>>excludeEnd("ctx");
  934. },
  935. //>>excludeStart("ide", pragmas.excludeIdeData);
  936. args: [],
  937. source: "packages\x0a\x09^ Smalltalk packages",
  938. referencedClasses: ["Smalltalk"],
  939. //>>excludeEnd("ide");
  940. messageSends: ["packages"]
  941. }),
  942. $globals.Environment);
  943. $core.addMethod(
  944. $core.method({
  945. selector: "registerErrorHandler:",
  946. protocol: 'services',
  947. fn: function (anErrorHandler){
  948. var self=this;
  949. function $ErrorHandler(){return $globals.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  950. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  951. return $core.withContext(function($ctx1) {
  952. //>>excludeEnd("ctx");
  953. $recv($ErrorHandler())._register_(anErrorHandler);
  954. return self;
  955. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  956. }, function($ctx1) {$ctx1.fill(self,"registerErrorHandler:",{anErrorHandler:anErrorHandler},$globals.Environment)});
  957. //>>excludeEnd("ctx");
  958. },
  959. //>>excludeStart("ide", pragmas.excludeIdeData);
  960. args: ["anErrorHandler"],
  961. source: "registerErrorHandler: anErrorHandler\x0a\x09ErrorHandler register: anErrorHandler",
  962. referencedClasses: ["ErrorHandler"],
  963. //>>excludeEnd("ide");
  964. messageSends: ["register:"]
  965. }),
  966. $globals.Environment);
  967. $core.addMethod(
  968. $core.method({
  969. selector: "registerFinder:",
  970. protocol: 'services',
  971. fn: function (aFinder){
  972. var self=this;
  973. function $Finder(){return $globals.Finder||(typeof Finder=="undefined"?nil:Finder)}
  974. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  975. return $core.withContext(function($ctx1) {
  976. //>>excludeEnd("ctx");
  977. $recv($Finder())._register_(aFinder);
  978. return self;
  979. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  980. }, function($ctx1) {$ctx1.fill(self,"registerFinder:",{aFinder:aFinder},$globals.Environment)});
  981. //>>excludeEnd("ctx");
  982. },
  983. //>>excludeStart("ide", pragmas.excludeIdeData);
  984. args: ["aFinder"],
  985. source: "registerFinder: aFinder\x0a\x09Finder register: aFinder",
  986. referencedClasses: ["Finder"],
  987. //>>excludeEnd("ide");
  988. messageSends: ["register:"]
  989. }),
  990. $globals.Environment);
  991. $core.addMethod(
  992. $core.method({
  993. selector: "registerInspector:",
  994. protocol: 'services',
  995. fn: function (anInspector){
  996. var self=this;
  997. function $Inspector(){return $globals.Inspector||(typeof Inspector=="undefined"?nil:Inspector)}
  998. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  999. return $core.withContext(function($ctx1) {
  1000. //>>excludeEnd("ctx");
  1001. $recv($Inspector())._register_(anInspector);
  1002. return self;
  1003. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1004. }, function($ctx1) {$ctx1.fill(self,"registerInspector:",{anInspector:anInspector},$globals.Environment)});
  1005. //>>excludeEnd("ctx");
  1006. },
  1007. //>>excludeStart("ide", pragmas.excludeIdeData);
  1008. args: ["anInspector"],
  1009. source: "registerInspector: anInspector\x0a\x09Inspector register: anInspector",
  1010. referencedClasses: ["Inspector"],
  1011. //>>excludeEnd("ide");
  1012. messageSends: ["register:"]
  1013. }),
  1014. $globals.Environment);
  1015. $core.addMethod(
  1016. $core.method({
  1017. selector: "registerProgressHandler:",
  1018. protocol: 'services',
  1019. fn: function (aProgressHandler){
  1020. var self=this;
  1021. function $ProgressHandler(){return $globals.ProgressHandler||(typeof ProgressHandler=="undefined"?nil:ProgressHandler)}
  1022. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1023. return $core.withContext(function($ctx1) {
  1024. //>>excludeEnd("ctx");
  1025. $recv($ProgressHandler())._register_(aProgressHandler);
  1026. return self;
  1027. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1028. }, function($ctx1) {$ctx1.fill(self,"registerProgressHandler:",{aProgressHandler:aProgressHandler},$globals.Environment)});
  1029. //>>excludeEnd("ctx");
  1030. },
  1031. //>>excludeStart("ide", pragmas.excludeIdeData);
  1032. args: ["aProgressHandler"],
  1033. source: "registerProgressHandler: aProgressHandler\x0a\x09ProgressHandler register: aProgressHandler",
  1034. referencedClasses: ["ProgressHandler"],
  1035. //>>excludeEnd("ide");
  1036. messageSends: ["register:"]
  1037. }),
  1038. $globals.Environment);
  1039. $core.addMethod(
  1040. $core.method({
  1041. selector: "registerTranscript:",
  1042. protocol: 'services',
  1043. fn: function (aTranscript){
  1044. var self=this;
  1045. function $Transcript(){return $globals.Transcript||(typeof Transcript=="undefined"?nil:Transcript)}
  1046. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1047. return $core.withContext(function($ctx1) {
  1048. //>>excludeEnd("ctx");
  1049. $recv($Transcript())._register_(aTranscript);
  1050. return self;
  1051. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1052. }, function($ctx1) {$ctx1.fill(self,"registerTranscript:",{aTranscript:aTranscript},$globals.Environment)});
  1053. //>>excludeEnd("ctx");
  1054. },
  1055. //>>excludeStart("ide", pragmas.excludeIdeData);
  1056. args: ["aTranscript"],
  1057. source: "registerTranscript: aTranscript\x0a\x09Transcript register: aTranscript",
  1058. referencedClasses: ["Transcript"],
  1059. //>>excludeEnd("ide");
  1060. messageSends: ["register:"]
  1061. }),
  1062. $globals.Environment);
  1063. $core.addMethod(
  1064. $core.method({
  1065. selector: "removeClass:",
  1066. protocol: 'actions',
  1067. fn: function (aClass){
  1068. var self=this;
  1069. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1070. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1071. return $core.withContext(function($ctx1) {
  1072. //>>excludeEnd("ctx");
  1073. $recv($Smalltalk())._removeClass_(aClass);
  1074. return self;
  1075. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1076. }, function($ctx1) {$ctx1.fill(self,"removeClass:",{aClass:aClass},$globals.Environment)});
  1077. //>>excludeEnd("ctx");
  1078. },
  1079. //>>excludeStart("ide", pragmas.excludeIdeData);
  1080. args: ["aClass"],
  1081. source: "removeClass: aClass\x0a\x09Smalltalk removeClass: aClass",
  1082. referencedClasses: ["Smalltalk"],
  1083. //>>excludeEnd("ide");
  1084. messageSends: ["removeClass:"]
  1085. }),
  1086. $globals.Environment);
  1087. $core.addMethod(
  1088. $core.method({
  1089. selector: "removeMethod:",
  1090. protocol: 'actions',
  1091. fn: function (aMethod){
  1092. var self=this;
  1093. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1094. return $core.withContext(function($ctx1) {
  1095. //>>excludeEnd("ctx");
  1096. $recv($recv(aMethod)._methodClass())._removeCompiledMethod_(aMethod);
  1097. return self;
  1098. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1099. }, function($ctx1) {$ctx1.fill(self,"removeMethod:",{aMethod:aMethod},$globals.Environment)});
  1100. //>>excludeEnd("ctx");
  1101. },
  1102. //>>excludeStart("ide", pragmas.excludeIdeData);
  1103. args: ["aMethod"],
  1104. source: "removeMethod: aMethod\x0a\x09aMethod methodClass removeCompiledMethod: aMethod",
  1105. referencedClasses: [],
  1106. //>>excludeEnd("ide");
  1107. messageSends: ["removeCompiledMethod:", "methodClass"]
  1108. }),
  1109. $globals.Environment);
  1110. $core.addMethod(
  1111. $core.method({
  1112. selector: "removeProtocol:from:",
  1113. protocol: 'actions',
  1114. fn: function (aString,aClass){
  1115. var self=this;
  1116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1117. return $core.withContext(function($ctx1) {
  1118. //>>excludeEnd("ctx");
  1119. $recv($recv(aClass)._methodsInProtocol_(aString))._do_((function(each){
  1120. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1121. return $core.withContext(function($ctx2) {
  1122. //>>excludeEnd("ctx");
  1123. return $recv(aClass)._removeCompiledMethod_(each);
  1124. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1125. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  1126. //>>excludeEnd("ctx");
  1127. }));
  1128. return self;
  1129. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1130. }, function($ctx1) {$ctx1.fill(self,"removeProtocol:from:",{aString:aString,aClass:aClass},$globals.Environment)});
  1131. //>>excludeEnd("ctx");
  1132. },
  1133. //>>excludeStart("ide", pragmas.excludeIdeData);
  1134. args: ["aString", "aClass"],
  1135. source: "removeProtocol: aString from: aClass\x0a\x09(aClass methodsInProtocol: aString)\x0a\x09\x09do: [ :each | aClass removeCompiledMethod: each ]",
  1136. referencedClasses: [],
  1137. //>>excludeEnd("ide");
  1138. messageSends: ["do:", "methodsInProtocol:", "removeCompiledMethod:"]
  1139. }),
  1140. $globals.Environment);
  1141. $core.addMethod(
  1142. $core.method({
  1143. selector: "renameClass:to:",
  1144. protocol: 'actions',
  1145. fn: function (aClass,aClassName){
  1146. var self=this;
  1147. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1148. function $ClassBuilder(){return $globals.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  1149. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1150. return $core.withContext(function($ctx1) {
  1151. //>>excludeEnd("ctx");
  1152. var $1,$2,$receiver;
  1153. $1=$recv($recv($Smalltalk())._globals())._at_(aClassName);
  1154. if(($receiver = $1) == null || $receiver.isNil){
  1155. $1;
  1156. } else {
  1157. $2=$recv("A class named ".__comma(aClassName)).__comma(" already exists");
  1158. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1159. $ctx1.sendIdx[","]=1;
  1160. //>>excludeEnd("ctx");
  1161. self._error_($2);
  1162. };
  1163. $recv($recv($ClassBuilder())._new())._renameClass_to_(aClass,aClassName);
  1164. return self;
  1165. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1166. }, function($ctx1) {$ctx1.fill(self,"renameClass:to:",{aClass:aClass,aClassName:aClassName},$globals.Environment)});
  1167. //>>excludeEnd("ctx");
  1168. },
  1169. //>>excludeStart("ide", pragmas.excludeIdeData);
  1170. args: ["aClass", "aClassName"],
  1171. source: "renameClass: aClass to: aClassName\x0a\x09(Smalltalk globals at: aClassName)\x0a\x09\x09ifNotNil: [ self error: 'A class named ', aClassName, ' already exists' ].\x0a\x09\x09\x0a\x09ClassBuilder new renameClass: aClass to: aClassName",
  1172. referencedClasses: ["Smalltalk", "ClassBuilder"],
  1173. //>>excludeEnd("ide");
  1174. messageSends: ["ifNotNil:", "at:", "globals", "error:", ",", "renameClass:to:", "new"]
  1175. }),
  1176. $globals.Environment);
  1177. $core.addMethod(
  1178. $core.method({
  1179. selector: "renameProtocol:to:in:",
  1180. protocol: 'actions',
  1181. fn: function (aString,anotherString,aClass){
  1182. var self=this;
  1183. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1184. return $core.withContext(function($ctx1) {
  1185. //>>excludeEnd("ctx");
  1186. $recv($recv(aClass)._methodsInProtocol_(aString))._do_((function(each){
  1187. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1188. return $core.withContext(function($ctx2) {
  1189. //>>excludeEnd("ctx");
  1190. return $recv(each)._protocol_(anotherString);
  1191. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1192. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  1193. //>>excludeEnd("ctx");
  1194. }));
  1195. return self;
  1196. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1197. }, function($ctx1) {$ctx1.fill(self,"renameProtocol:to:in:",{aString:aString,anotherString:anotherString,aClass:aClass},$globals.Environment)});
  1198. //>>excludeEnd("ctx");
  1199. },
  1200. //>>excludeStart("ide", pragmas.excludeIdeData);
  1201. args: ["aString", "anotherString", "aClass"],
  1202. source: "renameProtocol: aString to: anotherString in: aClass\x0a\x09(aClass methodsInProtocol: aString)\x0a\x09\x09do: [ :each | each protocol: anotherString ]",
  1203. referencedClasses: [],
  1204. //>>excludeEnd("ide");
  1205. messageSends: ["do:", "methodsInProtocol:", "protocol:"]
  1206. }),
  1207. $globals.Environment);
  1208. $core.addMethod(
  1209. $core.method({
  1210. selector: "setClassCommentOf:to:",
  1211. protocol: 'actions',
  1212. fn: function (aClass,aString){
  1213. var self=this;
  1214. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1215. return $core.withContext(function($ctx1) {
  1216. //>>excludeEnd("ctx");
  1217. $recv(aClass)._comment_(aString);
  1218. return self;
  1219. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1220. }, function($ctx1) {$ctx1.fill(self,"setClassCommentOf:to:",{aClass:aClass,aString:aString},$globals.Environment)});
  1221. //>>excludeEnd("ctx");
  1222. },
  1223. //>>excludeStart("ide", pragmas.excludeIdeData);
  1224. args: ["aClass", "aString"],
  1225. source: "setClassCommentOf: aClass to: aString\x0a\x09aClass comment: aString",
  1226. referencedClasses: [],
  1227. //>>excludeEnd("ide");
  1228. messageSends: ["comment:"]
  1229. }),
  1230. $globals.Environment);
  1231. $core.addMethod(
  1232. $core.method({
  1233. selector: "systemAnnouncer",
  1234. protocol: 'accessing',
  1235. fn: function (){
  1236. var self=this;
  1237. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1238. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1239. return $core.withContext(function($ctx1) {
  1240. //>>excludeEnd("ctx");
  1241. var $1;
  1242. $1=$recv($recv($recv($Smalltalk())._globals())._at_("SystemAnnouncer"))._current();
  1243. return $1;
  1244. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1245. }, function($ctx1) {$ctx1.fill(self,"systemAnnouncer",{},$globals.Environment)});
  1246. //>>excludeEnd("ctx");
  1247. },
  1248. //>>excludeStart("ide", pragmas.excludeIdeData);
  1249. args: [],
  1250. source: "systemAnnouncer\x0a\x09^ (Smalltalk globals at: #SystemAnnouncer) current",
  1251. referencedClasses: ["Smalltalk"],
  1252. //>>excludeEnd("ide");
  1253. messageSends: ["current", "at:", "globals"]
  1254. }),
  1255. $globals.Environment);
  1256. $core.addClass('JSObjectProxy', $globals.ProtoObject, ['jsObject'], 'Kernel-Infrastructure');
  1257. //>>excludeStart("ide", pragmas.excludeIdeData);
  1258. $globals.JSObjectProxy.comment="I handle sending messages to JavaScript objects, making JavaScript object accessing from Amber fully transparent.\x0aMy instances make intensive use of `#doesNotUnderstand:`.\x0a\x0aMy instances are automatically created by Amber whenever a message is sent to a JavaScript object.\x0a\x0a## Usage examples\x0a\x0aJSObjectProxy objects are instanciated by Amber when a Smalltalk message is sent to a JavaScript object.\x0a\x0a\x09window alert: 'hello world'.\x0a\x09window inspect.\x0a\x09(window jQuery: 'body') append: 'hello world'\x0a\x0aAmber messages sends are converted to JavaScript function calls or object property access _(in this order)_. If n one of them match, a `MessageNotUnderstood` error will be thrown.\x0a\x0a## Message conversion rules\x0a\x0a- `someUser name` becomes `someUser.name`\x0a- `someUser name: 'John'` becomes `someUser name = \x22John\x22`\x0a- `console log: 'hello world'` becomes `console.log('hello world')`\x0a- `(window jQuery: 'foo') css: 'background' color: 'red'` becomes `window.jQuery('foo').css('background', 'red')`\x0a\x0a__Note:__ For keyword-based messages, only the first keyword is kept: `window foo: 1 bar: 2` is equivalent to `window foo: 1 baz: 2`.";
  1259. //>>excludeEnd("ide");
  1260. $core.addMethod(
  1261. $core.method({
  1262. selector: "=",
  1263. protocol: 'comparing',
  1264. fn: function (anObject){
  1265. var self=this;
  1266. function $JSObjectProxy(){return $globals.JSObjectProxy||(typeof JSObjectProxy=="undefined"?nil:JSObjectProxy)}
  1267. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1268. return $core.withContext(function($ctx1) {
  1269. //>>excludeEnd("ctx");
  1270. var $2,$1,$3;
  1271. $2=$recv(anObject)._class();
  1272. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1273. $ctx1.sendIdx["class"]=1;
  1274. //>>excludeEnd("ctx");
  1275. $1=$recv($2).__eq_eq(self._class());
  1276. if(!$core.assert($1)){
  1277. return false;
  1278. };
  1279. $3=$recv($JSObjectProxy())._compareJSObjectOfProxy_withProxy_(self,anObject);
  1280. return $3;
  1281. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1282. }, function($ctx1) {$ctx1.fill(self,"=",{anObject:anObject},$globals.JSObjectProxy)});
  1283. //>>excludeEnd("ctx");
  1284. },
  1285. //>>excludeStart("ide", pragmas.excludeIdeData);
  1286. args: ["anObject"],
  1287. source: "= anObject\x0a\x09anObject class == self class ifFalse: [ ^ false ].\x0a\x09^ JSObjectProxy compareJSObjectOfProxy: self withProxy: anObject",
  1288. referencedClasses: ["JSObjectProxy"],
  1289. //>>excludeEnd("ide");
  1290. messageSends: ["ifFalse:", "==", "class", "compareJSObjectOfProxy:withProxy:"]
  1291. }),
  1292. $globals.JSObjectProxy);
  1293. $core.addMethod(
  1294. $core.method({
  1295. selector: "asJSON",
  1296. protocol: 'enumerating',
  1297. fn: function (){
  1298. var self=this;
  1299. var $1;
  1300. $1=self["@jsObject"];
  1301. return $1;
  1302. },
  1303. //>>excludeStart("ide", pragmas.excludeIdeData);
  1304. args: [],
  1305. source: "asJSON\x0a\x09\x22Answers the receiver in a stringyfy-friendly fashion\x22\x0a\x0a\x09^ jsObject",
  1306. referencedClasses: [],
  1307. //>>excludeEnd("ide");
  1308. messageSends: []
  1309. }),
  1310. $globals.JSObjectProxy);
  1311. $core.addMethod(
  1312. $core.method({
  1313. selector: "at:",
  1314. protocol: 'accessing',
  1315. fn: function (aString){
  1316. var self=this;
  1317. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1318. return $core.withContext(function($ctx1) {
  1319. //>>excludeEnd("ctx");
  1320. return self['@jsObject'][aString];
  1321. return self;
  1322. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1323. }, function($ctx1) {$ctx1.fill(self,"at:",{aString:aString},$globals.JSObjectProxy)});
  1324. //>>excludeEnd("ctx");
  1325. },
  1326. //>>excludeStart("ide", pragmas.excludeIdeData);
  1327. args: ["aString"],
  1328. source: "at: aString\x0a\x09<return self['@jsObject'][aString]>",
  1329. referencedClasses: [],
  1330. //>>excludeEnd("ide");
  1331. messageSends: []
  1332. }),
  1333. $globals.JSObjectProxy);
  1334. $core.addMethod(
  1335. $core.method({
  1336. selector: "at:ifAbsent:",
  1337. protocol: 'accessing',
  1338. fn: function (aString,aBlock){
  1339. var self=this;
  1340. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1341. return $core.withContext(function($ctx1) {
  1342. //>>excludeEnd("ctx");
  1343. var obj = self['@jsObject'];
  1344. return aString in obj ? obj[aString] : aBlock._value();
  1345. ;
  1346. return self;
  1347. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1348. }, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{aString:aString,aBlock:aBlock},$globals.JSObjectProxy)});
  1349. //>>excludeEnd("ctx");
  1350. },
  1351. //>>excludeStart("ide", pragmas.excludeIdeData);
  1352. args: ["aString", "aBlock"],
  1353. source: "at: aString ifAbsent: aBlock\x0a\x09\x22return the aString property or evaluate aBlock if the property is not defined on the object\x22\x0a\x09<\x0a\x09\x09var obj = self['@jsObject'];\x0a\x09\x09return aString in obj ? obj[aString] : aBlock._value();\x0a\x09>",
  1354. referencedClasses: [],
  1355. //>>excludeEnd("ide");
  1356. messageSends: []
  1357. }),
  1358. $globals.JSObjectProxy);
  1359. $core.addMethod(
  1360. $core.method({
  1361. selector: "at:ifPresent:",
  1362. protocol: 'accessing',
  1363. fn: function (aString,aBlock){
  1364. var self=this;
  1365. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1366. return $core.withContext(function($ctx1) {
  1367. //>>excludeEnd("ctx");
  1368. var obj = self['@jsObject'];
  1369. return aString in obj ? aBlock._value_(obj[aString]) : nil;
  1370. ;
  1371. return self;
  1372. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1373. }, function($ctx1) {$ctx1.fill(self,"at:ifPresent:",{aString:aString,aBlock:aBlock},$globals.JSObjectProxy)});
  1374. //>>excludeEnd("ctx");
  1375. },
  1376. //>>excludeStart("ide", pragmas.excludeIdeData);
  1377. args: ["aString", "aBlock"],
  1378. source: "at: aString ifPresent: aBlock\x0a\x09\x22return the evaluation of aBlock with the value if the property is defined or return nil\x22\x0a\x09<\x0a\x09\x09var obj = self['@jsObject'];\x0a\x09\x09return aString in obj ? aBlock._value_(obj[aString]) : nil;\x0a\x09>",
  1379. referencedClasses: [],
  1380. //>>excludeEnd("ide");
  1381. messageSends: []
  1382. }),
  1383. $globals.JSObjectProxy);
  1384. $core.addMethod(
  1385. $core.method({
  1386. selector: "at:ifPresent:ifAbsent:",
  1387. protocol: 'accessing',
  1388. fn: function (aString,aBlock,anotherBlock){
  1389. var self=this;
  1390. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1391. return $core.withContext(function($ctx1) {
  1392. //>>excludeEnd("ctx");
  1393. var obj = self['@jsObject'];
  1394. return aString in obj ? aBlock._value_(obj[aString]) : anotherBlock._value();
  1395. ;
  1396. return self;
  1397. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1398. }, function($ctx1) {$ctx1.fill(self,"at:ifPresent:ifAbsent:",{aString:aString,aBlock:aBlock,anotherBlock:anotherBlock},$globals.JSObjectProxy)});
  1399. //>>excludeEnd("ctx");
  1400. },
  1401. //>>excludeStart("ide", pragmas.excludeIdeData);
  1402. args: ["aString", "aBlock", "anotherBlock"],
  1403. source: "at: aString ifPresent: aBlock ifAbsent: anotherBlock\x0a\x09\x22return the evaluation of aBlock with the value if the property is defined\x0a\x09or return value of anotherBlock\x22\x0a\x09<\x0a\x09\x09var obj = self['@jsObject'];\x0a\x09\x09return aString in obj ? aBlock._value_(obj[aString]) : anotherBlock._value();\x0a\x09>",
  1404. referencedClasses: [],
  1405. //>>excludeEnd("ide");
  1406. messageSends: []
  1407. }),
  1408. $globals.JSObjectProxy);
  1409. $core.addMethod(
  1410. $core.method({
  1411. selector: "at:put:",
  1412. protocol: 'accessing',
  1413. fn: function (aString,anObject){
  1414. var self=this;
  1415. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1416. return $core.withContext(function($ctx1) {
  1417. //>>excludeEnd("ctx");
  1418. return self['@jsObject'][aString] = anObject;
  1419. return self;
  1420. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1421. }, function($ctx1) {$ctx1.fill(self,"at:put:",{aString:aString,anObject:anObject},$globals.JSObjectProxy)});
  1422. //>>excludeEnd("ctx");
  1423. },
  1424. //>>excludeStart("ide", pragmas.excludeIdeData);
  1425. args: ["aString", "anObject"],
  1426. source: "at: aString put: anObject\x0a\x09<return self['@jsObject'][aString] = anObject>",
  1427. referencedClasses: [],
  1428. //>>excludeEnd("ide");
  1429. messageSends: []
  1430. }),
  1431. $globals.JSObjectProxy);
  1432. $core.addMethod(
  1433. $core.method({
  1434. selector: "doesNotUnderstand:",
  1435. protocol: 'proxy',
  1436. fn: function (aMessage){
  1437. var self=this;
  1438. function $JSObjectProxy(){return $globals.JSObjectProxy||(typeof JSObjectProxy=="undefined"?nil:JSObjectProxy)}
  1439. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1440. return $core.withContext(function($ctx1) {
  1441. //>>excludeEnd("ctx");
  1442. var $2,$1,$receiver;
  1443. $2=$recv($JSObjectProxy())._lookupProperty_ofProxy_($recv($recv(aMessage)._selector())._asJavaScriptPropertyName(),self);
  1444. if(($receiver = $2) == null || $receiver.isNil){
  1445. $1=(
  1446. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1447. $ctx1.supercall = true,
  1448. //>>excludeEnd("ctx");
  1449. $globals.JSObjectProxy.superclass.fn.prototype._doesNotUnderstand_.apply($recv(self), [aMessage]));
  1450. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1451. $ctx1.supercall = false;
  1452. //>>excludeEnd("ctx");;
  1453. } else {
  1454. var jsSelector;
  1455. jsSelector=$receiver;
  1456. $1=$recv($JSObjectProxy())._forwardMessage_withArguments_ofProxy_(jsSelector,$recv(aMessage)._arguments(),self);
  1457. };
  1458. return $1;
  1459. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1460. }, function($ctx1) {$ctx1.fill(self,"doesNotUnderstand:",{aMessage:aMessage},$globals.JSObjectProxy)});
  1461. //>>excludeEnd("ctx");
  1462. },
  1463. //>>excludeStart("ide", pragmas.excludeIdeData);
  1464. args: ["aMessage"],
  1465. source: "doesNotUnderstand: aMessage\x0a\x09^ (JSObjectProxy lookupProperty: aMessage selector asJavaScriptPropertyName ofProxy: self)\x0a\x09\x09ifNil: [ super doesNotUnderstand: aMessage ]\x0a\x09\x09ifNotNil: [ :jsSelector | \x0a\x09\x09\x09JSObjectProxy \x0a\x09\x09\x09\x09forwardMessage: jsSelector \x0a\x09\x09\x09\x09withArguments: aMessage arguments\x0a\x09\x09\x09\x09ofProxy: self ]",
  1466. referencedClasses: ["JSObjectProxy"],
  1467. //>>excludeEnd("ide");
  1468. messageSends: ["ifNil:ifNotNil:", "lookupProperty:ofProxy:", "asJavaScriptPropertyName", "selector", "doesNotUnderstand:", "forwardMessage:withArguments:ofProxy:", "arguments"]
  1469. }),
  1470. $globals.JSObjectProxy);
  1471. $core.addMethod(
  1472. $core.method({
  1473. selector: "inspectOn:",
  1474. protocol: 'proxy',
  1475. fn: function (anInspector){
  1476. var self=this;
  1477. var variables;
  1478. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  1479. function $JSObjectProxy(){return $globals.JSObjectProxy||(typeof JSObjectProxy=="undefined"?nil:JSObjectProxy)}
  1480. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1481. return $core.withContext(function($ctx1) {
  1482. //>>excludeEnd("ctx");
  1483. variables=$recv($Dictionary())._new();
  1484. $recv(variables)._at_put_("#self",self._jsObject());
  1485. $recv(anInspector)._setLabel_(self._printString());
  1486. $recv($JSObjectProxy())._addObjectVariablesTo_ofProxy_(variables,self);
  1487. $recv(anInspector)._setVariables_(variables);
  1488. return self;
  1489. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1490. }, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables},$globals.JSObjectProxy)});
  1491. //>>excludeEnd("ctx");
  1492. },
  1493. //>>excludeStart("ide", pragmas.excludeIdeData);
  1494. args: ["anInspector"],
  1495. source: "inspectOn: anInspector\x0a\x09| variables |\x0a\x09variables := Dictionary new.\x0a\x09variables at: '#self' put: self jsObject.\x0a\x09anInspector setLabel: self printString.\x0a\x09JSObjectProxy addObjectVariablesTo: variables ofProxy: self.\x0a\x09anInspector setVariables: variables",
  1496. referencedClasses: ["Dictionary", "JSObjectProxy"],
  1497. //>>excludeEnd("ide");
  1498. messageSends: ["new", "at:put:", "jsObject", "setLabel:", "printString", "addObjectVariablesTo:ofProxy:", "setVariables:"]
  1499. }),
  1500. $globals.JSObjectProxy);
  1501. $core.addMethod(
  1502. $core.method({
  1503. selector: "jsObject",
  1504. protocol: 'accessing',
  1505. fn: function (){
  1506. var self=this;
  1507. var $1;
  1508. $1=self["@jsObject"];
  1509. return $1;
  1510. },
  1511. //>>excludeStart("ide", pragmas.excludeIdeData);
  1512. args: [],
  1513. source: "jsObject\x0a\x09^ jsObject",
  1514. referencedClasses: [],
  1515. //>>excludeEnd("ide");
  1516. messageSends: []
  1517. }),
  1518. $globals.JSObjectProxy);
  1519. $core.addMethod(
  1520. $core.method({
  1521. selector: "keysAndValuesDo:",
  1522. protocol: 'enumerating',
  1523. fn: function (aBlock){
  1524. var self=this;
  1525. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1526. return $core.withContext(function($ctx1) {
  1527. //>>excludeEnd("ctx");
  1528. var o = self['@jsObject'];
  1529. for(var i in o) {
  1530. aBlock._value_value_(i, o[i]);
  1531. }
  1532. ;
  1533. return self;
  1534. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1535. }, function($ctx1) {$ctx1.fill(self,"keysAndValuesDo:",{aBlock:aBlock},$globals.JSObjectProxy)});
  1536. //>>excludeEnd("ctx");
  1537. },
  1538. //>>excludeStart("ide", pragmas.excludeIdeData);
  1539. args: ["aBlock"],
  1540. source: "keysAndValuesDo: aBlock\x0a\x09<\x0a\x09\x09var o = self['@jsObject'];\x0a\x09\x09for(var i in o) {\x0a\x09\x09\x09aBlock._value_value_(i, o[i]);\x0a\x09\x09}\x0a\x09>",
  1541. referencedClasses: [],
  1542. //>>excludeEnd("ide");
  1543. messageSends: []
  1544. }),
  1545. $globals.JSObjectProxy);
  1546. $core.addMethod(
  1547. $core.method({
  1548. selector: "printOn:",
  1549. protocol: 'printing',
  1550. fn: function (aStream){
  1551. var self=this;
  1552. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1553. return $core.withContext(function($ctx1) {
  1554. //>>excludeEnd("ctx");
  1555. $recv(aStream)._nextPutAll_(self._printString());
  1556. return self;
  1557. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1558. }, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},$globals.JSObjectProxy)});
  1559. //>>excludeEnd("ctx");
  1560. },
  1561. //>>excludeStart("ide", pragmas.excludeIdeData);
  1562. args: ["aStream"],
  1563. source: "printOn: aStream\x0a\x09aStream nextPutAll: self printString",
  1564. referencedClasses: [],
  1565. //>>excludeEnd("ide");
  1566. messageSends: ["nextPutAll:", "printString"]
  1567. }),
  1568. $globals.JSObjectProxy);
  1569. $core.addMethod(
  1570. $core.method({
  1571. selector: "printString",
  1572. protocol: 'printing',
  1573. fn: function (){
  1574. var self=this;
  1575. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1576. return $core.withContext(function($ctx1) {
  1577. //>>excludeEnd("ctx");
  1578. var js = self['@jsObject'];
  1579. return js.toString
  1580. ? js.toString()
  1581. : Object.prototype.toString.call(js)
  1582. ;
  1583. return self;
  1584. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1585. }, function($ctx1) {$ctx1.fill(self,"printString",{},$globals.JSObjectProxy)});
  1586. //>>excludeEnd("ctx");
  1587. },
  1588. //>>excludeStart("ide", pragmas.excludeIdeData);
  1589. args: [],
  1590. source: "printString\x0a\x09<\x0a\x09\x09var js = self['@jsObject'];\x0a\x09\x09return js.toString\x0a\x09\x09\x09? js.toString()\x0a\x09\x09\x09: Object.prototype.toString.call(js)\x0a\x09>",
  1591. referencedClasses: [],
  1592. //>>excludeEnd("ide");
  1593. messageSends: []
  1594. }),
  1595. $globals.JSObjectProxy);
  1596. $core.addMethod(
  1597. $core.method({
  1598. selector: "addObjectVariablesTo:ofProxy:",
  1599. protocol: 'proxy',
  1600. fn: function (aDictionary,aProxy){
  1601. var self=this;
  1602. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1603. return $core.withContext(function($ctx1) {
  1604. //>>excludeEnd("ctx");
  1605. var jsObject = aProxy['@jsObject'];
  1606. for(var i in jsObject) {
  1607. aDictionary._at_put_(i, jsObject[i]);
  1608. }
  1609. ;
  1610. return self;
  1611. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1612. }, function($ctx1) {$ctx1.fill(self,"addObjectVariablesTo:ofProxy:",{aDictionary:aDictionary,aProxy:aProxy},$globals.JSObjectProxy.klass)});
  1613. //>>excludeEnd("ctx");
  1614. },
  1615. //>>excludeStart("ide", pragmas.excludeIdeData);
  1616. args: ["aDictionary", "aProxy"],
  1617. source: "addObjectVariablesTo: aDictionary ofProxy: aProxy\x0a\x09<\x0a\x09\x09var jsObject = aProxy['@jsObject'];\x0a\x09\x09for(var i in jsObject) {\x0a\x09\x09\x09aDictionary._at_put_(i, jsObject[i]);\x0a\x09\x09}\x0a\x09>",
  1618. referencedClasses: [],
  1619. //>>excludeEnd("ide");
  1620. messageSends: []
  1621. }),
  1622. $globals.JSObjectProxy.klass);
  1623. $core.addMethod(
  1624. $core.method({
  1625. selector: "compareJSObjectOfProxy:withProxy:",
  1626. protocol: 'proxy',
  1627. fn: function (aProxy,anotherProxy){
  1628. var self=this;
  1629. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1630. return $core.withContext(function($ctx1) {
  1631. //>>excludeEnd("ctx");
  1632. var anotherJSObject = anotherProxy.klass ? anotherProxy["@jsObject"] : anotherProxy;
  1633. return aProxy["@jsObject"] === anotherJSObject;
  1634. return self;
  1635. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1636. }, function($ctx1) {$ctx1.fill(self,"compareJSObjectOfProxy:withProxy:",{aProxy:aProxy,anotherProxy:anotherProxy},$globals.JSObjectProxy.klass)});
  1637. //>>excludeEnd("ctx");
  1638. },
  1639. //>>excludeStart("ide", pragmas.excludeIdeData);
  1640. args: ["aProxy", "anotherProxy"],
  1641. source: "compareJSObjectOfProxy: aProxy withProxy: anotherProxy\x0a<\x0a\x09var anotherJSObject = anotherProxy.klass ? anotherProxy[\x22@jsObject\x22] : anotherProxy;\x0a\x09return aProxy[\x22@jsObject\x22] === anotherJSObject\x0a>",
  1642. referencedClasses: [],
  1643. //>>excludeEnd("ide");
  1644. messageSends: []
  1645. }),
  1646. $globals.JSObjectProxy.klass);
  1647. $core.addMethod(
  1648. $core.method({
  1649. selector: "forwardMessage:withArguments:ofProxy:",
  1650. protocol: 'proxy',
  1651. fn: function (aString,anArray,aProxy){
  1652. var self=this;
  1653. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1654. return $core.withContext(function($ctx1) {
  1655. //>>excludeEnd("ctx");
  1656. return $core.accessJavaScript(aProxy._jsObject(), aString, anArray);
  1657. ;
  1658. return self;
  1659. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1660. }, function($ctx1) {$ctx1.fill(self,"forwardMessage:withArguments:ofProxy:",{aString:aString,anArray:anArray,aProxy:aProxy},$globals.JSObjectProxy.klass)});
  1661. //>>excludeEnd("ctx");
  1662. },
  1663. //>>excludeStart("ide", pragmas.excludeIdeData);
  1664. args: ["aString", "anArray", "aProxy"],
  1665. source: "forwardMessage: aString withArguments: anArray ofProxy: aProxy\x0a\x09<\x0a\x09\x09return $core.accessJavaScript(aProxy._jsObject(), aString, anArray);\x0a\x09>",
  1666. referencedClasses: [],
  1667. //>>excludeEnd("ide");
  1668. messageSends: []
  1669. }),
  1670. $globals.JSObjectProxy.klass);
  1671. $core.addMethod(
  1672. $core.method({
  1673. selector: "jsObject:ofProxy:",
  1674. protocol: 'proxy',
  1675. fn: function (aJSObject,aProxy){
  1676. var self=this;
  1677. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1678. return $core.withContext(function($ctx1) {
  1679. //>>excludeEnd("ctx");
  1680. aProxy['@jsObject'] = aJSObject;
  1681. return self;
  1682. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1683. }, function($ctx1) {$ctx1.fill(self,"jsObject:ofProxy:",{aJSObject:aJSObject,aProxy:aProxy},$globals.JSObjectProxy.klass)});
  1684. //>>excludeEnd("ctx");
  1685. },
  1686. //>>excludeStart("ide", pragmas.excludeIdeData);
  1687. args: ["aJSObject", "aProxy"],
  1688. source: "jsObject: aJSObject ofProxy: aProxy\x0a\x09<aProxy['@jsObject'] = aJSObject>",
  1689. referencedClasses: [],
  1690. //>>excludeEnd("ide");
  1691. messageSends: []
  1692. }),
  1693. $globals.JSObjectProxy.klass);
  1694. $core.addMethod(
  1695. $core.method({
  1696. selector: "lookupProperty:ofProxy:",
  1697. protocol: 'proxy',
  1698. fn: function (aString,aProxy){
  1699. var self=this;
  1700. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1701. return $core.withContext(function($ctx1) {
  1702. //>>excludeEnd("ctx");
  1703. return aString in aProxy._jsObject() ? aString : nil;
  1704. return self;
  1705. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1706. }, function($ctx1) {$ctx1.fill(self,"lookupProperty:ofProxy:",{aString:aString,aProxy:aProxy},$globals.JSObjectProxy.klass)});
  1707. //>>excludeEnd("ctx");
  1708. },
  1709. //>>excludeStart("ide", pragmas.excludeIdeData);
  1710. args: ["aString", "aProxy"],
  1711. source: "lookupProperty: aString ofProxy: aProxy\x0a\x09\x22Looks up a property in JS object.\x0a\x09Answer the property if it is present, or nil if it is not present.\x22\x0a\x09\x0a\x09<return aString in aProxy._jsObject() ? aString : nil>",
  1712. referencedClasses: [],
  1713. //>>excludeEnd("ide");
  1714. messageSends: []
  1715. }),
  1716. $globals.JSObjectProxy.klass);
  1717. $core.addMethod(
  1718. $core.method({
  1719. selector: "on:",
  1720. protocol: 'instance creation',
  1721. fn: function (aJSObject){
  1722. var self=this;
  1723. var instance;
  1724. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1725. return $core.withContext(function($ctx1) {
  1726. //>>excludeEnd("ctx");
  1727. var $1;
  1728. instance=self._new();
  1729. self._jsObject_ofProxy_(aJSObject,instance);
  1730. $1=instance;
  1731. return $1;
  1732. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1733. }, function($ctx1) {$ctx1.fill(self,"on:",{aJSObject:aJSObject,instance:instance},$globals.JSObjectProxy.klass)});
  1734. //>>excludeEnd("ctx");
  1735. },
  1736. //>>excludeStart("ide", pragmas.excludeIdeData);
  1737. args: ["aJSObject"],
  1738. source: "on: aJSObject\x0a\x09| instance |\x0a\x09instance := self new.\x0a\x09self jsObject: aJSObject ofProxy: instance.\x0a\x09^ instance",
  1739. referencedClasses: [],
  1740. //>>excludeEnd("ide");
  1741. messageSends: ["new", "jsObject:ofProxy:"]
  1742. }),
  1743. $globals.JSObjectProxy.klass);
  1744. $core.addClass('NullProgressHandler', $globals.Object, [], 'Kernel-Infrastructure');
  1745. //>>excludeStart("ide", pragmas.excludeIdeData);
  1746. $globals.NullProgressHandler.comment="I am the default progress handler. I do not display any progress, and simply iterate over the collection.";
  1747. //>>excludeEnd("ide");
  1748. $core.addMethod(
  1749. $core.method({
  1750. selector: "do:on:displaying:",
  1751. protocol: 'progress handling',
  1752. fn: function (aBlock,aCollection,aString){
  1753. var self=this;
  1754. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1755. return $core.withContext(function($ctx1) {
  1756. //>>excludeEnd("ctx");
  1757. $recv(aCollection)._do_(aBlock);
  1758. return self;
  1759. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1760. }, function($ctx1) {$ctx1.fill(self,"do:on:displaying:",{aBlock:aBlock,aCollection:aCollection,aString:aString},$globals.NullProgressHandler)});
  1761. //>>excludeEnd("ctx");
  1762. },
  1763. //>>excludeStart("ide", pragmas.excludeIdeData);
  1764. args: ["aBlock", "aCollection", "aString"],
  1765. source: "do: aBlock on: aCollection displaying: aString\x0a\x09aCollection do: aBlock",
  1766. referencedClasses: [],
  1767. //>>excludeEnd("ide");
  1768. messageSends: ["do:"]
  1769. }),
  1770. $globals.NullProgressHandler);
  1771. $globals.NullProgressHandler.klass.iVarNames = ['current'];
  1772. $core.addMethod(
  1773. $core.method({
  1774. selector: "initialize",
  1775. protocol: 'initialization',
  1776. fn: function (){
  1777. var self=this;
  1778. function $ProgressHandler(){return $globals.ProgressHandler||(typeof ProgressHandler=="undefined"?nil:ProgressHandler)}
  1779. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1780. return $core.withContext(function($ctx1) {
  1781. //>>excludeEnd("ctx");
  1782. $recv($ProgressHandler())._registerIfNone_(self._new());
  1783. return self;
  1784. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1785. }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.NullProgressHandler.klass)});
  1786. //>>excludeEnd("ctx");
  1787. },
  1788. //>>excludeStart("ide", pragmas.excludeIdeData);
  1789. args: [],
  1790. source: "initialize\x0a\x09ProgressHandler registerIfNone: self new",
  1791. referencedClasses: ["ProgressHandler"],
  1792. //>>excludeEnd("ide");
  1793. messageSends: ["registerIfNone:", "new"]
  1794. }),
  1795. $globals.NullProgressHandler.klass);
  1796. $core.addClass('Organizer', $globals.Object, [], 'Kernel-Infrastructure');
  1797. //>>excludeStart("ide", pragmas.excludeIdeData);
  1798. $globals.Organizer.comment="I represent categorization information. \x0a\x0a## API\x0a\x0aUse `#addElement:` and `#removeElement:` to manipulate instances.";
  1799. //>>excludeEnd("ide");
  1800. $core.addMethod(
  1801. $core.method({
  1802. selector: "addElement:",
  1803. protocol: 'accessing',
  1804. fn: function (anObject){
  1805. var self=this;
  1806. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1807. return $core.withContext(function($ctx1) {
  1808. //>>excludeEnd("ctx");
  1809. self.elements.addElement(anObject);
  1810. return self;
  1811. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1812. }, function($ctx1) {$ctx1.fill(self,"addElement:",{anObject:anObject},$globals.Organizer)});
  1813. //>>excludeEnd("ctx");
  1814. },
  1815. //>>excludeStart("ide", pragmas.excludeIdeData);
  1816. args: ["anObject"],
  1817. source: "addElement: anObject\x0a\x09<self.elements.addElement(anObject)>",
  1818. referencedClasses: [],
  1819. //>>excludeEnd("ide");
  1820. messageSends: []
  1821. }),
  1822. $globals.Organizer);
  1823. $core.addMethod(
  1824. $core.method({
  1825. selector: "elements",
  1826. protocol: 'accessing',
  1827. fn: function (){
  1828. var self=this;
  1829. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1830. return $core.withContext(function($ctx1) {
  1831. //>>excludeEnd("ctx");
  1832. var $1;
  1833. $1=$recv(self._basicAt_("elements"))._copy();
  1834. return $1;
  1835. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1836. }, function($ctx1) {$ctx1.fill(self,"elements",{},$globals.Organizer)});
  1837. //>>excludeEnd("ctx");
  1838. },
  1839. //>>excludeStart("ide", pragmas.excludeIdeData);
  1840. args: [],
  1841. source: "elements\x0a\x09^ (self basicAt: 'elements') copy",
  1842. referencedClasses: [],
  1843. //>>excludeEnd("ide");
  1844. messageSends: ["copy", "basicAt:"]
  1845. }),
  1846. $globals.Organizer);
  1847. $core.addMethod(
  1848. $core.method({
  1849. selector: "removeElement:",
  1850. protocol: 'accessing',
  1851. fn: function (anObject){
  1852. var self=this;
  1853. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1854. return $core.withContext(function($ctx1) {
  1855. //>>excludeEnd("ctx");
  1856. self.elements.removeElement(anObject);
  1857. return self;
  1858. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1859. }, function($ctx1) {$ctx1.fill(self,"removeElement:",{anObject:anObject},$globals.Organizer)});
  1860. //>>excludeEnd("ctx");
  1861. },
  1862. //>>excludeStart("ide", pragmas.excludeIdeData);
  1863. args: ["anObject"],
  1864. source: "removeElement: anObject\x0a\x09<self.elements.removeElement(anObject)>",
  1865. referencedClasses: [],
  1866. //>>excludeEnd("ide");
  1867. messageSends: []
  1868. }),
  1869. $globals.Organizer);
  1870. $core.addClass('ClassOrganizer', $globals.Organizer, [], 'Kernel-Infrastructure');
  1871. //>>excludeStart("ide", pragmas.excludeIdeData);
  1872. $globals.ClassOrganizer.comment="I am an organizer specific to classes. I hold method categorization information for classes.";
  1873. //>>excludeEnd("ide");
  1874. $core.addMethod(
  1875. $core.method({
  1876. selector: "addElement:",
  1877. protocol: 'accessing',
  1878. fn: function (aString){
  1879. var self=this;
  1880. function $SystemAnnouncer(){return $globals.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  1881. function $ProtocolAdded(){return $globals.ProtocolAdded||(typeof ProtocolAdded=="undefined"?nil:ProtocolAdded)}
  1882. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1883. return $core.withContext(function($ctx1) {
  1884. //>>excludeEnd("ctx");
  1885. var $1,$2;
  1886. (
  1887. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1888. $ctx1.supercall = true,
  1889. //>>excludeEnd("ctx");
  1890. $globals.ClassOrganizer.superclass.fn.prototype._addElement_.apply($recv(self), [aString]));
  1891. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1892. $ctx1.supercall = false;
  1893. //>>excludeEnd("ctx");;
  1894. $1=$recv($ProtocolAdded())._new();
  1895. $recv($1)._protocol_(aString);
  1896. $recv($1)._theClass_(self._theClass());
  1897. $2=$recv($1)._yourself();
  1898. $recv($recv($SystemAnnouncer())._current())._announce_($2);
  1899. return self;
  1900. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1901. }, function($ctx1) {$ctx1.fill(self,"addElement:",{aString:aString},$globals.ClassOrganizer)});
  1902. //>>excludeEnd("ctx");
  1903. },
  1904. //>>excludeStart("ide", pragmas.excludeIdeData);
  1905. args: ["aString"],
  1906. source: "addElement: aString\x0a\x09super addElement: aString.\x0a\x0a\x09SystemAnnouncer current announce: (ProtocolAdded new\x0a\x09\x09protocol: aString;\x0a\x09\x09theClass: self theClass;\x0a\x09\x09yourself)",
  1907. referencedClasses: ["SystemAnnouncer", "ProtocolAdded"],
  1908. //>>excludeEnd("ide");
  1909. messageSends: ["addElement:", "announce:", "current", "protocol:", "new", "theClass:", "theClass", "yourself"]
  1910. }),
  1911. $globals.ClassOrganizer);
  1912. $core.addMethod(
  1913. $core.method({
  1914. selector: "removeElement:",
  1915. protocol: 'accessing',
  1916. fn: function (aString){
  1917. var self=this;
  1918. function $SystemAnnouncer(){return $globals.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  1919. function $ProtocolRemoved(){return $globals.ProtocolRemoved||(typeof ProtocolRemoved=="undefined"?nil:ProtocolRemoved)}
  1920. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1921. return $core.withContext(function($ctx1) {
  1922. //>>excludeEnd("ctx");
  1923. var $1,$2;
  1924. (
  1925. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1926. $ctx1.supercall = true,
  1927. //>>excludeEnd("ctx");
  1928. $globals.ClassOrganizer.superclass.fn.prototype._removeElement_.apply($recv(self), [aString]));
  1929. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1930. $ctx1.supercall = false;
  1931. //>>excludeEnd("ctx");;
  1932. $1=$recv($ProtocolRemoved())._new();
  1933. $recv($1)._protocol_(aString);
  1934. $recv($1)._theClass_(self._theClass());
  1935. $2=$recv($1)._yourself();
  1936. $recv($recv($SystemAnnouncer())._current())._announce_($2);
  1937. return self;
  1938. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1939. }, function($ctx1) {$ctx1.fill(self,"removeElement:",{aString:aString},$globals.ClassOrganizer)});
  1940. //>>excludeEnd("ctx");
  1941. },
  1942. //>>excludeStart("ide", pragmas.excludeIdeData);
  1943. args: ["aString"],
  1944. source: "removeElement: aString\x0a\x09super removeElement: aString.\x0a\x0a\x09SystemAnnouncer current announce: (ProtocolRemoved new\x0a\x09\x09protocol: aString;\x0a\x09\x09theClass: self theClass;\x0a\x09\x09yourself)",
  1945. referencedClasses: ["SystemAnnouncer", "ProtocolRemoved"],
  1946. //>>excludeEnd("ide");
  1947. messageSends: ["removeElement:", "announce:", "current", "protocol:", "new", "theClass:", "theClass", "yourself"]
  1948. }),
  1949. $globals.ClassOrganizer);
  1950. $core.addMethod(
  1951. $core.method({
  1952. selector: "theClass",
  1953. protocol: 'accessing',
  1954. fn: function (){
  1955. var self=this;
  1956. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1957. return $core.withContext(function($ctx1) {
  1958. //>>excludeEnd("ctx");
  1959. return self.theClass ;
  1960. return self;
  1961. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1962. }, function($ctx1) {$ctx1.fill(self,"theClass",{},$globals.ClassOrganizer)});
  1963. //>>excludeEnd("ctx");
  1964. },
  1965. //>>excludeStart("ide", pragmas.excludeIdeData);
  1966. args: [],
  1967. source: "theClass\x0a\x09< return self.theClass >",
  1968. referencedClasses: [],
  1969. //>>excludeEnd("ide");
  1970. messageSends: []
  1971. }),
  1972. $globals.ClassOrganizer);
  1973. $core.addClass('PackageOrganizer', $globals.Organizer, [], 'Kernel-Infrastructure');
  1974. //>>excludeStart("ide", pragmas.excludeIdeData);
  1975. $globals.PackageOrganizer.comment="I am an organizer specific to packages. I hold classes categorization information.";
  1976. //>>excludeEnd("ide");
  1977. $core.addClass('Package', $globals.Object, ['transport', 'imports', 'dirty'], 'Kernel-Infrastructure');
  1978. //>>excludeStart("ide", pragmas.excludeIdeData);
  1979. $globals.Package.comment="I am similar to a \x22class category\x22 typically found in other Smalltalks like Pharo or Squeak. Amber does not have class categories anymore, it had in the beginning but now each class in the system knows which package it belongs to.\x0a\x0aEach package has a name and can be queried for its classes, but it will then resort to a reverse scan of all classes to find them.\x0a\x0a## API\x0a\x0aPackages are manipulated through \x22Smalltalk current\x22, like for example finding one based on a name or with `Package class >> #name` directly:\x0a\x0a Smalltalk current packageAt: 'Kernel'\x0a Package named: 'Kernel'\x0a\x0aA package differs slightly from a Monticello package which can span multiple class categories using a naming convention based on hyphenation. But just as in Monticello a package supports \x22class extensions\x22 so a package can define behaviors in foreign classes using a naming convention for method categories where the category starts with an asterisk and then the name of the owning package follows.\x0a\x0aYou can fetch a package from the server:\x0a\x0a\x09Package load: 'Additional-Examples'";
  1980. //>>excludeEnd("ide");
  1981. $core.addMethod(
  1982. $core.method({
  1983. selector: "basicImports",
  1984. protocol: 'private',
  1985. fn: function (){
  1986. var self=this;
  1987. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1988. return $core.withContext(function($ctx1) {
  1989. //>>excludeEnd("ctx");
  1990. return self.imports || [];
  1991. return self;
  1992. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1993. }, function($ctx1) {$ctx1.fill(self,"basicImports",{},$globals.Package)});
  1994. //>>excludeEnd("ctx");
  1995. },
  1996. //>>excludeStart("ide", pragmas.excludeIdeData);
  1997. args: [],
  1998. source: "basicImports\x0a\x09\x22Answer the imports literal JavaScript object as setup in the JavaScript file, if any\x22\x0a\x09\x0a\x09<return self.imports || []>",
  1999. referencedClasses: [],
  2000. //>>excludeEnd("ide");
  2001. messageSends: []
  2002. }),
  2003. $globals.Package);
  2004. $core.addMethod(
  2005. $core.method({
  2006. selector: "basicName:",
  2007. protocol: 'private',
  2008. fn: function (aString){
  2009. var self=this;
  2010. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2011. return $core.withContext(function($ctx1) {
  2012. //>>excludeEnd("ctx");
  2013. self.pkgName = aString;
  2014. return self;
  2015. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2016. }, function($ctx1) {$ctx1.fill(self,"basicName:",{aString:aString},$globals.Package)});
  2017. //>>excludeEnd("ctx");
  2018. },
  2019. //>>excludeStart("ide", pragmas.excludeIdeData);
  2020. args: ["aString"],
  2021. source: "basicName: aString\x0a\x09<self.pkgName = aString>",
  2022. referencedClasses: [],
  2023. //>>excludeEnd("ide");
  2024. messageSends: []
  2025. }),
  2026. $globals.Package);
  2027. $core.addMethod(
  2028. $core.method({
  2029. selector: "basicTransport",
  2030. protocol: 'private',
  2031. fn: function (){
  2032. var self=this;
  2033. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2034. return $core.withContext(function($ctx1) {
  2035. //>>excludeEnd("ctx");
  2036. return self.transport;
  2037. return self;
  2038. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2039. }, function($ctx1) {$ctx1.fill(self,"basicTransport",{},$globals.Package)});
  2040. //>>excludeEnd("ctx");
  2041. },
  2042. //>>excludeStart("ide", pragmas.excludeIdeData);
  2043. args: [],
  2044. source: "basicTransport\x0a\x09\x22Answer the transport literal JavaScript object as setup in the JavaScript file, if any\x22\x0a\x09\x0a\x09<return self.transport>",
  2045. referencedClasses: [],
  2046. //>>excludeEnd("ide");
  2047. messageSends: []
  2048. }),
  2049. $globals.Package);
  2050. $core.addMethod(
  2051. $core.method({
  2052. selector: "beClean",
  2053. protocol: 'accessing',
  2054. fn: function (){
  2055. var self=this;
  2056. function $SystemAnnouncer(){return $globals.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  2057. function $PackageClean(){return $globals.PackageClean||(typeof PackageClean=="undefined"?nil:PackageClean)}
  2058. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2059. return $core.withContext(function($ctx1) {
  2060. //>>excludeEnd("ctx");
  2061. var $1,$2;
  2062. self["@dirty"]=false;
  2063. $1=$recv($PackageClean())._new();
  2064. $recv($1)._package_(self);
  2065. $2=$recv($1)._yourself();
  2066. $recv($recv($SystemAnnouncer())._current())._announce_($2);
  2067. return self;
  2068. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2069. }, function($ctx1) {$ctx1.fill(self,"beClean",{},$globals.Package)});
  2070. //>>excludeEnd("ctx");
  2071. },
  2072. //>>excludeStart("ide", pragmas.excludeIdeData);
  2073. args: [],
  2074. source: "beClean\x0a\x09dirty := false.\x0a\x09\x0a\x09SystemAnnouncer current announce: (PackageClean new\x0a\x09\x09package: self;\x0a\x09\x09yourself)",
  2075. referencedClasses: ["SystemAnnouncer", "PackageClean"],
  2076. //>>excludeEnd("ide");
  2077. messageSends: ["announce:", "current", "package:", "new", "yourself"]
  2078. }),
  2079. $globals.Package);
  2080. $core.addMethod(
  2081. $core.method({
  2082. selector: "beDirty",
  2083. protocol: 'accessing',
  2084. fn: function (){
  2085. var self=this;
  2086. function $SystemAnnouncer(){return $globals.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  2087. function $PackageDirty(){return $globals.PackageDirty||(typeof PackageDirty=="undefined"?nil:PackageDirty)}
  2088. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2089. return $core.withContext(function($ctx1) {
  2090. //>>excludeEnd("ctx");
  2091. var $1,$2;
  2092. self["@dirty"]=true;
  2093. $1=$recv($PackageDirty())._new();
  2094. $recv($1)._package_(self);
  2095. $2=$recv($1)._yourself();
  2096. $recv($recv($SystemAnnouncer())._current())._announce_($2);
  2097. return self;
  2098. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2099. }, function($ctx1) {$ctx1.fill(self,"beDirty",{},$globals.Package)});
  2100. //>>excludeEnd("ctx");
  2101. },
  2102. //>>excludeStart("ide", pragmas.excludeIdeData);
  2103. args: [],
  2104. source: "beDirty\x0a\x09dirty := true.\x0a\x09\x0a\x09SystemAnnouncer current announce: (PackageDirty new\x0a\x09\x09package: self;\x0a\x09\x09yourself)",
  2105. referencedClasses: ["SystemAnnouncer", "PackageDirty"],
  2106. //>>excludeEnd("ide");
  2107. messageSends: ["announce:", "current", "package:", "new", "yourself"]
  2108. }),
  2109. $globals.Package);
  2110. $core.addMethod(
  2111. $core.method({
  2112. selector: "classTemplate",
  2113. protocol: 'accessing',
  2114. fn: function (){
  2115. var self=this;
  2116. function $String(){return $globals.String||(typeof String=="undefined"?nil:String)}
  2117. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2118. return $core.withContext(function($ctx1) {
  2119. //>>excludeEnd("ctx");
  2120. var $3,$4,$2,$5,$6,$7,$1;
  2121. $1=$recv($String())._streamContents_((function(stream){
  2122. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2123. return $core.withContext(function($ctx2) {
  2124. //>>excludeEnd("ctx");
  2125. $recv(stream)._nextPutAll_("Object");
  2126. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2127. $ctx2.sendIdx["nextPutAll:"]=1;
  2128. //>>excludeEnd("ctx");
  2129. $recv(stream)._nextPutAll_(" subclass: #NameOfSubclass");
  2130. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2131. $ctx2.sendIdx["nextPutAll:"]=2;
  2132. //>>excludeEnd("ctx");
  2133. $3=$recv($String())._lf();
  2134. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2135. $ctx2.sendIdx["lf"]=1;
  2136. //>>excludeEnd("ctx");
  2137. $4=$recv($String())._tab();
  2138. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2139. $ctx2.sendIdx["tab"]=1;
  2140. //>>excludeEnd("ctx");
  2141. $2=$recv($3).__comma($4);
  2142. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2143. $ctx2.sendIdx[","]=1;
  2144. //>>excludeEnd("ctx");
  2145. $recv(stream)._nextPutAll_($2);
  2146. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2147. $ctx2.sendIdx["nextPutAll:"]=3;
  2148. //>>excludeEnd("ctx");
  2149. $5=$recv(stream)._nextPutAll_("instanceVariableNames: ''");
  2150. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2151. $ctx2.sendIdx["nextPutAll:"]=4;
  2152. //>>excludeEnd("ctx");
  2153. $5;
  2154. $6=$recv("'".__comma($recv($String())._lf())).__comma($recv($String())._tab());
  2155. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2156. $ctx2.sendIdx[","]=2;
  2157. //>>excludeEnd("ctx");
  2158. $recv(stream)._nextPutAll_($6);
  2159. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2160. $ctx2.sendIdx["nextPutAll:"]=5;
  2161. //>>excludeEnd("ctx");
  2162. $recv(stream)._nextPutAll_("package: '");
  2163. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2164. $ctx2.sendIdx["nextPutAll:"]=6;
  2165. //>>excludeEnd("ctx");
  2166. $recv(stream)._nextPutAll_(self._name());
  2167. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2168. $ctx2.sendIdx["nextPutAll:"]=7;
  2169. //>>excludeEnd("ctx");
  2170. $7=$recv(stream)._nextPutAll_("'");
  2171. return $7;
  2172. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2173. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)});
  2174. //>>excludeEnd("ctx");
  2175. }));
  2176. return $1;
  2177. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2178. }, function($ctx1) {$ctx1.fill(self,"classTemplate",{},$globals.Package)});
  2179. //>>excludeEnd("ctx");
  2180. },
  2181. //>>excludeStart("ide", pragmas.excludeIdeData);
  2182. args: [],
  2183. source: "classTemplate\x0a\x09^ String streamContents: [ :stream |\x0a\x09\x09stream\x0a\x09\x09\x09nextPutAll: 'Object';\x0a\x09\x09\x09nextPutAll: ' subclass: #NameOfSubclass';\x0a\x09\x09\x09nextPutAll: String lf, String tab;\x0a\x09\x09\x09nextPutAll: 'instanceVariableNames: '''''.\x0a\x09\x09stream\x0a\x09\x09\x09nextPutAll: '''', String lf, String tab;\x0a\x09\x09\x09nextPutAll: 'package: ''';\x0a\x09\x09\x09nextPutAll: self name;\x0a\x09\x09\x09nextPutAll: '''' ]",
  2184. referencedClasses: ["String"],
  2185. //>>excludeEnd("ide");
  2186. messageSends: ["streamContents:", "nextPutAll:", ",", "lf", "tab", "name"]
  2187. }),
  2188. $globals.Package);
  2189. $core.addMethod(
  2190. $core.method({
  2191. selector: "classes",
  2192. protocol: 'classes',
  2193. fn: function (){
  2194. var self=this;
  2195. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2196. return $core.withContext(function($ctx1) {
  2197. //>>excludeEnd("ctx");
  2198. var $1;
  2199. $1=$recv(self._organization())._elements();
  2200. return $1;
  2201. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2202. }, function($ctx1) {$ctx1.fill(self,"classes",{},$globals.Package)});
  2203. //>>excludeEnd("ctx");
  2204. },
  2205. //>>excludeStart("ide", pragmas.excludeIdeData);
  2206. args: [],
  2207. source: "classes\x0a\x09^ self organization elements",
  2208. referencedClasses: [],
  2209. //>>excludeEnd("ide");
  2210. messageSends: ["elements", "organization"]
  2211. }),
  2212. $globals.Package);
  2213. $core.addMethod(
  2214. $core.method({
  2215. selector: "definition",
  2216. protocol: 'accessing',
  2217. fn: function (){
  2218. var self=this;
  2219. function $String(){return $globals.String||(typeof String=="undefined"?nil:String)}
  2220. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2221. return $core.withContext(function($ctx1) {
  2222. //>>excludeEnd("ctx");
  2223. var $2,$4,$5,$3,$7,$6,$9,$10,$8,$11,$12,$1;
  2224. $1=$recv($String())._streamContents_((function(stream){
  2225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2226. return $core.withContext(function($ctx2) {
  2227. //>>excludeEnd("ctx");
  2228. $2=$recv(self._class())._name();
  2229. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2230. $ctx2.sendIdx["name"]=1;
  2231. //>>excludeEnd("ctx");
  2232. $recv(stream)._nextPutAll_($2);
  2233. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2234. $ctx2.sendIdx["nextPutAll:"]=1;
  2235. //>>excludeEnd("ctx");
  2236. $4=$recv($String())._lf();
  2237. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2238. $ctx2.sendIdx["lf"]=1;
  2239. //>>excludeEnd("ctx");
  2240. $5=$recv($String())._tab();
  2241. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2242. $ctx2.sendIdx["tab"]=1;
  2243. //>>excludeEnd("ctx");
  2244. $3=$recv($4).__comma($5);
  2245. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2246. $ctx2.sendIdx[","]=1;
  2247. //>>excludeEnd("ctx");
  2248. $recv(stream)._nextPutAll_($3);
  2249. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2250. $ctx2.sendIdx["nextPutAll:"]=2;
  2251. //>>excludeEnd("ctx");
  2252. $recv(stream)._nextPutAll_("named: ");
  2253. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2254. $ctx2.sendIdx["nextPutAll:"]=3;
  2255. //>>excludeEnd("ctx");
  2256. $7="'".__comma(self._name());
  2257. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2258. $ctx2.sendIdx[","]=3;
  2259. //>>excludeEnd("ctx");
  2260. $6=$recv($7).__comma("'");
  2261. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2262. $ctx2.sendIdx[","]=2;
  2263. //>>excludeEnd("ctx");
  2264. $recv(stream)._nextPutAll_($6);
  2265. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2266. $ctx2.sendIdx["nextPutAll:"]=4;
  2267. //>>excludeEnd("ctx");
  2268. $9=$recv($String())._lf();
  2269. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2270. $ctx2.sendIdx["lf"]=2;
  2271. //>>excludeEnd("ctx");
  2272. $10=$recv($String())._tab();
  2273. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2274. $ctx2.sendIdx["tab"]=2;
  2275. //>>excludeEnd("ctx");
  2276. $8=$recv($9).__comma($10);
  2277. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2278. $ctx2.sendIdx[","]=4;
  2279. //>>excludeEnd("ctx");
  2280. $recv(stream)._nextPutAll_($8);
  2281. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2282. $ctx2.sendIdx["nextPutAll:"]=5;
  2283. //>>excludeEnd("ctx");
  2284. $recv(stream)._nextPutAll_("imports: ");
  2285. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2286. $ctx2.sendIdx["nextPutAll:"]=6;
  2287. //>>excludeEnd("ctx");
  2288. $recv(stream)._nextPutAll_(self._importsDefinition());
  2289. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2290. $ctx2.sendIdx["nextPutAll:"]=7;
  2291. //>>excludeEnd("ctx");
  2292. $11=$recv($recv($String())._lf()).__comma($recv($String())._tab());
  2293. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2294. $ctx2.sendIdx[","]=5;
  2295. //>>excludeEnd("ctx");
  2296. $recv(stream)._nextPutAll_($11);
  2297. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2298. $ctx2.sendIdx["nextPutAll:"]=8;
  2299. //>>excludeEnd("ctx");
  2300. $recv(stream)._nextPutAll_("transport: (");
  2301. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2302. $ctx2.sendIdx["nextPutAll:"]=9;
  2303. //>>excludeEnd("ctx");
  2304. $12=$recv(stream)._nextPutAll_($recv($recv(self._transport())._definition()).__comma(")"));
  2305. return $12;
  2306. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2307. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)});
  2308. //>>excludeEnd("ctx");
  2309. }));
  2310. return $1;
  2311. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2312. }, function($ctx1) {$ctx1.fill(self,"definition",{},$globals.Package)});
  2313. //>>excludeEnd("ctx");
  2314. },
  2315. //>>excludeStart("ide", pragmas.excludeIdeData);
  2316. args: [],
  2317. source: "definition\x0a\x09^ String streamContents: [ :stream |\x0a\x09\x09stream \x0a\x09\x09\x09nextPutAll: self class name;\x0a\x09\x09\x09nextPutAll: String lf, String tab;\x0a\x09\x09\x09nextPutAll: 'named: ';\x0a\x09\x09\x09nextPutAll: '''', self name, '''';\x0a\x09\x09\x09nextPutAll: String lf, String tab;\x0a\x09\x09\x09nextPutAll: 'imports: ';\x0a\x09\x09\x09nextPutAll: self importsDefinition;\x0a\x09\x09\x09nextPutAll: String lf, String tab;\x0a\x09\x09\x09nextPutAll: 'transport: (';\x0a\x09\x09\x09nextPutAll: self transport definition, ')' ]",
  2318. referencedClasses: ["String"],
  2319. //>>excludeEnd("ide");
  2320. messageSends: ["streamContents:", "nextPutAll:", "name", "class", ",", "lf", "tab", "importsDefinition", "definition", "transport"]
  2321. }),
  2322. $globals.Package);
  2323. $core.addMethod(
  2324. $core.method({
  2325. selector: "imports",
  2326. protocol: 'accessing',
  2327. fn: function (){
  2328. var self=this;
  2329. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2330. return $core.withContext(function($ctx1) {
  2331. //>>excludeEnd("ctx");
  2332. var $2,$1,$receiver;
  2333. $2=self["@imports"];
  2334. if(($receiver = $2) == null || $receiver.isNil){
  2335. var parsed;
  2336. parsed=self._importsFromJson_(self._basicImports());
  2337. parsed;
  2338. self._imports_(parsed);
  2339. $1=self["@imports"];
  2340. } else {
  2341. $1=$2;
  2342. };
  2343. return $1;
  2344. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2345. }, function($ctx1) {$ctx1.fill(self,"imports",{},$globals.Package)});
  2346. //>>excludeEnd("ctx");
  2347. },
  2348. //>>excludeStart("ide", pragmas.excludeIdeData);
  2349. args: [],
  2350. source: "imports\x0a\x09^ imports ifNil: [\x0a\x09\x09| parsed |\x0a\x09\x09parsed := self importsFromJson: self basicImports.\x0a\x09\x09self imports: parsed.\x0a\x09\x09imports ]",
  2351. referencedClasses: [],
  2352. //>>excludeEnd("ide");
  2353. messageSends: ["ifNil:", "importsFromJson:", "basicImports", "imports:"]
  2354. }),
  2355. $globals.Package);
  2356. $core.addMethod(
  2357. $core.method({
  2358. selector: "imports:",
  2359. protocol: 'accessing',
  2360. fn: function (anArray){
  2361. var self=this;
  2362. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2363. return $core.withContext(function($ctx1) {
  2364. //>>excludeEnd("ctx");
  2365. self._validateImports_(anArray);
  2366. self["@imports"]=$recv(anArray)._asSet();
  2367. return self;
  2368. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2369. }, function($ctx1) {$ctx1.fill(self,"imports:",{anArray:anArray},$globals.Package)});
  2370. //>>excludeEnd("ctx");
  2371. },
  2372. //>>excludeStart("ide", pragmas.excludeIdeData);
  2373. args: ["anArray"],
  2374. source: "imports: anArray\x0a\x09self validateImports: anArray.\x0a\x09imports := anArray asSet",
  2375. referencedClasses: [],
  2376. //>>excludeEnd("ide");
  2377. messageSends: ["validateImports:", "asSet"]
  2378. }),
  2379. $globals.Package);
  2380. $core.addMethod(
  2381. $core.method({
  2382. selector: "importsAsJson",
  2383. protocol: 'converting',
  2384. fn: function (){
  2385. var self=this;
  2386. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2387. return $core.withContext(function($ctx1) {
  2388. //>>excludeEnd("ctx");
  2389. var $2,$1;
  2390. $1=$recv(self._sortedImportsAsArray())._collect_((function(each){
  2391. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2392. return $core.withContext(function($ctx2) {
  2393. //>>excludeEnd("ctx");
  2394. $2=$recv(each)._isString();
  2395. if($core.assert($2)){
  2396. return each;
  2397. } else {
  2398. return $recv($recv($recv(each)._key()).__comma("=")).__comma($recv(each)._value());
  2399. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2400. $ctx2.sendIdx[","]=1;
  2401. //>>excludeEnd("ctx");
  2402. };
  2403. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2404. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2405. //>>excludeEnd("ctx");
  2406. }));
  2407. return $1;
  2408. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2409. }, function($ctx1) {$ctx1.fill(self,"importsAsJson",{},$globals.Package)});
  2410. //>>excludeEnd("ctx");
  2411. },
  2412. //>>excludeStart("ide", pragmas.excludeIdeData);
  2413. args: [],
  2414. source: "importsAsJson\x0a\x0a\x09^ self sortedImportsAsArray collect: [ :each |\x0a\x09\x09each isString\x0a\x09\x09\x09ifTrue: [ each ]\x0a\x09\x09\x09ifFalse: [ each key, '=', each value ]]",
  2415. referencedClasses: [],
  2416. //>>excludeEnd("ide");
  2417. messageSends: ["collect:", "sortedImportsAsArray", "ifTrue:ifFalse:", "isString", ",", "key", "value"]
  2418. }),
  2419. $globals.Package);
  2420. $core.addMethod(
  2421. $core.method({
  2422. selector: "importsDefinition",
  2423. protocol: 'accessing',
  2424. fn: function (){
  2425. var self=this;
  2426. function $String(){return $globals.String||(typeof String=="undefined"?nil:String)}
  2427. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2428. return $core.withContext(function($ctx1) {
  2429. //>>excludeEnd("ctx");
  2430. var $1;
  2431. $1=$recv($String())._streamContents_((function(stream){
  2432. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2433. return $core.withContext(function($ctx2) {
  2434. //>>excludeEnd("ctx");
  2435. $recv(stream)._nextPutAll_("{");
  2436. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2437. $ctx2.sendIdx["nextPutAll:"]=1;
  2438. //>>excludeEnd("ctx");
  2439. $recv(self._sortedImportsAsArray())._do_separatedBy_((function(each){
  2440. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2441. return $core.withContext(function($ctx3) {
  2442. //>>excludeEnd("ctx");
  2443. return $recv(stream)._nextPutAll_($recv(each)._importsString());
  2444. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2445. $ctx3.sendIdx["nextPutAll:"]=2;
  2446. //>>excludeEnd("ctx");
  2447. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2448. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)});
  2449. //>>excludeEnd("ctx");
  2450. }),(function(){
  2451. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2452. return $core.withContext(function($ctx3) {
  2453. //>>excludeEnd("ctx");
  2454. return $recv(stream)._nextPutAll_(". ");
  2455. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2456. $ctx3.sendIdx["nextPutAll:"]=3;
  2457. //>>excludeEnd("ctx");
  2458. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2459. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)});
  2460. //>>excludeEnd("ctx");
  2461. }));
  2462. return $recv(stream)._nextPutAll_("}");
  2463. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2464. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)});
  2465. //>>excludeEnd("ctx");
  2466. }));
  2467. return $1;
  2468. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2469. }, function($ctx1) {$ctx1.fill(self,"importsDefinition",{},$globals.Package)});
  2470. //>>excludeEnd("ctx");
  2471. },
  2472. //>>excludeStart("ide", pragmas.excludeIdeData);
  2473. args: [],
  2474. source: "importsDefinition\x0a\x09^ String streamContents: [ :stream |\x0a\x09\x09stream nextPutAll: '{'.\x0a\x09\x09self sortedImportsAsArray\x0a\x09\x09\x09do: [ :each | stream nextPutAll: each importsString ]\x0a\x09\x09\x09separatedBy: [ stream nextPutAll: '. ' ].\x0a\x09\x09stream nextPutAll: '}' ]",
  2475. referencedClasses: ["String"],
  2476. //>>excludeEnd("ide");
  2477. messageSends: ["streamContents:", "nextPutAll:", "do:separatedBy:", "sortedImportsAsArray", "importsString"]
  2478. }),
  2479. $globals.Package);
  2480. $core.addMethod(
  2481. $core.method({
  2482. selector: "importsFromJson:",
  2483. protocol: 'converting',
  2484. fn: function (anArray){
  2485. var self=this;
  2486. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2487. return $core.withContext(function($ctx1) {
  2488. //>>excludeEnd("ctx");
  2489. var $2,$1;
  2490. $1=$recv(anArray)._collect_((function(each){
  2491. var split;
  2492. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2493. return $core.withContext(function($ctx2) {
  2494. //>>excludeEnd("ctx");
  2495. split=$recv(each)._tokenize_("=");
  2496. split;
  2497. $2=$recv($recv(split)._size()).__eq((1));
  2498. if($core.assert($2)){
  2499. return $recv(split)._first();
  2500. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2501. $ctx2.sendIdx["first"]=1;
  2502. //>>excludeEnd("ctx");
  2503. } else {
  2504. return $recv($recv(split)._first()).__minus_gt($recv(split)._second());
  2505. };
  2506. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2507. }, function($ctx2) {$ctx2.fillBlock({each:each,split:split},$ctx1,1)});
  2508. //>>excludeEnd("ctx");
  2509. }));
  2510. return $1;
  2511. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2512. }, function($ctx1) {$ctx1.fill(self,"importsFromJson:",{anArray:anArray},$globals.Package)});
  2513. //>>excludeEnd("ctx");
  2514. },
  2515. //>>excludeStart("ide", pragmas.excludeIdeData);
  2516. args: ["anArray"],
  2517. source: "importsFromJson: anArray\x0a\x09\x22Parses array of string, eg. #('asdf' 'qwer=tyuo')\x0a\x09into array of Strings and Associations,\x0a\x09eg. {'asdf'. 'qwer'->'tyuo'}\x22\x0a\x0a\x09^ anArray collect: [ :each |\x0a\x09\x09| split |\x0a\x09\x09split := each tokenize: '='.\x0a\x09\x09split size = 1\x0a\x09\x09\x09ifTrue: [ split first ]\x0a\x09\x09\x09ifFalse: [ split first -> split second ]]",
  2518. referencedClasses: [],
  2519. //>>excludeEnd("ide");
  2520. messageSends: ["collect:", "tokenize:", "ifTrue:ifFalse:", "=", "size", "first", "->", "second"]
  2521. }),
  2522. $globals.Package);
  2523. $core.addMethod(
  2524. $core.method({
  2525. selector: "isDirty",
  2526. protocol: 'testing',
  2527. fn: function (){
  2528. var self=this;
  2529. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2530. return $core.withContext(function($ctx1) {
  2531. //>>excludeEnd("ctx");
  2532. var $2,$1,$receiver;
  2533. $2=self["@dirty"];
  2534. if(($receiver = $2) == null || $receiver.isNil){
  2535. $1=false;
  2536. } else {
  2537. $1=$2;
  2538. };
  2539. return $1;
  2540. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2541. }, function($ctx1) {$ctx1.fill(self,"isDirty",{},$globals.Package)});
  2542. //>>excludeEnd("ctx");
  2543. },
  2544. //>>excludeStart("ide", pragmas.excludeIdeData);
  2545. args: [],
  2546. source: "isDirty\x0a\x09^ dirty ifNil: [ false ]",
  2547. referencedClasses: [],
  2548. //>>excludeEnd("ide");
  2549. messageSends: ["ifNil:"]
  2550. }),
  2551. $globals.Package);
  2552. $core.addMethod(
  2553. $core.method({
  2554. selector: "isPackage",
  2555. protocol: 'testing',
  2556. fn: function (){
  2557. var self=this;
  2558. return true;
  2559. },
  2560. //>>excludeStart("ide", pragmas.excludeIdeData);
  2561. args: [],
  2562. source: "isPackage\x0a\x09^ true",
  2563. referencedClasses: [],
  2564. //>>excludeEnd("ide");
  2565. messageSends: []
  2566. }),
  2567. $globals.Package);
  2568. $core.addMethod(
  2569. $core.method({
  2570. selector: "loadDependencies",
  2571. protocol: 'dependencies',
  2572. fn: function (){
  2573. var self=this;
  2574. var classes,packages;
  2575. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2576. return $core.withContext(function($ctx1) {
  2577. //>>excludeEnd("ctx");
  2578. var $2,$3,$1;
  2579. classes=self._loadDependencyClasses();
  2580. $2=$recv($recv(classes)._collect_((function(each){
  2581. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2582. return $core.withContext(function($ctx2) {
  2583. //>>excludeEnd("ctx");
  2584. return $recv(each)._package();
  2585. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2586. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2587. //>>excludeEnd("ctx");
  2588. })))._asSet();
  2589. $recv($2)._remove_ifAbsent_(self,(function(){
  2590. }));
  2591. $3=$recv($2)._yourself();
  2592. $1=$3;
  2593. return $1;
  2594. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2595. }, function($ctx1) {$ctx1.fill(self,"loadDependencies",{classes:classes,packages:packages},$globals.Package)});
  2596. //>>excludeEnd("ctx");
  2597. },
  2598. //>>excludeStart("ide", pragmas.excludeIdeData);
  2599. args: [],
  2600. source: "loadDependencies\x0a\x09\x22Returns list of packages that need to be loaded\x0a\x09before loading this package.\x22\x0a\x09\x0a\x09| classes packages |\x0a\x09classes := self loadDependencyClasses.\x0a\x09^ (classes collect: [ :each | each package ]) asSet\x0a\x09\x09remove: self ifAbsent: [];\x0a\x09\x09yourself",
  2601. referencedClasses: [],
  2602. //>>excludeEnd("ide");
  2603. messageSends: ["loadDependencyClasses", "remove:ifAbsent:", "asSet", "collect:", "package", "yourself"]
  2604. }),
  2605. $globals.Package);
  2606. $core.addMethod(
  2607. $core.method({
  2608. selector: "loadDependencyClasses",
  2609. protocol: 'dependencies',
  2610. fn: function (){
  2611. var self=this;
  2612. var starCategoryName;
  2613. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  2614. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2615. return $core.withContext(function($ctx1) {
  2616. //>>excludeEnd("ctx");
  2617. var $4,$3,$2,$6,$5,$7,$1;
  2618. starCategoryName="*".__comma(self._name());
  2619. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2620. $ctx1.sendIdx[","]=1;
  2621. //>>excludeEnd("ctx");
  2622. $4=self._classes();
  2623. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2624. $ctx1.sendIdx["classes"]=1;
  2625. //>>excludeEnd("ctx");
  2626. $3=$recv($4)._collect_((function(each){
  2627. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2628. return $core.withContext(function($ctx2) {
  2629. //>>excludeEnd("ctx");
  2630. return $recv(each)._superclass();
  2631. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2632. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2633. //>>excludeEnd("ctx");
  2634. }));
  2635. $2=$recv($3)._asSet();
  2636. $recv($2)._remove_ifAbsent_(nil,(function(){
  2637. }));
  2638. $recv($2)._addAll_($recv($recv($Smalltalk())._classes())._select_((function(each){
  2639. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2640. return $core.withContext(function($ctx2) {
  2641. //>>excludeEnd("ctx");
  2642. $6=$recv(each)._protocols();
  2643. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2644. $ctx2.sendIdx["protocols"]=1;
  2645. //>>excludeEnd("ctx");
  2646. $5=$recv($6).__comma($recv($recv(each)._class())._protocols());
  2647. return $recv($5)._includes_(starCategoryName);
  2648. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2649. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
  2650. //>>excludeEnd("ctx");
  2651. })));
  2652. $7=$recv($2)._yourself();
  2653. $1=$7;
  2654. return $1;
  2655. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2656. }, function($ctx1) {$ctx1.fill(self,"loadDependencyClasses",{starCategoryName:starCategoryName},$globals.Package)});
  2657. //>>excludeEnd("ctx");
  2658. },
  2659. //>>excludeStart("ide", pragmas.excludeIdeData);
  2660. args: [],
  2661. source: "loadDependencyClasses\x0a\x09\x22Returns classes needed at the time of loading a package.\x0a\x09These are all that are used to subclass\x0a\x09and to define an extension method\x22\x0a\x09\x0a\x09| starCategoryName |\x0a\x09starCategoryName := '*', self name.\x0a\x09^ (self classes collect: [ :each | each superclass ]) asSet\x0a\x09\x09remove: nil ifAbsent: [];\x0a\x09\x09addAll: (Smalltalk classes select: [ :each | each protocols, each class protocols includes: starCategoryName ]);\x0a\x09\x09yourself",
  2662. referencedClasses: ["Smalltalk"],
  2663. //>>excludeEnd("ide");
  2664. messageSends: [",", "name", "remove:ifAbsent:", "asSet", "collect:", "classes", "superclass", "addAll:", "select:", "includes:", "protocols", "class", "yourself"]
  2665. }),
  2666. $globals.Package);
  2667. $core.addMethod(
  2668. $core.method({
  2669. selector: "name",
  2670. protocol: 'accessing',
  2671. fn: function (){
  2672. var self=this;
  2673. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2674. return $core.withContext(function($ctx1) {
  2675. //>>excludeEnd("ctx");
  2676. return self.pkgName;
  2677. return self;
  2678. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2679. }, function($ctx1) {$ctx1.fill(self,"name",{},$globals.Package)});
  2680. //>>excludeEnd("ctx");
  2681. },
  2682. //>>excludeStart("ide", pragmas.excludeIdeData);
  2683. args: [],
  2684. source: "name\x0a\x09<return self.pkgName>",
  2685. referencedClasses: [],
  2686. //>>excludeEnd("ide");
  2687. messageSends: []
  2688. }),
  2689. $globals.Package);
  2690. $core.addMethod(
  2691. $core.method({
  2692. selector: "name:",
  2693. protocol: 'accessing',
  2694. fn: function (aString){
  2695. var self=this;
  2696. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2697. return $core.withContext(function($ctx1) {
  2698. //>>excludeEnd("ctx");
  2699. self._basicName_(aString);
  2700. self._beDirty();
  2701. return self;
  2702. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2703. }, function($ctx1) {$ctx1.fill(self,"name:",{aString:aString},$globals.Package)});
  2704. //>>excludeEnd("ctx");
  2705. },
  2706. //>>excludeStart("ide", pragmas.excludeIdeData);
  2707. args: ["aString"],
  2708. source: "name: aString\x0a\x09self basicName: aString.\x0a\x09self beDirty",
  2709. referencedClasses: [],
  2710. //>>excludeEnd("ide");
  2711. messageSends: ["basicName:", "beDirty"]
  2712. }),
  2713. $globals.Package);
  2714. $core.addMethod(
  2715. $core.method({
  2716. selector: "organization",
  2717. protocol: 'accessing',
  2718. fn: function (){
  2719. var self=this;
  2720. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2721. return $core.withContext(function($ctx1) {
  2722. //>>excludeEnd("ctx");
  2723. var $1;
  2724. $1=self._basicAt_("organization");
  2725. return $1;
  2726. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2727. }, function($ctx1) {$ctx1.fill(self,"organization",{},$globals.Package)});
  2728. //>>excludeEnd("ctx");
  2729. },
  2730. //>>excludeStart("ide", pragmas.excludeIdeData);
  2731. args: [],
  2732. source: "organization\x0a\x09^ self basicAt: 'organization'",
  2733. referencedClasses: [],
  2734. //>>excludeEnd("ide");
  2735. messageSends: ["basicAt:"]
  2736. }),
  2737. $globals.Package);
  2738. $core.addMethod(
  2739. $core.method({
  2740. selector: "printOn:",
  2741. protocol: 'printing',
  2742. fn: function (aStream){
  2743. var self=this;
  2744. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2745. return $core.withContext(function($ctx1) {
  2746. //>>excludeEnd("ctx");
  2747. var $1;
  2748. (
  2749. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2750. $ctx1.supercall = true,
  2751. //>>excludeEnd("ctx");
  2752. $globals.Package.superclass.fn.prototype._printOn_.apply($recv(self), [aStream]));
  2753. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2754. $ctx1.supercall = false;
  2755. //>>excludeEnd("ctx");;
  2756. $recv(aStream)._nextPutAll_(" (");
  2757. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2758. $ctx1.sendIdx["nextPutAll:"]=1;
  2759. //>>excludeEnd("ctx");
  2760. $recv(aStream)._nextPutAll_(self._name());
  2761. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2762. $ctx1.sendIdx["nextPutAll:"]=2;
  2763. //>>excludeEnd("ctx");
  2764. $1=$recv(aStream)._nextPutAll_(")");
  2765. return self;
  2766. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2767. }, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},$globals.Package)});
  2768. //>>excludeEnd("ctx");
  2769. },
  2770. //>>excludeStart("ide", pragmas.excludeIdeData);
  2771. args: ["aStream"],
  2772. source: "printOn: aStream\x0a\x09super printOn: aStream.\x0a\x09aStream \x0a\x09\x09nextPutAll: ' (';\x0a\x09\x09nextPutAll: self name;\x0a\x09\x09nextPutAll: ')'",
  2773. referencedClasses: [],
  2774. //>>excludeEnd("ide");
  2775. messageSends: ["printOn:", "nextPutAll:", "name"]
  2776. }),
  2777. $globals.Package);
  2778. $core.addMethod(
  2779. $core.method({
  2780. selector: "setupClasses",
  2781. protocol: 'classes',
  2782. fn: function (){
  2783. var self=this;
  2784. function $ClassBuilder(){return $globals.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  2785. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2786. return $core.withContext(function($ctx1) {
  2787. //>>excludeEnd("ctx");
  2788. var $1,$2;
  2789. $1=self._classes();
  2790. $recv($1)._do_((function(each){
  2791. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2792. return $core.withContext(function($ctx2) {
  2793. //>>excludeEnd("ctx");
  2794. return $recv($recv($ClassBuilder())._new())._setupClass_(each);
  2795. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2796. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2797. //>>excludeEnd("ctx");
  2798. }));
  2799. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2800. $ctx1.sendIdx["do:"]=1;
  2801. //>>excludeEnd("ctx");
  2802. $2=$recv($1)._do_((function(each){
  2803. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2804. return $core.withContext(function($ctx2) {
  2805. //>>excludeEnd("ctx");
  2806. return $recv(each)._initialize();
  2807. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2808. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  2809. //>>excludeEnd("ctx");
  2810. }));
  2811. return self;
  2812. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2813. }, function($ctx1) {$ctx1.fill(self,"setupClasses",{},$globals.Package)});
  2814. //>>excludeEnd("ctx");
  2815. },
  2816. //>>excludeStart("ide", pragmas.excludeIdeData);
  2817. args: [],
  2818. source: "setupClasses\x0a\x09self classes\x0a\x09\x09do: [ :each | ClassBuilder new setupClass: each ];\x0a\x09\x09do: [ :each | each initialize ]",
  2819. referencedClasses: ["ClassBuilder"],
  2820. //>>excludeEnd("ide");
  2821. messageSends: ["do:", "classes", "setupClass:", "new", "initialize"]
  2822. }),
  2823. $globals.Package);
  2824. $core.addMethod(
  2825. $core.method({
  2826. selector: "sortedClasses",
  2827. protocol: 'classes',
  2828. fn: function (){
  2829. var self=this;
  2830. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2831. return $core.withContext(function($ctx1) {
  2832. //>>excludeEnd("ctx");
  2833. var $1;
  2834. $1=$recv(self._class())._sortedClasses_(self._classes());
  2835. return $1;
  2836. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2837. }, function($ctx1) {$ctx1.fill(self,"sortedClasses",{},$globals.Package)});
  2838. //>>excludeEnd("ctx");
  2839. },
  2840. //>>excludeStart("ide", pragmas.excludeIdeData);
  2841. args: [],
  2842. source: "sortedClasses\x0a\x09\x22Answer all classes in the receiver, sorted by superclass/subclasses and by class name for common subclasses (Issue #143).\x22\x0a\x0a\x09^ self class sortedClasses: self classes",
  2843. referencedClasses: [],
  2844. //>>excludeEnd("ide");
  2845. messageSends: ["sortedClasses:", "class", "classes"]
  2846. }),
  2847. $globals.Package);
  2848. $core.addMethod(
  2849. $core.method({
  2850. selector: "sortedImportsAsArray",
  2851. protocol: 'private',
  2852. fn: function (){
  2853. var self=this;
  2854. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2855. return $core.withContext(function($ctx1) {
  2856. //>>excludeEnd("ctx");
  2857. var $4,$3,$5,$2,$7,$6,$8,$1;
  2858. $1=$recv($recv(self._imports())._asArray())._sorted_((function(a,b){
  2859. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2860. return $core.withContext(function($ctx2) {
  2861. //>>excludeEnd("ctx");
  2862. $4=$recv(a)._isString();
  2863. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2864. $ctx2.sendIdx["isString"]=1;
  2865. //>>excludeEnd("ctx");
  2866. $3=$recv($4)._not();
  2867. $5=$recv(b)._isString();
  2868. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2869. $ctx2.sendIdx["isString"]=2;
  2870. //>>excludeEnd("ctx");
  2871. $2=$recv($3).__and($5);
  2872. return $recv($2)._or_((function(){
  2873. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2874. return $core.withContext(function($ctx3) {
  2875. //>>excludeEnd("ctx");
  2876. $7=$recv(a)._isString();
  2877. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2878. $ctx3.sendIdx["isString"]=3;
  2879. //>>excludeEnd("ctx");
  2880. $6=$recv($7).__eq($recv(b)._isString());
  2881. return $recv($6)._and_((function(){
  2882. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2883. return $core.withContext(function($ctx4) {
  2884. //>>excludeEnd("ctx");
  2885. $8=$recv(a)._value();
  2886. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2887. $ctx4.sendIdx["value"]=1;
  2888. //>>excludeEnd("ctx");
  2889. return $recv($8).__lt_eq($recv(b)._value());
  2890. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2891. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,3)});
  2892. //>>excludeEnd("ctx");
  2893. }));
  2894. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2895. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  2896. //>>excludeEnd("ctx");
  2897. }));
  2898. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2899. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,1)});
  2900. //>>excludeEnd("ctx");
  2901. }));
  2902. return $1;
  2903. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2904. }, function($ctx1) {$ctx1.fill(self,"sortedImportsAsArray",{},$globals.Package)});
  2905. //>>excludeEnd("ctx");
  2906. },
  2907. //>>excludeStart("ide", pragmas.excludeIdeData);
  2908. args: [],
  2909. source: "sortedImportsAsArray\x0a\x09\x22Answer imports sorted first by type (associations first),\x0a\x09then by value\x22\x0a\x0a\x09^ self imports asArray\x0a\x09\x09sorted: [ :a :b |\x0a\x09\x09\x09a isString not & b isString or: [\x0a\x09\x09\x09\x09a isString = b isString and: [\x0a\x09\x09\x09\x09\x09a value <= b value ]]]",
  2910. referencedClasses: [],
  2911. //>>excludeEnd("ide");
  2912. messageSends: ["sorted:", "asArray", "imports", "or:", "&", "not", "isString", "and:", "=", "<=", "value"]
  2913. }),
  2914. $globals.Package);
  2915. $core.addMethod(
  2916. $core.method({
  2917. selector: "transport",
  2918. protocol: 'accessing',
  2919. fn: function (){
  2920. var self=this;
  2921. function $PackageTransport(){return $globals.PackageTransport||(typeof PackageTransport=="undefined"?nil:PackageTransport)}
  2922. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2923. return $core.withContext(function($ctx1) {
  2924. //>>excludeEnd("ctx");
  2925. var $2,$3,$4,$1,$receiver;
  2926. $2=self["@transport"];
  2927. if(($receiver = $2) == null || $receiver.isNil){
  2928. $3=$recv($PackageTransport())._fromJson_(self._basicTransport());
  2929. $recv($3)._package_(self);
  2930. $4=$recv($3)._yourself();
  2931. self["@transport"]=$4;
  2932. $1=self["@transport"];
  2933. } else {
  2934. $1=$2;
  2935. };
  2936. return $1;
  2937. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2938. }, function($ctx1) {$ctx1.fill(self,"transport",{},$globals.Package)});
  2939. //>>excludeEnd("ctx");
  2940. },
  2941. //>>excludeStart("ide", pragmas.excludeIdeData);
  2942. args: [],
  2943. source: "transport\x0a\x09^ transport ifNil: [ \x0a\x09\x09transport := (PackageTransport fromJson: self basicTransport)\x0a\x09\x09\x09package: self;\x0a\x09\x09\x09yourself ]",
  2944. referencedClasses: ["PackageTransport"],
  2945. //>>excludeEnd("ide");
  2946. messageSends: ["ifNil:", "package:", "fromJson:", "basicTransport", "yourself"]
  2947. }),
  2948. $globals.Package);
  2949. $core.addMethod(
  2950. $core.method({
  2951. selector: "transport:",
  2952. protocol: 'accessing',
  2953. fn: function (aPackageTransport){
  2954. var self=this;
  2955. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2956. return $core.withContext(function($ctx1) {
  2957. //>>excludeEnd("ctx");
  2958. self["@transport"]=aPackageTransport;
  2959. $recv(aPackageTransport)._package_(self);
  2960. return self;
  2961. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2962. }, function($ctx1) {$ctx1.fill(self,"transport:",{aPackageTransport:aPackageTransport},$globals.Package)});
  2963. //>>excludeEnd("ctx");
  2964. },
  2965. //>>excludeStart("ide", pragmas.excludeIdeData);
  2966. args: ["aPackageTransport"],
  2967. source: "transport: aPackageTransport\x0a\x09transport := aPackageTransport.\x0a\x09aPackageTransport package: self",
  2968. referencedClasses: [],
  2969. //>>excludeEnd("ide");
  2970. messageSends: ["package:"]
  2971. }),
  2972. $globals.Package);
  2973. $core.addMethod(
  2974. $core.method({
  2975. selector: "validateImports:",
  2976. protocol: 'validation',
  2977. fn: function (aCollection){
  2978. var self=this;
  2979. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2980. return $core.withContext(function($ctx1) {
  2981. //>>excludeEnd("ctx");
  2982. var $1,$2,$5,$4,$3,$6;
  2983. $recv(aCollection)._do_((function(import_){
  2984. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2985. return $core.withContext(function($ctx2) {
  2986. //>>excludeEnd("ctx");
  2987. $1=$recv(import_)._isString();
  2988. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2989. $ctx2.sendIdx["isString"]=1;
  2990. //>>excludeEnd("ctx");
  2991. if(!$core.assert($1)){
  2992. $2=$recv(import_)._respondsTo_("key");
  2993. if(!$core.assert($2)){
  2994. self._error_("Imports must be Strings or Associations");
  2995. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2996. $ctx2.sendIdx["error:"]=1;
  2997. //>>excludeEnd("ctx");
  2998. };
  2999. $5=$recv(import_)._key();
  3000. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3001. $ctx2.sendIdx["key"]=1;
  3002. //>>excludeEnd("ctx");
  3003. $4=$recv($5)._isString();
  3004. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3005. $ctx2.sendIdx["isString"]=2;
  3006. //>>excludeEnd("ctx");
  3007. $3=$recv($4).__and($recv($recv(import_)._value())._isString());
  3008. if(!$core.assert($3)){
  3009. self._error_("Key and value must be Strings");
  3010. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3011. $ctx2.sendIdx["error:"]=2;
  3012. //>>excludeEnd("ctx");
  3013. };
  3014. $6=$recv($recv(import_)._key())._match_("^[a-zA-Z][a-zA-Z0-9]*$");
  3015. if(!$core.assert($6)){
  3016. return self._error_("Keys must be identifiers");
  3017. };
  3018. };
  3019. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3020. }, function($ctx2) {$ctx2.fillBlock({import_:import_},$ctx1,1)});
  3021. //>>excludeEnd("ctx");
  3022. }));
  3023. return self;
  3024. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3025. }, function($ctx1) {$ctx1.fill(self,"validateImports:",{aCollection:aCollection},$globals.Package)});
  3026. //>>excludeEnd("ctx");
  3027. },
  3028. //>>excludeStart("ide", pragmas.excludeIdeData);
  3029. args: ["aCollection"],
  3030. source: "validateImports: aCollection\x0a\x0a\x09aCollection do: [ :import |\x0a\x09\x09import isString ifFalse: [\x0a\x09\x09\x09(import respondsTo: #key) ifFalse: [\x0a\x09\x09\x09\x09self error: 'Imports must be Strings or Associations' ].\x0a\x09\x09\x09import key isString & import value isString ifFalse: [\x0a\x09\x09\x09\x09self error: 'Key and value must be Strings' ].\x0a\x09\x09\x09(import key match: '^[a-zA-Z][a-zA-Z0-9]*$') ifFalse: [\x0a\x09\x09\x09\x09self error: 'Keys must be identifiers' ]]]",
  3031. referencedClasses: [],
  3032. //>>excludeEnd("ide");
  3033. messageSends: ["do:", "ifFalse:", "isString", "respondsTo:", "error:", "&", "key", "value", "match:"]
  3034. }),
  3035. $globals.Package);
  3036. $globals.Package.klass.iVarNames = ['defaultCommitPathJs','defaultCommitPathSt'];
  3037. $core.addMethod(
  3038. $core.method({
  3039. selector: "named:",
  3040. protocol: 'accessing',
  3041. fn: function (aPackageName){
  3042. var self=this;
  3043. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  3044. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3045. return $core.withContext(function($ctx1) {
  3046. //>>excludeEnd("ctx");
  3047. var $1;
  3048. $1=$recv($Smalltalk())._packageAt_ifAbsent_(aPackageName,(function(){
  3049. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3050. return $core.withContext(function($ctx2) {
  3051. //>>excludeEnd("ctx");
  3052. return $recv($Smalltalk())._createPackage_(aPackageName);
  3053. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3054. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  3055. //>>excludeEnd("ctx");
  3056. }));
  3057. return $1;
  3058. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3059. }, function($ctx1) {$ctx1.fill(self,"named:",{aPackageName:aPackageName},$globals.Package.klass)});
  3060. //>>excludeEnd("ctx");
  3061. },
  3062. //>>excludeStart("ide", pragmas.excludeIdeData);
  3063. args: ["aPackageName"],
  3064. source: "named: aPackageName\x0a\x09^ Smalltalk \x0a\x09\x09packageAt: aPackageName\x0a\x09\x09ifAbsent: [ \x0a\x09\x09\x09Smalltalk createPackage: aPackageName ]",
  3065. referencedClasses: ["Smalltalk"],
  3066. //>>excludeEnd("ide");
  3067. messageSends: ["packageAt:ifAbsent:", "createPackage:"]
  3068. }),
  3069. $globals.Package.klass);
  3070. $core.addMethod(
  3071. $core.method({
  3072. selector: "named:ifAbsent:",
  3073. protocol: 'accessing',
  3074. fn: function (aPackageName,aBlock){
  3075. var self=this;
  3076. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  3077. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3078. return $core.withContext(function($ctx1) {
  3079. //>>excludeEnd("ctx");
  3080. var $1;
  3081. $1=$recv($Smalltalk())._packageAt_ifAbsent_(aPackageName,aBlock);
  3082. return $1;
  3083. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3084. }, function($ctx1) {$ctx1.fill(self,"named:ifAbsent:",{aPackageName:aPackageName,aBlock:aBlock},$globals.Package.klass)});
  3085. //>>excludeEnd("ctx");
  3086. },
  3087. //>>excludeStart("ide", pragmas.excludeIdeData);
  3088. args: ["aPackageName", "aBlock"],
  3089. source: "named: aPackageName ifAbsent: aBlock\x0a\x09^ Smalltalk packageAt: aPackageName ifAbsent: aBlock",
  3090. referencedClasses: ["Smalltalk"],
  3091. //>>excludeEnd("ide");
  3092. messageSends: ["packageAt:ifAbsent:"]
  3093. }),
  3094. $globals.Package.klass);
  3095. $core.addMethod(
  3096. $core.method({
  3097. selector: "named:imports:transport:",
  3098. protocol: 'accessing',
  3099. fn: function (aPackageName,anArray,aTransport){
  3100. var self=this;
  3101. var package_;
  3102. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3103. return $core.withContext(function($ctx1) {
  3104. //>>excludeEnd("ctx");
  3105. var $1;
  3106. package_=self._named_(aPackageName);
  3107. $recv(package_)._imports_(anArray);
  3108. $recv(package_)._transport_(aTransport);
  3109. $1=package_;
  3110. return $1;
  3111. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3112. }, function($ctx1) {$ctx1.fill(self,"named:imports:transport:",{aPackageName:aPackageName,anArray:anArray,aTransport:aTransport,package_:package_},$globals.Package.klass)});
  3113. //>>excludeEnd("ctx");
  3114. },
  3115. //>>excludeStart("ide", pragmas.excludeIdeData);
  3116. args: ["aPackageName", "anArray", "aTransport"],
  3117. source: "named: aPackageName imports: anArray transport: aTransport\x0a\x09| package |\x0a\x09\x0a\x09package := self named: aPackageName.\x0a\x09package imports: anArray.\x0a\x09package transport: aTransport.\x0a\x09\x0a\x09^ package",
  3118. referencedClasses: [],
  3119. //>>excludeEnd("ide");
  3120. messageSends: ["named:", "imports:", "transport:"]
  3121. }),
  3122. $globals.Package.klass);
  3123. $core.addMethod(
  3124. $core.method({
  3125. selector: "named:transport:",
  3126. protocol: 'accessing',
  3127. fn: function (aPackageName,aTransport){
  3128. var self=this;
  3129. var package_;
  3130. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3131. return $core.withContext(function($ctx1) {
  3132. //>>excludeEnd("ctx");
  3133. var $1;
  3134. package_=self._named_(aPackageName);
  3135. $recv(package_)._transport_(aTransport);
  3136. $1=package_;
  3137. return $1;
  3138. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3139. }, function($ctx1) {$ctx1.fill(self,"named:transport:",{aPackageName:aPackageName,aTransport:aTransport,package_:package_},$globals.Package.klass)});
  3140. //>>excludeEnd("ctx");
  3141. },
  3142. //>>excludeStart("ide", pragmas.excludeIdeData);
  3143. args: ["aPackageName", "aTransport"],
  3144. source: "named: aPackageName transport: aTransport\x0a\x09| package |\x0a\x09\x0a\x09package := self named: aPackageName.\x0a\x09package transport: aTransport.\x0a\x09\x0a\x09^ package",
  3145. referencedClasses: [],
  3146. //>>excludeEnd("ide");
  3147. messageSends: ["named:", "transport:"]
  3148. }),
  3149. $globals.Package.klass);
  3150. $core.addMethod(
  3151. $core.method({
  3152. selector: "sortedClasses:",
  3153. protocol: 'sorting',
  3154. fn: function (classes){
  3155. var self=this;
  3156. var children,others,nodes,expandedClasses;
  3157. function $ClassSorterNode(){return $globals.ClassSorterNode||(typeof ClassSorterNode=="undefined"?nil:ClassSorterNode)}
  3158. function $Array(){return $globals.Array||(typeof Array=="undefined"?nil:Array)}
  3159. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3160. return $core.withContext(function($ctx1) {
  3161. //>>excludeEnd("ctx");
  3162. var $1,$3,$2,$4;
  3163. children=[];
  3164. others=[];
  3165. $recv(classes)._do_((function(each){
  3166. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3167. return $core.withContext(function($ctx2) {
  3168. //>>excludeEnd("ctx");
  3169. $1=$recv(classes)._includes_($recv(each)._superclass());
  3170. if($core.assert($1)){
  3171. return $recv(others)._add_(each);
  3172. } else {
  3173. return $recv(children)._add_(each);
  3174. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3175. $ctx2.sendIdx["add:"]=1;
  3176. //>>excludeEnd("ctx");
  3177. };
  3178. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3179. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3180. //>>excludeEnd("ctx");
  3181. }));
  3182. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3183. $ctx1.sendIdx["do:"]=1;
  3184. //>>excludeEnd("ctx");
  3185. nodes=$recv(children)._collect_((function(each){
  3186. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3187. return $core.withContext(function($ctx2) {
  3188. //>>excludeEnd("ctx");
  3189. return $recv($ClassSorterNode())._on_classes_level_(each,others,(0));
  3190. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3191. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)});
  3192. //>>excludeEnd("ctx");
  3193. }));
  3194. nodes=$recv(nodes)._sorted_((function(a,b){
  3195. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3196. return $core.withContext(function($ctx2) {
  3197. //>>excludeEnd("ctx");
  3198. $3=$recv(a)._theClass();
  3199. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3200. $ctx2.sendIdx["theClass"]=1;
  3201. //>>excludeEnd("ctx");
  3202. $2=$recv($3)._name();
  3203. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3204. $ctx2.sendIdx["name"]=1;
  3205. //>>excludeEnd("ctx");
  3206. return $recv($2).__lt_eq($recv($recv(b)._theClass())._name());
  3207. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3208. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,5)});
  3209. //>>excludeEnd("ctx");
  3210. }));
  3211. expandedClasses=$recv($Array())._new();
  3212. $recv(nodes)._do_((function(aNode){
  3213. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3214. return $core.withContext(function($ctx2) {
  3215. //>>excludeEnd("ctx");
  3216. return $recv(aNode)._traverseClassesWith_(expandedClasses);
  3217. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3218. }, function($ctx2) {$ctx2.fillBlock({aNode:aNode},$ctx1,6)});
  3219. //>>excludeEnd("ctx");
  3220. }));
  3221. $4=expandedClasses;
  3222. return $4;
  3223. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3224. }, function($ctx1) {$ctx1.fill(self,"sortedClasses:",{classes:classes,children:children,others:others,nodes:nodes,expandedClasses:expandedClasses},$globals.Package.klass)});
  3225. //>>excludeEnd("ctx");
  3226. },
  3227. //>>excludeStart("ide", pragmas.excludeIdeData);
  3228. args: ["classes"],
  3229. source: "sortedClasses: classes\x0a\x09\x22Answer classes, sorted by superclass/subclasses and by class name for common subclasses (Issue #143)\x22\x0a\x0a\x09| children others nodes expandedClasses |\x0a\x09children := #().\x0a\x09others := #().\x0a\x09classes do: [ :each |\x0a\x09\x09(classes includes: each superclass)\x0a\x09\x09\x09ifFalse: [ children add: each ]\x0a\x09\x09\x09ifTrue: [ others add: each ]].\x0a\x09nodes := children collect: [ :each |\x0a\x09\x09ClassSorterNode on: each classes: others level: 0 ].\x0a\x09nodes := nodes sorted: [ :a :b | a theClass name <= b theClass name ].\x0a\x09expandedClasses := Array new.\x0a\x09nodes do: [ :aNode |\x0a\x09\x09aNode traverseClassesWith: expandedClasses ].\x0a\x09^ expandedClasses",
  3230. referencedClasses: ["ClassSorterNode", "Array"],
  3231. //>>excludeEnd("ide");
  3232. messageSends: ["do:", "ifFalse:ifTrue:", "includes:", "superclass", "add:", "collect:", "on:classes:level:", "sorted:", "<=", "name", "theClass", "new", "traverseClassesWith:"]
  3233. }),
  3234. $globals.Package.klass);
  3235. $core.addClass('PackageStateObserver', $globals.Object, [], 'Kernel-Infrastructure');
  3236. //>>excludeStart("ide", pragmas.excludeIdeData);
  3237. $globals.PackageStateObserver.comment="My current instance listens for any changes in the system that might affect the state of a package (being dirty).";
  3238. //>>excludeEnd("ide");
  3239. $core.addMethod(
  3240. $core.method({
  3241. selector: "announcer",
  3242. protocol: 'accessing',
  3243. fn: function (){
  3244. var self=this;
  3245. function $SystemAnnouncer(){return $globals.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  3246. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3247. return $core.withContext(function($ctx1) {
  3248. //>>excludeEnd("ctx");
  3249. var $1;
  3250. $1=$recv($SystemAnnouncer())._current();
  3251. return $1;
  3252. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3253. }, function($ctx1) {$ctx1.fill(self,"announcer",{},$globals.PackageStateObserver)});
  3254. //>>excludeEnd("ctx");
  3255. },
  3256. //>>excludeStart("ide", pragmas.excludeIdeData);
  3257. args: [],
  3258. source: "announcer\x0a\x09^ SystemAnnouncer current",
  3259. referencedClasses: ["SystemAnnouncer"],
  3260. //>>excludeEnd("ide");
  3261. messageSends: ["current"]
  3262. }),
  3263. $globals.PackageStateObserver);
  3264. $core.addMethod(
  3265. $core.method({
  3266. selector: "observeSystem",
  3267. protocol: 'actions',
  3268. fn: function (){
  3269. var self=this;
  3270. function $PackageAdded(){return $globals.PackageAdded||(typeof PackageAdded=="undefined"?nil:PackageAdded)}
  3271. function $ClassAnnouncement(){return $globals.ClassAnnouncement||(typeof ClassAnnouncement=="undefined"?nil:ClassAnnouncement)}
  3272. function $MethodAnnouncement(){return $globals.MethodAnnouncement||(typeof MethodAnnouncement=="undefined"?nil:MethodAnnouncement)}
  3273. function $ProtocolAnnouncement(){return $globals.ProtocolAnnouncement||(typeof ProtocolAnnouncement=="undefined"?nil:ProtocolAnnouncement)}
  3274. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3275. return $core.withContext(function($ctx1) {
  3276. //>>excludeEnd("ctx");
  3277. var $1,$2;
  3278. $1=self._announcer();
  3279. $recv($1)._on_send_to_($PackageAdded(),"onPackageAdded:",self);
  3280. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3281. $ctx1.sendIdx["on:send:to:"]=1;
  3282. //>>excludeEnd("ctx");
  3283. $recv($1)._on_send_to_($ClassAnnouncement(),"onClassModification:",self);
  3284. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3285. $ctx1.sendIdx["on:send:to:"]=2;
  3286. //>>excludeEnd("ctx");
  3287. $recv($1)._on_send_to_($MethodAnnouncement(),"onMethodModification:",self);
  3288. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3289. $ctx1.sendIdx["on:send:to:"]=3;
  3290. //>>excludeEnd("ctx");
  3291. $2=$recv($1)._on_send_to_($ProtocolAnnouncement(),"onProtocolModification:",self);
  3292. return self;
  3293. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3294. }, function($ctx1) {$ctx1.fill(self,"observeSystem",{},$globals.PackageStateObserver)});
  3295. //>>excludeEnd("ctx");
  3296. },
  3297. //>>excludeStart("ide", pragmas.excludeIdeData);
  3298. args: [],
  3299. source: "observeSystem\x0a\x09self announcer\x0a\x09\x09on: PackageAdded\x0a\x09\x09send: #onPackageAdded:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: ClassAnnouncement\x0a\x09\x09send: #onClassModification:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: MethodAnnouncement\x0a\x09\x09send: #onMethodModification:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: ProtocolAnnouncement\x0a\x09\x09send: #onProtocolModification:\x0a\x09\x09to: self",
  3300. referencedClasses: ["PackageAdded", "ClassAnnouncement", "MethodAnnouncement", "ProtocolAnnouncement"],
  3301. //>>excludeEnd("ide");
  3302. messageSends: ["on:send:to:", "announcer"]
  3303. }),
  3304. $globals.PackageStateObserver);
  3305. $core.addMethod(
  3306. $core.method({
  3307. selector: "onClassModification:",
  3308. protocol: 'reactions',
  3309. fn: function (anAnnouncement){
  3310. var self=this;
  3311. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3312. return $core.withContext(function($ctx1) {
  3313. //>>excludeEnd("ctx");
  3314. var $1,$receiver;
  3315. $1=$recv(anAnnouncement)._theClass();
  3316. if(($receiver = $1) == null || $receiver.isNil){
  3317. $1;
  3318. } else {
  3319. var theClass;
  3320. theClass=$receiver;
  3321. $recv($recv(theClass)._package())._beDirty();
  3322. };
  3323. return self;
  3324. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3325. }, function($ctx1) {$ctx1.fill(self,"onClassModification:",{anAnnouncement:anAnnouncement},$globals.PackageStateObserver)});
  3326. //>>excludeEnd("ctx");
  3327. },
  3328. //>>excludeStart("ide", pragmas.excludeIdeData);
  3329. args: ["anAnnouncement"],
  3330. source: "onClassModification: anAnnouncement\x0a\x09anAnnouncement theClass ifNotNil: [ :theClass | theClass package beDirty ]",
  3331. referencedClasses: [],
  3332. //>>excludeEnd("ide");
  3333. messageSends: ["ifNotNil:", "theClass", "beDirty", "package"]
  3334. }),
  3335. $globals.PackageStateObserver);
  3336. $core.addMethod(
  3337. $core.method({
  3338. selector: "onMethodModification:",
  3339. protocol: 'reactions',
  3340. fn: function (anAnnouncement){
  3341. var self=this;
  3342. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3343. return $core.withContext(function($ctx1) {
  3344. //>>excludeEnd("ctx");
  3345. var $1,$receiver;
  3346. $1=$recv($recv(anAnnouncement)._method())._package();
  3347. if(($receiver = $1) == null || $receiver.isNil){
  3348. $1;
  3349. } else {
  3350. var package_;
  3351. package_=$receiver;
  3352. $recv(package_)._beDirty();
  3353. };
  3354. return self;
  3355. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3356. }, function($ctx1) {$ctx1.fill(self,"onMethodModification:",{anAnnouncement:anAnnouncement},$globals.PackageStateObserver)});
  3357. //>>excludeEnd("ctx");
  3358. },
  3359. //>>excludeStart("ide", pragmas.excludeIdeData);
  3360. args: ["anAnnouncement"],
  3361. source: "onMethodModification: anAnnouncement\x0a\x09anAnnouncement method package ifNotNil: [ :package | package beDirty ]",
  3362. referencedClasses: [],
  3363. //>>excludeEnd("ide");
  3364. messageSends: ["ifNotNil:", "package", "method", "beDirty"]
  3365. }),
  3366. $globals.PackageStateObserver);
  3367. $core.addMethod(
  3368. $core.method({
  3369. selector: "onPackageAdded:",
  3370. protocol: 'reactions',
  3371. fn: function (anAnnouncement){
  3372. var self=this;
  3373. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3374. return $core.withContext(function($ctx1) {
  3375. //>>excludeEnd("ctx");
  3376. $recv($recv(anAnnouncement)._package())._beDirty();
  3377. return self;
  3378. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3379. }, function($ctx1) {$ctx1.fill(self,"onPackageAdded:",{anAnnouncement:anAnnouncement},$globals.PackageStateObserver)});
  3380. //>>excludeEnd("ctx");
  3381. },
  3382. //>>excludeStart("ide", pragmas.excludeIdeData);
  3383. args: ["anAnnouncement"],
  3384. source: "onPackageAdded: anAnnouncement\x0a\x09anAnnouncement package beDirty",
  3385. referencedClasses: [],
  3386. //>>excludeEnd("ide");
  3387. messageSends: ["beDirty", "package"]
  3388. }),
  3389. $globals.PackageStateObserver);
  3390. $core.addMethod(
  3391. $core.method({
  3392. selector: "onProtocolModification:",
  3393. protocol: 'reactions',
  3394. fn: function (anAnnouncement){
  3395. var self=this;
  3396. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3397. return $core.withContext(function($ctx1) {
  3398. //>>excludeEnd("ctx");
  3399. var $1,$receiver;
  3400. $1=$recv(anAnnouncement)._package();
  3401. if(($receiver = $1) == null || $receiver.isNil){
  3402. $1;
  3403. } else {
  3404. var package_;
  3405. package_=$receiver;
  3406. $recv(package_)._beDirty();
  3407. };
  3408. return self;
  3409. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3410. }, function($ctx1) {$ctx1.fill(self,"onProtocolModification:",{anAnnouncement:anAnnouncement},$globals.PackageStateObserver)});
  3411. //>>excludeEnd("ctx");
  3412. },
  3413. //>>excludeStart("ide", pragmas.excludeIdeData);
  3414. args: ["anAnnouncement"],
  3415. source: "onProtocolModification: anAnnouncement\x0a\x09anAnnouncement package ifNotNil: [ :package | package beDirty ]",
  3416. referencedClasses: [],
  3417. //>>excludeEnd("ide");
  3418. messageSends: ["ifNotNil:", "package", "beDirty"]
  3419. }),
  3420. $globals.PackageStateObserver);
  3421. $globals.PackageStateObserver.klass.iVarNames = ['current'];
  3422. $core.addMethod(
  3423. $core.method({
  3424. selector: "current",
  3425. protocol: 'accessing',
  3426. fn: function (){
  3427. var self=this;
  3428. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3429. return $core.withContext(function($ctx1) {
  3430. //>>excludeEnd("ctx");
  3431. var $2,$1,$receiver;
  3432. $2=self["@current"];
  3433. if(($receiver = $2) == null || $receiver.isNil){
  3434. self["@current"]=self._new();
  3435. $1=self["@current"];
  3436. } else {
  3437. $1=$2;
  3438. };
  3439. return $1;
  3440. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3441. }, function($ctx1) {$ctx1.fill(self,"current",{},$globals.PackageStateObserver.klass)});
  3442. //>>excludeEnd("ctx");
  3443. },
  3444. //>>excludeStart("ide", pragmas.excludeIdeData);
  3445. args: [],
  3446. source: "current\x0a\x09^ current ifNil: [ current := self new ]",
  3447. referencedClasses: [],
  3448. //>>excludeEnd("ide");
  3449. messageSends: ["ifNil:", "new"]
  3450. }),
  3451. $globals.PackageStateObserver.klass);
  3452. $core.addMethod(
  3453. $core.method({
  3454. selector: "initialize",
  3455. protocol: 'initialization',
  3456. fn: function (){
  3457. var self=this;
  3458. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3459. return $core.withContext(function($ctx1) {
  3460. //>>excludeEnd("ctx");
  3461. $recv(self._current())._observeSystem();
  3462. return self;
  3463. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3464. }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.PackageStateObserver.klass)});
  3465. //>>excludeEnd("ctx");
  3466. },
  3467. //>>excludeStart("ide", pragmas.excludeIdeData);
  3468. args: [],
  3469. source: "initialize\x0a\x09self current observeSystem",
  3470. referencedClasses: [],
  3471. //>>excludeEnd("ide");
  3472. messageSends: ["observeSystem", "current"]
  3473. }),
  3474. $globals.PackageStateObserver.klass);
  3475. $core.addClass('PlatformInterface', $globals.Object, [], 'Kernel-Infrastructure');
  3476. //>>excludeStart("ide", pragmas.excludeIdeData);
  3477. $globals.PlatformInterface.comment="I am single entry point to UI and environment interface.\x0aMy `initialize` tries several options (for now, browser environment only) to set myself up.\x0a\x0a## API\x0a\x0a PlatformInterface alert: 'Hey, there is a problem'.\x0a PlatformInterface confirm: 'Affirmative?'.\x0a PlatformInterface prompt: 'Your name:'.\x0a\x0a PlatformInterface ajax: #{\x0a 'url' -> '/patch.js'. 'type' -> 'GET'. dataType->'script'\x0a }.";
  3478. //>>excludeEnd("ide");
  3479. $globals.PlatformInterface.klass.iVarNames = ['worker'];
  3480. $core.addMethod(
  3481. $core.method({
  3482. selector: "ajax:",
  3483. protocol: 'actions',
  3484. fn: function (anObject){
  3485. var self=this;
  3486. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3487. return $core.withContext(function($ctx1) {
  3488. //>>excludeEnd("ctx");
  3489. var $2,$1,$receiver;
  3490. $2=self["@worker"];
  3491. if(($receiver = $2) == null || $receiver.isNil){
  3492. $1=self._error_("ajax: not available");
  3493. } else {
  3494. $1=$recv(self["@worker"])._ajax_(anObject);
  3495. };
  3496. return $1;
  3497. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3498. }, function($ctx1) {$ctx1.fill(self,"ajax:",{anObject:anObject},$globals.PlatformInterface.klass)});
  3499. //>>excludeEnd("ctx");
  3500. },
  3501. //>>excludeStart("ide", pragmas.excludeIdeData);
  3502. args: ["anObject"],
  3503. source: "ajax: anObject\x0a\x09^ worker\x0a\x09\x09ifNotNil: [ worker ajax: anObject ]\x0a\x09\x09ifNil: [ self error: 'ajax: not available' ]",
  3504. referencedClasses: [],
  3505. //>>excludeEnd("ide");
  3506. messageSends: ["ifNotNil:ifNil:", "ajax:", "error:"]
  3507. }),
  3508. $globals.PlatformInterface.klass);
  3509. $core.addMethod(
  3510. $core.method({
  3511. selector: "alert:",
  3512. protocol: 'actions',
  3513. fn: function (aString){
  3514. var self=this;
  3515. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3516. return $core.withContext(function($ctx1) {
  3517. //>>excludeEnd("ctx");
  3518. var $2,$1,$receiver;
  3519. $2=self["@worker"];
  3520. if(($receiver = $2) == null || $receiver.isNil){
  3521. $1=self._error_("alert: not available");
  3522. } else {
  3523. $1=$recv(self["@worker"])._alert_(aString);
  3524. };
  3525. return $1;
  3526. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3527. }, function($ctx1) {$ctx1.fill(self,"alert:",{aString:aString},$globals.PlatformInterface.klass)});
  3528. //>>excludeEnd("ctx");
  3529. },
  3530. //>>excludeStart("ide", pragmas.excludeIdeData);
  3531. args: ["aString"],
  3532. source: "alert: aString\x0a\x09^ worker\x0a\x09\x09ifNotNil: [ worker alert: aString ]\x0a\x09\x09ifNil: [ self error: 'alert: not available' ]",
  3533. referencedClasses: [],
  3534. //>>excludeEnd("ide");
  3535. messageSends: ["ifNotNil:ifNil:", "alert:", "error:"]
  3536. }),
  3537. $globals.PlatformInterface.klass);
  3538. $core.addMethod(
  3539. $core.method({
  3540. selector: "confirm:",
  3541. protocol: 'actions',
  3542. fn: function (aString){
  3543. var self=this;
  3544. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3545. return $core.withContext(function($ctx1) {
  3546. //>>excludeEnd("ctx");
  3547. var $2,$1,$receiver;
  3548. $2=self["@worker"];
  3549. if(($receiver = $2) == null || $receiver.isNil){
  3550. $1=self._error_("confirm: not available");
  3551. } else {
  3552. $1=$recv(self["@worker"])._confirm_(aString);
  3553. };
  3554. return $1;
  3555. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3556. }, function($ctx1) {$ctx1.fill(self,"confirm:",{aString:aString},$globals.PlatformInterface.klass)});
  3557. //>>excludeEnd("ctx");
  3558. },
  3559. //>>excludeStart("ide", pragmas.excludeIdeData);
  3560. args: ["aString"],
  3561. source: "confirm: aString\x0a\x09^ worker\x0a\x09\x09ifNotNil: [ worker confirm: aString ]\x0a\x09\x09ifNil: [ self error: 'confirm: not available' ]",
  3562. referencedClasses: [],
  3563. //>>excludeEnd("ide");
  3564. messageSends: ["ifNotNil:ifNil:", "confirm:", "error:"]
  3565. }),
  3566. $globals.PlatformInterface.klass);
  3567. $core.addMethod(
  3568. $core.method({
  3569. selector: "existsGlobal:",
  3570. protocol: 'actions',
  3571. fn: function (aString){
  3572. var self=this;
  3573. function $PlatformInterface(){return $globals.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  3574. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3575. return $core.withContext(function($ctx1) {
  3576. //>>excludeEnd("ctx");
  3577. var $1;
  3578. $1=$recv($recv($PlatformInterface())._globals())._at_ifPresent_ifAbsent_(aString,(function(){
  3579. return true;
  3580. }),(function(){
  3581. return false;
  3582. }));
  3583. return $1;
  3584. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3585. }, function($ctx1) {$ctx1.fill(self,"existsGlobal:",{aString:aString},$globals.PlatformInterface.klass)});
  3586. //>>excludeEnd("ctx");
  3587. },
  3588. //>>excludeStart("ide", pragmas.excludeIdeData);
  3589. args: ["aString"],
  3590. source: "existsGlobal: aString\x0a\x09^ PlatformInterface globals \x0a\x09\x09at: aString \x0a\x09\x09ifPresent: [ true ] \x0a\x09\x09ifAbsent: [ false ]",
  3591. referencedClasses: ["PlatformInterface"],
  3592. //>>excludeEnd("ide");
  3593. messageSends: ["at:ifPresent:ifAbsent:", "globals"]
  3594. }),
  3595. $globals.PlatformInterface.klass);
  3596. $core.addMethod(
  3597. $core.method({
  3598. selector: "globals",
  3599. protocol: 'accessing',
  3600. fn: function (){
  3601. var self=this;
  3602. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3603. return $core.withContext(function($ctx1) {
  3604. //>>excludeEnd("ctx");
  3605. return (new Function('return this'))();;
  3606. return self;
  3607. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3608. }, function($ctx1) {$ctx1.fill(self,"globals",{},$globals.PlatformInterface.klass)});
  3609. //>>excludeEnd("ctx");
  3610. },
  3611. //>>excludeStart("ide", pragmas.excludeIdeData);
  3612. args: [],
  3613. source: "globals\x0a\x09<return (new Function('return this'))();>",
  3614. referencedClasses: [],
  3615. //>>excludeEnd("ide");
  3616. messageSends: []
  3617. }),
  3618. $globals.PlatformInterface.klass);
  3619. $core.addMethod(
  3620. $core.method({
  3621. selector: "initialize",
  3622. protocol: 'initialization',
  3623. fn: function (){
  3624. var self=this;
  3625. var candidate;
  3626. function $BrowserInterface(){return $globals.BrowserInterface||(typeof BrowserInterface=="undefined"?nil:BrowserInterface)}
  3627. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3628. return $core.withContext(function($ctx1) {
  3629. //>>excludeEnd("ctx");
  3630. var $1,$receiver;
  3631. (
  3632. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3633. $ctx1.supercall = true,
  3634. //>>excludeEnd("ctx");
  3635. $globals.PlatformInterface.klass.superclass.fn.prototype._initialize.apply($recv(self), []));
  3636. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3637. $ctx1.supercall = false;
  3638. //>>excludeEnd("ctx");;
  3639. if(($receiver = $BrowserInterface()) == null || $receiver.isNil){
  3640. $BrowserInterface();
  3641. } else {
  3642. candidate=$recv($BrowserInterface())._new();
  3643. candidate;
  3644. $1=$recv(candidate)._isAvailable();
  3645. if($core.assert($1)){
  3646. self._setWorker_(candidate);
  3647. return self;
  3648. };
  3649. };
  3650. return self;
  3651. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3652. }, function($ctx1) {$ctx1.fill(self,"initialize",{candidate:candidate},$globals.PlatformInterface.klass)});
  3653. //>>excludeEnd("ctx");
  3654. },
  3655. //>>excludeStart("ide", pragmas.excludeIdeData);
  3656. args: [],
  3657. source: "initialize\x0a\x09| candidate |\x0a\x09\x0a\x09super initialize.\x0a\x09\x0a\x09BrowserInterface ifNotNil: [\x0a\x09\x09candidate := BrowserInterface new.\x0a\x09\x09candidate isAvailable ifTrue: [ self setWorker: candidate. ^ self ]\x0a\x09]",
  3658. referencedClasses: ["BrowserInterface"],
  3659. //>>excludeEnd("ide");
  3660. messageSends: ["initialize", "ifNotNil:", "new", "ifTrue:", "isAvailable", "setWorker:"]
  3661. }),
  3662. $globals.PlatformInterface.klass);
  3663. $core.addMethod(
  3664. $core.method({
  3665. selector: "prompt:",
  3666. protocol: 'actions',
  3667. fn: function (aString){
  3668. var self=this;
  3669. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3670. return $core.withContext(function($ctx1) {
  3671. //>>excludeEnd("ctx");
  3672. var $2,$1,$receiver;
  3673. $2=self["@worker"];
  3674. if(($receiver = $2) == null || $receiver.isNil){
  3675. $1=self._error_("prompt: not available");
  3676. } else {
  3677. $1=$recv(self["@worker"])._prompt_(aString);
  3678. };
  3679. return $1;
  3680. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3681. }, function($ctx1) {$ctx1.fill(self,"prompt:",{aString:aString},$globals.PlatformInterface.klass)});
  3682. //>>excludeEnd("ctx");
  3683. },
  3684. //>>excludeStart("ide", pragmas.excludeIdeData);
  3685. args: ["aString"],
  3686. source: "prompt: aString\x0a\x09^ worker\x0a\x09\x09ifNotNil: [ worker prompt: aString ]\x0a\x09\x09ifNil: [ self error: 'prompt: not available' ]",
  3687. referencedClasses: [],
  3688. //>>excludeEnd("ide");
  3689. messageSends: ["ifNotNil:ifNil:", "prompt:", "error:"]
  3690. }),
  3691. $globals.PlatformInterface.klass);
  3692. $core.addMethod(
  3693. $core.method({
  3694. selector: "prompt:default:",
  3695. protocol: 'actions',
  3696. fn: function (aString,defaultString){
  3697. var self=this;
  3698. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3699. return $core.withContext(function($ctx1) {
  3700. //>>excludeEnd("ctx");
  3701. var $2,$1,$receiver;
  3702. $2=self["@worker"];
  3703. if(($receiver = $2) == null || $receiver.isNil){
  3704. $1=self._error_("prompt: not available");
  3705. } else {
  3706. $1=$recv(self["@worker"])._prompt_default_(aString,defaultString);
  3707. };
  3708. return $1;
  3709. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3710. }, function($ctx1) {$ctx1.fill(self,"prompt:default:",{aString:aString,defaultString:defaultString},$globals.PlatformInterface.klass)});
  3711. //>>excludeEnd("ctx");
  3712. },
  3713. //>>excludeStart("ide", pragmas.excludeIdeData);
  3714. args: ["aString", "defaultString"],
  3715. source: "prompt: aString default: defaultString\x0a\x09^ worker\x0a\x09\x09ifNotNil: [ worker prompt: aString default: defaultString ]\x0a\x09\x09ifNil: [ self error: 'prompt: not available' ]",
  3716. referencedClasses: [],
  3717. //>>excludeEnd("ide");
  3718. messageSends: ["ifNotNil:ifNil:", "prompt:default:", "error:"]
  3719. }),
  3720. $globals.PlatformInterface.klass);
  3721. $core.addMethod(
  3722. $core.method({
  3723. selector: "setWorker:",
  3724. protocol: 'accessing',
  3725. fn: function (anObject){
  3726. var self=this;
  3727. self["@worker"]=anObject;
  3728. return self;
  3729. },
  3730. //>>excludeStart("ide", pragmas.excludeIdeData);
  3731. args: ["anObject"],
  3732. source: "setWorker: anObject\x0a\x09worker := anObject",
  3733. referencedClasses: [],
  3734. //>>excludeEnd("ide");
  3735. messageSends: []
  3736. }),
  3737. $globals.PlatformInterface.klass);
  3738. $core.addClass('Service', $globals.Object, [], 'Kernel-Infrastructure');
  3739. //>>excludeStart("ide", pragmas.excludeIdeData);
  3740. $globals.Service.comment="I implement the basic behavior for class registration to a service.\x0a\x0aSee the `Transcript` class for a concrete service.\x0a\x0a## API\x0a\x0aUse class-side methods `#register:` and `#registerIfNone:` to register classes to a specific service.";
  3741. //>>excludeEnd("ide");
  3742. $globals.Service.klass.iVarNames = ['current'];
  3743. $core.addMethod(
  3744. $core.method({
  3745. selector: "current",
  3746. protocol: 'accessing',
  3747. fn: function (){
  3748. var self=this;
  3749. var $1;
  3750. $1=self["@current"];
  3751. return $1;
  3752. },
  3753. //>>excludeStart("ide", pragmas.excludeIdeData);
  3754. args: [],
  3755. source: "current\x0a\x09^ current",
  3756. referencedClasses: [],
  3757. //>>excludeEnd("ide");
  3758. messageSends: []
  3759. }),
  3760. $globals.Service.klass);
  3761. $core.addMethod(
  3762. $core.method({
  3763. selector: "new",
  3764. protocol: 'instance creation',
  3765. fn: function (){
  3766. var self=this;
  3767. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3768. return $core.withContext(function($ctx1) {
  3769. //>>excludeEnd("ctx");
  3770. self._shouldNotImplement();
  3771. return self;
  3772. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3773. }, function($ctx1) {$ctx1.fill(self,"new",{},$globals.Service.klass)});
  3774. //>>excludeEnd("ctx");
  3775. },
  3776. //>>excludeStart("ide", pragmas.excludeIdeData);
  3777. args: [],
  3778. source: "new\x0a\x09self shouldNotImplement",
  3779. referencedClasses: [],
  3780. //>>excludeEnd("ide");
  3781. messageSends: ["shouldNotImplement"]
  3782. }),
  3783. $globals.Service.klass);
  3784. $core.addMethod(
  3785. $core.method({
  3786. selector: "register:",
  3787. protocol: 'registration',
  3788. fn: function (anObject){
  3789. var self=this;
  3790. self["@current"]=anObject;
  3791. return self;
  3792. },
  3793. //>>excludeStart("ide", pragmas.excludeIdeData);
  3794. args: ["anObject"],
  3795. source: "register: anObject\x0a\x09current := anObject",
  3796. referencedClasses: [],
  3797. //>>excludeEnd("ide");
  3798. messageSends: []
  3799. }),
  3800. $globals.Service.klass);
  3801. $core.addMethod(
  3802. $core.method({
  3803. selector: "registerIfNone:",
  3804. protocol: 'registration',
  3805. fn: function (anObject){
  3806. var self=this;
  3807. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3808. return $core.withContext(function($ctx1) {
  3809. //>>excludeEnd("ctx");
  3810. var $1,$receiver;
  3811. $1=self._current();
  3812. if(($receiver = $1) == null || $receiver.isNil){
  3813. self._register_(anObject);
  3814. } else {
  3815. $1;
  3816. };
  3817. return self;
  3818. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3819. }, function($ctx1) {$ctx1.fill(self,"registerIfNone:",{anObject:anObject},$globals.Service.klass)});
  3820. //>>excludeEnd("ctx");
  3821. },
  3822. //>>excludeStart("ide", pragmas.excludeIdeData);
  3823. args: ["anObject"],
  3824. source: "registerIfNone: anObject\x0a\x09self current ifNil: [ self register: anObject ]",
  3825. referencedClasses: [],
  3826. //>>excludeEnd("ide");
  3827. messageSends: ["ifNil:", "current", "register:"]
  3828. }),
  3829. $globals.Service.klass);
  3830. $core.addClass('ErrorHandler', $globals.Service, [], 'Kernel-Infrastructure');
  3831. //>>excludeStart("ide", pragmas.excludeIdeData);
  3832. $globals.ErrorHandler.comment="I am the service used to handle Smalltalk errors.\x0aSee `boot.js` `handleError()` function.\x0a\x0aRegistered service instances must implement `#handleError:` to perform an action on the thrown exception.";
  3833. //>>excludeEnd("ide");
  3834. $core.addMethod(
  3835. $core.method({
  3836. selector: "handleError:",
  3837. protocol: 'error handling',
  3838. fn: function (anError){
  3839. var self=this;
  3840. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3841. return $core.withContext(function($ctx1) {
  3842. //>>excludeEnd("ctx");
  3843. self._handleUnhandledError_(anError);
  3844. return self;
  3845. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3846. }, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},$globals.ErrorHandler.klass)});
  3847. //>>excludeEnd("ctx");
  3848. },
  3849. //>>excludeStart("ide", pragmas.excludeIdeData);
  3850. args: ["anError"],
  3851. source: "handleError: anError\x0a\x09self handleUnhandledError: anError",
  3852. referencedClasses: [],
  3853. //>>excludeEnd("ide");
  3854. messageSends: ["handleUnhandledError:"]
  3855. }),
  3856. $globals.ErrorHandler.klass);
  3857. $core.addMethod(
  3858. $core.method({
  3859. selector: "handleUnhandledError:",
  3860. protocol: 'error handling',
  3861. fn: function (anError){
  3862. var self=this;
  3863. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3864. return $core.withContext(function($ctx1) {
  3865. //>>excludeEnd("ctx");
  3866. var $1,$2;
  3867. $1=$recv(anError)._wasHandled();
  3868. if($core.assert($1)){
  3869. return self;
  3870. };
  3871. $2=$recv(self._current())._handleError_(anError);
  3872. return $2;
  3873. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3874. }, function($ctx1) {$ctx1.fill(self,"handleUnhandledError:",{anError:anError},$globals.ErrorHandler.klass)});
  3875. //>>excludeEnd("ctx");
  3876. },
  3877. //>>excludeStart("ide", pragmas.excludeIdeData);
  3878. args: ["anError"],
  3879. source: "handleUnhandledError: anError\x0a\x09anError wasHandled ifTrue: [ ^ self ].\x0a\x09\x0a\x09^ self current handleError: anError",
  3880. referencedClasses: [],
  3881. //>>excludeEnd("ide");
  3882. messageSends: ["ifTrue:", "wasHandled", "handleError:", "current"]
  3883. }),
  3884. $globals.ErrorHandler.klass);
  3885. $core.addClass('Finder', $globals.Service, [], 'Kernel-Infrastructure');
  3886. //>>excludeStart("ide", pragmas.excludeIdeData);
  3887. $globals.Finder.comment="I am the service responsible for finding classes/methods.\x0a__There is no default finder.__\x0a\x0a## API\x0a\x0aUse `#browse` on an object to find it.";
  3888. //>>excludeEnd("ide");
  3889. $core.addMethod(
  3890. $core.method({
  3891. selector: "findClass:",
  3892. protocol: 'finding',
  3893. fn: function (aClass){
  3894. var self=this;
  3895. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3896. return $core.withContext(function($ctx1) {
  3897. //>>excludeEnd("ctx");
  3898. var $1;
  3899. $1=$recv(self._current())._findClass_(aClass);
  3900. return $1;
  3901. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3902. }, function($ctx1) {$ctx1.fill(self,"findClass:",{aClass:aClass},$globals.Finder.klass)});
  3903. //>>excludeEnd("ctx");
  3904. },
  3905. //>>excludeStart("ide", pragmas.excludeIdeData);
  3906. args: ["aClass"],
  3907. source: "findClass: aClass\x0a\x09^ self current findClass: aClass",
  3908. referencedClasses: [],
  3909. //>>excludeEnd("ide");
  3910. messageSends: ["findClass:", "current"]
  3911. }),
  3912. $globals.Finder.klass);
  3913. $core.addMethod(
  3914. $core.method({
  3915. selector: "findMethod:",
  3916. protocol: 'finding',
  3917. fn: function (aCompiledMethod){
  3918. var self=this;
  3919. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3920. return $core.withContext(function($ctx1) {
  3921. //>>excludeEnd("ctx");
  3922. var $1;
  3923. $1=$recv(self._current())._findMethod_(aCompiledMethod);
  3924. return $1;
  3925. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3926. }, function($ctx1) {$ctx1.fill(self,"findMethod:",{aCompiledMethod:aCompiledMethod},$globals.Finder.klass)});
  3927. //>>excludeEnd("ctx");
  3928. },
  3929. //>>excludeStart("ide", pragmas.excludeIdeData);
  3930. args: ["aCompiledMethod"],
  3931. source: "findMethod: aCompiledMethod\x0a\x09^ self current findMethod: aCompiledMethod",
  3932. referencedClasses: [],
  3933. //>>excludeEnd("ide");
  3934. messageSends: ["findMethod:", "current"]
  3935. }),
  3936. $globals.Finder.klass);
  3937. $core.addMethod(
  3938. $core.method({
  3939. selector: "findString:",
  3940. protocol: 'finding',
  3941. fn: function (aString){
  3942. var self=this;
  3943. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3944. return $core.withContext(function($ctx1) {
  3945. //>>excludeEnd("ctx");
  3946. var $1;
  3947. $1=$recv(self._current())._findString_(aString);
  3948. return $1;
  3949. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3950. }, function($ctx1) {$ctx1.fill(self,"findString:",{aString:aString},$globals.Finder.klass)});
  3951. //>>excludeEnd("ctx");
  3952. },
  3953. //>>excludeStart("ide", pragmas.excludeIdeData);
  3954. args: ["aString"],
  3955. source: "findString: aString\x0a\x09^ self current findString: aString",
  3956. referencedClasses: [],
  3957. //>>excludeEnd("ide");
  3958. messageSends: ["findString:", "current"]
  3959. }),
  3960. $globals.Finder.klass);
  3961. $core.addClass('Inspector', $globals.Service, [], 'Kernel-Infrastructure');
  3962. //>>excludeStart("ide", pragmas.excludeIdeData);
  3963. $globals.Inspector.comment="I am the service responsible for inspecting objects.\x0a\x0aThe default inspector object is the transcript.";
  3964. //>>excludeEnd("ide");
  3965. $core.addMethod(
  3966. $core.method({
  3967. selector: "inspect:",
  3968. protocol: 'inspecting',
  3969. fn: function (anObject){
  3970. var self=this;
  3971. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3972. return $core.withContext(function($ctx1) {
  3973. //>>excludeEnd("ctx");
  3974. var $1;
  3975. $1=$recv(self._current())._inspect_(anObject);
  3976. return $1;
  3977. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3978. }, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},$globals.Inspector.klass)});
  3979. //>>excludeEnd("ctx");
  3980. },
  3981. //>>excludeStart("ide", pragmas.excludeIdeData);
  3982. args: ["anObject"],
  3983. source: "inspect: anObject\x0a\x09^ self current inspect: anObject",
  3984. referencedClasses: [],
  3985. //>>excludeEnd("ide");
  3986. messageSends: ["inspect:", "current"]
  3987. }),
  3988. $globals.Inspector.klass);
  3989. $core.addClass('ProgressHandler', $globals.Service, [], 'Kernel-Infrastructure');
  3990. //>>excludeStart("ide", pragmas.excludeIdeData);
  3991. $globals.ProgressHandler.comment="I am used to manage progress in collection iterations, see `SequenceableCollection >> #do:displayingProgress:`.\x0a\x0aRegistered instances must implement `#do:on:displaying:`.\x0a\x0aThe default behavior is to simply iterate over the collection, using `NullProgressHandler`.";
  3992. //>>excludeEnd("ide");
  3993. $core.addMethod(
  3994. $core.method({
  3995. selector: "do:on:displaying:",
  3996. protocol: 'progress handling',
  3997. fn: function (aBlock,aCollection,aString){
  3998. var self=this;
  3999. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4000. return $core.withContext(function($ctx1) {
  4001. //>>excludeEnd("ctx");
  4002. $recv(self._current())._do_on_displaying_(aBlock,aCollection,aString);
  4003. return self;
  4004. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4005. }, function($ctx1) {$ctx1.fill(self,"do:on:displaying:",{aBlock:aBlock,aCollection:aCollection,aString:aString},$globals.ProgressHandler.klass)});
  4006. //>>excludeEnd("ctx");
  4007. },
  4008. //>>excludeStart("ide", pragmas.excludeIdeData);
  4009. args: ["aBlock", "aCollection", "aString"],
  4010. source: "do: aBlock on: aCollection displaying: aString\x0a\x09self current do: aBlock on: aCollection displaying: aString",
  4011. referencedClasses: [],
  4012. //>>excludeEnd("ide");
  4013. messageSends: ["do:on:displaying:", "current"]
  4014. }),
  4015. $globals.ProgressHandler.klass);
  4016. $core.addClass('Transcript', $globals.Service, [], 'Kernel-Infrastructure');
  4017. //>>excludeStart("ide", pragmas.excludeIdeData);
  4018. $globals.Transcript.comment="I am a facade for Transcript actions.\x0a\x0aI delegate actions to the currently registered transcript.\x0a\x0a## API\x0a\x0a Transcript \x0a show: 'hello world';\x0a cr;\x0a show: anObject.";
  4019. //>>excludeEnd("ide");
  4020. $core.addMethod(
  4021. $core.method({
  4022. selector: "clear",
  4023. protocol: 'printing',
  4024. fn: function (){
  4025. var self=this;
  4026. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4027. return $core.withContext(function($ctx1) {
  4028. //>>excludeEnd("ctx");
  4029. $recv(self._current())._clear();
  4030. return self;
  4031. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4032. }, function($ctx1) {$ctx1.fill(self,"clear",{},$globals.Transcript.klass)});
  4033. //>>excludeEnd("ctx");
  4034. },
  4035. //>>excludeStart("ide", pragmas.excludeIdeData);
  4036. args: [],
  4037. source: "clear\x0a\x09self current clear",
  4038. referencedClasses: [],
  4039. //>>excludeEnd("ide");
  4040. messageSends: ["clear", "current"]
  4041. }),
  4042. $globals.Transcript.klass);
  4043. $core.addMethod(
  4044. $core.method({
  4045. selector: "cr",
  4046. protocol: 'printing',
  4047. fn: function (){
  4048. var self=this;
  4049. function $String(){return $globals.String||(typeof String=="undefined"?nil:String)}
  4050. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4051. return $core.withContext(function($ctx1) {
  4052. //>>excludeEnd("ctx");
  4053. $recv(self._current())._show_($recv($String())._cr());
  4054. return self;
  4055. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4056. }, function($ctx1) {$ctx1.fill(self,"cr",{},$globals.Transcript.klass)});
  4057. //>>excludeEnd("ctx");
  4058. },
  4059. //>>excludeStart("ide", pragmas.excludeIdeData);
  4060. args: [],
  4061. source: "cr\x0a\x09self current show: String cr",
  4062. referencedClasses: ["String"],
  4063. //>>excludeEnd("ide");
  4064. messageSends: ["show:", "current", "cr"]
  4065. }),
  4066. $globals.Transcript.klass);
  4067. $core.addMethod(
  4068. $core.method({
  4069. selector: "inspect:",
  4070. protocol: 'printing',
  4071. fn: function (anObject){
  4072. var self=this;
  4073. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4074. return $core.withContext(function($ctx1) {
  4075. //>>excludeEnd("ctx");
  4076. self._show_(anObject);
  4077. return self;
  4078. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4079. }, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},$globals.Transcript.klass)});
  4080. //>>excludeEnd("ctx");
  4081. },
  4082. //>>excludeStart("ide", pragmas.excludeIdeData);
  4083. args: ["anObject"],
  4084. source: "inspect: anObject\x0a\x09self show: anObject",
  4085. referencedClasses: [],
  4086. //>>excludeEnd("ide");
  4087. messageSends: ["show:"]
  4088. }),
  4089. $globals.Transcript.klass);
  4090. $core.addMethod(
  4091. $core.method({
  4092. selector: "open",
  4093. protocol: 'instance creation',
  4094. fn: function (){
  4095. var self=this;
  4096. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4097. return $core.withContext(function($ctx1) {
  4098. //>>excludeEnd("ctx");
  4099. $recv(self._current())._open();
  4100. return self;
  4101. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4102. }, function($ctx1) {$ctx1.fill(self,"open",{},$globals.Transcript.klass)});
  4103. //>>excludeEnd("ctx");
  4104. },
  4105. //>>excludeStart("ide", pragmas.excludeIdeData);
  4106. args: [],
  4107. source: "open\x0a\x09self current open",
  4108. referencedClasses: [],
  4109. //>>excludeEnd("ide");
  4110. messageSends: ["open", "current"]
  4111. }),
  4112. $globals.Transcript.klass);
  4113. $core.addMethod(
  4114. $core.method({
  4115. selector: "show:",
  4116. protocol: 'printing',
  4117. fn: function (anObject){
  4118. var self=this;
  4119. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4120. return $core.withContext(function($ctx1) {
  4121. //>>excludeEnd("ctx");
  4122. $recv(self._current())._show_(anObject);
  4123. return self;
  4124. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4125. }, function($ctx1) {$ctx1.fill(self,"show:",{anObject:anObject},$globals.Transcript.klass)});
  4126. //>>excludeEnd("ctx");
  4127. },
  4128. //>>excludeStart("ide", pragmas.excludeIdeData);
  4129. args: ["anObject"],
  4130. source: "show: anObject\x0a\x09self current show: anObject",
  4131. referencedClasses: [],
  4132. //>>excludeEnd("ide");
  4133. messageSends: ["show:", "current"]
  4134. }),
  4135. $globals.Transcript.klass);
  4136. $core.addClass('Setting', $globals.Object, ['key', 'value', 'defaultValue'], 'Kernel-Infrastructure');
  4137. //>>excludeStart("ide", pragmas.excludeIdeData);
  4138. $globals.Setting.comment="I represent a setting **stored** at `Smalltalk settings`. \x0aIn the current implementation, `Smalltalk settings` is an object persisted in the localStorage.\x0a\x0a## API\x0a\x0aA `Setting` value can be read using `value` and set using `value:`.\x0a\x0aSettings are accessed with `'key' asSetting` or `'key' asSettingIfAbsent: aDefaultValue`.\x0a\x0aTo read the value of a setting you can also use the convenience:\x0a\x0a`theValueSet := 'any.characteristic' settingValue` \x0a\x0aor with a default using:\x0a\x0a `theEnsuredValueSet := 'any.characteristic' settingValueIfAbsent: true`";
  4139. //>>excludeEnd("ide");
  4140. $core.addMethod(
  4141. $core.method({
  4142. selector: "defaultValue",
  4143. protocol: 'accessing',
  4144. fn: function (){
  4145. var self=this;
  4146. var $1;
  4147. $1=self["@defaultValue"];
  4148. return $1;
  4149. },
  4150. //>>excludeStart("ide", pragmas.excludeIdeData);
  4151. args: [],
  4152. source: "defaultValue\x0a\x09^ defaultValue",
  4153. referencedClasses: [],
  4154. //>>excludeEnd("ide");
  4155. messageSends: []
  4156. }),
  4157. $globals.Setting);
  4158. $core.addMethod(
  4159. $core.method({
  4160. selector: "defaultValue:",
  4161. protocol: 'accessing',
  4162. fn: function (aStringifiableObject){
  4163. var self=this;
  4164. self["@defaultValue"]=aStringifiableObject;
  4165. return self;
  4166. },
  4167. //>>excludeStart("ide", pragmas.excludeIdeData);
  4168. args: ["aStringifiableObject"],
  4169. source: "defaultValue: aStringifiableObject\x0a\x09defaultValue := aStringifiableObject",
  4170. referencedClasses: [],
  4171. //>>excludeEnd("ide");
  4172. messageSends: []
  4173. }),
  4174. $globals.Setting);
  4175. $core.addMethod(
  4176. $core.method({
  4177. selector: "key",
  4178. protocol: 'accessing',
  4179. fn: function (){
  4180. var self=this;
  4181. var $1;
  4182. $1=self["@key"];
  4183. return $1;
  4184. },
  4185. //>>excludeStart("ide", pragmas.excludeIdeData);
  4186. args: [],
  4187. source: "key\x0a\x09^ key",
  4188. referencedClasses: [],
  4189. //>>excludeEnd("ide");
  4190. messageSends: []
  4191. }),
  4192. $globals.Setting);
  4193. $core.addMethod(
  4194. $core.method({
  4195. selector: "key:",
  4196. protocol: 'accessing',
  4197. fn: function (aString){
  4198. var self=this;
  4199. self["@key"]=aString;
  4200. return self;
  4201. },
  4202. //>>excludeStart("ide", pragmas.excludeIdeData);
  4203. args: ["aString"],
  4204. source: "key: aString\x0a\x09key := aString",
  4205. referencedClasses: [],
  4206. //>>excludeEnd("ide");
  4207. messageSends: []
  4208. }),
  4209. $globals.Setting);
  4210. $core.addMethod(
  4211. $core.method({
  4212. selector: "value",
  4213. protocol: 'accessing',
  4214. fn: function (){
  4215. var self=this;
  4216. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  4217. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4218. return $core.withContext(function($ctx1) {
  4219. //>>excludeEnd("ctx");
  4220. var $1;
  4221. $1=$recv($recv($Smalltalk())._settings())._at_ifAbsent_(self._key(),(function(){
  4222. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4223. return $core.withContext(function($ctx2) {
  4224. //>>excludeEnd("ctx");
  4225. return self._defaultValue();
  4226. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4227. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  4228. //>>excludeEnd("ctx");
  4229. }));
  4230. return $1;
  4231. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4232. }, function($ctx1) {$ctx1.fill(self,"value",{},$globals.Setting)});
  4233. //>>excludeEnd("ctx");
  4234. },
  4235. //>>excludeStart("ide", pragmas.excludeIdeData);
  4236. args: [],
  4237. source: "value\x0a\x09^ Smalltalk settings at: self key ifAbsent: [ self defaultValue ]",
  4238. referencedClasses: ["Smalltalk"],
  4239. //>>excludeEnd("ide");
  4240. messageSends: ["at:ifAbsent:", "settings", "key", "defaultValue"]
  4241. }),
  4242. $globals.Setting);
  4243. $core.addMethod(
  4244. $core.method({
  4245. selector: "value:",
  4246. protocol: 'accessing',
  4247. fn: function (aStringifiableObject){
  4248. var self=this;
  4249. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  4250. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4251. return $core.withContext(function($ctx1) {
  4252. //>>excludeEnd("ctx");
  4253. var $1;
  4254. $1=$recv($recv($Smalltalk())._settings())._at_put_(self._key(),aStringifiableObject);
  4255. return $1;
  4256. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4257. }, function($ctx1) {$ctx1.fill(self,"value:",{aStringifiableObject:aStringifiableObject},$globals.Setting)});
  4258. //>>excludeEnd("ctx");
  4259. },
  4260. //>>excludeStart("ide", pragmas.excludeIdeData);
  4261. args: ["aStringifiableObject"],
  4262. source: "value: aStringifiableObject\x0a\x09^ Smalltalk settings at: self key put: aStringifiableObject",
  4263. referencedClasses: ["Smalltalk"],
  4264. //>>excludeEnd("ide");
  4265. messageSends: ["at:put:", "settings", "key"]
  4266. }),
  4267. $globals.Setting);
  4268. $core.addMethod(
  4269. $core.method({
  4270. selector: "at:ifAbsent:",
  4271. protocol: 'instance creation',
  4272. fn: function (aString,aDefaultValue){
  4273. var self=this;
  4274. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4275. return $core.withContext(function($ctx1) {
  4276. //>>excludeEnd("ctx");
  4277. var $2,$3,$1;
  4278. $2=(
  4279. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4280. $ctx1.supercall = true,
  4281. //>>excludeEnd("ctx");
  4282. $globals.Setting.klass.superclass.fn.prototype._new.apply($recv(self), []));
  4283. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4284. $ctx1.supercall = false;
  4285. //>>excludeEnd("ctx");;
  4286. $recv($2)._key_(aString);
  4287. $recv($2)._defaultValue_(aDefaultValue);
  4288. $3=$recv($2)._yourself();
  4289. $1=$3;
  4290. return $1;
  4291. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4292. }, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{aString:aString,aDefaultValue:aDefaultValue},$globals.Setting.klass)});
  4293. //>>excludeEnd("ctx");
  4294. },
  4295. //>>excludeStart("ide", pragmas.excludeIdeData);
  4296. args: ["aString", "aDefaultValue"],
  4297. source: "at: aString ifAbsent: aDefaultValue\x0a\x09\x0a\x09^ super new\x0a\x09\x09key: aString;\x0a\x09\x09defaultValue: aDefaultValue;\x0a\x09\x09yourself",
  4298. referencedClasses: [],
  4299. //>>excludeEnd("ide");
  4300. messageSends: ["key:", "new", "defaultValue:", "yourself"]
  4301. }),
  4302. $globals.Setting.klass);
  4303. $core.addMethod(
  4304. $core.method({
  4305. selector: "new",
  4306. protocol: 'instance creation',
  4307. fn: function (){
  4308. var self=this;
  4309. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4310. return $core.withContext(function($ctx1) {
  4311. //>>excludeEnd("ctx");
  4312. self._shouldNotImplement();
  4313. return self;
  4314. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4315. }, function($ctx1) {$ctx1.fill(self,"new",{},$globals.Setting.klass)});
  4316. //>>excludeEnd("ctx");
  4317. },
  4318. //>>excludeStart("ide", pragmas.excludeIdeData);
  4319. args: [],
  4320. source: "new\x0a\x09self shouldNotImplement",
  4321. referencedClasses: [],
  4322. //>>excludeEnd("ide");
  4323. messageSends: ["shouldNotImplement"]
  4324. }),
  4325. $globals.Setting.klass);
  4326. $core.addClass('SmalltalkImage', $globals.Object, [], 'Kernel-Infrastructure');
  4327. //>>excludeStart("ide", pragmas.excludeIdeData);
  4328. $globals.SmalltalkImage.comment="I represent the Smalltalk system, wrapping\x0aoperations of variable `$core` declared in `support/boot.js`.\x0a\x0a## API\x0a\x0aI have only one instance, accessed with global variable `Smalltalk`.\x0a\x0a## Classes\x0a\x0aClasses can be accessed using the following methods:\x0a\x0a- `#classes` answers the full list of Smalltalk classes in the system\x0a- `#globals #at:` answers a specific global (usually, a class) or `nil`\x0a\x0a## Packages\x0a\x0aPackages can be accessed using the following methods:\x0a\x0a- `#packages` answers the full list of packages\x0a- `#packageAt:` answers a specific package or `nil`\x0a\x0a## Parsing\x0a\x0aThe `#parse:` method is used to parse Amber source code.\x0aIt requires the `Compiler` package and the `support/parser.js` parser file in order to work.";
  4329. //>>excludeEnd("ide");
  4330. $core.addMethod(
  4331. $core.method({
  4332. selector: "addGlobalJsVariable:",
  4333. protocol: 'globals',
  4334. fn: function (aString){
  4335. var self=this;
  4336. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4337. return $core.withContext(function($ctx1) {
  4338. //>>excludeEnd("ctx");
  4339. $recv(self._globalJsVariables())._add_(aString);
  4340. return self;
  4341. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4342. }, function($ctx1) {$ctx1.fill(self,"addGlobalJsVariable:",{aString:aString},$globals.SmalltalkImage)});
  4343. //>>excludeEnd("ctx");
  4344. },
  4345. //>>excludeStart("ide", pragmas.excludeIdeData);
  4346. args: ["aString"],
  4347. source: "addGlobalJsVariable: aString\x0a\x09self globalJsVariables add: aString",
  4348. referencedClasses: [],
  4349. //>>excludeEnd("ide");
  4350. messageSends: ["add:", "globalJsVariables"]
  4351. }),
  4352. $globals.SmalltalkImage);
  4353. $core.addMethod(
  4354. $core.method({
  4355. selector: "amdRequire",
  4356. protocol: 'accessing amd',
  4357. fn: function (){
  4358. var self=this;
  4359. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4360. return $core.withContext(function($ctx1) {
  4361. //>>excludeEnd("ctx");
  4362. var $1;
  4363. $1=$recv(self._core())._at_("amdRequire");
  4364. return $1;
  4365. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4366. }, function($ctx1) {$ctx1.fill(self,"amdRequire",{},$globals.SmalltalkImage)});
  4367. //>>excludeEnd("ctx");
  4368. },
  4369. //>>excludeStart("ide", pragmas.excludeIdeData);
  4370. args: [],
  4371. source: "amdRequire\x0a\x09^ self core at: 'amdRequire'",
  4372. referencedClasses: [],
  4373. //>>excludeEnd("ide");
  4374. messageSends: ["at:", "core"]
  4375. }),
  4376. $globals.SmalltalkImage);
  4377. $core.addMethod(
  4378. $core.method({
  4379. selector: "asSmalltalkException:",
  4380. protocol: 'error handling',
  4381. fn: function (anObject){
  4382. var self=this;
  4383. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  4384. function $JavaScriptException(){return $globals.JavaScriptException||(typeof JavaScriptException=="undefined"?nil:JavaScriptException)}
  4385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4386. return $core.withContext(function($ctx1) {
  4387. //>>excludeEnd("ctx");
  4388. var $2,$1;
  4389. $2=$recv(self._isSmalltalkObject_(anObject))._and_((function(){
  4390. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4391. return $core.withContext(function($ctx2) {
  4392. //>>excludeEnd("ctx");
  4393. return $recv(anObject)._isKindOf_($Error());
  4394. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4395. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  4396. //>>excludeEnd("ctx");
  4397. }));
  4398. if($core.assert($2)){
  4399. $1=anObject;
  4400. } else {
  4401. $1=$recv($JavaScriptException())._on_(anObject);
  4402. };
  4403. return $1;
  4404. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4405. }, function($ctx1) {$ctx1.fill(self,"asSmalltalkException:",{anObject:anObject},$globals.SmalltalkImage)});
  4406. //>>excludeEnd("ctx");
  4407. },
  4408. //>>excludeStart("ide", pragmas.excludeIdeData);
  4409. args: ["anObject"],
  4410. source: "asSmalltalkException: anObject\x0a\x09\x22A JavaScript exception may be thrown.\x0a\x09We then need to convert it back to a Smalltalk object\x22\x0a\x09\x0a\x09^ ((self isSmalltalkObject: anObject) and: [ anObject isKindOf: Error ])\x0a\x09\x09ifTrue: [ anObject ]\x0a\x09\x09ifFalse: [ JavaScriptException on: anObject ]",
  4411. referencedClasses: ["Error", "JavaScriptException"],
  4412. //>>excludeEnd("ide");
  4413. messageSends: ["ifTrue:ifFalse:", "and:", "isSmalltalkObject:", "isKindOf:", "on:"]
  4414. }),
  4415. $globals.SmalltalkImage);
  4416. $core.addMethod(
  4417. $core.method({
  4418. selector: "basicCreatePackage:",
  4419. protocol: 'private',
  4420. fn: function (packageName){
  4421. var self=this;
  4422. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4423. return $core.withContext(function($ctx1) {
  4424. //>>excludeEnd("ctx");
  4425. return $core.addPackage(packageName);
  4426. return self;
  4427. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4428. }, function($ctx1) {$ctx1.fill(self,"basicCreatePackage:",{packageName:packageName},$globals.SmalltalkImage)});
  4429. //>>excludeEnd("ctx");
  4430. },
  4431. //>>excludeStart("ide", pragmas.excludeIdeData);
  4432. args: ["packageName"],
  4433. source: "basicCreatePackage: packageName\x0a\x09\x22Create and bind a new bare package with given name and return it.\x22\x0a\x09<return $core.addPackage(packageName)>",
  4434. referencedClasses: [],
  4435. //>>excludeEnd("ide");
  4436. messageSends: []
  4437. }),
  4438. $globals.SmalltalkImage);
  4439. $core.addMethod(
  4440. $core.method({
  4441. selector: "basicParse:",
  4442. protocol: 'private',
  4443. fn: function (aString){
  4444. var self=this;
  4445. function $SmalltalkParser(){return $globals.SmalltalkParser||(typeof SmalltalkParser=="undefined"?nil:SmalltalkParser)}
  4446. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4447. return $core.withContext(function($ctx1) {
  4448. //>>excludeEnd("ctx");
  4449. var $1;
  4450. $1=$recv($SmalltalkParser())._parse_(aString);
  4451. return $1;
  4452. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4453. }, function($ctx1) {$ctx1.fill(self,"basicParse:",{aString:aString},$globals.SmalltalkImage)});
  4454. //>>excludeEnd("ctx");
  4455. },
  4456. //>>excludeStart("ide", pragmas.excludeIdeData);
  4457. args: ["aString"],
  4458. source: "basicParse: aString\x0a\x09^ SmalltalkParser parse: aString",
  4459. referencedClasses: ["SmalltalkParser"],
  4460. //>>excludeEnd("ide");
  4461. messageSends: ["parse:"]
  4462. }),
  4463. $globals.SmalltalkImage);
  4464. $core.addMethod(
  4465. $core.method({
  4466. selector: "basicRegisterPackage:",
  4467. protocol: 'private',
  4468. fn: function (aPackage){
  4469. var self=this;
  4470. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4471. return $core.withContext(function($ctx1) {
  4472. //>>excludeEnd("ctx");
  4473. $core.packages[aPackage.pkgName]=aPackage;
  4474. return self;
  4475. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4476. }, function($ctx1) {$ctx1.fill(self,"basicRegisterPackage:",{aPackage:aPackage},$globals.SmalltalkImage)});
  4477. //>>excludeEnd("ctx");
  4478. },
  4479. //>>excludeStart("ide", pragmas.excludeIdeData);
  4480. args: ["aPackage"],
  4481. source: "basicRegisterPackage: aPackage\x0a\x09\x22Put aPackage in $core.packages object.\x22\x0a\x09<$core.packages[aPackage.pkgName]=aPackage>",
  4482. referencedClasses: [],
  4483. //>>excludeEnd("ide");
  4484. messageSends: []
  4485. }),
  4486. $globals.SmalltalkImage);
  4487. $core.addMethod(
  4488. $core.method({
  4489. selector: "cancelOptOut:",
  4490. protocol: 'accessing',
  4491. fn: function (anObject){
  4492. var self=this;
  4493. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4494. return $core.withContext(function($ctx1) {
  4495. //>>excludeEnd("ctx");
  4496. delete anObject.klass;
  4497. return self;
  4498. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4499. }, function($ctx1) {$ctx1.fill(self,"cancelOptOut:",{anObject:anObject},$globals.SmalltalkImage)});
  4500. //>>excludeEnd("ctx");
  4501. },
  4502. //>>excludeStart("ide", pragmas.excludeIdeData);
  4503. args: ["anObject"],
  4504. source: "cancelOptOut: anObject\x0a\x09\x22A Smalltalk object has a 'klass' property.\x0a\x09If this property is shadowed for anObject by optOut:,\x0a\x09the object is treated as plain JS object.\x0a\x09This removes the shadow and anObject is Smalltalk object\x0a\x09again if it was before.\x22\x0a\x09\x0a\x09<delete anObject.klass>",
  4505. referencedClasses: [],
  4506. //>>excludeEnd("ide");
  4507. messageSends: []
  4508. }),
  4509. $globals.SmalltalkImage);
  4510. $core.addMethod(
  4511. $core.method({
  4512. selector: "classes",
  4513. protocol: 'classes',
  4514. fn: function (){
  4515. var self=this;
  4516. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4517. return $core.withContext(function($ctx1) {
  4518. //>>excludeEnd("ctx");
  4519. return $core.classes();
  4520. return self;
  4521. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4522. }, function($ctx1) {$ctx1.fill(self,"classes",{},$globals.SmalltalkImage)});
  4523. //>>excludeEnd("ctx");
  4524. },
  4525. //>>excludeStart("ide", pragmas.excludeIdeData);
  4526. args: [],
  4527. source: "classes\x0a\x09<return $core.classes()>",
  4528. referencedClasses: [],
  4529. //>>excludeEnd("ide");
  4530. messageSends: []
  4531. }),
  4532. $globals.SmalltalkImage);
  4533. $core.addMethod(
  4534. $core.method({
  4535. selector: "core",
  4536. protocol: 'accessing',
  4537. fn: function (){
  4538. var self=this;
  4539. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4540. return $core.withContext(function($ctx1) {
  4541. //>>excludeEnd("ctx");
  4542. return $core;
  4543. return self;
  4544. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4545. }, function($ctx1) {$ctx1.fill(self,"core",{},$globals.SmalltalkImage)});
  4546. //>>excludeEnd("ctx");
  4547. },
  4548. //>>excludeStart("ide", pragmas.excludeIdeData);
  4549. args: [],
  4550. source: "core\x0a\x09<return $core>",
  4551. referencedClasses: [],
  4552. //>>excludeEnd("ide");
  4553. messageSends: []
  4554. }),
  4555. $globals.SmalltalkImage);
  4556. $core.addMethod(
  4557. $core.method({
  4558. selector: "createPackage:",
  4559. protocol: 'packages',
  4560. fn: function (packageName){
  4561. var self=this;
  4562. var package_,announcement;
  4563. function $PackageAdded(){return $globals.PackageAdded||(typeof PackageAdded=="undefined"?nil:PackageAdded)}
  4564. function $SystemAnnouncer(){return $globals.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  4565. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4566. return $core.withContext(function($ctx1) {
  4567. //>>excludeEnd("ctx");
  4568. var $1,$2,$3;
  4569. package_=self._basicCreatePackage_(packageName);
  4570. $1=$recv($PackageAdded())._new();
  4571. $recv($1)._package_(package_);
  4572. $2=$recv($1)._yourself();
  4573. announcement=$2;
  4574. $recv($recv($SystemAnnouncer())._current())._announce_(announcement);
  4575. $3=package_;
  4576. return $3;
  4577. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4578. }, function($ctx1) {$ctx1.fill(self,"createPackage:",{packageName:packageName,package_:package_,announcement:announcement},$globals.SmalltalkImage)});
  4579. //>>excludeEnd("ctx");
  4580. },
  4581. //>>excludeStart("ide", pragmas.excludeIdeData);
  4582. args: ["packageName"],
  4583. source: "createPackage: packageName\x0a\x09| package announcement |\x0a\x09\x0a\x09package := self basicCreatePackage: packageName.\x0a\x09\x0a\x09announcement := PackageAdded new\x0a\x09\x09package: package;\x0a\x09\x09yourself.\x0a\x09\x09\x0a\x09SystemAnnouncer current announce: announcement.\x0a\x09\x0a\x09^ package",
  4584. referencedClasses: ["PackageAdded", "SystemAnnouncer"],
  4585. //>>excludeEnd("ide");
  4586. messageSends: ["basicCreatePackage:", "package:", "new", "yourself", "announce:", "current"]
  4587. }),
  4588. $globals.SmalltalkImage);
  4589. $core.addMethod(
  4590. $core.method({
  4591. selector: "defaultAmdNamespace",
  4592. protocol: 'accessing amd',
  4593. fn: function (){
  4594. var self=this;
  4595. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4596. return $core.withContext(function($ctx1) {
  4597. //>>excludeEnd("ctx");
  4598. var $1;
  4599. $1="transport.defaultAmdNamespace"._settingValue();
  4600. return $1;
  4601. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4602. }, function($ctx1) {$ctx1.fill(self,"defaultAmdNamespace",{},$globals.SmalltalkImage)});
  4603. //>>excludeEnd("ctx");
  4604. },
  4605. //>>excludeStart("ide", pragmas.excludeIdeData);
  4606. args: [],
  4607. source: "defaultAmdNamespace\x0a\x09^ 'transport.defaultAmdNamespace' settingValue",
  4608. referencedClasses: [],
  4609. //>>excludeEnd("ide");
  4610. messageSends: ["settingValue"]
  4611. }),
  4612. $globals.SmalltalkImage);
  4613. $core.addMethod(
  4614. $core.method({
  4615. selector: "defaultAmdNamespace:",
  4616. protocol: 'accessing amd',
  4617. fn: function (aString){
  4618. var self=this;
  4619. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4620. return $core.withContext(function($ctx1) {
  4621. //>>excludeEnd("ctx");
  4622. "transport.defaultAmdNamespace"._settingValue_(aString);
  4623. return self;
  4624. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4625. }, function($ctx1) {$ctx1.fill(self,"defaultAmdNamespace:",{aString:aString},$globals.SmalltalkImage)});
  4626. //>>excludeEnd("ctx");
  4627. },
  4628. //>>excludeStart("ide", pragmas.excludeIdeData);
  4629. args: ["aString"],
  4630. source: "defaultAmdNamespace: aString\x0a\x09'transport.defaultAmdNamespace' settingValue: aString",
  4631. referencedClasses: [],
  4632. //>>excludeEnd("ide");
  4633. messageSends: ["settingValue:"]
  4634. }),
  4635. $globals.SmalltalkImage);
  4636. $core.addMethod(
  4637. $core.method({
  4638. selector: "deleteClass:",
  4639. protocol: 'private',
  4640. fn: function (aClass){
  4641. var self=this;
  4642. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4643. return $core.withContext(function($ctx1) {
  4644. //>>excludeEnd("ctx");
  4645. $core.removeClass(aClass);
  4646. return self;
  4647. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4648. }, function($ctx1) {$ctx1.fill(self,"deleteClass:",{aClass:aClass},$globals.SmalltalkImage)});
  4649. //>>excludeEnd("ctx");
  4650. },
  4651. //>>excludeStart("ide", pragmas.excludeIdeData);
  4652. args: ["aClass"],
  4653. source: "deleteClass: aClass\x0a\x09\x22Deletes a class by deleting its binding only. Use #removeClass instead\x22\x0a\x09\x0a\x09<$core.removeClass(aClass)>",
  4654. referencedClasses: [],
  4655. //>>excludeEnd("ide");
  4656. messageSends: []
  4657. }),
  4658. $globals.SmalltalkImage);
  4659. $core.addMethod(
  4660. $core.method({
  4661. selector: "deleteGlobalJsVariable:",
  4662. protocol: 'globals',
  4663. fn: function (aString){
  4664. var self=this;
  4665. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4666. return $core.withContext(function($ctx1) {
  4667. //>>excludeEnd("ctx");
  4668. $recv(self._globalJsVariables())._remove_ifAbsent_(aString,(function(){
  4669. }));
  4670. return self;
  4671. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4672. }, function($ctx1) {$ctx1.fill(self,"deleteGlobalJsVariable:",{aString:aString},$globals.SmalltalkImage)});
  4673. //>>excludeEnd("ctx");
  4674. },
  4675. //>>excludeStart("ide", pragmas.excludeIdeData);
  4676. args: ["aString"],
  4677. source: "deleteGlobalJsVariable: aString\x0a\x09self globalJsVariables remove: aString ifAbsent:[]",
  4678. referencedClasses: [],
  4679. //>>excludeEnd("ide");
  4680. messageSends: ["remove:ifAbsent:", "globalJsVariables"]
  4681. }),
  4682. $globals.SmalltalkImage);
  4683. $core.addMethod(
  4684. $core.method({
  4685. selector: "deletePackage:",
  4686. protocol: 'private',
  4687. fn: function (packageName){
  4688. var self=this;
  4689. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4690. return $core.withContext(function($ctx1) {
  4691. //>>excludeEnd("ctx");
  4692. delete $core.packages[packageName];
  4693. return self;
  4694. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4695. }, function($ctx1) {$ctx1.fill(self,"deletePackage:",{packageName:packageName},$globals.SmalltalkImage)});
  4696. //>>excludeEnd("ctx");
  4697. },
  4698. //>>excludeStart("ide", pragmas.excludeIdeData);
  4699. args: ["packageName"],
  4700. source: "deletePackage: packageName\x0a\x09\x22Deletes a package by deleting its binding, but does not check if it contains classes etc.\x0a\x09To remove a package, use #removePackage instead.\x22\x0a\x0a\x09<delete $core.packages[packageName]>",
  4701. referencedClasses: [],
  4702. //>>excludeEnd("ide");
  4703. messageSends: []
  4704. }),
  4705. $globals.SmalltalkImage);
  4706. $core.addMethod(
  4707. $core.method({
  4708. selector: "globalJsVariables",
  4709. protocol: 'globals',
  4710. fn: function (){
  4711. var self=this;
  4712. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4713. return $core.withContext(function($ctx1) {
  4714. //>>excludeEnd("ctx");
  4715. return $core.globalJsVariables;
  4716. return self;
  4717. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4718. }, function($ctx1) {$ctx1.fill(self,"globalJsVariables",{},$globals.SmalltalkImage)});
  4719. //>>excludeEnd("ctx");
  4720. },
  4721. //>>excludeStart("ide", pragmas.excludeIdeData);
  4722. args: [],
  4723. source: "globalJsVariables\x0a\x09\x22Array of global JavaScript variables\x22\x0a\x09<return $core.globalJsVariables>",
  4724. referencedClasses: [],
  4725. //>>excludeEnd("ide");
  4726. messageSends: []
  4727. }),
  4728. $globals.SmalltalkImage);
  4729. $core.addMethod(
  4730. $core.method({
  4731. selector: "globals",
  4732. protocol: 'accessing',
  4733. fn: function (){
  4734. var self=this;
  4735. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4736. return $core.withContext(function($ctx1) {
  4737. //>>excludeEnd("ctx");
  4738. return $globals;
  4739. return self;
  4740. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4741. }, function($ctx1) {$ctx1.fill(self,"globals",{},$globals.SmalltalkImage)});
  4742. //>>excludeEnd("ctx");
  4743. },
  4744. //>>excludeStart("ide", pragmas.excludeIdeData);
  4745. args: [],
  4746. source: "globals\x0a\x09<return $globals>",
  4747. referencedClasses: [],
  4748. //>>excludeEnd("ide");
  4749. messageSends: []
  4750. }),
  4751. $globals.SmalltalkImage);
  4752. $core.addMethod(
  4753. $core.method({
  4754. selector: "includesKey:",
  4755. protocol: 'accessing',
  4756. fn: function (aKey){
  4757. var self=this;
  4758. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4759. return $core.withContext(function($ctx1) {
  4760. //>>excludeEnd("ctx");
  4761. return $core.hasOwnProperty(aKey);
  4762. return self;
  4763. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4764. }, function($ctx1) {$ctx1.fill(self,"includesKey:",{aKey:aKey},$globals.SmalltalkImage)});
  4765. //>>excludeEnd("ctx");
  4766. },
  4767. //>>excludeStart("ide", pragmas.excludeIdeData);
  4768. args: ["aKey"],
  4769. source: "includesKey: aKey\x0a\x09<return $core.hasOwnProperty(aKey)>",
  4770. referencedClasses: [],
  4771. //>>excludeEnd("ide");
  4772. messageSends: []
  4773. }),
  4774. $globals.SmalltalkImage);
  4775. $core.addMethod(
  4776. $core.method({
  4777. selector: "isSmalltalkObject:",
  4778. protocol: 'testing',
  4779. fn: function (anObject){
  4780. var self=this;
  4781. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4782. return $core.withContext(function($ctx1) {
  4783. //>>excludeEnd("ctx");
  4784. return typeof anObject.klass !== 'undefined';
  4785. return self;
  4786. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4787. }, function($ctx1) {$ctx1.fill(self,"isSmalltalkObject:",{anObject:anObject},$globals.SmalltalkImage)});
  4788. //>>excludeEnd("ctx");
  4789. },
  4790. //>>excludeStart("ide", pragmas.excludeIdeData);
  4791. args: ["anObject"],
  4792. source: "isSmalltalkObject: anObject\x0a\x09\x22Consider anObject a Smalltalk object if it has a 'klass' property.\x0a\x09Note that this may be unaccurate\x22\x0a\x09\x0a\x09<return typeof anObject.klass !== 'undefined'>",
  4793. referencedClasses: [],
  4794. //>>excludeEnd("ide");
  4795. messageSends: []
  4796. }),
  4797. $globals.SmalltalkImage);
  4798. $core.addMethod(
  4799. $core.method({
  4800. selector: "optOut:",
  4801. protocol: 'accessing',
  4802. fn: function (anObject){
  4803. var self=this;
  4804. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4805. return $core.withContext(function($ctx1) {
  4806. //>>excludeEnd("ctx");
  4807. anObject.klass = null;
  4808. return self;
  4809. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4810. }, function($ctx1) {$ctx1.fill(self,"optOut:",{anObject:anObject},$globals.SmalltalkImage)});
  4811. //>>excludeEnd("ctx");
  4812. },
  4813. //>>excludeStart("ide", pragmas.excludeIdeData);
  4814. args: ["anObject"],
  4815. source: "optOut: anObject\x0a\x09\x22A Smalltalk object has a 'klass' property.\x0a\x09This shadows the property for anObject.\x0a\x09The object is treated as plain JS object following this.\x22\x0a\x09\x0a\x09<anObject.klass = null>",
  4816. referencedClasses: [],
  4817. //>>excludeEnd("ide");
  4818. messageSends: []
  4819. }),
  4820. $globals.SmalltalkImage);
  4821. $core.addMethod(
  4822. $core.method({
  4823. selector: "packageAt:",
  4824. protocol: 'packages',
  4825. fn: function (packageName){
  4826. var self=this;
  4827. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4828. return $core.withContext(function($ctx1) {
  4829. //>>excludeEnd("ctx");
  4830. return $core.packages[packageName];
  4831. return self;
  4832. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4833. }, function($ctx1) {$ctx1.fill(self,"packageAt:",{packageName:packageName},$globals.SmalltalkImage)});
  4834. //>>excludeEnd("ctx");
  4835. },
  4836. //>>excludeStart("ide", pragmas.excludeIdeData);
  4837. args: ["packageName"],
  4838. source: "packageAt: packageName\x0a\x09<return $core.packages[packageName]>",
  4839. referencedClasses: [],
  4840. //>>excludeEnd("ide");
  4841. messageSends: []
  4842. }),
  4843. $globals.SmalltalkImage);
  4844. $core.addMethod(
  4845. $core.method({
  4846. selector: "packageAt:ifAbsent:",
  4847. protocol: 'packages',
  4848. fn: function (packageName,aBlock){
  4849. var self=this;
  4850. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4851. return $core.withContext(function($ctx1) {
  4852. //>>excludeEnd("ctx");
  4853. var $2,$1;
  4854. $2=self._packageAt_(packageName);
  4855. $1=$recv($2)._ifNil_(aBlock);
  4856. return $1;
  4857. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4858. }, function($ctx1) {$ctx1.fill(self,"packageAt:ifAbsent:",{packageName:packageName,aBlock:aBlock},$globals.SmalltalkImage)});
  4859. //>>excludeEnd("ctx");
  4860. },
  4861. //>>excludeStart("ide", pragmas.excludeIdeData);
  4862. args: ["packageName", "aBlock"],
  4863. source: "packageAt: packageName ifAbsent: aBlock\x0a\x09^ (self packageAt: packageName) ifNil: aBlock",
  4864. referencedClasses: [],
  4865. //>>excludeEnd("ide");
  4866. messageSends: ["ifNil:", "packageAt:"]
  4867. }),
  4868. $globals.SmalltalkImage);
  4869. $core.addMethod(
  4870. $core.method({
  4871. selector: "packages",
  4872. protocol: 'packages',
  4873. fn: function (){
  4874. var self=this;
  4875. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4876. return $core.withContext(function($ctx1) {
  4877. //>>excludeEnd("ctx");
  4878. return Object.keys($core.packages).map(function(k) {
  4879. return $core.packages[k];
  4880. })
  4881. ;
  4882. return self;
  4883. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4884. }, function($ctx1) {$ctx1.fill(self,"packages",{},$globals.SmalltalkImage)});
  4885. //>>excludeEnd("ctx");
  4886. },
  4887. //>>excludeStart("ide", pragmas.excludeIdeData);
  4888. args: [],
  4889. source: "packages\x0a\x09\x22Return all Package instances in the system.\x22\x0a\x0a\x09<\x0a\x09\x09return Object.keys($core.packages).map(function(k) {\x0a\x09\x09\x09return $core.packages[k];\x0a\x09\x09})\x0a\x09>",
  4890. referencedClasses: [],
  4891. //>>excludeEnd("ide");
  4892. messageSends: []
  4893. }),
  4894. $globals.SmalltalkImage);
  4895. $core.addMethod(
  4896. $core.method({
  4897. selector: "parse:",
  4898. protocol: 'accessing',
  4899. fn: function (aString){
  4900. var self=this;
  4901. var result;
  4902. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4903. return $core.withContext(function($ctx1) {
  4904. //>>excludeEnd("ctx");
  4905. var $2,$3,$1;
  4906. $recv((function(){
  4907. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4908. return $core.withContext(function($ctx2) {
  4909. //>>excludeEnd("ctx");
  4910. result=self._basicParse_(aString);
  4911. return result;
  4912. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4913. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  4914. //>>excludeEnd("ctx");
  4915. }))._tryCatch_((function(ex){
  4916. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4917. return $core.withContext(function($ctx2) {
  4918. //>>excludeEnd("ctx");
  4919. return $recv(self._parseError_parsing_(ex,aString))._signal();
  4920. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4921. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1,2)});
  4922. //>>excludeEnd("ctx");
  4923. }));
  4924. $2=result;
  4925. $recv($2)._source_(aString);
  4926. $3=$recv($2)._yourself();
  4927. $1=$3;
  4928. return $1;
  4929. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4930. }, function($ctx1) {$ctx1.fill(self,"parse:",{aString:aString,result:result},$globals.SmalltalkImage)});
  4931. //>>excludeEnd("ctx");
  4932. },
  4933. //>>excludeStart("ide", pragmas.excludeIdeData);
  4934. args: ["aString"],
  4935. source: "parse: aString\x0a\x09| result |\x0a\x09\x0a\x09[ result := self basicParse: aString ] \x0a\x09\x09tryCatch: [ :ex | (self parseError: ex parsing: aString) signal ].\x0a\x09\x09\x0a\x09^ result\x0a\x09\x09source: aString;\x0a\x09\x09yourself",
  4936. referencedClasses: [],
  4937. //>>excludeEnd("ide");
  4938. messageSends: ["tryCatch:", "basicParse:", "signal", "parseError:parsing:", "source:", "yourself"]
  4939. }),
  4940. $globals.SmalltalkImage);
  4941. $core.addMethod(
  4942. $core.method({
  4943. selector: "parseError:parsing:",
  4944. protocol: 'error handling',
  4945. fn: function (anException,aString){
  4946. var self=this;
  4947. function $ParseError(){return $globals.ParseError||(typeof ParseError=="undefined"?nil:ParseError)}
  4948. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4949. return $core.withContext(function($ctx1) {
  4950. //>>excludeEnd("ctx");
  4951. var $2,$8,$7,$6,$9,$5,$4,$3,$1;
  4952. $2=$recv($ParseError())._new();
  4953. $8=$recv(anException)._basicAt_("line");
  4954. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4955. $ctx1.sendIdx["basicAt:"]=1;
  4956. //>>excludeEnd("ctx");
  4957. $7="Parse error on line ".__comma($8);
  4958. $6=$recv($7).__comma(" column ");
  4959. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4960. $ctx1.sendIdx[","]=4;
  4961. //>>excludeEnd("ctx");
  4962. $9=$recv(anException)._basicAt_("column");
  4963. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4964. $ctx1.sendIdx["basicAt:"]=2;
  4965. //>>excludeEnd("ctx");
  4966. $5=$recv($6).__comma($9);
  4967. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4968. $ctx1.sendIdx[","]=3;
  4969. //>>excludeEnd("ctx");
  4970. $4=$recv($5).__comma(" : Unexpected character ");
  4971. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4972. $ctx1.sendIdx[","]=2;
  4973. //>>excludeEnd("ctx");
  4974. $3=$recv($4).__comma($recv(anException)._basicAt_("found"));
  4975. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4976. $ctx1.sendIdx[","]=1;
  4977. //>>excludeEnd("ctx");
  4978. $1=$recv($2)._messageText_($3);
  4979. return $1;
  4980. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4981. }, function($ctx1) {$ctx1.fill(self,"parseError:parsing:",{anException:anException,aString:aString},$globals.SmalltalkImage)});
  4982. //>>excludeEnd("ctx");
  4983. },
  4984. //>>excludeStart("ide", pragmas.excludeIdeData);
  4985. args: ["anException", "aString"],
  4986. source: "parseError: anException parsing: aString\x0a\x09^ ParseError new messageText: 'Parse error on line ', (anException basicAt: 'line') ,' column ' , (anException basicAt: 'column') ,' : Unexpected character ', (anException basicAt: 'found')",
  4987. referencedClasses: ["ParseError"],
  4988. //>>excludeEnd("ide");
  4989. messageSends: ["messageText:", "new", ",", "basicAt:"]
  4990. }),
  4991. $globals.SmalltalkImage);
  4992. $core.addMethod(
  4993. $core.method({
  4994. selector: "pseudoVariableNames",
  4995. protocol: 'accessing',
  4996. fn: function (){
  4997. var self=this;
  4998. var $1;
  4999. $1=["self", "super", "nil", "true", "false", "thisContext"];
  5000. return $1;
  5001. },
  5002. //>>excludeStart("ide", pragmas.excludeIdeData);
  5003. args: [],
  5004. source: "pseudoVariableNames\x0a\x09^ #('self' 'super' 'nil' 'true' 'false' 'thisContext')",
  5005. referencedClasses: [],
  5006. //>>excludeEnd("ide");
  5007. messageSends: []
  5008. }),
  5009. $globals.SmalltalkImage);
  5010. $core.addMethod(
  5011. $core.method({
  5012. selector: "readJSObject:",
  5013. protocol: 'accessing',
  5014. fn: function (anObject){
  5015. var self=this;
  5016. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5017. return $core.withContext(function($ctx1) {
  5018. //>>excludeEnd("ctx");
  5019. return $core.readJSObject(anObject);
  5020. return self;
  5021. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5022. }, function($ctx1) {$ctx1.fill(self,"readJSObject:",{anObject:anObject},$globals.SmalltalkImage)});
  5023. //>>excludeEnd("ctx");
  5024. },
  5025. //>>excludeStart("ide", pragmas.excludeIdeData);
  5026. args: ["anObject"],
  5027. source: "readJSObject: anObject\x0a\x09<return $core.readJSObject(anObject)>",
  5028. referencedClasses: [],
  5029. //>>excludeEnd("ide");
  5030. messageSends: []
  5031. }),
  5032. $globals.SmalltalkImage);
  5033. $core.addMethod(
  5034. $core.method({
  5035. selector: "removeClass:",
  5036. protocol: 'classes',
  5037. fn: function (aClass){
  5038. var self=this;
  5039. function $SystemAnnouncer(){return $globals.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  5040. function $ClassRemoved(){return $globals.ClassRemoved||(typeof ClassRemoved=="undefined"?nil:ClassRemoved)}
  5041. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5042. return $core.withContext(function($ctx1) {
  5043. //>>excludeEnd("ctx");
  5044. var $1,$2,$3;
  5045. $1=$recv(aClass)._isMetaclass();
  5046. if($core.assert($1)){
  5047. self._error_($recv($recv(aClass)._asString()).__comma(" is a Metaclass and cannot be removed!"));
  5048. };
  5049. self._deleteClass_(aClass);
  5050. $2=$recv($ClassRemoved())._new();
  5051. $recv($2)._theClass_(aClass);
  5052. $3=$recv($2)._yourself();
  5053. $recv($recv($SystemAnnouncer())._current())._announce_($3);
  5054. return self;
  5055. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5056. }, function($ctx1) {$ctx1.fill(self,"removeClass:",{aClass:aClass},$globals.SmalltalkImage)});
  5057. //>>excludeEnd("ctx");
  5058. },
  5059. //>>excludeStart("ide", pragmas.excludeIdeData);
  5060. args: ["aClass"],
  5061. source: "removeClass: aClass\x0a\x09aClass isMetaclass ifTrue: [ self error: aClass asString, ' is a Metaclass and cannot be removed!' ].\x0a\x09\x0a\x09self deleteClass: aClass.\x0a\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (ClassRemoved new\x0a\x09\x09\x09theClass: aClass;\x0a\x09\x09\x09yourself)",
  5062. referencedClasses: ["SystemAnnouncer", "ClassRemoved"],
  5063. //>>excludeEnd("ide");
  5064. messageSends: ["ifTrue:", "isMetaclass", "error:", ",", "asString", "deleteClass:", "announce:", "current", "theClass:", "new", "yourself"]
  5065. }),
  5066. $globals.SmalltalkImage);
  5067. $core.addMethod(
  5068. $core.method({
  5069. selector: "removePackage:",
  5070. protocol: 'packages',
  5071. fn: function (packageName){
  5072. var self=this;
  5073. var pkg;
  5074. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5075. return $core.withContext(function($ctx1) {
  5076. //>>excludeEnd("ctx");
  5077. pkg=self._packageAt_ifAbsent_(packageName,(function(){
  5078. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5079. return $core.withContext(function($ctx2) {
  5080. //>>excludeEnd("ctx");
  5081. return self._error_("Missing package: ".__comma(packageName));
  5082. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5083. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  5084. //>>excludeEnd("ctx");
  5085. }));
  5086. $recv($recv(pkg)._classes())._do_((function(each){
  5087. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5088. return $core.withContext(function($ctx2) {
  5089. //>>excludeEnd("ctx");
  5090. return self._removeClass_(each);
  5091. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5092. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  5093. //>>excludeEnd("ctx");
  5094. }));
  5095. self._deletePackage_(packageName);
  5096. return self;
  5097. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5098. }, function($ctx1) {$ctx1.fill(self,"removePackage:",{packageName:packageName,pkg:pkg},$globals.SmalltalkImage)});
  5099. //>>excludeEnd("ctx");
  5100. },
  5101. //>>excludeStart("ide", pragmas.excludeIdeData);
  5102. args: ["packageName"],
  5103. source: "removePackage: packageName\x0a\x09\x22Removes a package and all its classes.\x22\x0a\x0a\x09| pkg |\x0a\x09pkg := self packageAt: packageName ifAbsent: [ self error: 'Missing package: ', packageName ].\x0a\x09pkg classes do: [ :each |\x0a\x09\x09\x09self removeClass: each ].\x0a\x09self deletePackage: packageName",
  5104. referencedClasses: [],
  5105. //>>excludeEnd("ide");
  5106. messageSends: ["packageAt:ifAbsent:", "error:", ",", "do:", "classes", "removeClass:", "deletePackage:"]
  5107. }),
  5108. $globals.SmalltalkImage);
  5109. $core.addMethod(
  5110. $core.method({
  5111. selector: "renamePackage:to:",
  5112. protocol: 'packages',
  5113. fn: function (packageName,newName){
  5114. var self=this;
  5115. var pkg;
  5116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5117. return $core.withContext(function($ctx1) {
  5118. //>>excludeEnd("ctx");
  5119. var $1,$2,$receiver;
  5120. pkg=self._packageAt_ifAbsent_(packageName,(function(){
  5121. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5122. return $core.withContext(function($ctx2) {
  5123. //>>excludeEnd("ctx");
  5124. $1="Missing package: ".__comma(packageName);
  5125. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5126. $ctx2.sendIdx[","]=1;
  5127. //>>excludeEnd("ctx");
  5128. return self._error_($1);
  5129. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5130. $ctx2.sendIdx["error:"]=1;
  5131. //>>excludeEnd("ctx");
  5132. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5133. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  5134. //>>excludeEnd("ctx");
  5135. }));
  5136. $2=self._packageAt_(newName);
  5137. if(($receiver = $2) == null || $receiver.isNil){
  5138. $2;
  5139. } else {
  5140. self._error_("Already exists a package called: ".__comma(newName));
  5141. };
  5142. $recv(pkg)._name_(newName);
  5143. self._basicRegisterPackage_(pkg);
  5144. self._deletePackage_(packageName);
  5145. return self;
  5146. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5147. }, function($ctx1) {$ctx1.fill(self,"renamePackage:to:",{packageName:packageName,newName:newName,pkg:pkg},$globals.SmalltalkImage)});
  5148. //>>excludeEnd("ctx");
  5149. },
  5150. //>>excludeStart("ide", pragmas.excludeIdeData);
  5151. args: ["packageName", "newName"],
  5152. source: "renamePackage: packageName to: newName\x0a\x09\x22Rename a package.\x22\x0a\x0a\x09| pkg |\x0a\x09pkg := self packageAt: packageName ifAbsent: [ self error: 'Missing package: ', packageName ].\x0a\x09(self packageAt: newName) ifNotNil: [ self error: 'Already exists a package called: ', newName ].\x0a\x09pkg name: newName.\x0a\x09self basicRegisterPackage: pkg.\x0a\x09self deletePackage: packageName.",
  5153. referencedClasses: [],
  5154. //>>excludeEnd("ide");
  5155. messageSends: ["packageAt:ifAbsent:", "error:", ",", "ifNotNil:", "packageAt:", "name:", "basicRegisterPackage:", "deletePackage:"]
  5156. }),
  5157. $globals.SmalltalkImage);
  5158. $core.addMethod(
  5159. $core.method({
  5160. selector: "reservedWords",
  5161. protocol: 'accessing',
  5162. fn: function (){
  5163. var self=this;
  5164. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5165. return $core.withContext(function($ctx1) {
  5166. //>>excludeEnd("ctx");
  5167. return $core.reservedWords;
  5168. return self;
  5169. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5170. }, function($ctx1) {$ctx1.fill(self,"reservedWords",{},$globals.SmalltalkImage)});
  5171. //>>excludeEnd("ctx");
  5172. },
  5173. //>>excludeStart("ide", pragmas.excludeIdeData);
  5174. args: [],
  5175. source: "reservedWords\x0a\x09\x22JavaScript reserved words\x22\x0a\x09<return $core.reservedWords>",
  5176. referencedClasses: [],
  5177. //>>excludeEnd("ide");
  5178. messageSends: []
  5179. }),
  5180. $globals.SmalltalkImage);
  5181. $core.addMethod(
  5182. $core.method({
  5183. selector: "settings",
  5184. protocol: 'accessing',
  5185. fn: function (){
  5186. var self=this;
  5187. function $SmalltalkSettings(){return $globals.SmalltalkSettings||(typeof SmalltalkSettings=="undefined"?nil:SmalltalkSettings)}
  5188. return $SmalltalkSettings();
  5189. },
  5190. //>>excludeStart("ide", pragmas.excludeIdeData);
  5191. args: [],
  5192. source: "settings\x0a\x09^ SmalltalkSettings",
  5193. referencedClasses: ["SmalltalkSettings"],
  5194. //>>excludeEnd("ide");
  5195. messageSends: []
  5196. }),
  5197. $globals.SmalltalkImage);
  5198. $core.addMethod(
  5199. $core.method({
  5200. selector: "version",
  5201. protocol: 'accessing',
  5202. fn: function (){
  5203. var self=this;
  5204. return "0.15.0-pre";
  5205. },
  5206. //>>excludeStart("ide", pragmas.excludeIdeData);
  5207. args: [],
  5208. source: "version\x0a\x09\x22Answer the version string of Amber\x22\x0a\x09\x0a\x09^ '0.15.0-pre'",
  5209. referencedClasses: [],
  5210. //>>excludeEnd("ide");
  5211. messageSends: []
  5212. }),
  5213. $globals.SmalltalkImage);
  5214. $globals.SmalltalkImage.klass.iVarNames = ['current'];
  5215. $core.addMethod(
  5216. $core.method({
  5217. selector: "current",
  5218. protocol: 'instance creation',
  5219. fn: function (){
  5220. var self=this;
  5221. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5222. return $core.withContext(function($ctx1) {
  5223. //>>excludeEnd("ctx");
  5224. var $2,$1,$receiver;
  5225. $2=self["@current"];
  5226. if(($receiver = $2) == null || $receiver.isNil){
  5227. self["@current"]=(
  5228. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5229. $ctx1.supercall = true,
  5230. //>>excludeEnd("ctx");
  5231. $globals.SmalltalkImage.klass.superclass.fn.prototype._new.apply($recv(self), []));
  5232. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5233. $ctx1.supercall = false;
  5234. //>>excludeEnd("ctx");;
  5235. $1=self["@current"];
  5236. } else {
  5237. self._deprecatedAPI();
  5238. $1=self["@current"];
  5239. };
  5240. return $1;
  5241. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5242. }, function($ctx1) {$ctx1.fill(self,"current",{},$globals.SmalltalkImage.klass)});
  5243. //>>excludeEnd("ctx");
  5244. },
  5245. //>>excludeStart("ide", pragmas.excludeIdeData);
  5246. args: [],
  5247. source: "current\x0a\x09^ current ifNil: [ current := super new ] ifNotNil: [ self deprecatedAPI. current ]",
  5248. referencedClasses: [],
  5249. //>>excludeEnd("ide");
  5250. messageSends: ["ifNil:ifNotNil:", "new", "deprecatedAPI"]
  5251. }),
  5252. $globals.SmalltalkImage.klass);
  5253. $core.addMethod(
  5254. $core.method({
  5255. selector: "initialize",
  5256. protocol: 'initialization',
  5257. fn: function (){
  5258. var self=this;
  5259. var st;
  5260. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5261. return $core.withContext(function($ctx1) {
  5262. //>>excludeEnd("ctx");
  5263. st=self._current();
  5264. $recv($recv(st)._globals())._at_put_("Smalltalk",st);
  5265. return self;
  5266. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5267. }, function($ctx1) {$ctx1.fill(self,"initialize",{st:st},$globals.SmalltalkImage.klass)});
  5268. //>>excludeEnd("ctx");
  5269. },
  5270. //>>excludeStart("ide", pragmas.excludeIdeData);
  5271. args: [],
  5272. source: "initialize\x0a\x09| st |\x0a\x09st := self current.\x0a\x09st globals at: 'Smalltalk' put: st",
  5273. referencedClasses: [],
  5274. //>>excludeEnd("ide");
  5275. messageSends: ["current", "at:put:", "globals"]
  5276. }),
  5277. $globals.SmalltalkImage.klass);
  5278. $core.addMethod(
  5279. $core.method({
  5280. selector: "new",
  5281. protocol: 'instance creation',
  5282. fn: function (){
  5283. var self=this;
  5284. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5285. return $core.withContext(function($ctx1) {
  5286. //>>excludeEnd("ctx");
  5287. self._shouldNotImplement();
  5288. return self;
  5289. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5290. }, function($ctx1) {$ctx1.fill(self,"new",{},$globals.SmalltalkImage.klass)});
  5291. //>>excludeEnd("ctx");
  5292. },
  5293. //>>excludeStart("ide", pragmas.excludeIdeData);
  5294. args: [],
  5295. source: "new\x0a\x09self shouldNotImplement",
  5296. referencedClasses: [],
  5297. //>>excludeEnd("ide");
  5298. messageSends: ["shouldNotImplement"]
  5299. }),
  5300. $globals.SmalltalkImage.klass);
  5301. $core.addMethod(
  5302. $core.method({
  5303. selector: "importsString",
  5304. protocol: '*Kernel-Infrastructure',
  5305. fn: function (){
  5306. var self=this;
  5307. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5308. return $core.withContext(function($ctx1) {
  5309. //>>excludeEnd("ctx");
  5310. var $3,$2,$1;
  5311. $3=$recv(self._key())._importsString();
  5312. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5313. $ctx1.sendIdx["importsString"]=1;
  5314. //>>excludeEnd("ctx");
  5315. $2=$recv($3).__comma(" -> ");
  5316. $1=$recv($2).__comma($recv(self._value())._importsString());
  5317. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5318. $ctx1.sendIdx[","]=1;
  5319. //>>excludeEnd("ctx");
  5320. return $1;
  5321. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5322. }, function($ctx1) {$ctx1.fill(self,"importsString",{},$globals.Association)});
  5323. //>>excludeEnd("ctx");
  5324. },
  5325. //>>excludeStart("ide", pragmas.excludeIdeData);
  5326. args: [],
  5327. source: "importsString\x0a\x09\x22This is for use by package exporter.\x0a\x09It can fail for non-string keys and values.\x22\x0a\x0a\x09^ self key importsString, ' -> ', self value importsString",
  5328. referencedClasses: [],
  5329. //>>excludeEnd("ide");
  5330. messageSends: [",", "importsString", "key", "value"]
  5331. }),
  5332. $globals.Association);
  5333. $core.addMethod(
  5334. $core.method({
  5335. selector: "do:displayingProgress:",
  5336. protocol: '*Kernel-Infrastructure',
  5337. fn: function (aBlock,aString){
  5338. var self=this;
  5339. function $ProgressHandler(){return $globals.ProgressHandler||(typeof ProgressHandler=="undefined"?nil:ProgressHandler)}
  5340. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5341. return $core.withContext(function($ctx1) {
  5342. //>>excludeEnd("ctx");
  5343. $recv($ProgressHandler())._do_on_displaying_(aBlock,self,aString);
  5344. return self;
  5345. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5346. }, function($ctx1) {$ctx1.fill(self,"do:displayingProgress:",{aBlock:aBlock,aString:aString},$globals.SequenceableCollection)});
  5347. //>>excludeEnd("ctx");
  5348. },
  5349. //>>excludeStart("ide", pragmas.excludeIdeData);
  5350. args: ["aBlock", "aString"],
  5351. source: "do: aBlock displayingProgress: aString\x0a\x09ProgressHandler \x0a\x09\x09do: aBlock \x0a\x09\x09on: self \x0a\x09\x09displaying: aString",
  5352. referencedClasses: ["ProgressHandler"],
  5353. //>>excludeEnd("ide");
  5354. messageSends: ["do:on:displaying:"]
  5355. }),
  5356. $globals.SequenceableCollection);
  5357. $core.addMethod(
  5358. $core.method({
  5359. selector: "asJavaScriptPropertyName",
  5360. protocol: '*Kernel-Infrastructure',
  5361. fn: function (){
  5362. var self=this;
  5363. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5364. return $core.withContext(function($ctx1) {
  5365. //>>excludeEnd("ctx");
  5366. return $core.st2prop(self);
  5367. return self;
  5368. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5369. }, function($ctx1) {$ctx1.fill(self,"asJavaScriptPropertyName",{},$globals.String)});
  5370. //>>excludeEnd("ctx");
  5371. },
  5372. //>>excludeStart("ide", pragmas.excludeIdeData);
  5373. args: [],
  5374. source: "asJavaScriptPropertyName\x0a<return $core.st2prop(self)>",
  5375. referencedClasses: [],
  5376. //>>excludeEnd("ide");
  5377. messageSends: []
  5378. }),
  5379. $globals.String);
  5380. $core.addMethod(
  5381. $core.method({
  5382. selector: "asSetting",
  5383. protocol: '*Kernel-Infrastructure',
  5384. fn: function (){
  5385. var self=this;
  5386. function $Setting(){return $globals.Setting||(typeof Setting=="undefined"?nil:Setting)}
  5387. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5388. return $core.withContext(function($ctx1) {
  5389. //>>excludeEnd("ctx");
  5390. var $1;
  5391. $1=$recv($Setting())._at_ifAbsent_(self,nil);
  5392. return $1;
  5393. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5394. }, function($ctx1) {$ctx1.fill(self,"asSetting",{},$globals.String)});
  5395. //>>excludeEnd("ctx");
  5396. },
  5397. //>>excludeStart("ide", pragmas.excludeIdeData);
  5398. args: [],
  5399. source: "asSetting\x0a\x09\x22Answer aSetting dedicated to locally store a value using this string as key.\x0a\x09Nil will be the default value.\x22\x0a\x09^ Setting at: self ifAbsent: nil",
  5400. referencedClasses: ["Setting"],
  5401. //>>excludeEnd("ide");
  5402. messageSends: ["at:ifAbsent:"]
  5403. }),
  5404. $globals.String);
  5405. $core.addMethod(
  5406. $core.method({
  5407. selector: "asSettingIfAbsent:",
  5408. protocol: '*Kernel-Infrastructure',
  5409. fn: function (aDefaultValue){
  5410. var self=this;
  5411. function $Setting(){return $globals.Setting||(typeof Setting=="undefined"?nil:Setting)}
  5412. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5413. return $core.withContext(function($ctx1) {
  5414. //>>excludeEnd("ctx");
  5415. var $1;
  5416. $1=$recv($Setting())._at_ifAbsent_(self,aDefaultValue);
  5417. return $1;
  5418. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5419. }, function($ctx1) {$ctx1.fill(self,"asSettingIfAbsent:",{aDefaultValue:aDefaultValue},$globals.String)});
  5420. //>>excludeEnd("ctx");
  5421. },
  5422. //>>excludeStart("ide", pragmas.excludeIdeData);
  5423. args: ["aDefaultValue"],
  5424. source: "asSettingIfAbsent: aDefaultValue\x0a\x09\x22Answer aSetting dedicated to locally store a value using this string as key.\x0a\x09Make this setting to have aDefaultValue.\x22\x0a\x09^ Setting at: self ifAbsent: aDefaultValue",
  5425. referencedClasses: ["Setting"],
  5426. //>>excludeEnd("ide");
  5427. messageSends: ["at:ifAbsent:"]
  5428. }),
  5429. $globals.String);
  5430. $core.addMethod(
  5431. $core.method({
  5432. selector: "importsString",
  5433. protocol: '*Kernel-Infrastructure',
  5434. fn: function (){
  5435. var self=this;
  5436. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5437. return $core.withContext(function($ctx1) {
  5438. //>>excludeEnd("ctx");
  5439. var $1;
  5440. $1=$recv("'".__comma(self._replace_with_("'","''"))).__comma("'");
  5441. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5442. $ctx1.sendIdx[","]=1;
  5443. //>>excludeEnd("ctx");
  5444. return $1;
  5445. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5446. }, function($ctx1) {$ctx1.fill(self,"importsString",{},$globals.String)});
  5447. //>>excludeEnd("ctx");
  5448. },
  5449. //>>excludeStart("ide", pragmas.excludeIdeData);
  5450. args: [],
  5451. source: "importsString\x0a\x09\x22Answer receiver as Smalltalk expression\x22\x0a\x09^ '''', (self replace: '''' with: ''''''), ''''",
  5452. referencedClasses: [],
  5453. //>>excludeEnd("ide");
  5454. messageSends: [",", "replace:with:"]
  5455. }),
  5456. $globals.String);
  5457. $core.addMethod(
  5458. $core.method({
  5459. selector: "settingValue",
  5460. protocol: '*Kernel-Infrastructure',
  5461. fn: function (){
  5462. var self=this;
  5463. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5464. return $core.withContext(function($ctx1) {
  5465. //>>excludeEnd("ctx");
  5466. var $1;
  5467. $1=$recv(self._asSetting())._value();
  5468. return $1;
  5469. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5470. }, function($ctx1) {$ctx1.fill(self,"settingValue",{},$globals.String)});
  5471. //>>excludeEnd("ctx");
  5472. },
  5473. //>>excludeStart("ide", pragmas.excludeIdeData);
  5474. args: [],
  5475. source: "settingValue\x0a\x09^ self asSetting value",
  5476. referencedClasses: [],
  5477. //>>excludeEnd("ide");
  5478. messageSends: ["value", "asSetting"]
  5479. }),
  5480. $globals.String);
  5481. $core.addMethod(
  5482. $core.method({
  5483. selector: "settingValue:",
  5484. protocol: '*Kernel-Infrastructure',
  5485. fn: function (aValue){
  5486. var self=this;
  5487. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5488. return $core.withContext(function($ctx1) {
  5489. //>>excludeEnd("ctx");
  5490. var $1;
  5491. $1=$recv(self._asSetting())._value_(aValue);
  5492. return $1;
  5493. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5494. }, function($ctx1) {$ctx1.fill(self,"settingValue:",{aValue:aValue},$globals.String)});
  5495. //>>excludeEnd("ctx");
  5496. },
  5497. //>>excludeStart("ide", pragmas.excludeIdeData);
  5498. args: ["aValue"],
  5499. source: "settingValue: aValue\x0a\x09\x22Sets the value of the setting that will be locally stored using this string as key.\x0a\x09Note that aValue can be any object that can be stringifyed\x22\x0a\x09^ self asSetting value: aValue",
  5500. referencedClasses: [],
  5501. //>>excludeEnd("ide");
  5502. messageSends: ["value:", "asSetting"]
  5503. }),
  5504. $globals.String);
  5505. $core.addMethod(
  5506. $core.method({
  5507. selector: "settingValueIfAbsent:",
  5508. protocol: '*Kernel-Infrastructure',
  5509. fn: function (aDefaultValue){
  5510. var self=this;
  5511. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5512. return $core.withContext(function($ctx1) {
  5513. //>>excludeEnd("ctx");
  5514. var $1;
  5515. $1=$recv(self._asSettingIfAbsent_(aDefaultValue))._value();
  5516. return $1;
  5517. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5518. }, function($ctx1) {$ctx1.fill(self,"settingValueIfAbsent:",{aDefaultValue:aDefaultValue},$globals.String)});
  5519. //>>excludeEnd("ctx");
  5520. },
  5521. //>>excludeStart("ide", pragmas.excludeIdeData);
  5522. args: ["aDefaultValue"],
  5523. source: "settingValueIfAbsent: aDefaultValue\x0a\x09\x22Answer the value of the locally stored setting using this string as key.\x0a\x09Use aDefaultValue in case no setting is found\x22\x0a\x09^ (self asSettingIfAbsent: aDefaultValue) value",
  5524. referencedClasses: [],
  5525. //>>excludeEnd("ide");
  5526. messageSends: ["value", "asSettingIfAbsent:"]
  5527. }),
  5528. $globals.String);
  5529. });