Kernel-Infrastructure.js 186 KB

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