Kernel-Infrastructure.js 157 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398
  1. define(["amber/boot", "require", "amber/core/Kernel-Collections", "amber/core/Kernel-Exceptions", "amber/core/Kernel-Objects", "amber/core/Kernel-Promises"], function($boot,requirejs){"use strict";
  2. var $core=$boot.api,nil=$boot.nilAsValue,$nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;
  3. var $pkg = $core.addPackage("Kernel-Infrastructure");
  4. $pkg.innerEval = function (expr) { return eval(expr); };
  5. $pkg.imports = ["smalltalkParser=amber/parser"];
  6. //>>excludeStart("imports", pragmas.excludeImports);
  7. var smalltalkParser;
  8. $pkg.isReady = new Promise(function (resolve, reject) { requirejs(["amber/parser"], function ($1) {smalltalkParser=$1; resolve();}, reject); });
  9. //>>excludeEnd("imports");
  10. $pkg.transport = {"type":"amd","amdNamespace":"amber/core"};
  11. $core.addClass("AmberBootstrapInitialization", $globals.Object, [], "Kernel-Infrastructure");
  12. $core.addMethod(
  13. $core.method({
  14. selector: "organizeClasses",
  15. protocol: "organization",
  16. fn: function (){
  17. var self=this,$self=this;
  18. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  19. return $core.withContext(function($ctx1) {
  20. //>>excludeEnd("ctx");
  21. $recv($recv($globals.Smalltalk)._classes())._do_((function(each){
  22. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  23. return $core.withContext(function($ctx2) {
  24. //>>excludeEnd("ctx");
  25. return $recv(each)._enterOrganization();
  26. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  27. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  28. //>>excludeEnd("ctx");
  29. }));
  30. return self;
  31. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  32. }, function($ctx1) {$ctx1.fill(self,"organizeClasses",{},$globals.AmberBootstrapInitialization.a$cls)});
  33. //>>excludeEnd("ctx");
  34. },
  35. //>>excludeStart("ide", pragmas.excludeIdeData);
  36. args: [],
  37. source: "organizeClasses\x0a\x09Smalltalk classes do: [ :each | each enterOrganization ]",
  38. referencedClasses: ["Smalltalk"],
  39. //>>excludeEnd("ide");
  40. messageSends: ["do:", "classes", "enterOrganization"]
  41. }),
  42. $globals.AmberBootstrapInitialization.a$cls);
  43. $core.addMethod(
  44. $core.method({
  45. selector: "organizeMethods",
  46. protocol: "organization",
  47. fn: function (){
  48. var self=this,$self=this;
  49. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  50. return $core.withContext(function($ctx1) {
  51. //>>excludeEnd("ctx");
  52. $recv($recv($globals.Smalltalk)._classes())._do_((function(eachClass){
  53. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  54. return $core.withContext(function($ctx2) {
  55. //>>excludeEnd("ctx");
  56. return $recv($recv(eachClass)._definedMethods())._do_((function(eachMethod){
  57. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  58. return $core.withContext(function($ctx3) {
  59. //>>excludeEnd("ctx");
  60. return $recv($recv(eachMethod)._methodClass())._methodOrganizationEnter_andLeave_(eachMethod,nil);
  61. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  62. }, function($ctx3) {$ctx3.fillBlock({eachMethod:eachMethod},$ctx2,2)});
  63. //>>excludeEnd("ctx");
  64. }));
  65. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  66. }, function($ctx2) {$ctx2.fillBlock({eachClass:eachClass},$ctx1,1)});
  67. //>>excludeEnd("ctx");
  68. }));
  69. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  70. $ctx1.sendIdx["do:"]=1;
  71. //>>excludeEnd("ctx");
  72. return self;
  73. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  74. }, function($ctx1) {$ctx1.fill(self,"organizeMethods",{},$globals.AmberBootstrapInitialization.a$cls)});
  75. //>>excludeEnd("ctx");
  76. },
  77. //>>excludeStart("ide", pragmas.excludeIdeData);
  78. args: [],
  79. source: "organizeMethods\x0a\x09Smalltalk classes do: [ :eachClass |\x0a\x09\x09eachClass definedMethods do: [ :eachMethod |\x0a\x09\x09\x09eachMethod methodClass methodOrganizationEnter: eachMethod andLeave: nil ] ]",
  80. referencedClasses: ["Smalltalk"],
  81. //>>excludeEnd("ide");
  82. messageSends: ["do:", "classes", "definedMethods", "methodOrganizationEnter:andLeave:", "methodClass"]
  83. }),
  84. $globals.AmberBootstrapInitialization.a$cls);
  85. $core.addMethod(
  86. $core.method({
  87. selector: "run",
  88. protocol: "public api",
  89. fn: function (){
  90. var self=this,$self=this;
  91. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  92. return $core.withContext(function($ctx1) {
  93. //>>excludeEnd("ctx");
  94. $recv($globals.SmalltalkImage)._initialize();
  95. $self._organizeClasses();
  96. $self._organizeMethods();
  97. return $recv($recv($globals.Smalltalk)._postLoad())._then_((function(){
  98. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  99. return $core.withContext(function($ctx2) {
  100. //>>excludeEnd("ctx");
  101. return $recv($recv($globals.Smalltalk)._globals())._at_put_("SmalltalkParser",smalltalkParser);
  102. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  103. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  104. //>>excludeEnd("ctx");
  105. }));
  106. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  107. }, function($ctx1) {$ctx1.fill(self,"run",{},$globals.AmberBootstrapInitialization.a$cls)});
  108. //>>excludeEnd("ctx");
  109. },
  110. //>>excludeStart("ide", pragmas.excludeIdeData);
  111. args: [],
  112. source: "run\x0a\x09SmalltalkImage initialize.\x0a\x09self\x0a\x09\x09organizeClasses;\x0a\x09\x09organizeMethods.\x0a\x09^ Smalltalk postLoad\x0a\x09\x09\x22TODO remove, backward compat\x22\x0a\x09\x09then: [ Smalltalk globals at: #SmalltalkParser put: smalltalkParser ]",
  113. referencedClasses: ["SmalltalkImage", "Smalltalk"],
  114. //>>excludeEnd("ide");
  115. messageSends: ["initialize", "organizeClasses", "organizeMethods", "then:", "postLoad", "at:put:", "globals"]
  116. }),
  117. $globals.AmberBootstrapInitialization.a$cls);
  118. $core.addClass("JSObjectProxy", $globals.ProtoObject, ["jsObject"], "Kernel-Infrastructure");
  119. //>>excludeStart("ide", pragmas.excludeIdeData);
  120. $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`.";
  121. //>>excludeEnd("ide");
  122. $core.addMethod(
  123. $core.method({
  124. selector: "=",
  125. protocol: "comparing",
  126. fn: function (anObject){
  127. var self=this,$self=this;
  128. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  129. return $core.withContext(function($ctx1) {
  130. //>>excludeEnd("ctx");
  131. var $2,$1;
  132. $2=$recv(anObject)._class();
  133. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  134. $ctx1.sendIdx["class"]=1;
  135. //>>excludeEnd("ctx");
  136. $1=$recv($2).__eq_eq($self._class());
  137. if(!$core.assert($1)){
  138. return false;
  139. }
  140. return $recv($globals.JSObjectProxy)._compareJSObjectOfProxy_withProxy_(self,anObject);
  141. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  142. }, function($ctx1) {$ctx1.fill(self,"=",{anObject:anObject},$globals.JSObjectProxy)});
  143. //>>excludeEnd("ctx");
  144. },
  145. //>>excludeStart("ide", pragmas.excludeIdeData);
  146. args: ["anObject"],
  147. source: "= anObject\x0a\x09anObject class == self class ifFalse: [ ^ false ].\x0a\x09^ JSObjectProxy compareJSObjectOfProxy: self withProxy: anObject",
  148. referencedClasses: ["JSObjectProxy"],
  149. //>>excludeEnd("ide");
  150. messageSends: ["ifFalse:", "==", "class", "compareJSObjectOfProxy:withProxy:"]
  151. }),
  152. $globals.JSObjectProxy);
  153. $core.addMethod(
  154. $core.method({
  155. selector: "asJavaScriptObject",
  156. protocol: "converting",
  157. fn: function (){
  158. var self=this,$self=this;
  159. return $self.jsObject;
  160. },
  161. //>>excludeStart("ide", pragmas.excludeIdeData);
  162. args: [],
  163. source: "asJavaScriptObject\x0a\x09\x22Answers the receiver in a stringify-friendly fashion\x22\x0a\x0a\x09^ jsObject",
  164. referencedClasses: [],
  165. //>>excludeEnd("ide");
  166. messageSends: []
  167. }),
  168. $globals.JSObjectProxy);
  169. $core.addMethod(
  170. $core.method({
  171. selector: "at:",
  172. protocol: "accessing",
  173. fn: function (aString){
  174. var self=this,$self=this;
  175. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  176. return $core.withContext(function($ctx1) {
  177. //>>excludeEnd("ctx");
  178. return $self.jsObject[aString];
  179. return self;
  180. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  181. }, function($ctx1) {$ctx1.fill(self,"at:",{aString:aString},$globals.JSObjectProxy)});
  182. //>>excludeEnd("ctx");
  183. },
  184. //>>excludeStart("ide", pragmas.excludeIdeData);
  185. args: ["aString"],
  186. source: "at: aString\x0a\x09<inlineJS: 'return $self.jsObject[aString]'>",
  187. referencedClasses: [],
  188. //>>excludeEnd("ide");
  189. messageSends: []
  190. }),
  191. $globals.JSObjectProxy);
  192. $core.addMethod(
  193. $core.method({
  194. selector: "at:ifAbsent:",
  195. protocol: "accessing",
  196. fn: function (aString,aBlock){
  197. var self=this,$self=this;
  198. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  199. return $core.withContext(function($ctx1) {
  200. //>>excludeEnd("ctx");
  201. var obj = $self.jsObject;
  202. return aString in obj ? obj[aString] : aBlock._value();
  203. ;
  204. return self;
  205. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  206. }, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{aString:aString,aBlock:aBlock},$globals.JSObjectProxy)});
  207. //>>excludeEnd("ctx");
  208. },
  209. //>>excludeStart("ide", pragmas.excludeIdeData);
  210. args: ["aString", "aBlock"],
  211. 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<inlineJS: '\x0a\x09\x09var obj = $self.jsObject;\x0a\x09\x09return aString in obj ? obj[aString] : aBlock._value();\x0a\x09'>",
  212. referencedClasses: [],
  213. //>>excludeEnd("ide");
  214. messageSends: []
  215. }),
  216. $globals.JSObjectProxy);
  217. $core.addMethod(
  218. $core.method({
  219. selector: "at:ifPresent:",
  220. protocol: "accessing",
  221. fn: function (aString,aBlock){
  222. var self=this,$self=this;
  223. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  224. return $core.withContext(function($ctx1) {
  225. //>>excludeEnd("ctx");
  226. var obj = $self.jsObject;
  227. return aString in obj ? aBlock._value_(obj[aString]) : nil;
  228. ;
  229. return self;
  230. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  231. }, function($ctx1) {$ctx1.fill(self,"at:ifPresent:",{aString:aString,aBlock:aBlock},$globals.JSObjectProxy)});
  232. //>>excludeEnd("ctx");
  233. },
  234. //>>excludeStart("ide", pragmas.excludeIdeData);
  235. args: ["aString", "aBlock"],
  236. 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<inlineJS: '\x0a\x09\x09var obj = $self.jsObject;\x0a\x09\x09return aString in obj ? aBlock._value_(obj[aString]) : nil;\x0a\x09'>",
  237. referencedClasses: [],
  238. //>>excludeEnd("ide");
  239. messageSends: []
  240. }),
  241. $globals.JSObjectProxy);
  242. $core.addMethod(
  243. $core.method({
  244. selector: "at:ifPresent:ifAbsent:",
  245. protocol: "accessing",
  246. fn: function (aString,aBlock,anotherBlock){
  247. var self=this,$self=this;
  248. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  249. return $core.withContext(function($ctx1) {
  250. //>>excludeEnd("ctx");
  251. var obj = $self.jsObject;
  252. return aString in obj ? aBlock._value_(obj[aString]) : anotherBlock._value();
  253. ;
  254. return self;
  255. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  256. }, function($ctx1) {$ctx1.fill(self,"at:ifPresent:ifAbsent:",{aString:aString,aBlock:aBlock,anotherBlock:anotherBlock},$globals.JSObjectProxy)});
  257. //>>excludeEnd("ctx");
  258. },
  259. //>>excludeStart("ide", pragmas.excludeIdeData);
  260. args: ["aString", "aBlock", "anotherBlock"],
  261. 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<inlineJS: '\x0a\x09\x09var obj = $self.jsObject;\x0a\x09\x09return aString in obj ? aBlock._value_(obj[aString]) : anotherBlock._value();\x0a\x09'>",
  262. referencedClasses: [],
  263. //>>excludeEnd("ide");
  264. messageSends: []
  265. }),
  266. $globals.JSObjectProxy);
  267. $core.addMethod(
  268. $core.method({
  269. selector: "at:put:",
  270. protocol: "accessing",
  271. fn: function (aString,anObject){
  272. var self=this,$self=this;
  273. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  274. return $core.withContext(function($ctx1) {
  275. //>>excludeEnd("ctx");
  276. return $self.jsObject[aString] = anObject;
  277. return self;
  278. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  279. }, function($ctx1) {$ctx1.fill(self,"at:put:",{aString:aString,anObject:anObject},$globals.JSObjectProxy)});
  280. //>>excludeEnd("ctx");
  281. },
  282. //>>excludeStart("ide", pragmas.excludeIdeData);
  283. args: ["aString", "anObject"],
  284. source: "at: aString put: anObject\x0a\x09<inlineJS: 'return $self.jsObject[aString] = anObject'>",
  285. referencedClasses: [],
  286. //>>excludeEnd("ide");
  287. messageSends: []
  288. }),
  289. $globals.JSObjectProxy);
  290. $core.addMethod(
  291. $core.method({
  292. selector: "catch:",
  293. protocol: "promises",
  294. fn: function (aBlock){
  295. var self=this,$self=this;
  296. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  297. return $core.withContext(function($ctx1) {
  298. //>>excludeEnd("ctx");
  299. var $1,$2;
  300. $1=$recv($globals.NativeFunction)._isNativeFunction_($self._at_("then"));
  301. if($core.assert($1)){
  302. return $recv($recv($globals.TThenable).__gt_gt("catch:"))._sendTo_arguments_($self.jsObject,[aBlock]);
  303. } else {
  304. $2=(
  305. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  306. $ctx1.supercall = true,
  307. //>>excludeEnd("ctx");
  308. ($globals.JSObjectProxy.superclass||$boot.nilAsClass).fn.prototype._catch_.apply($self, [aBlock]));
  309. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  310. $ctx1.supercall = false;
  311. //>>excludeEnd("ctx");;
  312. return $2;
  313. }
  314. return self;
  315. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  316. }, function($ctx1) {$ctx1.fill(self,"catch:",{aBlock:aBlock},$globals.JSObjectProxy)});
  317. //>>excludeEnd("ctx");
  318. },
  319. //>>excludeStart("ide", pragmas.excludeIdeData);
  320. args: ["aBlock"],
  321. source: "catch: aBlock\x0a(NativeFunction isNativeFunction: (self at: #then))\x0a\x09ifTrue: [ ^ (TThenable >> #catch:) sendTo: jsObject arguments: {aBlock} ]\x0a\x09ifFalse: [ ^ super catch: aBlock ]",
  322. referencedClasses: ["NativeFunction", "TThenable"],
  323. //>>excludeEnd("ide");
  324. messageSends: ["ifTrue:ifFalse:", "isNativeFunction:", "at:", "sendTo:arguments:", ">>", "catch:"]
  325. }),
  326. $globals.JSObjectProxy);
  327. $core.addMethod(
  328. $core.method({
  329. selector: "doesNotUnderstand:",
  330. protocol: "proxy",
  331. fn: function (aMessage){
  332. var self=this,$self=this;
  333. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  334. return $core.withContext(function($ctx1) {
  335. //>>excludeEnd("ctx");
  336. var $1,$receiver;
  337. $1=$recv($globals.JSObjectProxy)._lookupProperty_ofProxy_($recv($recv(aMessage)._selector())._asJavaScriptPropertyName(),self);
  338. if(($receiver = $1) == null || $receiver.a$nil){
  339. return (
  340. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  341. $ctx1.supercall = true,
  342. //>>excludeEnd("ctx");
  343. ($globals.JSObjectProxy.superclass||$boot.nilAsClass).fn.prototype._doesNotUnderstand_.apply($self, [aMessage]));
  344. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  345. $ctx1.supercall = false;
  346. //>>excludeEnd("ctx");;
  347. } else {
  348. var jsSelector;
  349. jsSelector=$receiver;
  350. return $recv($globals.JSObjectProxy)._forwardMessage_withArguments_ofProxy_(jsSelector,$recv(aMessage)._arguments(),self);
  351. }
  352. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  353. }, function($ctx1) {$ctx1.fill(self,"doesNotUnderstand:",{aMessage:aMessage},$globals.JSObjectProxy)});
  354. //>>excludeEnd("ctx");
  355. },
  356. //>>excludeStart("ide", pragmas.excludeIdeData);
  357. args: ["aMessage"],
  358. source: "doesNotUnderstand: aMessage\x0a\x09^ (JSObjectProxy lookupProperty: aMessage selector asJavaScriptPropertyName ofProxy: self)\x0a\x09\x09ifNil: [ super doesNotUnderstand: aMessage ]\x0a\x09\x09ifNotNil: [ :jsSelector | \x0a\x09\x09\x09JSObjectProxy \x0a\x09\x09\x09\x09forwardMessage: jsSelector \x0a\x09\x09\x09\x09withArguments: aMessage arguments\x0a\x09\x09\x09\x09ofProxy: self ]",
  359. referencedClasses: ["JSObjectProxy"],
  360. //>>excludeEnd("ide");
  361. messageSends: ["ifNil:ifNotNil:", "lookupProperty:ofProxy:", "asJavaScriptPropertyName", "selector", "doesNotUnderstand:", "forwardMessage:withArguments:ofProxy:", "arguments"]
  362. }),
  363. $globals.JSObjectProxy);
  364. $core.addMethod(
  365. $core.method({
  366. selector: "in:",
  367. protocol: "accessing",
  368. fn: function (aValuable){
  369. var self=this,$self=this;
  370. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  371. return $core.withContext(function($ctx1) {
  372. //>>excludeEnd("ctx");
  373. return $recv(aValuable)._value_($self.jsObject);
  374. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  375. }, function($ctx1) {$ctx1.fill(self,"in:",{aValuable:aValuable},$globals.JSObjectProxy)});
  376. //>>excludeEnd("ctx");
  377. },
  378. //>>excludeStart("ide", pragmas.excludeIdeData);
  379. args: ["aValuable"],
  380. source: "in: aValuable\x0a\x09^ aValuable value: jsObject",
  381. referencedClasses: [],
  382. //>>excludeEnd("ide");
  383. messageSends: ["value:"]
  384. }),
  385. $globals.JSObjectProxy);
  386. $core.addMethod(
  387. $core.method({
  388. selector: "jsObject",
  389. protocol: "accessing",
  390. fn: function (){
  391. var self=this,$self=this;
  392. return $self.jsObject;
  393. },
  394. //>>excludeStart("ide", pragmas.excludeIdeData);
  395. args: [],
  396. source: "jsObject\x0a\x09^ jsObject",
  397. referencedClasses: [],
  398. //>>excludeEnd("ide");
  399. messageSends: []
  400. }),
  401. $globals.JSObjectProxy);
  402. $core.addMethod(
  403. $core.method({
  404. selector: "keysAndValuesDo:",
  405. protocol: "enumerating",
  406. fn: function (aBlock){
  407. var self=this,$self=this;
  408. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  409. return $core.withContext(function($ctx1) {
  410. //>>excludeEnd("ctx");
  411. var o = $self.jsObject;
  412. for(var i in o) {
  413. aBlock._value_value_(i, o[i]);
  414. }
  415. ;
  416. return self;
  417. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  418. }, function($ctx1) {$ctx1.fill(self,"keysAndValuesDo:",{aBlock:aBlock},$globals.JSObjectProxy)});
  419. //>>excludeEnd("ctx");
  420. },
  421. //>>excludeStart("ide", pragmas.excludeIdeData);
  422. args: ["aBlock"],
  423. source: "keysAndValuesDo: aBlock\x0a\x09<inlineJS: '\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'>",
  424. referencedClasses: [],
  425. //>>excludeEnd("ide");
  426. messageSends: []
  427. }),
  428. $globals.JSObjectProxy);
  429. $core.addMethod(
  430. $core.method({
  431. selector: "on:do:",
  432. protocol: "promises",
  433. fn: function (aClass,aBlock){
  434. var self=this,$self=this;
  435. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  436. return $core.withContext(function($ctx1) {
  437. //>>excludeEnd("ctx");
  438. var $1,$2;
  439. $1=$recv($globals.NativeFunction)._isNativeFunction_($self._at_("then"));
  440. if($core.assert($1)){
  441. return $recv($recv($globals.TThenable).__gt_gt("on:do:"))._sendTo_arguments_($self.jsObject,[aClass,aBlock]);
  442. } else {
  443. $2=(
  444. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  445. $ctx1.supercall = true,
  446. //>>excludeEnd("ctx");
  447. ($globals.JSObjectProxy.superclass||$boot.nilAsClass).fn.prototype._on_do_.apply($self, [aClass,aBlock]));
  448. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  449. $ctx1.supercall = false;
  450. //>>excludeEnd("ctx");;
  451. return $2;
  452. }
  453. return self;
  454. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  455. }, function($ctx1) {$ctx1.fill(self,"on:do:",{aClass:aClass,aBlock:aBlock},$globals.JSObjectProxy)});
  456. //>>excludeEnd("ctx");
  457. },
  458. //>>excludeStart("ide", pragmas.excludeIdeData);
  459. args: ["aClass", "aBlock"],
  460. source: "on: aClass do: aBlock\x0a(NativeFunction isNativeFunction: (self at: #then))\x0a\x09ifTrue: [ ^ (TThenable >> #on:do:) sendTo: jsObject arguments: {aClass. aBlock} ]\x0a\x09ifFalse: [ ^ super on: aClass do: aBlock ]",
  461. referencedClasses: ["NativeFunction", "TThenable"],
  462. //>>excludeEnd("ide");
  463. messageSends: ["ifTrue:ifFalse:", "isNativeFunction:", "at:", "sendTo:arguments:", ">>", "on:do:"]
  464. }),
  465. $globals.JSObjectProxy);
  466. $core.addMethod(
  467. $core.method({
  468. selector: "printOn:",
  469. protocol: "printing",
  470. fn: function (aStream){
  471. var self=this,$self=this;
  472. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  473. return $core.withContext(function($ctx1) {
  474. //>>excludeEnd("ctx");
  475. $recv(aStream)._nextPutAll_($self._printString());
  476. return self;
  477. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  478. }, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},$globals.JSObjectProxy)});
  479. //>>excludeEnd("ctx");
  480. },
  481. //>>excludeStart("ide", pragmas.excludeIdeData);
  482. args: ["aStream"],
  483. source: "printOn: aStream\x0a\x09aStream nextPutAll: self printString",
  484. referencedClasses: [],
  485. //>>excludeEnd("ide");
  486. messageSends: ["nextPutAll:", "printString"]
  487. }),
  488. $globals.JSObjectProxy);
  489. $core.addMethod(
  490. $core.method({
  491. selector: "printString",
  492. protocol: "printing",
  493. fn: function (){
  494. var self=this,$self=this;
  495. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  496. return $core.withContext(function($ctx1) {
  497. //>>excludeEnd("ctx");
  498. var js = $self.jsObject;
  499. return js.toString
  500. ? js.toString()
  501. : Object.prototype.toString.call(js)
  502. ;
  503. return self;
  504. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  505. }, function($ctx1) {$ctx1.fill(self,"printString",{},$globals.JSObjectProxy)});
  506. //>>excludeEnd("ctx");
  507. },
  508. //>>excludeStart("ide", pragmas.excludeIdeData);
  509. args: [],
  510. source: "printString\x0a\x09<inlineJS: '\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'>",
  511. referencedClasses: [],
  512. //>>excludeEnd("ide");
  513. messageSends: []
  514. }),
  515. $globals.JSObjectProxy);
  516. $core.addMethod(
  517. $core.method({
  518. selector: "putOn:",
  519. protocol: "streaming",
  520. fn: function (aStream){
  521. var self=this,$self=this;
  522. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  523. return $core.withContext(function($ctx1) {
  524. //>>excludeEnd("ctx");
  525. $recv(aStream)._nextPutJSObject_($self.jsObject);
  526. return self;
  527. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  528. }, function($ctx1) {$ctx1.fill(self,"putOn:",{aStream:aStream},$globals.JSObjectProxy)});
  529. //>>excludeEnd("ctx");
  530. },
  531. //>>excludeStart("ide", pragmas.excludeIdeData);
  532. args: ["aStream"],
  533. source: "putOn: aStream\x0a\x09aStream nextPutJSObject: jsObject",
  534. referencedClasses: [],
  535. //>>excludeEnd("ide");
  536. messageSends: ["nextPutJSObject:"]
  537. }),
  538. $globals.JSObjectProxy);
  539. $core.addMethod(
  540. $core.method({
  541. selector: "removeKey:",
  542. protocol: "accessing",
  543. fn: function (aString){
  544. var self=this,$self=this;
  545. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  546. return $core.withContext(function($ctx1) {
  547. //>>excludeEnd("ctx");
  548. delete $self.jsObject[aString]; return aString;
  549. return self;
  550. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  551. }, function($ctx1) {$ctx1.fill(self,"removeKey:",{aString:aString},$globals.JSObjectProxy)});
  552. //>>excludeEnd("ctx");
  553. },
  554. //>>excludeStart("ide", pragmas.excludeIdeData);
  555. args: ["aString"],
  556. source: "removeKey: aString\x0a\x09<inlineJS: 'delete $self.jsObject[aString]; return aString'>",
  557. referencedClasses: [],
  558. //>>excludeEnd("ide");
  559. messageSends: []
  560. }),
  561. $globals.JSObjectProxy);
  562. $core.addMethod(
  563. $core.method({
  564. selector: "then:",
  565. protocol: "promises",
  566. fn: function (aBlockOrArray){
  567. var self=this,$self=this;
  568. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  569. return $core.withContext(function($ctx1) {
  570. //>>excludeEnd("ctx");
  571. var $1,$2;
  572. $1=$recv($globals.NativeFunction)._isNativeFunction_($self._at_("then"));
  573. if($core.assert($1)){
  574. return $recv($recv($globals.TThenable).__gt_gt("then:"))._sendTo_arguments_($self.jsObject,[aBlockOrArray]);
  575. } else {
  576. $2=(
  577. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  578. $ctx1.supercall = true,
  579. //>>excludeEnd("ctx");
  580. ($globals.JSObjectProxy.superclass||$boot.nilAsClass).fn.prototype._then_.apply($self, [aBlockOrArray]));
  581. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  582. $ctx1.supercall = false;
  583. //>>excludeEnd("ctx");;
  584. return $2;
  585. }
  586. return self;
  587. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  588. }, function($ctx1) {$ctx1.fill(self,"then:",{aBlockOrArray:aBlockOrArray},$globals.JSObjectProxy)});
  589. //>>excludeEnd("ctx");
  590. },
  591. //>>excludeStart("ide", pragmas.excludeIdeData);
  592. args: ["aBlockOrArray"],
  593. source: "then: aBlockOrArray\x0a(NativeFunction isNativeFunction: (self at: #then))\x0a\x09ifTrue: [ ^ (TThenable >> #then:) sendTo: jsObject arguments: {aBlockOrArray} ]\x0a\x09ifFalse: [ ^ super then: aBlockOrArray ]",
  594. referencedClasses: ["NativeFunction", "TThenable"],
  595. //>>excludeEnd("ide");
  596. messageSends: ["ifTrue:ifFalse:", "isNativeFunction:", "at:", "sendTo:arguments:", ">>", "then:"]
  597. }),
  598. $globals.JSObjectProxy);
  599. $core.addMethod(
  600. $core.method({
  601. selector: "addObjectVariablesTo:ofProxy:",
  602. protocol: "proxy",
  603. fn: function (aDictionary,aProxy){
  604. var self=this,$self=this;
  605. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  606. return $core.withContext(function($ctx1) {
  607. //>>excludeEnd("ctx");
  608. var jsObject = aProxy.jsObject;
  609. for(var i in jsObject) {
  610. aDictionary._at_put_(i, jsObject[i]);
  611. }
  612. ;
  613. return self;
  614. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  615. }, function($ctx1) {$ctx1.fill(self,"addObjectVariablesTo:ofProxy:",{aDictionary:aDictionary,aProxy:aProxy},$globals.JSObjectProxy.a$cls)});
  616. //>>excludeEnd("ctx");
  617. },
  618. //>>excludeStart("ide", pragmas.excludeIdeData);
  619. args: ["aDictionary", "aProxy"],
  620. source: "addObjectVariablesTo: aDictionary ofProxy: aProxy\x0a\x09<inlineJS: '\x0a\x09\x09var jsObject = aProxy.jsObject;\x0a\x09\x09for(var i in jsObject) {\x0a\x09\x09\x09aDictionary._at_put_(i, jsObject[i]);\x0a\x09\x09}\x0a\x09'>",
  621. referencedClasses: [],
  622. //>>excludeEnd("ide");
  623. messageSends: []
  624. }),
  625. $globals.JSObjectProxy.a$cls);
  626. $core.addMethod(
  627. $core.method({
  628. selector: "compareJSObjectOfProxy:withProxy:",
  629. protocol: "proxy",
  630. fn: function (aProxy,anotherProxy){
  631. var self=this,$self=this;
  632. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  633. return $core.withContext(function($ctx1) {
  634. //>>excludeEnd("ctx");
  635. var anotherJSObject = anotherProxy.a$cls ? anotherProxy.jsObject : anotherProxy;
  636. return aProxy.jsObject === anotherJSObject;
  637. return self;
  638. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  639. }, function($ctx1) {$ctx1.fill(self,"compareJSObjectOfProxy:withProxy:",{aProxy:aProxy,anotherProxy:anotherProxy},$globals.JSObjectProxy.a$cls)});
  640. //>>excludeEnd("ctx");
  641. },
  642. //>>excludeStart("ide", pragmas.excludeIdeData);
  643. args: ["aProxy", "anotherProxy"],
  644. source: "compareJSObjectOfProxy: aProxy withProxy: anotherProxy\x0a<inlineJS: '\x0a\x09var anotherJSObject = anotherProxy.a$cls ? anotherProxy.jsObject : anotherProxy;\x0a\x09return aProxy.jsObject === anotherJSObject\x0a'>",
  645. referencedClasses: [],
  646. //>>excludeEnd("ide");
  647. messageSends: []
  648. }),
  649. $globals.JSObjectProxy.a$cls);
  650. $core.addMethod(
  651. $core.method({
  652. selector: "forwardMessage:withArguments:ofProxy:",
  653. protocol: "proxy",
  654. fn: function (aString,anArray,aProxy){
  655. var self=this,$self=this;
  656. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  657. return $core.withContext(function($ctx1) {
  658. //>>excludeEnd("ctx");
  659. return $core.accessJavaScript(aProxy._jsObject(), aString, anArray);
  660. ;
  661. return self;
  662. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  663. }, function($ctx1) {$ctx1.fill(self,"forwardMessage:withArguments:ofProxy:",{aString:aString,anArray:anArray,aProxy:aProxy},$globals.JSObjectProxy.a$cls)});
  664. //>>excludeEnd("ctx");
  665. },
  666. //>>excludeStart("ide", pragmas.excludeIdeData);
  667. args: ["aString", "anArray", "aProxy"],
  668. source: "forwardMessage: aString withArguments: anArray ofProxy: aProxy\x0a\x09<inlineJS: '\x0a\x09\x09return $core.accessJavaScript(aProxy._jsObject(), aString, anArray);\x0a\x09'>",
  669. referencedClasses: [],
  670. //>>excludeEnd("ide");
  671. messageSends: []
  672. }),
  673. $globals.JSObjectProxy.a$cls);
  674. $core.addMethod(
  675. $core.method({
  676. selector: "jsObject:ofProxy:",
  677. protocol: "proxy",
  678. fn: function (aJSObject,aProxy){
  679. var self=this,$self=this;
  680. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  681. return $core.withContext(function($ctx1) {
  682. //>>excludeEnd("ctx");
  683. aProxy.jsObject = aJSObject;
  684. return self;
  685. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  686. }, function($ctx1) {$ctx1.fill(self,"jsObject:ofProxy:",{aJSObject:aJSObject,aProxy:aProxy},$globals.JSObjectProxy.a$cls)});
  687. //>>excludeEnd("ctx");
  688. },
  689. //>>excludeStart("ide", pragmas.excludeIdeData);
  690. args: ["aJSObject", "aProxy"],
  691. source: "jsObject: aJSObject ofProxy: aProxy\x0a\x09<inlineJS: 'aProxy.jsObject = aJSObject'>",
  692. referencedClasses: [],
  693. //>>excludeEnd("ide");
  694. messageSends: []
  695. }),
  696. $globals.JSObjectProxy.a$cls);
  697. $core.addMethod(
  698. $core.method({
  699. selector: "lookupProperty:ofProxy:",
  700. protocol: "proxy",
  701. fn: function (aString,aProxy){
  702. var self=this,$self=this;
  703. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  704. return $core.withContext(function($ctx1) {
  705. //>>excludeEnd("ctx");
  706. return aString in aProxy._jsObject() ? aString : nil;
  707. return self;
  708. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  709. }, function($ctx1) {$ctx1.fill(self,"lookupProperty:ofProxy:",{aString:aString,aProxy:aProxy},$globals.JSObjectProxy.a$cls)});
  710. //>>excludeEnd("ctx");
  711. },
  712. //>>excludeStart("ide", pragmas.excludeIdeData);
  713. args: ["aString", "aProxy"],
  714. source: "lookupProperty: aString ofProxy: aProxy\x0a\x09\x22Looks up a property in JS object.\x0a\x09Answer the property if it is present, or nil if it is not present.\x22\x0a\x09\x0a\x09<inlineJS: 'return aString in aProxy._jsObject() ? aString : nil'>",
  715. referencedClasses: [],
  716. //>>excludeEnd("ide");
  717. messageSends: []
  718. }),
  719. $globals.JSObjectProxy.a$cls);
  720. $core.addMethod(
  721. $core.method({
  722. selector: "null",
  723. protocol: "accessing",
  724. fn: function (){
  725. var self=this,$self=this;
  726. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  727. return $core.withContext(function($ctx1) {
  728. //>>excludeEnd("ctx");
  729. return null;
  730. return self;
  731. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  732. }, function($ctx1) {$ctx1.fill(self,"null",{},$globals.JSObjectProxy.a$cls)});
  733. //>>excludeEnd("ctx");
  734. },
  735. //>>excludeStart("ide", pragmas.excludeIdeData);
  736. args: [],
  737. source: "null\x0a\x09<inlineJS: 'return null'>",
  738. referencedClasses: [],
  739. //>>excludeEnd("ide");
  740. messageSends: []
  741. }),
  742. $globals.JSObjectProxy.a$cls);
  743. $core.addMethod(
  744. $core.method({
  745. selector: "on:",
  746. protocol: "instance creation",
  747. fn: function (aJSObject){
  748. var self=this,$self=this;
  749. var instance;
  750. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  751. return $core.withContext(function($ctx1) {
  752. //>>excludeEnd("ctx");
  753. instance=$self._new();
  754. $self._jsObject_ofProxy_(aJSObject,instance);
  755. return instance;
  756. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  757. }, function($ctx1) {$ctx1.fill(self,"on:",{aJSObject:aJSObject,instance:instance},$globals.JSObjectProxy.a$cls)});
  758. //>>excludeEnd("ctx");
  759. },
  760. //>>excludeStart("ide", pragmas.excludeIdeData);
  761. args: ["aJSObject"],
  762. source: "on: aJSObject\x0a\x09| instance |\x0a\x09instance := self new.\x0a\x09self jsObject: aJSObject ofProxy: instance.\x0a\x09^ instance",
  763. referencedClasses: [],
  764. //>>excludeEnd("ide");
  765. messageSends: ["new", "jsObject:ofProxy:"]
  766. }),
  767. $globals.JSObjectProxy.a$cls);
  768. $core.addMethod(
  769. $core.method({
  770. selector: "undefined",
  771. protocol: "accessing",
  772. fn: function (){
  773. var self=this,$self=this;
  774. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  775. return $core.withContext(function($ctx1) {
  776. //>>excludeEnd("ctx");
  777. return undefined;
  778. return self;
  779. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  780. }, function($ctx1) {$ctx1.fill(self,"undefined",{},$globals.JSObjectProxy.a$cls)});
  781. //>>excludeEnd("ctx");
  782. },
  783. //>>excludeStart("ide", pragmas.excludeIdeData);
  784. args: [],
  785. source: "undefined\x0a\x09<inlineJS: 'return undefined'>",
  786. referencedClasses: [],
  787. //>>excludeEnd("ide");
  788. messageSends: []
  789. }),
  790. $globals.JSObjectProxy.a$cls);
  791. $core.addClass("Organizer", $globals.Object, ["elements"], "Kernel-Infrastructure");
  792. //>>excludeStart("ide", pragmas.excludeIdeData);
  793. $globals.Organizer.comment="I represent categorization information. \x0a\x0a## API\x0a\x0aUse `#addElement:` and `#removeElement:` to manipulate instances.";
  794. //>>excludeEnd("ide");
  795. $core.addMethod(
  796. $core.method({
  797. selector: "addElement:",
  798. protocol: "accessing",
  799. fn: function (anObject){
  800. var self=this,$self=this;
  801. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  802. return $core.withContext(function($ctx1) {
  803. //>>excludeEnd("ctx");
  804. $recv($self._elements())._add_(anObject);
  805. return self;
  806. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  807. }, function($ctx1) {$ctx1.fill(self,"addElement:",{anObject:anObject},$globals.Organizer)});
  808. //>>excludeEnd("ctx");
  809. },
  810. //>>excludeStart("ide", pragmas.excludeIdeData);
  811. args: ["anObject"],
  812. source: "addElement: anObject\x0a\x09self elements add: anObject",
  813. referencedClasses: [],
  814. //>>excludeEnd("ide");
  815. messageSends: ["add:", "elements"]
  816. }),
  817. $globals.Organizer);
  818. $core.addMethod(
  819. $core.method({
  820. selector: "elements",
  821. protocol: "accessing",
  822. fn: function (){
  823. var self=this,$self=this;
  824. return $self.elements;
  825. },
  826. //>>excludeStart("ide", pragmas.excludeIdeData);
  827. args: [],
  828. source: "elements\x0a\x09^ elements",
  829. referencedClasses: [],
  830. //>>excludeEnd("ide");
  831. messageSends: []
  832. }),
  833. $globals.Organizer);
  834. $core.addMethod(
  835. $core.method({
  836. selector: "initialize",
  837. protocol: "initialization",
  838. fn: function (){
  839. var self=this,$self=this;
  840. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  841. return $core.withContext(function($ctx1) {
  842. //>>excludeEnd("ctx");
  843. (
  844. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  845. $ctx1.supercall = true,
  846. //>>excludeEnd("ctx");
  847. ($globals.Organizer.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($self, []));
  848. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  849. $ctx1.supercall = false;
  850. //>>excludeEnd("ctx");;
  851. $self.elements=$recv($globals.Set)._new();
  852. return self;
  853. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  854. }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.Organizer)});
  855. //>>excludeEnd("ctx");
  856. },
  857. //>>excludeStart("ide", pragmas.excludeIdeData);
  858. args: [],
  859. source: "initialize\x0a\x09super initialize.\x0a\x09elements := Set new",
  860. referencedClasses: ["Set"],
  861. //>>excludeEnd("ide");
  862. messageSends: ["initialize", "new"]
  863. }),
  864. $globals.Organizer);
  865. $core.addMethod(
  866. $core.method({
  867. selector: "removeElement:",
  868. protocol: "accessing",
  869. fn: function (anObject){
  870. var self=this,$self=this;
  871. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  872. return $core.withContext(function($ctx1) {
  873. //>>excludeEnd("ctx");
  874. $recv($self._elements())._remove_ifAbsent_(anObject,(function(){
  875. }));
  876. return self;
  877. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  878. }, function($ctx1) {$ctx1.fill(self,"removeElement:",{anObject:anObject},$globals.Organizer)});
  879. //>>excludeEnd("ctx");
  880. },
  881. //>>excludeStart("ide", pragmas.excludeIdeData);
  882. args: ["anObject"],
  883. source: "removeElement: anObject\x0a\x09self elements remove: anObject ifAbsent: []",
  884. referencedClasses: [],
  885. //>>excludeEnd("ide");
  886. messageSends: ["remove:ifAbsent:", "elements"]
  887. }),
  888. $globals.Organizer);
  889. $core.addClass("ClassOrganizer", $globals.Organizer, ["traitOrBehavior"], "Kernel-Infrastructure");
  890. //>>excludeStart("ide", pragmas.excludeIdeData);
  891. $globals.ClassOrganizer.comment="I am an organizer specific to classes. I hold method categorization information for classes.";
  892. //>>excludeEnd("ide");
  893. $core.addMethod(
  894. $core.method({
  895. selector: "addElement:",
  896. protocol: "accessing",
  897. fn: function (aString){
  898. var self=this,$self=this;
  899. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  900. return $core.withContext(function($ctx1) {
  901. //>>excludeEnd("ctx");
  902. var $1,$3,$2;
  903. (
  904. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  905. $ctx1.supercall = true,
  906. //>>excludeEnd("ctx");
  907. ($globals.ClassOrganizer.superclass||$boot.nilAsClass).fn.prototype._addElement_.apply($self, [aString]));
  908. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  909. $ctx1.supercall = false;
  910. //>>excludeEnd("ctx");;
  911. $1=$recv($globals.SystemAnnouncer)._current();
  912. $3=$recv($globals.ProtocolAdded)._new();
  913. $recv($3)._protocol_(aString);
  914. $recv($3)._theClass_($self._theClass());
  915. $2=$recv($3)._yourself();
  916. $recv($1)._announce_($2);
  917. return self;
  918. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  919. }, function($ctx1) {$ctx1.fill(self,"addElement:",{aString:aString},$globals.ClassOrganizer)});
  920. //>>excludeEnd("ctx");
  921. },
  922. //>>excludeStart("ide", pragmas.excludeIdeData);
  923. args: ["aString"],
  924. 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)",
  925. referencedClasses: ["SystemAnnouncer", "ProtocolAdded"],
  926. //>>excludeEnd("ide");
  927. messageSends: ["addElement:", "announce:", "current", "protocol:", "new", "theClass:", "theClass", "yourself"]
  928. }),
  929. $globals.ClassOrganizer);
  930. $core.addMethod(
  931. $core.method({
  932. selector: "removeElement:",
  933. protocol: "accessing",
  934. fn: function (aString){
  935. var self=this,$self=this;
  936. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  937. return $core.withContext(function($ctx1) {
  938. //>>excludeEnd("ctx");
  939. var $1,$3,$2;
  940. (
  941. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  942. $ctx1.supercall = true,
  943. //>>excludeEnd("ctx");
  944. ($globals.ClassOrganizer.superclass||$boot.nilAsClass).fn.prototype._removeElement_.apply($self, [aString]));
  945. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  946. $ctx1.supercall = false;
  947. //>>excludeEnd("ctx");;
  948. $1=$recv($globals.SystemAnnouncer)._current();
  949. $3=$recv($globals.ProtocolRemoved)._new();
  950. $recv($3)._protocol_(aString);
  951. $recv($3)._theClass_($self._theClass());
  952. $2=$recv($3)._yourself();
  953. $recv($1)._announce_($2);
  954. return self;
  955. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  956. }, function($ctx1) {$ctx1.fill(self,"removeElement:",{aString:aString},$globals.ClassOrganizer)});
  957. //>>excludeEnd("ctx");
  958. },
  959. //>>excludeStart("ide", pragmas.excludeIdeData);
  960. args: ["aString"],
  961. 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)",
  962. referencedClasses: ["SystemAnnouncer", "ProtocolRemoved"],
  963. //>>excludeEnd("ide");
  964. messageSends: ["removeElement:", "announce:", "current", "protocol:", "new", "theClass:", "theClass", "yourself"]
  965. }),
  966. $globals.ClassOrganizer);
  967. $core.addMethod(
  968. $core.method({
  969. selector: "theClass",
  970. protocol: "accessing",
  971. fn: function (){
  972. var self=this,$self=this;
  973. return $self.traitOrBehavior;
  974. },
  975. //>>excludeStart("ide", pragmas.excludeIdeData);
  976. args: [],
  977. source: "theClass\x0a\x09^ traitOrBehavior",
  978. referencedClasses: [],
  979. //>>excludeEnd("ide");
  980. messageSends: []
  981. }),
  982. $globals.ClassOrganizer);
  983. $core.addMethod(
  984. $core.method({
  985. selector: "theClass:",
  986. protocol: "accessing",
  987. fn: function (aClass){
  988. var self=this,$self=this;
  989. $self.traitOrBehavior=aClass;
  990. return self;
  991. },
  992. //>>excludeStart("ide", pragmas.excludeIdeData);
  993. args: ["aClass"],
  994. source: "theClass: aClass\x0a\x09traitOrBehavior := aClass",
  995. referencedClasses: [],
  996. //>>excludeEnd("ide");
  997. messageSends: []
  998. }),
  999. $globals.ClassOrganizer);
  1000. $core.addMethod(
  1001. $core.method({
  1002. selector: "on:",
  1003. protocol: "instance creation",
  1004. fn: function (aClass){
  1005. var self=this,$self=this;
  1006. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1007. return $core.withContext(function($ctx1) {
  1008. //>>excludeEnd("ctx");
  1009. var $1;
  1010. $1=$self._new();
  1011. $recv($1)._theClass_(aClass);
  1012. return $recv($1)._yourself();
  1013. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1014. }, function($ctx1) {$ctx1.fill(self,"on:",{aClass:aClass},$globals.ClassOrganizer.a$cls)});
  1015. //>>excludeEnd("ctx");
  1016. },
  1017. //>>excludeStart("ide", pragmas.excludeIdeData);
  1018. args: ["aClass"],
  1019. source: "on: aClass\x0a\x09^ self new\x0a\x09\x09theClass: aClass;\x0a\x09\x09yourself",
  1020. referencedClasses: [],
  1021. //>>excludeEnd("ide");
  1022. messageSends: ["theClass:", "new", "yourself"]
  1023. }),
  1024. $globals.ClassOrganizer.a$cls);
  1025. $core.addClass("PackageOrganizer", $globals.Organizer, [], "Kernel-Infrastructure");
  1026. //>>excludeStart("ide", pragmas.excludeIdeData);
  1027. $globals.PackageOrganizer.comment="I am an organizer specific to packages. I hold classes categorization information.";
  1028. //>>excludeEnd("ide");
  1029. $core.addClass("Package", $globals.Object, ["evalBlock", "basicTransport", "name", "transport", "imports", "dirty", "organization", "isReady"], "Kernel-Infrastructure");
  1030. //>>excludeStart("ide", pragmas.excludeIdeData);
  1031. $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'";
  1032. //>>excludeEnd("ide");
  1033. $core.addMethod(
  1034. $core.method({
  1035. selector: "basicTransport",
  1036. protocol: "private",
  1037. fn: function (){
  1038. var self=this,$self=this;
  1039. return $self.basicTransport;
  1040. },
  1041. //>>excludeStart("ide", pragmas.excludeIdeData);
  1042. args: [],
  1043. source: "basicTransport\x0a\x09\x22Answer the transport literal JavaScript object as setup in the JavaScript file, if any\x22\x0a\x09\x0a\x09^ basicTransport",
  1044. referencedClasses: [],
  1045. //>>excludeEnd("ide");
  1046. messageSends: []
  1047. }),
  1048. $globals.Package);
  1049. $core.addMethod(
  1050. $core.method({
  1051. selector: "beClean",
  1052. protocol: "accessing",
  1053. fn: function (){
  1054. var self=this,$self=this;
  1055. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1056. return $core.withContext(function($ctx1) {
  1057. //>>excludeEnd("ctx");
  1058. var $1,$3,$2;
  1059. $self.dirty=false;
  1060. $1=$recv($globals.SystemAnnouncer)._current();
  1061. $3=$recv($globals.PackageClean)._new();
  1062. $recv($3)._package_(self);
  1063. $2=$recv($3)._yourself();
  1064. $recv($1)._announce_($2);
  1065. return self;
  1066. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1067. }, function($ctx1) {$ctx1.fill(self,"beClean",{},$globals.Package)});
  1068. //>>excludeEnd("ctx");
  1069. },
  1070. //>>excludeStart("ide", pragmas.excludeIdeData);
  1071. args: [],
  1072. source: "beClean\x0a\x09dirty := false.\x0a\x09\x0a\x09SystemAnnouncer current announce: (PackageClean new\x0a\x09\x09package: self;\x0a\x09\x09yourself)",
  1073. referencedClasses: ["SystemAnnouncer", "PackageClean"],
  1074. //>>excludeEnd("ide");
  1075. messageSends: ["announce:", "current", "package:", "new", "yourself"]
  1076. }),
  1077. $globals.Package);
  1078. $core.addMethod(
  1079. $core.method({
  1080. selector: "beDirty",
  1081. protocol: "accessing",
  1082. fn: function (){
  1083. var self=this,$self=this;
  1084. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1085. return $core.withContext(function($ctx1) {
  1086. //>>excludeEnd("ctx");
  1087. var $1,$3,$2;
  1088. $self.dirty=true;
  1089. $1=$recv($globals.SystemAnnouncer)._current();
  1090. $3=$recv($globals.PackageDirty)._new();
  1091. $recv($3)._package_(self);
  1092. $2=$recv($3)._yourself();
  1093. $recv($1)._announce_($2);
  1094. return self;
  1095. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1096. }, function($ctx1) {$ctx1.fill(self,"beDirty",{},$globals.Package)});
  1097. //>>excludeEnd("ctx");
  1098. },
  1099. //>>excludeStart("ide", pragmas.excludeIdeData);
  1100. args: [],
  1101. source: "beDirty\x0a\x09dirty := true.\x0a\x09\x0a\x09SystemAnnouncer current announce: (PackageDirty new\x0a\x09\x09package: self;\x0a\x09\x09yourself)",
  1102. referencedClasses: ["SystemAnnouncer", "PackageDirty"],
  1103. //>>excludeEnd("ide");
  1104. messageSends: ["announce:", "current", "package:", "new", "yourself"]
  1105. }),
  1106. $globals.Package);
  1107. $core.addMethod(
  1108. $core.method({
  1109. selector: "classTemplate",
  1110. protocol: "accessing",
  1111. fn: function (){
  1112. var self=this,$self=this;
  1113. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1114. return $core.withContext(function($ctx1) {
  1115. //>>excludeEnd("ctx");
  1116. return $recv($globals.String)._streamContents_((function(stream){
  1117. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1118. return $core.withContext(function($ctx2) {
  1119. //>>excludeEnd("ctx");
  1120. $recv(stream)._write_("Object subclass: #NameOfSubclass");
  1121. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1122. $ctx2.sendIdx["write:"]=1;
  1123. //>>excludeEnd("ctx");
  1124. $recv(stream)._lf();
  1125. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1126. $ctx2.sendIdx["lf"]=1;
  1127. //>>excludeEnd("ctx");
  1128. $recv(stream)._tab();
  1129. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1130. $ctx2.sendIdx["tab"]=1;
  1131. //>>excludeEnd("ctx");
  1132. $recv(stream)._write_("instanceVariableNames: ''");
  1133. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1134. $ctx2.sendIdx["write:"]=2;
  1135. //>>excludeEnd("ctx");
  1136. $recv(stream)._lf();
  1137. $recv(stream)._tab();
  1138. $recv(stream)._write_("package: ");
  1139. return $recv(stream)._print_($self._name());
  1140. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1141. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)});
  1142. //>>excludeEnd("ctx");
  1143. }));
  1144. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1145. }, function($ctx1) {$ctx1.fill(self,"classTemplate",{},$globals.Package)});
  1146. //>>excludeEnd("ctx");
  1147. },
  1148. //>>excludeStart("ide", pragmas.excludeIdeData);
  1149. args: [],
  1150. source: "classTemplate\x0a\x09^ String streamContents: [ :stream | stream\x0a\x09\x09write: 'Object subclass: #NameOfSubclass'; lf;\x0a\x09\x09tab; write: 'instanceVariableNames: '''''; lf;\x0a\x09\x09tab; write: 'package: '; print: self name ]",
  1151. referencedClasses: ["String"],
  1152. //>>excludeEnd("ide");
  1153. messageSends: ["streamContents:", "write:", "lf", "tab", "print:", "name"]
  1154. }),
  1155. $globals.Package);
  1156. $core.addMethod(
  1157. $core.method({
  1158. selector: "classes",
  1159. protocol: "classes",
  1160. fn: function (){
  1161. var self=this,$self=this;
  1162. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1163. return $core.withContext(function($ctx1) {
  1164. //>>excludeEnd("ctx");
  1165. return $recv($recv($self._organization())._elements())._copy();
  1166. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1167. }, function($ctx1) {$ctx1.fill(self,"classes",{},$globals.Package)});
  1168. //>>excludeEnd("ctx");
  1169. },
  1170. //>>excludeStart("ide", pragmas.excludeIdeData);
  1171. args: [],
  1172. source: "classes\x0a\x09^ self organization elements copy",
  1173. referencedClasses: [],
  1174. //>>excludeEnd("ide");
  1175. messageSends: ["copy", "elements", "organization"]
  1176. }),
  1177. $globals.Package);
  1178. $core.addMethod(
  1179. $core.method({
  1180. selector: "definition",
  1181. protocol: "accessing",
  1182. fn: function (){
  1183. var self=this,$self=this;
  1184. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1185. return $core.withContext(function($ctx1) {
  1186. //>>excludeEnd("ctx");
  1187. var $1;
  1188. return $recv($globals.String)._streamContents_((function(stream){
  1189. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1190. return $core.withContext(function($ctx2) {
  1191. //>>excludeEnd("ctx");
  1192. $1=$recv($self._class())._name();
  1193. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1194. $ctx2.sendIdx["name"]=1;
  1195. //>>excludeEnd("ctx");
  1196. $recv(stream)._write_($1);
  1197. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1198. $ctx2.sendIdx["write:"]=1;
  1199. //>>excludeEnd("ctx");
  1200. $recv(stream)._lf();
  1201. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1202. $ctx2.sendIdx["lf"]=1;
  1203. //>>excludeEnd("ctx");
  1204. $recv(stream)._tab();
  1205. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1206. $ctx2.sendIdx["tab"]=1;
  1207. //>>excludeEnd("ctx");
  1208. $recv(stream)._write_("named: ");
  1209. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1210. $ctx2.sendIdx["write:"]=2;
  1211. //>>excludeEnd("ctx");
  1212. $recv(stream)._print_($self._name());
  1213. $recv(stream)._lf();
  1214. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1215. $ctx2.sendIdx["lf"]=2;
  1216. //>>excludeEnd("ctx");
  1217. $recv(stream)._tab();
  1218. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1219. $ctx2.sendIdx["tab"]=2;
  1220. //>>excludeEnd("ctx");
  1221. $recv(stream)._write_(["imports: ",$self._importsDefinition()]);
  1222. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1223. $ctx2.sendIdx["write:"]=3;
  1224. //>>excludeEnd("ctx");
  1225. $recv(stream)._lf();
  1226. $recv(stream)._tab();
  1227. return $recv(stream)._write_(["transport: (",$recv($self._transport())._definition(),")"]);
  1228. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1229. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)});
  1230. //>>excludeEnd("ctx");
  1231. }));
  1232. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1233. }, function($ctx1) {$ctx1.fill(self,"definition",{},$globals.Package)});
  1234. //>>excludeEnd("ctx");
  1235. },
  1236. //>>excludeStart("ide", pragmas.excludeIdeData);
  1237. args: [],
  1238. source: "definition\x0a\x09^ String streamContents: [ :stream | stream\x0a\x09\x09write: self class name; lf;\x0a\x09\x09tab; write: 'named: '; print: self name; lf;\x0a\x09\x09tab; write: { 'imports: '. self importsDefinition }; lf;\x0a\x09\x09tab; write: { 'transport: ('. self transport definition. ')' } ]",
  1239. referencedClasses: ["String"],
  1240. //>>excludeEnd("ide");
  1241. messageSends: ["streamContents:", "write:", "name", "class", "lf", "tab", "print:", "importsDefinition", "definition", "transport"]
  1242. }),
  1243. $globals.Package);
  1244. $core.addMethod(
  1245. $core.method({
  1246. selector: "eval:",
  1247. protocol: "evaluating",
  1248. fn: function (aString){
  1249. var self=this,$self=this;
  1250. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1251. return $core.withContext(function($ctx1) {
  1252. //>>excludeEnd("ctx");
  1253. var $1,$receiver;
  1254. $1=$self.evalBlock;
  1255. if(($receiver = $1) == null || $receiver.a$nil){
  1256. return $recv($globals.Compiler)._eval_(aString);
  1257. } else {
  1258. return $recv($self.evalBlock)._value_(aString);
  1259. }
  1260. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1261. }, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString},$globals.Package)});
  1262. //>>excludeEnd("ctx");
  1263. },
  1264. //>>excludeStart("ide", pragmas.excludeIdeData);
  1265. args: ["aString"],
  1266. source: "eval: aString\x0a\x09^ evalBlock\x0a\x09\x09ifNotNil: [ evalBlock value: aString ]\x0a\x09\x09ifNil: [ Compiler eval: aString ]",
  1267. referencedClasses: ["Compiler"],
  1268. //>>excludeEnd("ide");
  1269. messageSends: ["ifNotNil:ifNil:", "value:", "eval:"]
  1270. }),
  1271. $globals.Package);
  1272. $core.addMethod(
  1273. $core.method({
  1274. selector: "evalBlock",
  1275. protocol: "accessing",
  1276. fn: function (){
  1277. var self=this,$self=this;
  1278. return $self.evalBlock;
  1279. },
  1280. //>>excludeStart("ide", pragmas.excludeIdeData);
  1281. args: [],
  1282. source: "evalBlock\x0a\x09^ evalBlock",
  1283. referencedClasses: [],
  1284. //>>excludeEnd("ide");
  1285. messageSends: []
  1286. }),
  1287. $globals.Package);
  1288. $core.addMethod(
  1289. $core.method({
  1290. selector: "evalBlock:",
  1291. protocol: "accessing",
  1292. fn: function (aBlock){
  1293. var self=this,$self=this;
  1294. $self.evalBlock=aBlock;
  1295. return self;
  1296. },
  1297. //>>excludeStart("ide", pragmas.excludeIdeData);
  1298. args: ["aBlock"],
  1299. source: "evalBlock: aBlock\x0a\x09evalBlock := aBlock",
  1300. referencedClasses: [],
  1301. //>>excludeEnd("ide");
  1302. messageSends: []
  1303. }),
  1304. $globals.Package);
  1305. $core.addMethod(
  1306. $core.method({
  1307. selector: "imports",
  1308. protocol: "accessing",
  1309. fn: function (){
  1310. var self=this,$self=this;
  1311. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1312. return $core.withContext(function($ctx1) {
  1313. //>>excludeEnd("ctx");
  1314. var $1,$receiver;
  1315. $1=$self.imports;
  1316. if(($receiver = $1) == null || $receiver.a$nil){
  1317. $self._imports_([]);
  1318. return $self.imports;
  1319. } else {
  1320. return $1;
  1321. }
  1322. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1323. }, function($ctx1) {$ctx1.fill(self,"imports",{},$globals.Package)});
  1324. //>>excludeEnd("ctx");
  1325. },
  1326. //>>excludeStart("ide", pragmas.excludeIdeData);
  1327. args: [],
  1328. source: "imports\x0a\x09^ imports ifNil: [\x0a\x09\x09self imports: #().\x0a\x09\x09imports ]",
  1329. referencedClasses: [],
  1330. //>>excludeEnd("ide");
  1331. messageSends: ["ifNil:", "imports:"]
  1332. }),
  1333. $globals.Package);
  1334. $core.addMethod(
  1335. $core.method({
  1336. selector: "imports:",
  1337. protocol: "accessing",
  1338. fn: function (anArray){
  1339. var self=this,$self=this;
  1340. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1341. return $core.withContext(function($ctx1) {
  1342. //>>excludeEnd("ctx");
  1343. $self._validateImports_(anArray);
  1344. $self.imports=$recv(anArray)._asSet();
  1345. return self;
  1346. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1347. }, function($ctx1) {$ctx1.fill(self,"imports:",{anArray:anArray},$globals.Package)});
  1348. //>>excludeEnd("ctx");
  1349. },
  1350. //>>excludeStart("ide", pragmas.excludeIdeData);
  1351. args: ["anArray"],
  1352. source: "imports: anArray\x0a\x09self validateImports: anArray.\x0a\x09imports := anArray asSet",
  1353. referencedClasses: [],
  1354. //>>excludeEnd("ide");
  1355. messageSends: ["validateImports:", "asSet"]
  1356. }),
  1357. $globals.Package);
  1358. $core.addMethod(
  1359. $core.method({
  1360. selector: "importsAsJson",
  1361. protocol: "converting",
  1362. fn: function (){
  1363. var self=this,$self=this;
  1364. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1365. return $core.withContext(function($ctx1) {
  1366. //>>excludeEnd("ctx");
  1367. var $1;
  1368. return $recv($self._sortedImportsAsArray())._collect_((function(each){
  1369. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1370. return $core.withContext(function($ctx2) {
  1371. //>>excludeEnd("ctx");
  1372. $1=$recv(each)._isString();
  1373. if($core.assert($1)){
  1374. return each;
  1375. } else {
  1376. return $recv($recv($recv(each)._key()).__comma("=")).__comma($recv(each)._value());
  1377. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1378. $ctx2.sendIdx[","]=1;
  1379. //>>excludeEnd("ctx");
  1380. }
  1381. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1382. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  1383. //>>excludeEnd("ctx");
  1384. }));
  1385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1386. }, function($ctx1) {$ctx1.fill(self,"importsAsJson",{},$globals.Package)});
  1387. //>>excludeEnd("ctx");
  1388. },
  1389. //>>excludeStart("ide", pragmas.excludeIdeData);
  1390. args: [],
  1391. source: "importsAsJson\x0a\x0a\x09^ self sortedImportsAsArray collect: [ :each |\x0a\x09\x09each isString\x0a\x09\x09\x09ifTrue: [ each ]\x0a\x09\x09\x09ifFalse: [ each key, '=', each value ]]",
  1392. referencedClasses: [],
  1393. //>>excludeEnd("ide");
  1394. messageSends: ["collect:", "sortedImportsAsArray", "ifTrue:ifFalse:", "isString", ",", "key", "value"]
  1395. }),
  1396. $globals.Package);
  1397. $core.addMethod(
  1398. $core.method({
  1399. selector: "importsDefinition",
  1400. protocol: "accessing",
  1401. fn: function (){
  1402. var self=this,$self=this;
  1403. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1404. return $core.withContext(function($ctx1) {
  1405. //>>excludeEnd("ctx");
  1406. return $recv($globals.String)._streamContents_((function(stream){
  1407. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1408. return $core.withContext(function($ctx2) {
  1409. //>>excludeEnd("ctx");
  1410. $recv(stream)._write_("{");
  1411. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1412. $ctx2.sendIdx["write:"]=1;
  1413. //>>excludeEnd("ctx");
  1414. $recv($self._sortedImportsAsArray())._do_separatedBy_((function(each){
  1415. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1416. return $core.withContext(function($ctx3) {
  1417. //>>excludeEnd("ctx");
  1418. return $recv(stream)._print_(each);
  1419. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1420. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)});
  1421. //>>excludeEnd("ctx");
  1422. }),(function(){
  1423. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1424. return $core.withContext(function($ctx3) {
  1425. //>>excludeEnd("ctx");
  1426. return $recv(stream)._write_(". ");
  1427. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1428. $ctx3.sendIdx["write:"]=2;
  1429. //>>excludeEnd("ctx");
  1430. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1431. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)});
  1432. //>>excludeEnd("ctx");
  1433. }));
  1434. return $recv(stream)._write_("}");
  1435. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1436. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)});
  1437. //>>excludeEnd("ctx");
  1438. }));
  1439. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1440. }, function($ctx1) {$ctx1.fill(self,"importsDefinition",{},$globals.Package)});
  1441. //>>excludeEnd("ctx");
  1442. },
  1443. //>>excludeStart("ide", pragmas.excludeIdeData);
  1444. args: [],
  1445. source: "importsDefinition\x0a\x09^ String streamContents: [ :stream |\x0a\x09\x09stream write: '{'.\x0a\x09\x09self sortedImportsAsArray\x0a\x09\x09\x09do: [ :each | stream print: each ]\x0a\x09\x09\x09separatedBy: [ stream write: '. ' ].\x0a\x09\x09stream write: '}' ]",
  1446. referencedClasses: ["String"],
  1447. //>>excludeEnd("ide");
  1448. messageSends: ["streamContents:", "write:", "do:separatedBy:", "sortedImportsAsArray", "print:"]
  1449. }),
  1450. $globals.Package);
  1451. $core.addMethod(
  1452. $core.method({
  1453. selector: "importsFromJson:",
  1454. protocol: "converting",
  1455. fn: function (anArray){
  1456. var self=this,$self=this;
  1457. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1458. return $core.withContext(function($ctx1) {
  1459. //>>excludeEnd("ctx");
  1460. var $1;
  1461. return $recv(anArray)._collect_((function(each){
  1462. var split;
  1463. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1464. return $core.withContext(function($ctx2) {
  1465. //>>excludeEnd("ctx");
  1466. split=$recv(each)._tokenize_("=");
  1467. $1=$recv($recv(split)._size()).__eq((1));
  1468. if($core.assert($1)){
  1469. return $recv(split)._first();
  1470. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1471. $ctx2.sendIdx["first"]=1;
  1472. //>>excludeEnd("ctx");
  1473. } else {
  1474. return $recv($recv(split)._first()).__minus_gt($recv(split)._second());
  1475. }
  1476. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1477. }, function($ctx2) {$ctx2.fillBlock({each:each,split:split},$ctx1,1)});
  1478. //>>excludeEnd("ctx");
  1479. }));
  1480. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1481. }, function($ctx1) {$ctx1.fill(self,"importsFromJson:",{anArray:anArray},$globals.Package)});
  1482. //>>excludeEnd("ctx");
  1483. },
  1484. //>>excludeStart("ide", pragmas.excludeIdeData);
  1485. args: ["anArray"],
  1486. source: "importsFromJson: anArray\x0a\x09\x22Parses array of string, eg. #('asdf' 'qwer=tyuo')\x0a\x09into array of Strings and Associations,\x0a\x09eg. {'asdf'. 'qwer'->'tyuo'}\x22\x0a\x0a\x09^ anArray collect: [ :each |\x0a\x09\x09| split |\x0a\x09\x09split := each tokenize: '='.\x0a\x09\x09split size = 1\x0a\x09\x09\x09ifTrue: [ split first ]\x0a\x09\x09\x09ifFalse: [ split first -> split second ]]",
  1487. referencedClasses: [],
  1488. //>>excludeEnd("ide");
  1489. messageSends: ["collect:", "tokenize:", "ifTrue:ifFalse:", "=", "size", "first", "->", "second"]
  1490. }),
  1491. $globals.Package);
  1492. $core.addMethod(
  1493. $core.method({
  1494. selector: "initialize",
  1495. protocol: "initialization",
  1496. fn: function (){
  1497. var self=this,$self=this;
  1498. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1499. return $core.withContext(function($ctx1) {
  1500. //>>excludeEnd("ctx");
  1501. (
  1502. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1503. $ctx1.supercall = true,
  1504. //>>excludeEnd("ctx");
  1505. ($globals.Package.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($self, []));
  1506. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1507. $ctx1.supercall = false;
  1508. //>>excludeEnd("ctx");;
  1509. $self.organization=$recv($globals.PackageOrganizer)._new();
  1510. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1511. $ctx1.sendIdx["new"]=1;
  1512. //>>excludeEnd("ctx");
  1513. $self.evalBlock=nil;
  1514. $self.dirty=nil;
  1515. $self.imports=nil;
  1516. $self.isReady=$recv($globals.Promise)._new();
  1517. $self.transport=nil;
  1518. return self;
  1519. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1520. }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.Package)});
  1521. //>>excludeEnd("ctx");
  1522. },
  1523. //>>excludeStart("ide", pragmas.excludeIdeData);
  1524. args: [],
  1525. source: "initialize\x0a\x09super initialize.\x0a\x0a\x09organization := PackageOrganizer new.\x0a\x09evalBlock := nil.\x0a\x09dirty := nil.\x0a\x09imports := nil.\x0a\x09isReady := Promise new.\x0a\x09transport := nil",
  1526. referencedClasses: ["PackageOrganizer", "Promise"],
  1527. //>>excludeEnd("ide");
  1528. messageSends: ["initialize", "new"]
  1529. }),
  1530. $globals.Package);
  1531. $core.addMethod(
  1532. $core.method({
  1533. selector: "isDirty",
  1534. protocol: "testing",
  1535. fn: function (){
  1536. var self=this,$self=this;
  1537. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1538. return $core.withContext(function($ctx1) {
  1539. //>>excludeEnd("ctx");
  1540. var $1,$receiver;
  1541. $1=$self.dirty;
  1542. if(($receiver = $1) == null || $receiver.a$nil){
  1543. return false;
  1544. } else {
  1545. return $1;
  1546. }
  1547. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1548. }, function($ctx1) {$ctx1.fill(self,"isDirty",{},$globals.Package)});
  1549. //>>excludeEnd("ctx");
  1550. },
  1551. //>>excludeStart("ide", pragmas.excludeIdeData);
  1552. args: [],
  1553. source: "isDirty\x0a\x09^ dirty ifNil: [ false ]",
  1554. referencedClasses: [],
  1555. //>>excludeEnd("ide");
  1556. messageSends: ["ifNil:"]
  1557. }),
  1558. $globals.Package);
  1559. $core.addMethod(
  1560. $core.method({
  1561. selector: "isPackage",
  1562. protocol: "testing",
  1563. fn: function (){
  1564. var self=this,$self=this;
  1565. return true;
  1566. },
  1567. //>>excludeStart("ide", pragmas.excludeIdeData);
  1568. args: [],
  1569. source: "isPackage\x0a\x09^ true",
  1570. referencedClasses: [],
  1571. //>>excludeEnd("ide");
  1572. messageSends: []
  1573. }),
  1574. $globals.Package);
  1575. $core.addMethod(
  1576. $core.method({
  1577. selector: "isReady",
  1578. protocol: "accessing",
  1579. fn: function (){
  1580. var self=this,$self=this;
  1581. return $self.isReady;
  1582. },
  1583. //>>excludeStart("ide", pragmas.excludeIdeData);
  1584. args: [],
  1585. source: "isReady\x0a\x09^ isReady",
  1586. referencedClasses: [],
  1587. //>>excludeEnd("ide");
  1588. messageSends: []
  1589. }),
  1590. $globals.Package);
  1591. $core.addMethod(
  1592. $core.method({
  1593. selector: "isReady:",
  1594. protocol: "accessing",
  1595. fn: function (aPromise){
  1596. var self=this,$self=this;
  1597. $self.isReady=aPromise;
  1598. return self;
  1599. },
  1600. //>>excludeStart("ide", pragmas.excludeIdeData);
  1601. args: ["aPromise"],
  1602. source: "isReady: aPromise\x0a\x09isReady := aPromise",
  1603. referencedClasses: [],
  1604. //>>excludeEnd("ide");
  1605. messageSends: []
  1606. }),
  1607. $globals.Package);
  1608. $core.addMethod(
  1609. $core.method({
  1610. selector: "javaScriptDescriptor:",
  1611. protocol: "accessing",
  1612. fn: function (anObject){
  1613. var self=this,$self=this;
  1614. var basicEval,basicImports;
  1615. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1616. return $core.withContext(function($ctx1) {
  1617. //>>excludeEnd("ctx");
  1618. basicEval=$recv(anObject)._at_ifAbsent_("innerEval",(function(){
  1619. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1620. return $core.withContext(function($ctx2) {
  1621. //>>excludeEnd("ctx");
  1622. return nil._asJavaScriptObject();
  1623. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1624. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  1625. //>>excludeEnd("ctx");
  1626. }));
  1627. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1628. $ctx1.sendIdx["at:ifAbsent:"]=1;
  1629. //>>excludeEnd("ctx");
  1630. basicImports=$recv(anObject)._at_ifAbsent_("imports",(function(){
  1631. return [];
  1632. }));
  1633. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1634. $ctx1.sendIdx["at:ifAbsent:"]=2;
  1635. //>>excludeEnd("ctx");
  1636. $self.basicTransport=$recv(anObject)._at_ifAbsent_("transport",(function(){
  1637. }));
  1638. $recv(anObject)._at_ifPresent_("isReady",(function(aPromise){
  1639. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1640. return $core.withContext(function($ctx2) {
  1641. //>>excludeEnd("ctx");
  1642. return $self._isReady_(aPromise);
  1643. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1644. }, function($ctx2) {$ctx2.fillBlock({aPromise:aPromise},$ctx1,4)});
  1645. //>>excludeEnd("ctx");
  1646. }));
  1647. $self._evalBlock_(basicEval);
  1648. $self._imports_($self._importsFromJson_(basicImports));
  1649. return self;
  1650. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1651. }, function($ctx1) {$ctx1.fill(self,"javaScriptDescriptor:",{anObject:anObject,basicEval:basicEval,basicImports:basicImports},$globals.Package)});
  1652. //>>excludeEnd("ctx");
  1653. },
  1654. //>>excludeStart("ide", pragmas.excludeIdeData);
  1655. args: ["anObject"],
  1656. source: "javaScriptDescriptor: anObject\x0a\x09| basicEval basicImports |\x0a\x0a\x09basicEval := anObject at: 'innerEval' ifAbsent: [ nil asJavaScriptObject ].\x0a\x09basicImports := anObject at: 'imports' ifAbsent: [ #() ].\x0a\x09basicTransport := anObject at: 'transport' ifAbsent: [].\x0a\x09anObject at: 'isReady' ifPresent: [ :aPromise | self isReady: aPromise ].\x0a\x0a\x09self\x0a\x09\x09evalBlock: basicEval;\x0a\x09\x09imports: (self importsFromJson: basicImports)",
  1657. referencedClasses: [],
  1658. //>>excludeEnd("ide");
  1659. messageSends: ["at:ifAbsent:", "asJavaScriptObject", "at:ifPresent:", "isReady:", "evalBlock:", "imports:", "importsFromJson:"]
  1660. }),
  1661. $globals.Package);
  1662. $core.addMethod(
  1663. $core.method({
  1664. selector: "loadDependencies",
  1665. protocol: "dependencies",
  1666. fn: function (){
  1667. var self=this,$self=this;
  1668. var classes,packages;
  1669. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1670. return $core.withContext(function($ctx1) {
  1671. //>>excludeEnd("ctx");
  1672. var $1;
  1673. classes=$self._loadDependencyClasses();
  1674. $1=$recv($recv(classes)._collect_((function(each){
  1675. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1676. return $core.withContext(function($ctx2) {
  1677. //>>excludeEnd("ctx");
  1678. return $recv(each)._package();
  1679. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1680. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  1681. //>>excludeEnd("ctx");
  1682. })))._asSet();
  1683. $recv($1)._remove_ifAbsent_(self,(function(){
  1684. }));
  1685. return $recv($1)._yourself();
  1686. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1687. }, function($ctx1) {$ctx1.fill(self,"loadDependencies",{classes:classes,packages:packages},$globals.Package)});
  1688. //>>excludeEnd("ctx");
  1689. },
  1690. //>>excludeStart("ide", pragmas.excludeIdeData);
  1691. args: [],
  1692. 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",
  1693. referencedClasses: [],
  1694. //>>excludeEnd("ide");
  1695. messageSends: ["loadDependencyClasses", "remove:ifAbsent:", "asSet", "collect:", "package", "yourself"]
  1696. }),
  1697. $globals.Package);
  1698. $core.addMethod(
  1699. $core.method({
  1700. selector: "loadDependencyClasses",
  1701. protocol: "dependencies",
  1702. fn: function (){
  1703. var self=this,$self=this;
  1704. var starCategoryName;
  1705. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1706. return $core.withContext(function($ctx1) {
  1707. //>>excludeEnd("ctx");
  1708. var $3,$2,$1;
  1709. starCategoryName="*".__comma($self._name());
  1710. $3=$self._classes();
  1711. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1712. $ctx1.sendIdx["classes"]=1;
  1713. //>>excludeEnd("ctx");
  1714. $2=$recv($3)._collect_((function(each){
  1715. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1716. return $core.withContext(function($ctx2) {
  1717. //>>excludeEnd("ctx");
  1718. return $recv(each)._superclass();
  1719. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1720. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  1721. //>>excludeEnd("ctx");
  1722. }));
  1723. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1724. $ctx1.sendIdx["collect:"]=1;
  1725. //>>excludeEnd("ctx");
  1726. $1=$recv($2)._asSet();
  1727. $recv($1)._addAll_($recv($recv($globals.Smalltalk)._classes())._select_((function(each){
  1728. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1729. return $core.withContext(function($ctx2) {
  1730. //>>excludeEnd("ctx");
  1731. return $recv($recv([each,$recv(each)._theMetaClass()])._copyWithout_(nil))._anySatisfy_((function(any){
  1732. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1733. return $core.withContext(function($ctx3) {
  1734. //>>excludeEnd("ctx");
  1735. return $recv($recv($recv(any)._protocols())._includes_(starCategoryName))._and_((function(){
  1736. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1737. return $core.withContext(function($ctx4) {
  1738. //>>excludeEnd("ctx");
  1739. return $recv($recv(any)._ownMethodsInProtocol_(starCategoryName))._notEmpty();
  1740. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1741. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,4)});
  1742. //>>excludeEnd("ctx");
  1743. }));
  1744. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1745. }, function($ctx3) {$ctx3.fillBlock({any:any},$ctx2,3)});
  1746. //>>excludeEnd("ctx");
  1747. }));
  1748. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1749. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  1750. //>>excludeEnd("ctx");
  1751. })));
  1752. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1753. $ctx1.sendIdx["addAll:"]=1;
  1754. //>>excludeEnd("ctx");
  1755. $recv($1)._addAll_($recv($globals.Array)._streamContents_((function(as){
  1756. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1757. return $core.withContext(function($ctx2) {
  1758. //>>excludeEnd("ctx");
  1759. return $recv($self._traitCompositions())._valuesDo_((function(each){
  1760. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1761. return $core.withContext(function($ctx3) {
  1762. //>>excludeEnd("ctx");
  1763. return $recv(as)._write_($recv(each)._collect_((function(eachTT){
  1764. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1765. return $core.withContext(function($ctx4) {
  1766. //>>excludeEnd("ctx");
  1767. return $recv(eachTT)._trait();
  1768. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1769. }, function($ctx4) {$ctx4.fillBlock({eachTT:eachTT},$ctx3,7)});
  1770. //>>excludeEnd("ctx");
  1771. })));
  1772. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1773. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,6)});
  1774. //>>excludeEnd("ctx");
  1775. }));
  1776. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1777. }, function($ctx2) {$ctx2.fillBlock({as:as},$ctx1,5)});
  1778. //>>excludeEnd("ctx");
  1779. })));
  1780. $recv($1)._remove_ifAbsent_(nil,(function(){
  1781. }));
  1782. return $recv($1)._yourself();
  1783. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1784. }, function($ctx1) {$ctx1.fill(self,"loadDependencyClasses",{starCategoryName:starCategoryName},$globals.Package)});
  1785. //>>excludeEnd("ctx");
  1786. },
  1787. //>>excludeStart("ide", pragmas.excludeIdeData);
  1788. args: [],
  1789. 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\x0a\x09as well as all traits used\x22\x0a\x09\x0a\x09| starCategoryName |\x0a\x09starCategoryName := '*', self name.\x0a\x09^ (self classes collect: [ :each | each superclass ]) asSet\x0a\x09\x09addAll: (Smalltalk classes select: [ :each |\x0a\x09\x09\x09({each. each theMetaClass} copyWithout: nil) anySatisfy: [ :any |\x0a\x09\x09\x09\x09(any protocols includes: starCategoryName) and: [\x0a\x09\x09\x09\x09\x09(any ownMethodsInProtocol: starCategoryName) notEmpty ]]]);\x0a\x09\x09addAll: (Array streamContents: [ :as | self traitCompositions valuesDo: [ :each | as write: (each collect: [ :eachTT | eachTT trait ])]]);\x0a\x09\x09remove: nil ifAbsent: [];\x0a\x09\x09yourself",
  1790. referencedClasses: ["Smalltalk", "Array"],
  1791. //>>excludeEnd("ide");
  1792. messageSends: [",", "name", "addAll:", "asSet", "collect:", "classes", "superclass", "select:", "anySatisfy:", "copyWithout:", "theMetaClass", "and:", "includes:", "protocols", "notEmpty", "ownMethodsInProtocol:", "streamContents:", "valuesDo:", "traitCompositions", "write:", "trait", "remove:ifAbsent:", "yourself"]
  1793. }),
  1794. $globals.Package);
  1795. $core.addMethod(
  1796. $core.method({
  1797. selector: "name",
  1798. protocol: "accessing",
  1799. fn: function (){
  1800. var self=this,$self=this;
  1801. return $self.name;
  1802. },
  1803. //>>excludeStart("ide", pragmas.excludeIdeData);
  1804. args: [],
  1805. source: "name\x0a\x09^ name",
  1806. referencedClasses: [],
  1807. //>>excludeEnd("ide");
  1808. messageSends: []
  1809. }),
  1810. $globals.Package);
  1811. $core.addMethod(
  1812. $core.method({
  1813. selector: "name:",
  1814. protocol: "accessing",
  1815. fn: function (aString){
  1816. var self=this,$self=this;
  1817. $self.name=aString;
  1818. return self;
  1819. },
  1820. //>>excludeStart("ide", pragmas.excludeIdeData);
  1821. args: ["aString"],
  1822. source: "name: aString\x0a\x09name := aString",
  1823. referencedClasses: [],
  1824. //>>excludeEnd("ide");
  1825. messageSends: []
  1826. }),
  1827. $globals.Package);
  1828. $core.addMethod(
  1829. $core.method({
  1830. selector: "organization",
  1831. protocol: "accessing",
  1832. fn: function (){
  1833. var self=this,$self=this;
  1834. return $self.organization;
  1835. },
  1836. //>>excludeStart("ide", pragmas.excludeIdeData);
  1837. args: [],
  1838. source: "organization\x0a\x09^ organization",
  1839. referencedClasses: [],
  1840. //>>excludeEnd("ide");
  1841. messageSends: []
  1842. }),
  1843. $globals.Package);
  1844. $core.addMethod(
  1845. $core.method({
  1846. selector: "printOn:",
  1847. protocol: "printing",
  1848. fn: function (aStream){
  1849. var self=this,$self=this;
  1850. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1851. return $core.withContext(function($ctx1) {
  1852. //>>excludeEnd("ctx");
  1853. (
  1854. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1855. $ctx1.supercall = true,
  1856. //>>excludeEnd("ctx");
  1857. ($globals.Package.superclass||$boot.nilAsClass).fn.prototype._printOn_.apply($self, [aStream]));
  1858. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1859. $ctx1.supercall = false;
  1860. //>>excludeEnd("ctx");;
  1861. $recv(aStream)._nextPutAll_(" (");
  1862. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1863. $ctx1.sendIdx["nextPutAll:"]=1;
  1864. //>>excludeEnd("ctx");
  1865. $recv(aStream)._nextPutAll_($self._name());
  1866. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1867. $ctx1.sendIdx["nextPutAll:"]=2;
  1868. //>>excludeEnd("ctx");
  1869. $recv(aStream)._nextPutAll_(")");
  1870. return self;
  1871. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1872. }, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},$globals.Package)});
  1873. //>>excludeEnd("ctx");
  1874. },
  1875. //>>excludeStart("ide", pragmas.excludeIdeData);
  1876. args: ["aStream"],
  1877. source: "printOn: aStream\x0a\x09super printOn: aStream.\x0a\x09aStream \x0a\x09\x09nextPutAll: ' (';\x0a\x09\x09nextPutAll: self name;\x0a\x09\x09nextPutAll: ')'",
  1878. referencedClasses: [],
  1879. //>>excludeEnd("ide");
  1880. messageSends: ["printOn:", "nextPutAll:", "name"]
  1881. }),
  1882. $globals.Package);
  1883. $core.addMethod(
  1884. $core.method({
  1885. selector: "setupClasses",
  1886. protocol: "classes",
  1887. fn: function (){
  1888. var self=this,$self=this;
  1889. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1890. return $core.withContext(function($ctx1) {
  1891. //>>excludeEnd("ctx");
  1892. $recv($self._classes())._do_((function(each){
  1893. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1894. return $core.withContext(function($ctx2) {
  1895. //>>excludeEnd("ctx");
  1896. return $recv(each)._initialize();
  1897. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1898. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  1899. //>>excludeEnd("ctx");
  1900. }));
  1901. return self;
  1902. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1903. }, function($ctx1) {$ctx1.fill(self,"setupClasses",{},$globals.Package)});
  1904. //>>excludeEnd("ctx");
  1905. },
  1906. //>>excludeStart("ide", pragmas.excludeIdeData);
  1907. args: [],
  1908. source: "setupClasses\x0a\x09self classes do: [ :each | each initialize ]",
  1909. referencedClasses: [],
  1910. //>>excludeEnd("ide");
  1911. messageSends: ["do:", "classes", "initialize"]
  1912. }),
  1913. $globals.Package);
  1914. $core.addMethod(
  1915. $core.method({
  1916. selector: "sortedClasses",
  1917. protocol: "classes",
  1918. fn: function (){
  1919. var self=this,$self=this;
  1920. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1921. return $core.withContext(function($ctx1) {
  1922. //>>excludeEnd("ctx");
  1923. return $recv($self._class())._sortedClasses_($self._classes());
  1924. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1925. }, function($ctx1) {$ctx1.fill(self,"sortedClasses",{},$globals.Package)});
  1926. //>>excludeEnd("ctx");
  1927. },
  1928. //>>excludeStart("ide", pragmas.excludeIdeData);
  1929. args: [],
  1930. 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",
  1931. referencedClasses: [],
  1932. //>>excludeEnd("ide");
  1933. messageSends: ["sortedClasses:", "class", "classes"]
  1934. }),
  1935. $globals.Package);
  1936. $core.addMethod(
  1937. $core.method({
  1938. selector: "sortedImportsAsArray",
  1939. protocol: "private",
  1940. fn: function (){
  1941. var self=this,$self=this;
  1942. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1943. return $core.withContext(function($ctx1) {
  1944. //>>excludeEnd("ctx");
  1945. var $3,$2,$4,$1,$6,$5,$7;
  1946. return $recv($recv($self._imports())._asArray())._sorted_((function(a,b){
  1947. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1948. return $core.withContext(function($ctx2) {
  1949. //>>excludeEnd("ctx");
  1950. $3=$recv(a)._isString();
  1951. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1952. $ctx2.sendIdx["isString"]=1;
  1953. //>>excludeEnd("ctx");
  1954. $2=$recv($3)._not();
  1955. $4=$recv(b)._isString();
  1956. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1957. $ctx2.sendIdx["isString"]=2;
  1958. //>>excludeEnd("ctx");
  1959. $1=$recv($2).__and($4);
  1960. return $recv($1)._or_((function(){
  1961. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1962. return $core.withContext(function($ctx3) {
  1963. //>>excludeEnd("ctx");
  1964. $6=$recv(a)._isString();
  1965. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1966. $ctx3.sendIdx["isString"]=3;
  1967. //>>excludeEnd("ctx");
  1968. $5=$recv($6).__eq($recv(b)._isString());
  1969. return $recv($5)._and_((function(){
  1970. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1971. return $core.withContext(function($ctx4) {
  1972. //>>excludeEnd("ctx");
  1973. $7=$recv(a)._value();
  1974. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1975. $ctx4.sendIdx["value"]=1;
  1976. //>>excludeEnd("ctx");
  1977. return $recv($7).__lt_eq($recv(b)._value());
  1978. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1979. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,3)});
  1980. //>>excludeEnd("ctx");
  1981. }));
  1982. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1983. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  1984. //>>excludeEnd("ctx");
  1985. }));
  1986. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1987. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,1)});
  1988. //>>excludeEnd("ctx");
  1989. }));
  1990. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1991. }, function($ctx1) {$ctx1.fill(self,"sortedImportsAsArray",{},$globals.Package)});
  1992. //>>excludeEnd("ctx");
  1993. },
  1994. //>>excludeStart("ide", pragmas.excludeIdeData);
  1995. args: [],
  1996. source: "sortedImportsAsArray\x0a\x09\x22Answer imports sorted first by type (associations first),\x0a\x09then by value\x22\x0a\x0a\x09^ self imports asArray\x0a\x09\x09sorted: [ :a :b |\x0a\x09\x09\x09a isString not & b isString or: [\x0a\x09\x09\x09\x09a isString = b isString and: [\x0a\x09\x09\x09\x09\x09a value <= b value ]]]",
  1997. referencedClasses: [],
  1998. //>>excludeEnd("ide");
  1999. messageSends: ["sorted:", "asArray", "imports", "or:", "&", "not", "isString", "and:", "=", "<=", "value"]
  2000. }),
  2001. $globals.Package);
  2002. $core.addMethod(
  2003. $core.method({
  2004. selector: "traitCompositions",
  2005. protocol: "dependencies",
  2006. fn: function (){
  2007. var self=this,$self=this;
  2008. var traitCompositions;
  2009. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2010. return $core.withContext(function($ctx1) {
  2011. //>>excludeEnd("ctx");
  2012. var $1,$2,$3,$receiver;
  2013. traitCompositions=$recv($globals.Dictionary)._new();
  2014. $recv($self._classes())._do_((function(each){
  2015. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2016. return $core.withContext(function($ctx2) {
  2017. //>>excludeEnd("ctx");
  2018. $1=traitCompositions;
  2019. $2=$recv(each)._traitComposition();
  2020. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2021. $ctx2.sendIdx["traitComposition"]=1;
  2022. //>>excludeEnd("ctx");
  2023. $recv($1)._at_put_(each,$2);
  2024. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2025. $ctx2.sendIdx["at:put:"]=1;
  2026. //>>excludeEnd("ctx");
  2027. $3=$recv(each)._theMetaClass();
  2028. if(($receiver = $3) == null || $receiver.a$nil){
  2029. return $3;
  2030. } else {
  2031. var meta;
  2032. meta=$receiver;
  2033. return $recv(traitCompositions)._at_put_(meta,$recv(meta)._traitComposition());
  2034. }
  2035. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2036. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2037. //>>excludeEnd("ctx");
  2038. }));
  2039. return $recv(traitCompositions)._reject_((function(each){
  2040. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2041. return $core.withContext(function($ctx2) {
  2042. //>>excludeEnd("ctx");
  2043. return $recv(each)._isEmpty();
  2044. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2045. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
  2046. //>>excludeEnd("ctx");
  2047. }));
  2048. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2049. }, function($ctx1) {$ctx1.fill(self,"traitCompositions",{traitCompositions:traitCompositions},$globals.Package)});
  2050. //>>excludeEnd("ctx");
  2051. },
  2052. //>>excludeStart("ide", pragmas.excludeIdeData);
  2053. args: [],
  2054. source: "traitCompositions\x0a\x09| traitCompositions |\x0a\x09traitCompositions := Dictionary new.\x0a\x09self classes do: [ :each |\x0a\x09\x09traitCompositions at: each put: each traitComposition.\x0a\x09\x09each theMetaClass ifNotNil: [ :meta | traitCompositions at: meta put: meta traitComposition ] ].\x0a\x09^ traitCompositions reject: [ :each | each isEmpty ]",
  2055. referencedClasses: ["Dictionary"],
  2056. //>>excludeEnd("ide");
  2057. messageSends: ["new", "do:", "classes", "at:put:", "traitComposition", "ifNotNil:", "theMetaClass", "reject:", "isEmpty"]
  2058. }),
  2059. $globals.Package);
  2060. $core.addMethod(
  2061. $core.method({
  2062. selector: "transport",
  2063. protocol: "accessing",
  2064. fn: function (){
  2065. var self=this,$self=this;
  2066. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2067. return $core.withContext(function($ctx1) {
  2068. //>>excludeEnd("ctx");
  2069. var $1,$receiver;
  2070. $1=$self.transport;
  2071. if(($receiver = $1) == null || $receiver.a$nil){
  2072. $self._transport_($recv($globals.PackageTransport)._fromJson_($self._basicTransport()));
  2073. return $self.transport;
  2074. } else {
  2075. return $1;
  2076. }
  2077. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2078. }, function($ctx1) {$ctx1.fill(self,"transport",{},$globals.Package)});
  2079. //>>excludeEnd("ctx");
  2080. },
  2081. //>>excludeStart("ide", pragmas.excludeIdeData);
  2082. args: [],
  2083. source: "transport\x0a\x09^ transport ifNil: [ \x0a\x09\x09self transport: (PackageTransport fromJson: self basicTransport).\x0a\x09\x09transport ]",
  2084. referencedClasses: ["PackageTransport"],
  2085. //>>excludeEnd("ide");
  2086. messageSends: ["ifNil:", "transport:", "fromJson:", "basicTransport"]
  2087. }),
  2088. $globals.Package);
  2089. $core.addMethod(
  2090. $core.method({
  2091. selector: "transport:",
  2092. protocol: "accessing",
  2093. fn: function (aPackageTransport){
  2094. var self=this,$self=this;
  2095. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2096. return $core.withContext(function($ctx1) {
  2097. //>>excludeEnd("ctx");
  2098. $self.transport=aPackageTransport;
  2099. $recv(aPackageTransport)._package_(self);
  2100. return self;
  2101. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2102. }, function($ctx1) {$ctx1.fill(self,"transport:",{aPackageTransport:aPackageTransport},$globals.Package)});
  2103. //>>excludeEnd("ctx");
  2104. },
  2105. //>>excludeStart("ide", pragmas.excludeIdeData);
  2106. args: ["aPackageTransport"],
  2107. source: "transport: aPackageTransport\x0a\x09transport := aPackageTransport.\x0a\x09aPackageTransport package: self",
  2108. referencedClasses: [],
  2109. //>>excludeEnd("ide");
  2110. messageSends: ["package:"]
  2111. }),
  2112. $globals.Package);
  2113. $core.addMethod(
  2114. $core.method({
  2115. selector: "validateImports:",
  2116. protocol: "validation",
  2117. fn: function (aCollection){
  2118. var self=this,$self=this;
  2119. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2120. return $core.withContext(function($ctx1) {
  2121. //>>excludeEnd("ctx");
  2122. var $1,$2,$5,$4,$3,$6;
  2123. $recv(aCollection)._do_((function(import_){
  2124. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2125. return $core.withContext(function($ctx2) {
  2126. //>>excludeEnd("ctx");
  2127. $1=$recv(import_)._isString();
  2128. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2129. $ctx2.sendIdx["isString"]=1;
  2130. //>>excludeEnd("ctx");
  2131. if(!$core.assert($1)){
  2132. $2=$recv(import_)._respondsTo_("key");
  2133. if(!$core.assert($2)){
  2134. $self._error_("Imports must be Strings or Associations");
  2135. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2136. $ctx2.sendIdx["error:"]=1;
  2137. //>>excludeEnd("ctx");
  2138. }
  2139. $5=$recv(import_)._key();
  2140. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2141. $ctx2.sendIdx["key"]=1;
  2142. //>>excludeEnd("ctx");
  2143. $4=$recv($5)._isString();
  2144. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2145. $ctx2.sendIdx["isString"]=2;
  2146. //>>excludeEnd("ctx");
  2147. $3=$recv($4).__and($recv($recv(import_)._value())._isString());
  2148. if(!$core.assert($3)){
  2149. $self._error_("Key and value must be Strings");
  2150. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2151. $ctx2.sendIdx["error:"]=2;
  2152. //>>excludeEnd("ctx");
  2153. }
  2154. $6=$recv($recv(import_)._key())._match_("^[a-zA-Z][a-zA-Z0-9]*$");
  2155. if(!$core.assert($6)){
  2156. return $self._error_("Keys must be identifiers");
  2157. }
  2158. }
  2159. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2160. }, function($ctx2) {$ctx2.fillBlock({import_:import_},$ctx1,1)});
  2161. //>>excludeEnd("ctx");
  2162. }));
  2163. return self;
  2164. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2165. }, function($ctx1) {$ctx1.fill(self,"validateImports:",{aCollection:aCollection},$globals.Package)});
  2166. //>>excludeEnd("ctx");
  2167. },
  2168. //>>excludeStart("ide", pragmas.excludeIdeData);
  2169. args: ["aCollection"],
  2170. source: "validateImports: aCollection\x0a\x0a\x09aCollection do: [ :import |\x0a\x09\x09import isString ifFalse: [\x0a\x09\x09\x09(import respondsTo: #key) ifFalse: [\x0a\x09\x09\x09\x09self error: 'Imports must be Strings or Associations' ].\x0a\x09\x09\x09import key isString & import value isString ifFalse: [\x0a\x09\x09\x09\x09self error: 'Key and value must be Strings' ].\x0a\x09\x09\x09(import key match: '^[a-zA-Z][a-zA-Z0-9]*$') ifFalse: [\x0a\x09\x09\x09\x09self error: 'Keys must be identifiers' ]]]",
  2171. referencedClasses: [],
  2172. //>>excludeEnd("ide");
  2173. messageSends: ["do:", "ifFalse:", "isString", "respondsTo:", "error:", "&", "key", "value", "match:"]
  2174. }),
  2175. $globals.Package);
  2176. $core.setSlots($globals.Package.a$cls, ["defaultCommitPathJs", "defaultCommitPathSt"]);
  2177. $core.addMethod(
  2178. $core.method({
  2179. selector: "named:",
  2180. protocol: "accessing",
  2181. fn: function (aPackageName){
  2182. var self=this,$self=this;
  2183. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2184. return $core.withContext(function($ctx1) {
  2185. //>>excludeEnd("ctx");
  2186. return $recv($globals.Smalltalk)._packageAt_ifAbsent_(aPackageName,(function(){
  2187. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2188. return $core.withContext(function($ctx2) {
  2189. //>>excludeEnd("ctx");
  2190. return $recv($globals.Smalltalk)._createPackage_(aPackageName);
  2191. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2192. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2193. //>>excludeEnd("ctx");
  2194. }));
  2195. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2196. }, function($ctx1) {$ctx1.fill(self,"named:",{aPackageName:aPackageName},$globals.Package.a$cls)});
  2197. //>>excludeEnd("ctx");
  2198. },
  2199. //>>excludeStart("ide", pragmas.excludeIdeData);
  2200. args: ["aPackageName"],
  2201. source: "named: aPackageName\x0a\x09^ Smalltalk \x0a\x09\x09packageAt: aPackageName\x0a\x09\x09ifAbsent: [ \x0a\x09\x09\x09Smalltalk createPackage: aPackageName ]",
  2202. referencedClasses: ["Smalltalk"],
  2203. //>>excludeEnd("ide");
  2204. messageSends: ["packageAt:ifAbsent:", "createPackage:"]
  2205. }),
  2206. $globals.Package.a$cls);
  2207. $core.addMethod(
  2208. $core.method({
  2209. selector: "named:ifAbsent:",
  2210. protocol: "accessing",
  2211. fn: function (aPackageName,aBlock){
  2212. var self=this,$self=this;
  2213. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2214. return $core.withContext(function($ctx1) {
  2215. //>>excludeEnd("ctx");
  2216. return $recv($globals.Smalltalk)._packageAt_ifAbsent_(aPackageName,aBlock);
  2217. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2218. }, function($ctx1) {$ctx1.fill(self,"named:ifAbsent:",{aPackageName:aPackageName,aBlock:aBlock},$globals.Package.a$cls)});
  2219. //>>excludeEnd("ctx");
  2220. },
  2221. //>>excludeStart("ide", pragmas.excludeIdeData);
  2222. args: ["aPackageName", "aBlock"],
  2223. source: "named: aPackageName ifAbsent: aBlock\x0a\x09^ Smalltalk packageAt: aPackageName ifAbsent: aBlock",
  2224. referencedClasses: ["Smalltalk"],
  2225. //>>excludeEnd("ide");
  2226. messageSends: ["packageAt:ifAbsent:"]
  2227. }),
  2228. $globals.Package.a$cls);
  2229. $core.addMethod(
  2230. $core.method({
  2231. selector: "named:imports:transport:",
  2232. protocol: "accessing",
  2233. fn: function (aPackageName,anArray,aTransport){
  2234. var self=this,$self=this;
  2235. var pkg;
  2236. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2237. return $core.withContext(function($ctx1) {
  2238. //>>excludeEnd("ctx");
  2239. pkg=$self._named_(aPackageName);
  2240. $recv(pkg)._imports_(anArray);
  2241. $recv(pkg)._transport_(aTransport);
  2242. return pkg;
  2243. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2244. }, function($ctx1) {$ctx1.fill(self,"named:imports:transport:",{aPackageName:aPackageName,anArray:anArray,aTransport:aTransport,pkg:pkg},$globals.Package.a$cls)});
  2245. //>>excludeEnd("ctx");
  2246. },
  2247. //>>excludeStart("ide", pragmas.excludeIdeData);
  2248. args: ["aPackageName", "anArray", "aTransport"],
  2249. source: "named: aPackageName imports: anArray transport: aTransport\x0a\x09| pkg |\x0a\x09\x0a\x09pkg := self named: aPackageName.\x0a\x09pkg imports: anArray.\x0a\x09pkg transport: aTransport.\x0a\x09\x0a\x09^ pkg",
  2250. referencedClasses: [],
  2251. //>>excludeEnd("ide");
  2252. messageSends: ["named:", "imports:", "transport:"]
  2253. }),
  2254. $globals.Package.a$cls);
  2255. $core.addMethod(
  2256. $core.method({
  2257. selector: "named:javaScriptDescriptor:",
  2258. protocol: "instance creation",
  2259. fn: function (aString,anObject){
  2260. var self=this,$self=this;
  2261. var pkg;
  2262. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2263. return $core.withContext(function($ctx1) {
  2264. //>>excludeEnd("ctx");
  2265. pkg=$recv($globals.Smalltalk)._createPackage_(aString);
  2266. $recv(pkg)._javaScriptDescriptor_(anObject);
  2267. return pkg;
  2268. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2269. }, function($ctx1) {$ctx1.fill(self,"named:javaScriptDescriptor:",{aString:aString,anObject:anObject,pkg:pkg},$globals.Package.a$cls)});
  2270. //>>excludeEnd("ctx");
  2271. },
  2272. //>>excludeStart("ide", pragmas.excludeIdeData);
  2273. args: ["aString", "anObject"],
  2274. source: "named: aString javaScriptDescriptor: anObject\x0a\x09| pkg |\x0a\x09\x0a\x09pkg := Smalltalk createPackage: aString.\x0a\x09pkg javaScriptDescriptor: anObject.\x0a\x09^ pkg",
  2275. referencedClasses: ["Smalltalk"],
  2276. //>>excludeEnd("ide");
  2277. messageSends: ["createPackage:", "javaScriptDescriptor:"]
  2278. }),
  2279. $globals.Package.a$cls);
  2280. $core.addMethod(
  2281. $core.method({
  2282. selector: "named:transport:",
  2283. protocol: "accessing",
  2284. fn: function (aPackageName,aTransport){
  2285. var self=this,$self=this;
  2286. var pkg;
  2287. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2288. return $core.withContext(function($ctx1) {
  2289. //>>excludeEnd("ctx");
  2290. pkg=$self._named_(aPackageName);
  2291. $recv(pkg)._transport_(aTransport);
  2292. return pkg;
  2293. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2294. }, function($ctx1) {$ctx1.fill(self,"named:transport:",{aPackageName:aPackageName,aTransport:aTransport,pkg:pkg},$globals.Package.a$cls)});
  2295. //>>excludeEnd("ctx");
  2296. },
  2297. //>>excludeStart("ide", pragmas.excludeIdeData);
  2298. args: ["aPackageName", "aTransport"],
  2299. source: "named: aPackageName transport: aTransport\x0a\x09| pkg |\x0a\x09\x0a\x09pkg := self named: aPackageName.\x0a\x09pkg transport: aTransport.\x0a\x09\x0a\x09^ pkg",
  2300. referencedClasses: [],
  2301. //>>excludeEnd("ide");
  2302. messageSends: ["named:", "transport:"]
  2303. }),
  2304. $globals.Package.a$cls);
  2305. $core.addMethod(
  2306. $core.method({
  2307. selector: "new:",
  2308. protocol: "instance creation",
  2309. fn: function (aString){
  2310. var self=this,$self=this;
  2311. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2312. return $core.withContext(function($ctx1) {
  2313. //>>excludeEnd("ctx");
  2314. var $1;
  2315. $1=$recv($globals.Package)._new();
  2316. $recv($1)._name_(aString);
  2317. return $recv($1)._yourself();
  2318. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2319. }, function($ctx1) {$ctx1.fill(self,"new:",{aString:aString},$globals.Package.a$cls)});
  2320. //>>excludeEnd("ctx");
  2321. },
  2322. //>>excludeStart("ide", pragmas.excludeIdeData);
  2323. args: ["aString"],
  2324. source: "new: aString\x0a\x09^ Package new\x0a\x09\x09name: aString;\x0a\x09\x09yourself",
  2325. referencedClasses: ["Package"],
  2326. //>>excludeEnd("ide");
  2327. messageSends: ["name:", "new", "yourself"]
  2328. }),
  2329. $globals.Package.a$cls);
  2330. $core.addMethod(
  2331. $core.method({
  2332. selector: "sortedClasses:",
  2333. protocol: "sorting",
  2334. fn: function (classes){
  2335. var self=this,$self=this;
  2336. var children,others,nodes,expandedClasses;
  2337. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2338. return $core.withContext(function($ctx1) {
  2339. //>>excludeEnd("ctx");
  2340. var $1,$3,$2;
  2341. children=[];
  2342. others=[];
  2343. $recv(classes)._do_((function(each){
  2344. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2345. return $core.withContext(function($ctx2) {
  2346. //>>excludeEnd("ctx");
  2347. $1=$recv(classes)._includes_($recv(each)._superclass());
  2348. if($core.assert($1)){
  2349. return $recv(others)._add_(each);
  2350. } else {
  2351. return $recv(children)._add_(each);
  2352. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2353. $ctx2.sendIdx["add:"]=1;
  2354. //>>excludeEnd("ctx");
  2355. }
  2356. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2357. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2358. //>>excludeEnd("ctx");
  2359. }));
  2360. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2361. $ctx1.sendIdx["do:"]=1;
  2362. //>>excludeEnd("ctx");
  2363. nodes=$recv(children)._collect_((function(each){
  2364. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2365. return $core.withContext(function($ctx2) {
  2366. //>>excludeEnd("ctx");
  2367. return $recv($globals.ClassSorterNode)._on_classes_level_(each,others,(0));
  2368. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2369. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)});
  2370. //>>excludeEnd("ctx");
  2371. }));
  2372. nodes=$recv(nodes)._sorted_((function(a,b){
  2373. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2374. return $core.withContext(function($ctx2) {
  2375. //>>excludeEnd("ctx");
  2376. $3=$recv(a)._theClass();
  2377. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2378. $ctx2.sendIdx["theClass"]=1;
  2379. //>>excludeEnd("ctx");
  2380. $2=$recv($3)._name();
  2381. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2382. $ctx2.sendIdx["name"]=1;
  2383. //>>excludeEnd("ctx");
  2384. return $recv($2).__lt_eq($recv($recv(b)._theClass())._name());
  2385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2386. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,5)});
  2387. //>>excludeEnd("ctx");
  2388. }));
  2389. expandedClasses=$recv($globals.Array)._new();
  2390. $recv(nodes)._do_((function(aNode){
  2391. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2392. return $core.withContext(function($ctx2) {
  2393. //>>excludeEnd("ctx");
  2394. return $recv(aNode)._traverseClassesWith_(expandedClasses);
  2395. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2396. }, function($ctx2) {$ctx2.fillBlock({aNode:aNode},$ctx1,6)});
  2397. //>>excludeEnd("ctx");
  2398. }));
  2399. return expandedClasses;
  2400. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2401. }, function($ctx1) {$ctx1.fill(self,"sortedClasses:",{classes:classes,children:children,others:others,nodes:nodes,expandedClasses:expandedClasses},$globals.Package.a$cls)});
  2402. //>>excludeEnd("ctx");
  2403. },
  2404. //>>excludeStart("ide", pragmas.excludeIdeData);
  2405. args: ["classes"],
  2406. 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",
  2407. referencedClasses: ["ClassSorterNode", "Array"],
  2408. //>>excludeEnd("ide");
  2409. messageSends: ["do:", "ifFalse:ifTrue:", "includes:", "superclass", "add:", "collect:", "on:classes:level:", "sorted:", "<=", "name", "theClass", "new", "traverseClassesWith:"]
  2410. }),
  2411. $globals.Package.a$cls);
  2412. $core.addClass("PackageStateObserver", $globals.Object, [], "Kernel-Infrastructure");
  2413. //>>excludeStart("ide", pragmas.excludeIdeData);
  2414. $globals.PackageStateObserver.comment="My current instance listens for any changes in the system that might affect the state of a package (being dirty).";
  2415. //>>excludeEnd("ide");
  2416. $core.addMethod(
  2417. $core.method({
  2418. selector: "announcer",
  2419. protocol: "accessing",
  2420. fn: function (){
  2421. var self=this,$self=this;
  2422. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2423. return $core.withContext(function($ctx1) {
  2424. //>>excludeEnd("ctx");
  2425. return $recv($globals.SystemAnnouncer)._current();
  2426. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2427. }, function($ctx1) {$ctx1.fill(self,"announcer",{},$globals.PackageStateObserver)});
  2428. //>>excludeEnd("ctx");
  2429. },
  2430. //>>excludeStart("ide", pragmas.excludeIdeData);
  2431. args: [],
  2432. source: "announcer\x0a\x09^ SystemAnnouncer current",
  2433. referencedClasses: ["SystemAnnouncer"],
  2434. //>>excludeEnd("ide");
  2435. messageSends: ["current"]
  2436. }),
  2437. $globals.PackageStateObserver);
  2438. $core.addMethod(
  2439. $core.method({
  2440. selector: "observeSystem",
  2441. protocol: "actions",
  2442. fn: function (){
  2443. var self=this,$self=this;
  2444. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2445. return $core.withContext(function($ctx1) {
  2446. //>>excludeEnd("ctx");
  2447. var $1;
  2448. $1=$self._announcer();
  2449. $recv($1)._on_send_to_($globals.PackageAdded,"onPackageAdded:",self);
  2450. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2451. $ctx1.sendIdx["on:send:to:"]=1;
  2452. //>>excludeEnd("ctx");
  2453. $recv($1)._on_send_to_($globals.ClassAnnouncement,"onClassModification:",self);
  2454. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2455. $ctx1.sendIdx["on:send:to:"]=2;
  2456. //>>excludeEnd("ctx");
  2457. $recv($1)._on_send_to_($globals.MethodAnnouncement,"onMethodModification:",self);
  2458. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2459. $ctx1.sendIdx["on:send:to:"]=3;
  2460. //>>excludeEnd("ctx");
  2461. $recv($1)._on_send_to_($globals.ProtocolAnnouncement,"onProtocolModification:",self);
  2462. return self;
  2463. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2464. }, function($ctx1) {$ctx1.fill(self,"observeSystem",{},$globals.PackageStateObserver)});
  2465. //>>excludeEnd("ctx");
  2466. },
  2467. //>>excludeStart("ide", pragmas.excludeIdeData);
  2468. args: [],
  2469. 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",
  2470. referencedClasses: ["PackageAdded", "ClassAnnouncement", "MethodAnnouncement", "ProtocolAnnouncement"],
  2471. //>>excludeEnd("ide");
  2472. messageSends: ["on:send:to:", "announcer"]
  2473. }),
  2474. $globals.PackageStateObserver);
  2475. $core.addMethod(
  2476. $core.method({
  2477. selector: "onClassModification:",
  2478. protocol: "reactions",
  2479. fn: function (anAnnouncement){
  2480. var self=this,$self=this;
  2481. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2482. return $core.withContext(function($ctx1) {
  2483. //>>excludeEnd("ctx");
  2484. var $1,$receiver;
  2485. $1=$recv(anAnnouncement)._theClass();
  2486. if(($receiver = $1) == null || $receiver.a$nil){
  2487. $1;
  2488. } else {
  2489. var theClass;
  2490. theClass=$receiver;
  2491. $recv($recv(theClass)._package())._beDirty();
  2492. }
  2493. return self;
  2494. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2495. }, function($ctx1) {$ctx1.fill(self,"onClassModification:",{anAnnouncement:anAnnouncement},$globals.PackageStateObserver)});
  2496. //>>excludeEnd("ctx");
  2497. },
  2498. //>>excludeStart("ide", pragmas.excludeIdeData);
  2499. args: ["anAnnouncement"],
  2500. source: "onClassModification: anAnnouncement\x0a\x09anAnnouncement theClass ifNotNil: [ :theClass | theClass package beDirty ]",
  2501. referencedClasses: [],
  2502. //>>excludeEnd("ide");
  2503. messageSends: ["ifNotNil:", "theClass", "beDirty", "package"]
  2504. }),
  2505. $globals.PackageStateObserver);
  2506. $core.addMethod(
  2507. $core.method({
  2508. selector: "onMethodModification:",
  2509. protocol: "reactions",
  2510. fn: function (anAnnouncement){
  2511. var self=this,$self=this;
  2512. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2513. return $core.withContext(function($ctx1) {
  2514. //>>excludeEnd("ctx");
  2515. var $1,$receiver;
  2516. $1=$recv($recv(anAnnouncement)._method())._package();
  2517. if(($receiver = $1) == null || $receiver.a$nil){
  2518. $1;
  2519. } else {
  2520. var package_;
  2521. package_=$receiver;
  2522. $recv(package_)._beDirty();
  2523. }
  2524. return self;
  2525. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2526. }, function($ctx1) {$ctx1.fill(self,"onMethodModification:",{anAnnouncement:anAnnouncement},$globals.PackageStateObserver)});
  2527. //>>excludeEnd("ctx");
  2528. },
  2529. //>>excludeStart("ide", pragmas.excludeIdeData);
  2530. args: ["anAnnouncement"],
  2531. source: "onMethodModification: anAnnouncement\x0a\x09anAnnouncement method package ifNotNil: [ :package | package beDirty ]",
  2532. referencedClasses: [],
  2533. //>>excludeEnd("ide");
  2534. messageSends: ["ifNotNil:", "package", "method", "beDirty"]
  2535. }),
  2536. $globals.PackageStateObserver);
  2537. $core.addMethod(
  2538. $core.method({
  2539. selector: "onPackageAdded:",
  2540. protocol: "reactions",
  2541. fn: function (anAnnouncement){
  2542. var self=this,$self=this;
  2543. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2544. return $core.withContext(function($ctx1) {
  2545. //>>excludeEnd("ctx");
  2546. $recv($recv(anAnnouncement)._package())._beDirty();
  2547. return self;
  2548. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2549. }, function($ctx1) {$ctx1.fill(self,"onPackageAdded:",{anAnnouncement:anAnnouncement},$globals.PackageStateObserver)});
  2550. //>>excludeEnd("ctx");
  2551. },
  2552. //>>excludeStart("ide", pragmas.excludeIdeData);
  2553. args: ["anAnnouncement"],
  2554. source: "onPackageAdded: anAnnouncement\x0a\x09anAnnouncement package beDirty",
  2555. referencedClasses: [],
  2556. //>>excludeEnd("ide");
  2557. messageSends: ["beDirty", "package"]
  2558. }),
  2559. $globals.PackageStateObserver);
  2560. $core.addMethod(
  2561. $core.method({
  2562. selector: "onProtocolModification:",
  2563. protocol: "reactions",
  2564. fn: function (anAnnouncement){
  2565. var self=this,$self=this;
  2566. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2567. return $core.withContext(function($ctx1) {
  2568. //>>excludeEnd("ctx");
  2569. var $1,$receiver;
  2570. $1=$recv(anAnnouncement)._package();
  2571. if(($receiver = $1) == null || $receiver.a$nil){
  2572. $1;
  2573. } else {
  2574. var package_;
  2575. package_=$receiver;
  2576. $recv(package_)._beDirty();
  2577. }
  2578. return self;
  2579. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2580. }, function($ctx1) {$ctx1.fill(self,"onProtocolModification:",{anAnnouncement:anAnnouncement},$globals.PackageStateObserver)});
  2581. //>>excludeEnd("ctx");
  2582. },
  2583. //>>excludeStart("ide", pragmas.excludeIdeData);
  2584. args: ["anAnnouncement"],
  2585. source: "onProtocolModification: anAnnouncement\x0a\x09anAnnouncement package ifNotNil: [ :package | package beDirty ]",
  2586. referencedClasses: [],
  2587. //>>excludeEnd("ide");
  2588. messageSends: ["ifNotNil:", "package", "beDirty"]
  2589. }),
  2590. $globals.PackageStateObserver);
  2591. $core.setSlots($globals.PackageStateObserver.a$cls, ["current"]);
  2592. $core.addMethod(
  2593. $core.method({
  2594. selector: "current",
  2595. protocol: "accessing",
  2596. fn: function (){
  2597. var self=this,$self=this;
  2598. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2599. return $core.withContext(function($ctx1) {
  2600. //>>excludeEnd("ctx");
  2601. var $1,$receiver;
  2602. $1=$self.current;
  2603. if(($receiver = $1) == null || $receiver.a$nil){
  2604. $self.current=$self._new();
  2605. return $self.current;
  2606. } else {
  2607. return $1;
  2608. }
  2609. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2610. }, function($ctx1) {$ctx1.fill(self,"current",{},$globals.PackageStateObserver.a$cls)});
  2611. //>>excludeEnd("ctx");
  2612. },
  2613. //>>excludeStart("ide", pragmas.excludeIdeData);
  2614. args: [],
  2615. source: "current\x0a\x09^ current ifNil: [ current := self new ]",
  2616. referencedClasses: [],
  2617. //>>excludeEnd("ide");
  2618. messageSends: ["ifNil:", "new"]
  2619. }),
  2620. $globals.PackageStateObserver.a$cls);
  2621. $core.addMethod(
  2622. $core.method({
  2623. selector: "initialize",
  2624. protocol: "initialization",
  2625. fn: function (){
  2626. var self=this,$self=this;
  2627. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2628. return $core.withContext(function($ctx1) {
  2629. //>>excludeEnd("ctx");
  2630. $recv($self._current())._observeSystem();
  2631. return self;
  2632. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2633. }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.PackageStateObserver.a$cls)});
  2634. //>>excludeEnd("ctx");
  2635. },
  2636. //>>excludeStart("ide", pragmas.excludeIdeData);
  2637. args: [],
  2638. source: "initialize\x0a\x09self current observeSystem",
  2639. referencedClasses: [],
  2640. //>>excludeEnd("ide");
  2641. messageSends: ["observeSystem", "current"]
  2642. }),
  2643. $globals.PackageStateObserver.a$cls);
  2644. $core.addClass("ParseError", $globals.Error, [], "Kernel-Infrastructure");
  2645. //>>excludeStart("ide", pragmas.excludeIdeData);
  2646. $globals.ParseError.comment="Instance of ParseError are signaled on any parsing error.\x0aSee `Smalltalk >> #parse:`";
  2647. //>>excludeEnd("ide");
  2648. $core.addClass("Setting", $globals.Object, ["key", "value", "defaultValue"], "Kernel-Infrastructure");
  2649. //>>excludeStart("ide", pragmas.excludeIdeData);
  2650. $globals.Setting.comment="I represent a setting **stored** at `Smalltalk settings`. \x0aIn the current implementation, `Smalltalk settings` is an object persisted in the localStorage.\x0a\x0a## API\x0a\x0aA `Setting` value can be read using `value` and set using `value:`.\x0a\x0aSettings are accessed with `'key' asSetting` or `'key' asSettingIfAbsent: aDefaultValue`.\x0a\x0aTo read the value of a setting you can also use the convenience:\x0a\x0a`theValueSet := 'any.characteristic' settingValue` \x0a\x0aor with a default using:\x0a\x0a `theEnsuredValueSet := 'any.characteristic' settingValueIfAbsent: true`";
  2651. //>>excludeEnd("ide");
  2652. $core.addMethod(
  2653. $core.method({
  2654. selector: "defaultValue",
  2655. protocol: "accessing",
  2656. fn: function (){
  2657. var self=this,$self=this;
  2658. return $self.defaultValue;
  2659. },
  2660. //>>excludeStart("ide", pragmas.excludeIdeData);
  2661. args: [],
  2662. source: "defaultValue\x0a\x09^ defaultValue",
  2663. referencedClasses: [],
  2664. //>>excludeEnd("ide");
  2665. messageSends: []
  2666. }),
  2667. $globals.Setting);
  2668. $core.addMethod(
  2669. $core.method({
  2670. selector: "defaultValue:",
  2671. protocol: "accessing",
  2672. fn: function (aStringifiableObject){
  2673. var self=this,$self=this;
  2674. $self.defaultValue=aStringifiableObject;
  2675. return self;
  2676. },
  2677. //>>excludeStart("ide", pragmas.excludeIdeData);
  2678. args: ["aStringifiableObject"],
  2679. source: "defaultValue: aStringifiableObject\x0a\x09defaultValue := aStringifiableObject",
  2680. referencedClasses: [],
  2681. //>>excludeEnd("ide");
  2682. messageSends: []
  2683. }),
  2684. $globals.Setting);
  2685. $core.addMethod(
  2686. $core.method({
  2687. selector: "key",
  2688. protocol: "accessing",
  2689. fn: function (){
  2690. var self=this,$self=this;
  2691. return $self.key;
  2692. },
  2693. //>>excludeStart("ide", pragmas.excludeIdeData);
  2694. args: [],
  2695. source: "key\x0a\x09^ key",
  2696. referencedClasses: [],
  2697. //>>excludeEnd("ide");
  2698. messageSends: []
  2699. }),
  2700. $globals.Setting);
  2701. $core.addMethod(
  2702. $core.method({
  2703. selector: "key:",
  2704. protocol: "accessing",
  2705. fn: function (aString){
  2706. var self=this,$self=this;
  2707. $self.key=aString;
  2708. return self;
  2709. },
  2710. //>>excludeStart("ide", pragmas.excludeIdeData);
  2711. args: ["aString"],
  2712. source: "key: aString\x0a\x09key := aString",
  2713. referencedClasses: [],
  2714. //>>excludeEnd("ide");
  2715. messageSends: []
  2716. }),
  2717. $globals.Setting);
  2718. $core.addMethod(
  2719. $core.method({
  2720. selector: "value",
  2721. protocol: "accessing",
  2722. fn: function (){
  2723. var self=this,$self=this;
  2724. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2725. return $core.withContext(function($ctx1) {
  2726. //>>excludeEnd("ctx");
  2727. return $recv($recv($globals.Smalltalk)._settings())._at_ifAbsent_($self._key(),(function(){
  2728. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2729. return $core.withContext(function($ctx2) {
  2730. //>>excludeEnd("ctx");
  2731. return $self._defaultValue();
  2732. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2733. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2734. //>>excludeEnd("ctx");
  2735. }));
  2736. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2737. }, function($ctx1) {$ctx1.fill(self,"value",{},$globals.Setting)});
  2738. //>>excludeEnd("ctx");
  2739. },
  2740. //>>excludeStart("ide", pragmas.excludeIdeData);
  2741. args: [],
  2742. source: "value\x0a\x09^ Smalltalk settings at: self key ifAbsent: [ self defaultValue ]",
  2743. referencedClasses: ["Smalltalk"],
  2744. //>>excludeEnd("ide");
  2745. messageSends: ["at:ifAbsent:", "settings", "key", "defaultValue"]
  2746. }),
  2747. $globals.Setting);
  2748. $core.addMethod(
  2749. $core.method({
  2750. selector: "value:",
  2751. protocol: "accessing",
  2752. fn: function (aStringifiableObject){
  2753. var self=this,$self=this;
  2754. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2755. return $core.withContext(function($ctx1) {
  2756. //>>excludeEnd("ctx");
  2757. return $recv($recv($globals.Smalltalk)._settings())._at_put_($self._key(),aStringifiableObject);
  2758. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2759. }, function($ctx1) {$ctx1.fill(self,"value:",{aStringifiableObject:aStringifiableObject},$globals.Setting)});
  2760. //>>excludeEnd("ctx");
  2761. },
  2762. //>>excludeStart("ide", pragmas.excludeIdeData);
  2763. args: ["aStringifiableObject"],
  2764. source: "value: aStringifiableObject\x0a\x09^ Smalltalk settings at: self key put: aStringifiableObject",
  2765. referencedClasses: ["Smalltalk"],
  2766. //>>excludeEnd("ide");
  2767. messageSends: ["at:put:", "settings", "key"]
  2768. }),
  2769. $globals.Setting);
  2770. $core.addMethod(
  2771. $core.method({
  2772. selector: "at:ifAbsent:",
  2773. protocol: "instance creation",
  2774. fn: function (aString,aDefaultValue){
  2775. var self=this,$self=this;
  2776. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2777. return $core.withContext(function($ctx1) {
  2778. //>>excludeEnd("ctx");
  2779. var $1;
  2780. $1=(
  2781. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2782. $ctx1.supercall = true,
  2783. //>>excludeEnd("ctx");
  2784. ($globals.Setting.a$cls.superclass||$boot.nilAsClass).fn.prototype._new.apply($self, []));
  2785. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2786. $ctx1.supercall = false;
  2787. //>>excludeEnd("ctx");;
  2788. $recv($1)._key_(aString);
  2789. $recv($1)._defaultValue_(aDefaultValue);
  2790. return $recv($1)._yourself();
  2791. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2792. }, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{aString:aString,aDefaultValue:aDefaultValue},$globals.Setting.a$cls)});
  2793. //>>excludeEnd("ctx");
  2794. },
  2795. //>>excludeStart("ide", pragmas.excludeIdeData);
  2796. args: ["aString", "aDefaultValue"],
  2797. source: "at: aString ifAbsent: aDefaultValue\x0a\x09\x0a\x09^ super new\x0a\x09\x09key: aString;\x0a\x09\x09defaultValue: aDefaultValue;\x0a\x09\x09yourself",
  2798. referencedClasses: [],
  2799. //>>excludeEnd("ide");
  2800. messageSends: ["key:", "new", "defaultValue:", "yourself"]
  2801. }),
  2802. $globals.Setting.a$cls);
  2803. $core.addMethod(
  2804. $core.method({
  2805. selector: "new",
  2806. protocol: "instance creation",
  2807. fn: function (){
  2808. var self=this,$self=this;
  2809. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2810. return $core.withContext(function($ctx1) {
  2811. //>>excludeEnd("ctx");
  2812. $self._shouldNotImplement();
  2813. return self;
  2814. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2815. }, function($ctx1) {$ctx1.fill(self,"new",{},$globals.Setting.a$cls)});
  2816. //>>excludeEnd("ctx");
  2817. },
  2818. //>>excludeStart("ide", pragmas.excludeIdeData);
  2819. args: [],
  2820. source: "new\x0a\x09self shouldNotImplement",
  2821. referencedClasses: [],
  2822. //>>excludeEnd("ide");
  2823. messageSends: ["shouldNotImplement"]
  2824. }),
  2825. $globals.Setting.a$cls);
  2826. $core.addClass("SmalltalkImage", $globals.Object, ["globalJsVariables", "packageDictionary"], "Kernel-Infrastructure");
  2827. //>>excludeStart("ide", pragmas.excludeIdeData);
  2828. $globals.SmalltalkImage.comment="I represent the Smalltalk system, wrapping\x0aoperations of variable `$core` declared in `base/boot.js`.\x0a\x0a## API\x0a\x0aI have only one instance, accessed with global variable `Smalltalk`.\x0a\x0a## Classes\x0a\x0aClasses can be accessed using the following methods:\x0a\x0a- `#classes` answers the full list of Smalltalk classes in the system\x0a- `#globals #at:` answers a specific global (usually, a class) or `nil`\x0a\x0a## Packages\x0a\x0aPackages can be accessed using the following methods:\x0a\x0a- `#packages` answers the full list of packages\x0a- `#packageAt:` answers a specific package or `nil`\x0a\x0a## Parsing\x0a\x0aThe `#parse:` method is used to parse Amber source code.\x0aIt requires the `Compiler` package and the `base/parser.js` parser file in order to work.";
  2829. //>>excludeEnd("ide");
  2830. $core.addMethod(
  2831. $core.method({
  2832. selector: "addGlobalJsVariable:",
  2833. protocol: "globals",
  2834. fn: function (aString){
  2835. var self=this,$self=this;
  2836. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2837. return $core.withContext(function($ctx1) {
  2838. //>>excludeEnd("ctx");
  2839. $recv($self._globalJsVariables())._add_(aString);
  2840. return self;
  2841. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2842. }, function($ctx1) {$ctx1.fill(self,"addGlobalJsVariable:",{aString:aString},$globals.SmalltalkImage)});
  2843. //>>excludeEnd("ctx");
  2844. },
  2845. //>>excludeStart("ide", pragmas.excludeIdeData);
  2846. args: ["aString"],
  2847. source: "addGlobalJsVariable: aString\x0a\x09self globalJsVariables add: aString",
  2848. referencedClasses: [],
  2849. //>>excludeEnd("ide");
  2850. messageSends: ["add:", "globalJsVariables"]
  2851. }),
  2852. $globals.SmalltalkImage);
  2853. $core.addMethod(
  2854. $core.method({
  2855. selector: "adoptPackageDescriptors",
  2856. protocol: "private",
  2857. fn: function (){
  2858. var self=this,$self=this;
  2859. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2860. return $core.withContext(function($ctx1) {
  2861. //>>excludeEnd("ctx");
  2862. return $self._tryAdoptPackageDescriptorsBeyond_($recv($globals.Set)._new());
  2863. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2864. }, function($ctx1) {$ctx1.fill(self,"adoptPackageDescriptors",{},$globals.SmalltalkImage)});
  2865. //>>excludeEnd("ctx");
  2866. },
  2867. //>>excludeStart("ide", pragmas.excludeIdeData);
  2868. args: [],
  2869. source: "adoptPackageDescriptors\x0a\x09^ self tryAdoptPackageDescriptorsBeyond: Set new",
  2870. referencedClasses: ["Set"],
  2871. //>>excludeEnd("ide");
  2872. messageSends: ["tryAdoptPackageDescriptorsBeyond:", "new"]
  2873. }),
  2874. $globals.SmalltalkImage);
  2875. $core.addMethod(
  2876. $core.method({
  2877. selector: "amdRequire",
  2878. protocol: "accessing amd",
  2879. fn: function (){
  2880. var self=this,$self=this;
  2881. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2882. return $core.withContext(function($ctx1) {
  2883. //>>excludeEnd("ctx");
  2884. return $recv($self._core())._at_("amdRequire");
  2885. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2886. }, function($ctx1) {$ctx1.fill(self,"amdRequire",{},$globals.SmalltalkImage)});
  2887. //>>excludeEnd("ctx");
  2888. },
  2889. //>>excludeStart("ide", pragmas.excludeIdeData);
  2890. args: [],
  2891. source: "amdRequire\x0a\x09^ self core at: 'amdRequire'",
  2892. referencedClasses: [],
  2893. //>>excludeEnd("ide");
  2894. messageSends: ["at:", "core"]
  2895. }),
  2896. $globals.SmalltalkImage);
  2897. $core.addMethod(
  2898. $core.method({
  2899. selector: "asSmalltalkException:",
  2900. protocol: "error handling",
  2901. fn: function (anObject){
  2902. var self=this,$self=this;
  2903. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2904. return $core.withContext(function($ctx1) {
  2905. //>>excludeEnd("ctx");
  2906. var $1;
  2907. $1=$recv($self._isSmalltalkObject_(anObject))._and_((function(){
  2908. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2909. return $core.withContext(function($ctx2) {
  2910. //>>excludeEnd("ctx");
  2911. return $recv(anObject)._isKindOf_($globals.Error);
  2912. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2913. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2914. //>>excludeEnd("ctx");
  2915. }));
  2916. if($core.assert($1)){
  2917. return anObject;
  2918. } else {
  2919. return $recv($globals.JavaScriptException)._on_(anObject);
  2920. }
  2921. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2922. }, function($ctx1) {$ctx1.fill(self,"asSmalltalkException:",{anObject:anObject},$globals.SmalltalkImage)});
  2923. //>>excludeEnd("ctx");
  2924. },
  2925. //>>excludeStart("ide", pragmas.excludeIdeData);
  2926. args: ["anObject"],
  2927. 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 ]",
  2928. referencedClasses: ["Error", "JavaScriptException"],
  2929. //>>excludeEnd("ide");
  2930. messageSends: ["ifTrue:ifFalse:", "and:", "isSmalltalkObject:", "isKindOf:", "on:"]
  2931. }),
  2932. $globals.SmalltalkImage);
  2933. $core.addMethod(
  2934. $core.method({
  2935. selector: "basicCreatePackage:",
  2936. protocol: "private",
  2937. fn: function (packageName){
  2938. var self=this,$self=this;
  2939. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2940. return $core.withContext(function($ctx1) {
  2941. //>>excludeEnd("ctx");
  2942. return $recv($self._packageDictionary())._at_ifAbsentPut_(packageName,(function(){
  2943. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2944. return $core.withContext(function($ctx2) {
  2945. //>>excludeEnd("ctx");
  2946. return $recv($globals.Package)._new_(packageName);
  2947. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2948. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2949. //>>excludeEnd("ctx");
  2950. }));
  2951. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2952. }, function($ctx1) {$ctx1.fill(self,"basicCreatePackage:",{packageName:packageName},$globals.SmalltalkImage)});
  2953. //>>excludeEnd("ctx");
  2954. },
  2955. //>>excludeStart("ide", pragmas.excludeIdeData);
  2956. args: ["packageName"],
  2957. source: "basicCreatePackage: packageName\x0a\x09\x22Create and bind a new bare package with given name and return it.\x22\x0a\x09^ self packageDictionary at: packageName ifAbsentPut: [ Package new: packageName ]",
  2958. referencedClasses: ["Package"],
  2959. //>>excludeEnd("ide");
  2960. messageSends: ["at:ifAbsentPut:", "packageDictionary", "new:"]
  2961. }),
  2962. $globals.SmalltalkImage);
  2963. $core.addMethod(
  2964. $core.method({
  2965. selector: "basicParse:",
  2966. protocol: "private",
  2967. fn: function (aString){
  2968. var self=this,$self=this;
  2969. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2970. return $core.withContext(function($ctx1) {
  2971. //>>excludeEnd("ctx");
  2972. return $recv(smalltalkParser)._parse_(aString);
  2973. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2974. }, function($ctx1) {$ctx1.fill(self,"basicParse:",{aString:aString},$globals.SmalltalkImage)});
  2975. //>>excludeEnd("ctx");
  2976. },
  2977. //>>excludeStart("ide", pragmas.excludeIdeData);
  2978. args: ["aString"],
  2979. source: "basicParse: aString\x0a\x09^ smalltalkParser parse: aString",
  2980. referencedClasses: [],
  2981. //>>excludeEnd("ide");
  2982. messageSends: ["parse:"]
  2983. }),
  2984. $globals.SmalltalkImage);
  2985. $core.addMethod(
  2986. $core.method({
  2987. selector: "beClean",
  2988. protocol: "packages",
  2989. fn: function (){
  2990. var self=this,$self=this;
  2991. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2992. return $core.withContext(function($ctx1) {
  2993. //>>excludeEnd("ctx");
  2994. $recv($self._packages())._do_("beClean");
  2995. return self;
  2996. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2997. }, function($ctx1) {$ctx1.fill(self,"beClean",{},$globals.SmalltalkImage)});
  2998. //>>excludeEnd("ctx");
  2999. },
  3000. //>>excludeStart("ide", pragmas.excludeIdeData);
  3001. args: [],
  3002. source: "beClean\x0a\x09\x22Marks all packages clean.\x22\x0a\x0a\x09self packages do: #beClean",
  3003. referencedClasses: [],
  3004. //>>excludeEnd("ide");
  3005. messageSends: ["do:", "packages"]
  3006. }),
  3007. $globals.SmalltalkImage);
  3008. $core.addMethod(
  3009. $core.method({
  3010. selector: "cancelOptOut:",
  3011. protocol: "accessing",
  3012. fn: function (anObject){
  3013. var self=this,$self=this;
  3014. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3015. return $core.withContext(function($ctx1) {
  3016. //>>excludeEnd("ctx");
  3017. delete anObject.a$cls;;
  3018. return self;
  3019. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3020. }, function($ctx1) {$ctx1.fill(self,"cancelOptOut:",{anObject:anObject},$globals.SmalltalkImage)});
  3021. //>>excludeEnd("ctx");
  3022. },
  3023. //>>excludeStart("ide", pragmas.excludeIdeData);
  3024. args: ["anObject"],
  3025. source: "cancelOptOut: anObject\x0a\x09\x22A Smalltalk object has a 'a$cls' property.\x0a\x09If this property is shadowed for anObject by optOut:,\x0a\x09the object is treated as plain JS object.\x0a\x09This removes the shadow and anObject is Smalltalk object\x0a\x09again if it was before.\x22\x0a\x09\x0a\x09<inlineJS: 'delete anObject.a$cls;'>",
  3026. referencedClasses: [],
  3027. //>>excludeEnd("ide");
  3028. messageSends: []
  3029. }),
  3030. $globals.SmalltalkImage);
  3031. $core.addMethod(
  3032. $core.method({
  3033. selector: "classes",
  3034. protocol: "classes",
  3035. fn: function (){
  3036. var self=this,$self=this;
  3037. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3038. return $core.withContext(function($ctx1) {
  3039. //>>excludeEnd("ctx");
  3040. return $recv($recv($self._core())._traitsOrClasses())._copy();
  3041. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3042. }, function($ctx1) {$ctx1.fill(self,"classes",{},$globals.SmalltalkImage)});
  3043. //>>excludeEnd("ctx");
  3044. },
  3045. //>>excludeStart("ide", pragmas.excludeIdeData);
  3046. args: [],
  3047. source: "classes\x0a\x09^ self core traitsOrClasses copy",
  3048. referencedClasses: [],
  3049. //>>excludeEnd("ide");
  3050. messageSends: ["copy", "traitsOrClasses", "core"]
  3051. }),
  3052. $globals.SmalltalkImage);
  3053. $core.addMethod(
  3054. $core.method({
  3055. selector: "core",
  3056. protocol: "accessing",
  3057. fn: function (){
  3058. var self=this,$self=this;
  3059. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3060. return $core.withContext(function($ctx1) {
  3061. //>>excludeEnd("ctx");
  3062. return $core;
  3063. return self;
  3064. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3065. }, function($ctx1) {$ctx1.fill(self,"core",{},$globals.SmalltalkImage)});
  3066. //>>excludeEnd("ctx");
  3067. },
  3068. //>>excludeStart("ide", pragmas.excludeIdeData);
  3069. args: [],
  3070. source: "core\x0a\x09<inlineJS: 'return $core'>",
  3071. referencedClasses: [],
  3072. //>>excludeEnd("ide");
  3073. messageSends: []
  3074. }),
  3075. $globals.SmalltalkImage);
  3076. $core.addMethod(
  3077. $core.method({
  3078. selector: "createPackage:",
  3079. protocol: "packages",
  3080. fn: function (packageName){
  3081. var self=this,$self=this;
  3082. var package_,announcement;
  3083. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3084. return $core.withContext(function($ctx1) {
  3085. //>>excludeEnd("ctx");
  3086. var $1;
  3087. package_=$self._basicCreatePackage_(packageName);
  3088. $1=$recv($globals.PackageAdded)._new();
  3089. $recv($1)._package_(package_);
  3090. announcement=$recv($1)._yourself();
  3091. $recv($recv($globals.SystemAnnouncer)._current())._announce_(announcement);
  3092. return package_;
  3093. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3094. }, function($ctx1) {$ctx1.fill(self,"createPackage:",{packageName:packageName,package_:package_,announcement:announcement},$globals.SmalltalkImage)});
  3095. //>>excludeEnd("ctx");
  3096. },
  3097. //>>excludeStart("ide", pragmas.excludeIdeData);
  3098. args: ["packageName"],
  3099. 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",
  3100. referencedClasses: ["PackageAdded", "SystemAnnouncer"],
  3101. //>>excludeEnd("ide");
  3102. messageSends: ["basicCreatePackage:", "package:", "new", "yourself", "announce:", "current"]
  3103. }),
  3104. $globals.SmalltalkImage);
  3105. $core.addMethod(
  3106. $core.method({
  3107. selector: "defaultAmdNamespace",
  3108. protocol: "accessing amd",
  3109. fn: function (){
  3110. var self=this,$self=this;
  3111. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3112. return $core.withContext(function($ctx1) {
  3113. //>>excludeEnd("ctx");
  3114. return "transport.defaultAmdNamespace"._settingValue();
  3115. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3116. }, function($ctx1) {$ctx1.fill(self,"defaultAmdNamespace",{},$globals.SmalltalkImage)});
  3117. //>>excludeEnd("ctx");
  3118. },
  3119. //>>excludeStart("ide", pragmas.excludeIdeData);
  3120. args: [],
  3121. source: "defaultAmdNamespace\x0a\x09^ 'transport.defaultAmdNamespace' settingValue",
  3122. referencedClasses: [],
  3123. //>>excludeEnd("ide");
  3124. messageSends: ["settingValue"]
  3125. }),
  3126. $globals.SmalltalkImage);
  3127. $core.addMethod(
  3128. $core.method({
  3129. selector: "defaultAmdNamespace:",
  3130. protocol: "accessing amd",
  3131. fn: function (aString){
  3132. var self=this,$self=this;
  3133. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3134. return $core.withContext(function($ctx1) {
  3135. //>>excludeEnd("ctx");
  3136. "transport.defaultAmdNamespace"._settingValue_(aString);
  3137. return self;
  3138. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3139. }, function($ctx1) {$ctx1.fill(self,"defaultAmdNamespace:",{aString:aString},$globals.SmalltalkImage)});
  3140. //>>excludeEnd("ctx");
  3141. },
  3142. //>>excludeStart("ide", pragmas.excludeIdeData);
  3143. args: ["aString"],
  3144. source: "defaultAmdNamespace: aString\x0a\x09'transport.defaultAmdNamespace' settingValue: aString",
  3145. referencedClasses: [],
  3146. //>>excludeEnd("ide");
  3147. messageSends: ["settingValue:"]
  3148. }),
  3149. $globals.SmalltalkImage);
  3150. $core.addMethod(
  3151. $core.method({
  3152. selector: "deleteClass:",
  3153. protocol: "private",
  3154. fn: function (aClass){
  3155. var self=this,$self=this;
  3156. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3157. return $core.withContext(function($ctx1) {
  3158. //>>excludeEnd("ctx");
  3159. $core.removeClass(aClass);
  3160. return self;
  3161. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3162. }, function($ctx1) {$ctx1.fill(self,"deleteClass:",{aClass:aClass},$globals.SmalltalkImage)});
  3163. //>>excludeEnd("ctx");
  3164. },
  3165. //>>excludeStart("ide", pragmas.excludeIdeData);
  3166. args: ["aClass"],
  3167. source: "deleteClass: aClass\x0a\x09\x22Deletes a class by deleting its binding only. Use #removeClass instead\x22\x0a\x09\x0a\x09<inlineJS: '$core.removeClass(aClass)'>",
  3168. referencedClasses: [],
  3169. //>>excludeEnd("ide");
  3170. messageSends: []
  3171. }),
  3172. $globals.SmalltalkImage);
  3173. $core.addMethod(
  3174. $core.method({
  3175. selector: "deleteGlobalJsVariable:",
  3176. protocol: "globals",
  3177. fn: function (aString){
  3178. var self=this,$self=this;
  3179. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3180. return $core.withContext(function($ctx1) {
  3181. //>>excludeEnd("ctx");
  3182. $recv($self._globalJsVariables())._remove_ifAbsent_(aString,(function(){
  3183. }));
  3184. return self;
  3185. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3186. }, function($ctx1) {$ctx1.fill(self,"deleteGlobalJsVariable:",{aString:aString},$globals.SmalltalkImage)});
  3187. //>>excludeEnd("ctx");
  3188. },
  3189. //>>excludeStart("ide", pragmas.excludeIdeData);
  3190. args: ["aString"],
  3191. source: "deleteGlobalJsVariable: aString\x0a\x09self globalJsVariables remove: aString ifAbsent:[]",
  3192. referencedClasses: [],
  3193. //>>excludeEnd("ide");
  3194. messageSends: ["remove:ifAbsent:", "globalJsVariables"]
  3195. }),
  3196. $globals.SmalltalkImage);
  3197. $core.addMethod(
  3198. $core.method({
  3199. selector: "existsJsGlobal:",
  3200. protocol: "testing",
  3201. fn: function (aString){
  3202. var self=this,$self=this;
  3203. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3204. return $core.withContext(function($ctx1) {
  3205. //>>excludeEnd("ctx");
  3206. $self._deprecatedAPI_("Use Platform >> includesGlobal: instead");
  3207. return $recv($globals.Platform)._includesGlobal_(aString);
  3208. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3209. }, function($ctx1) {$ctx1.fill(self,"existsJsGlobal:",{aString:aString},$globals.SmalltalkImage)});
  3210. //>>excludeEnd("ctx");
  3211. },
  3212. //>>excludeStart("ide", pragmas.excludeIdeData);
  3213. args: ["aString"],
  3214. source: "existsJsGlobal: aString\x0a\x09self deprecatedAPI: 'Use Platform >> includesGlobal: instead'.\x0a\x09^ Platform includesGlobal: aString",
  3215. referencedClasses: ["Platform"],
  3216. //>>excludeEnd("ide");
  3217. messageSends: ["deprecatedAPI:", "includesGlobal:"]
  3218. }),
  3219. $globals.SmalltalkImage);
  3220. $core.addMethod(
  3221. $core.method({
  3222. selector: "globalJsVariables",
  3223. protocol: "globals",
  3224. fn: function (){
  3225. var self=this,$self=this;
  3226. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3227. return $core.withContext(function($ctx1) {
  3228. //>>excludeEnd("ctx");
  3229. var $1,$receiver;
  3230. $1=$self.globalJsVariables;
  3231. if(($receiver = $1) == null || $receiver.a$nil){
  3232. $self.globalJsVariables=["window", "document", "process", "global"];
  3233. return $self.globalJsVariables;
  3234. } else {
  3235. return $1;
  3236. }
  3237. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3238. }, function($ctx1) {$ctx1.fill(self,"globalJsVariables",{},$globals.SmalltalkImage)});
  3239. //>>excludeEnd("ctx");
  3240. },
  3241. //>>excludeStart("ide", pragmas.excludeIdeData);
  3242. args: [],
  3243. source: "globalJsVariables\x0a\x09^ globalJsVariables ifNil: [\x0a\x09\x09globalJsVariables := #(window document process global) ]",
  3244. referencedClasses: [],
  3245. //>>excludeEnd("ide");
  3246. messageSends: ["ifNil:"]
  3247. }),
  3248. $globals.SmalltalkImage);
  3249. $core.addMethod(
  3250. $core.method({
  3251. selector: "globals",
  3252. protocol: "accessing",
  3253. fn: function (){
  3254. var self=this,$self=this;
  3255. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3256. return $core.withContext(function($ctx1) {
  3257. //>>excludeEnd("ctx");
  3258. return $globals;
  3259. return self;
  3260. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3261. }, function($ctx1) {$ctx1.fill(self,"globals",{},$globals.SmalltalkImage)});
  3262. //>>excludeEnd("ctx");
  3263. },
  3264. //>>excludeStart("ide", pragmas.excludeIdeData);
  3265. args: [],
  3266. source: "globals\x0a\x09<inlineJS: 'return $globals'>",
  3267. referencedClasses: [],
  3268. //>>excludeEnd("ide");
  3269. messageSends: []
  3270. }),
  3271. $globals.SmalltalkImage);
  3272. $core.addMethod(
  3273. $core.method({
  3274. selector: "includesKey:",
  3275. protocol: "accessing",
  3276. fn: function (aKey){
  3277. var self=this,$self=this;
  3278. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3279. return $core.withContext(function($ctx1) {
  3280. //>>excludeEnd("ctx");
  3281. return $core.hasOwnProperty(aKey);
  3282. return self;
  3283. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3284. }, function($ctx1) {$ctx1.fill(self,"includesKey:",{aKey:aKey},$globals.SmalltalkImage)});
  3285. //>>excludeEnd("ctx");
  3286. },
  3287. //>>excludeStart("ide", pragmas.excludeIdeData);
  3288. args: ["aKey"],
  3289. source: "includesKey: aKey\x0a\x09<inlineJS: 'return $core.hasOwnProperty(aKey)'>",
  3290. referencedClasses: [],
  3291. //>>excludeEnd("ide");
  3292. messageSends: []
  3293. }),
  3294. $globals.SmalltalkImage);
  3295. $core.addMethod(
  3296. $core.method({
  3297. selector: "isSmalltalkObject:",
  3298. protocol: "testing",
  3299. fn: function (anObject){
  3300. var self=this,$self=this;
  3301. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3302. return $core.withContext(function($ctx1) {
  3303. //>>excludeEnd("ctx");
  3304. return anObject.a$cls != null;
  3305. return self;
  3306. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3307. }, function($ctx1) {$ctx1.fill(self,"isSmalltalkObject:",{anObject:anObject},$globals.SmalltalkImage)});
  3308. //>>excludeEnd("ctx");
  3309. },
  3310. //>>excludeStart("ide", pragmas.excludeIdeData);
  3311. args: ["anObject"],
  3312. source: "isSmalltalkObject: anObject\x0a\x09\x22Consider anObject a Smalltalk object if it has a 'a$cls' property.\x0a\x09Note that this may be unaccurate\x22\x0a\x09\x0a\x09<inlineJS: 'return anObject.a$cls != null'>",
  3313. referencedClasses: [],
  3314. //>>excludeEnd("ide");
  3315. messageSends: []
  3316. }),
  3317. $globals.SmalltalkImage);
  3318. $core.addMethod(
  3319. $core.method({
  3320. selector: "optOut:",
  3321. protocol: "accessing",
  3322. fn: function (anObject){
  3323. var self=this,$self=this;
  3324. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3325. return $core.withContext(function($ctx1) {
  3326. //>>excludeEnd("ctx");
  3327. anObject.a$cls = null;
  3328. return self;
  3329. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3330. }, function($ctx1) {$ctx1.fill(self,"optOut:",{anObject:anObject},$globals.SmalltalkImage)});
  3331. //>>excludeEnd("ctx");
  3332. },
  3333. //>>excludeStart("ide", pragmas.excludeIdeData);
  3334. args: ["anObject"],
  3335. source: "optOut: anObject\x0a\x09\x22A Smalltalk object has a 'a$cls' property.\x0a\x09This shadows the property for anObject.\x0a\x09The object is treated as plain JS object following this.\x22\x0a\x09\x0a\x09<inlineJS: 'anObject.a$cls = null'>",
  3336. referencedClasses: [],
  3337. //>>excludeEnd("ide");
  3338. messageSends: []
  3339. }),
  3340. $globals.SmalltalkImage);
  3341. $core.addMethod(
  3342. $core.method({
  3343. selector: "packageAt:ifAbsent:",
  3344. protocol: "packages",
  3345. fn: function (packageName,aBlock){
  3346. var self=this,$self=this;
  3347. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3348. return $core.withContext(function($ctx1) {
  3349. //>>excludeEnd("ctx");
  3350. return $recv($self._packageDictionary())._at_ifAbsent_(packageName,aBlock);
  3351. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3352. }, function($ctx1) {$ctx1.fill(self,"packageAt:ifAbsent:",{packageName:packageName,aBlock:aBlock},$globals.SmalltalkImage)});
  3353. //>>excludeEnd("ctx");
  3354. },
  3355. //>>excludeStart("ide", pragmas.excludeIdeData);
  3356. args: ["packageName", "aBlock"],
  3357. source: "packageAt: packageName ifAbsent: aBlock\x0a\x09^ self packageDictionary at: packageName ifAbsent: aBlock",
  3358. referencedClasses: [],
  3359. //>>excludeEnd("ide");
  3360. messageSends: ["at:ifAbsent:", "packageDictionary"]
  3361. }),
  3362. $globals.SmalltalkImage);
  3363. $core.addMethod(
  3364. $core.method({
  3365. selector: "packageAt:ifPresent:",
  3366. protocol: "packages",
  3367. fn: function (packageName,aBlock){
  3368. var self=this,$self=this;
  3369. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3370. return $core.withContext(function($ctx1) {
  3371. //>>excludeEnd("ctx");
  3372. return $recv($self._packageDictionary())._at_ifPresent_(packageName,aBlock);
  3373. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3374. }, function($ctx1) {$ctx1.fill(self,"packageAt:ifPresent:",{packageName:packageName,aBlock:aBlock},$globals.SmalltalkImage)});
  3375. //>>excludeEnd("ctx");
  3376. },
  3377. //>>excludeStart("ide", pragmas.excludeIdeData);
  3378. args: ["packageName", "aBlock"],
  3379. source: "packageAt: packageName ifPresent: aBlock\x0a\x09^ self packageDictionary at: packageName ifPresent: aBlock",
  3380. referencedClasses: [],
  3381. //>>excludeEnd("ide");
  3382. messageSends: ["at:ifPresent:", "packageDictionary"]
  3383. }),
  3384. $globals.SmalltalkImage);
  3385. $core.addMethod(
  3386. $core.method({
  3387. selector: "packageDictionary",
  3388. protocol: "packages",
  3389. fn: function (){
  3390. var self=this,$self=this;
  3391. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3392. return $core.withContext(function($ctx1) {
  3393. //>>excludeEnd("ctx");
  3394. var $1,$receiver;
  3395. $1=$self.packageDictionary;
  3396. if(($receiver = $1) == null || $receiver.a$nil){
  3397. $self.packageDictionary=$recv($globals.Dictionary)._new();
  3398. return $self.packageDictionary;
  3399. } else {
  3400. return $1;
  3401. }
  3402. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3403. }, function($ctx1) {$ctx1.fill(self,"packageDictionary",{},$globals.SmalltalkImage)});
  3404. //>>excludeEnd("ctx");
  3405. },
  3406. //>>excludeStart("ide", pragmas.excludeIdeData);
  3407. args: [],
  3408. source: "packageDictionary\x0a\x09^ packageDictionary ifNil: [ packageDictionary := Dictionary new ]",
  3409. referencedClasses: ["Dictionary"],
  3410. //>>excludeEnd("ide");
  3411. messageSends: ["ifNil:", "new"]
  3412. }),
  3413. $globals.SmalltalkImage);
  3414. $core.addMethod(
  3415. $core.method({
  3416. selector: "packages",
  3417. protocol: "packages",
  3418. fn: function (){
  3419. var self=this,$self=this;
  3420. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3421. return $core.withContext(function($ctx1) {
  3422. //>>excludeEnd("ctx");
  3423. return $recv($recv($self._packageDictionary())._values())._copy();
  3424. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3425. }, function($ctx1) {$ctx1.fill(self,"packages",{},$globals.SmalltalkImage)});
  3426. //>>excludeEnd("ctx");
  3427. },
  3428. //>>excludeStart("ide", pragmas.excludeIdeData);
  3429. args: [],
  3430. source: "packages\x0a\x09\x22Return all Package instances in the system.\x22\x0a\x0a\x09^ self packageDictionary values copy",
  3431. referencedClasses: [],
  3432. //>>excludeEnd("ide");
  3433. messageSends: ["copy", "values", "packageDictionary"]
  3434. }),
  3435. $globals.SmalltalkImage);
  3436. $core.addMethod(
  3437. $core.method({
  3438. selector: "parse:",
  3439. protocol: "accessing",
  3440. fn: function (aString){
  3441. var self=this,$self=this;
  3442. var result;
  3443. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3444. return $core.withContext(function($ctx1) {
  3445. //>>excludeEnd("ctx");
  3446. var $1;
  3447. $recv((function(){
  3448. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3449. return $core.withContext(function($ctx2) {
  3450. //>>excludeEnd("ctx");
  3451. result=$self._basicParse_(aString);
  3452. return result;
  3453. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3454. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  3455. //>>excludeEnd("ctx");
  3456. }))._tryCatch_((function(ex){
  3457. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3458. return $core.withContext(function($ctx2) {
  3459. //>>excludeEnd("ctx");
  3460. return $recv($self._parseError_parsing_(ex,aString))._signal();
  3461. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3462. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1,2)});
  3463. //>>excludeEnd("ctx");
  3464. }));
  3465. $1=result;
  3466. $recv($1)._source_(aString);
  3467. return $recv($1)._yourself();
  3468. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3469. }, function($ctx1) {$ctx1.fill(self,"parse:",{aString:aString,result:result},$globals.SmalltalkImage)});
  3470. //>>excludeEnd("ctx");
  3471. },
  3472. //>>excludeStart("ide", pragmas.excludeIdeData);
  3473. args: ["aString"],
  3474. 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",
  3475. referencedClasses: [],
  3476. //>>excludeEnd("ide");
  3477. messageSends: ["tryCatch:", "basicParse:", "signal", "parseError:parsing:", "source:", "yourself"]
  3478. }),
  3479. $globals.SmalltalkImage);
  3480. $core.addMethod(
  3481. $core.method({
  3482. selector: "parseError:parsing:",
  3483. protocol: "error handling",
  3484. fn: function (anException,aString){
  3485. var self=this,$self=this;
  3486. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3487. return $core.withContext(function($ctx1) {
  3488. //>>excludeEnd("ctx");
  3489. var $1,$2,$9,$8,$7,$6,$5,$4,$3,$receiver;
  3490. $1=$recv(anException)._basicAt_("location");
  3491. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3492. $ctx1.sendIdx["basicAt:"]=1;
  3493. //>>excludeEnd("ctx");
  3494. if(($receiver = $1) == null || $receiver.a$nil){
  3495. return $recv(anException)._pass();
  3496. } else {
  3497. var loc;
  3498. loc=$receiver;
  3499. $2=$recv($globals.ParseError)._new();
  3500. $9=$recv(loc)._start();
  3501. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3502. $ctx1.sendIdx["start"]=1;
  3503. //>>excludeEnd("ctx");
  3504. $8=$recv($9)._line();
  3505. $7="Parse error on line ".__comma($8);
  3506. $6=$recv($7).__comma(" column ");
  3507. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3508. $ctx1.sendIdx[","]=4;
  3509. //>>excludeEnd("ctx");
  3510. $5=$recv($6).__comma($recv($recv(loc)._start())._column());
  3511. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3512. $ctx1.sendIdx[","]=3;
  3513. //>>excludeEnd("ctx");
  3514. $4=$recv($5).__comma(" : Unexpected character ");
  3515. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3516. $ctx1.sendIdx[","]=2;
  3517. //>>excludeEnd("ctx");
  3518. $3=$recv($4).__comma($recv(anException)._basicAt_("found"));
  3519. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3520. $ctx1.sendIdx[","]=1;
  3521. //>>excludeEnd("ctx");
  3522. $recv($2)._messageText_($3);
  3523. return $recv($2)._yourself();
  3524. }
  3525. return self;
  3526. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3527. }, function($ctx1) {$ctx1.fill(self,"parseError:parsing:",{anException:anException,aString:aString},$globals.SmalltalkImage)});
  3528. //>>excludeEnd("ctx");
  3529. },
  3530. //>>excludeStart("ide", pragmas.excludeIdeData);
  3531. args: ["anException", "aString"],
  3532. source: "parseError: anException parsing: aString\x0a\x09(anException basicAt: 'location')\x0a\x09\x09ifNil: [ ^ anException pass ]\x0a\x09\x09ifNotNil: [ :loc |\x0a\x09\x09\x09^ ParseError new \x0a\x09\x09\x09\x09messageText: \x0a\x09\x09\x09\x09\x09'Parse error on line ', loc start line ,\x0a\x09\x09\x09\x09\x09' column ' , loc start column ,\x0a\x09\x09\x09\x09\x09' : Unexpected character ', (anException basicAt: 'found');\x0a\x09\x09\x09\x09yourself ]",
  3533. referencedClasses: ["ParseError"],
  3534. //>>excludeEnd("ide");
  3535. messageSends: ["ifNil:ifNotNil:", "basicAt:", "pass", "messageText:", "new", ",", "line", "start", "column", "yourself"]
  3536. }),
  3537. $globals.SmalltalkImage);
  3538. $core.addMethod(
  3539. $core.method({
  3540. selector: "postLoad",
  3541. protocol: "image",
  3542. fn: function (){
  3543. var self=this,$self=this;
  3544. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3545. return $core.withContext(function($ctx1) {
  3546. //>>excludeEnd("ctx");
  3547. var $1;
  3548. return $recv($self._adoptPackageDescriptors())._then_((function(pkgs){
  3549. var classes;
  3550. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3551. return $core.withContext(function($ctx2) {
  3552. //>>excludeEnd("ctx");
  3553. $recv(pkgs)._do_("beClean");
  3554. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3555. $ctx2.sendIdx["do:"]=1;
  3556. //>>excludeEnd("ctx");
  3557. classes=$recv($recv($globals.Smalltalk)._classes())._select_((function(each){
  3558. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3559. return $core.withContext(function($ctx3) {
  3560. //>>excludeEnd("ctx");
  3561. return $recv(pkgs)._includes_($recv(each)._package());
  3562. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3563. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)});
  3564. //>>excludeEnd("ctx");
  3565. }));
  3566. $recv(classes)._do_((function(each){
  3567. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3568. return $core.withContext(function($ctx3) {
  3569. //>>excludeEnd("ctx");
  3570. $1=$recv(each).__eq($self._class());
  3571. if(!$core.assert($1)){
  3572. return $recv(each)._initialize();
  3573. }
  3574. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3575. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,3)});
  3576. //>>excludeEnd("ctx");
  3577. }));
  3578. return $self._sweepPackageDescriptors_(pkgs);
  3579. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3580. }, function($ctx2) {$ctx2.fillBlock({pkgs:pkgs,classes:classes},$ctx1,1)});
  3581. //>>excludeEnd("ctx");
  3582. }));
  3583. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3584. }, function($ctx1) {$ctx1.fill(self,"postLoad",{},$globals.SmalltalkImage)});
  3585. //>>excludeEnd("ctx");
  3586. },
  3587. //>>excludeStart("ide", pragmas.excludeIdeData);
  3588. args: [],
  3589. source: "postLoad\x0a\x09^ self adoptPackageDescriptors then: [ :pkgs |\x0a\x09\x09| classes |\x0a\x09\x09pkgs do: #beClean.\x0a\x09\x09classes := Smalltalk classes select:\x0a\x09\x09\x09[ :each | pkgs includes: each package ].\x0a\x09\x09classes do: [ :each |\x0a\x09\x09\x09each = self class ifFalse: [ each initialize ] ].\x0a\x09\x09self sweepPackageDescriptors: pkgs ]",
  3590. referencedClasses: ["Smalltalk"],
  3591. //>>excludeEnd("ide");
  3592. messageSends: ["then:", "adoptPackageDescriptors", "do:", "select:", "classes", "includes:", "package", "ifFalse:", "=", "class", "initialize", "sweepPackageDescriptors:"]
  3593. }),
  3594. $globals.SmalltalkImage);
  3595. $core.addMethod(
  3596. $core.method({
  3597. selector: "pseudoVariableNames",
  3598. protocol: "accessing",
  3599. fn: function (){
  3600. var self=this,$self=this;
  3601. return ["self", "super", "nil", "true", "false", "thisContext"];
  3602. },
  3603. //>>excludeStart("ide", pragmas.excludeIdeData);
  3604. args: [],
  3605. source: "pseudoVariableNames\x0a\x09^ #('self' 'super' 'nil' 'true' 'false' 'thisContext')",
  3606. referencedClasses: [],
  3607. //>>excludeEnd("ide");
  3608. messageSends: []
  3609. }),
  3610. $globals.SmalltalkImage);
  3611. $core.addMethod(
  3612. $core.method({
  3613. selector: "readJSObject:",
  3614. protocol: "accessing",
  3615. fn: function (anObject){
  3616. var self=this,$self=this;
  3617. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3618. return $core.withContext(function($ctx1) {
  3619. //>>excludeEnd("ctx");
  3620. return $core.readJSObject(anObject);
  3621. return self;
  3622. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3623. }, function($ctx1) {$ctx1.fill(self,"readJSObject:",{anObject:anObject},$globals.SmalltalkImage)});
  3624. //>>excludeEnd("ctx");
  3625. },
  3626. //>>excludeStart("ide", pragmas.excludeIdeData);
  3627. args: ["anObject"],
  3628. source: "readJSObject: anObject\x0a\x09<inlineJS: 'return $core.readJSObject(anObject)'>",
  3629. referencedClasses: [],
  3630. //>>excludeEnd("ide");
  3631. messageSends: []
  3632. }),
  3633. $globals.SmalltalkImage);
  3634. $core.addMethod(
  3635. $core.method({
  3636. selector: "removeClass:",
  3637. protocol: "classes",
  3638. fn: function (aClass){
  3639. var self=this,$self=this;
  3640. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3641. return $core.withContext(function($ctx1) {
  3642. //>>excludeEnd("ctx");
  3643. var $1,$2,$5,$4,$6,$3,$7,$8,$10,$9,$receiver;
  3644. $1=$recv(aClass)._isMetaclass();
  3645. if($core.assert($1)){
  3646. $2=$recv($recv(aClass)._asString()).__comma(" is a Metaclass and cannot be removed!");
  3647. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3648. $ctx1.sendIdx[","]=1;
  3649. //>>excludeEnd("ctx");
  3650. $self._error_($2);
  3651. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3652. $ctx1.sendIdx["error:"]=1;
  3653. //>>excludeEnd("ctx");
  3654. }
  3655. $recv(aClass)._allSubclassesDo_((function(subclass){
  3656. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3657. return $core.withContext(function($ctx2) {
  3658. //>>excludeEnd("ctx");
  3659. $5=$recv(aClass)._name();
  3660. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3661. $ctx2.sendIdx["name"]=1;
  3662. //>>excludeEnd("ctx");
  3663. $4=$recv($5).__comma(" has a subclass: ");
  3664. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3665. $ctx2.sendIdx[","]=3;
  3666. //>>excludeEnd("ctx");
  3667. $6=$recv(subclass)._name();
  3668. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3669. $ctx2.sendIdx["name"]=2;
  3670. //>>excludeEnd("ctx");
  3671. $3=$recv($4).__comma($6);
  3672. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3673. $ctx2.sendIdx[","]=2;
  3674. //>>excludeEnd("ctx");
  3675. return $self._error_($3);
  3676. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3677. $ctx2.sendIdx["error:"]=2;
  3678. //>>excludeEnd("ctx");
  3679. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3680. }, function($ctx2) {$ctx2.fillBlock({subclass:subclass},$ctx1,2)});
  3681. //>>excludeEnd("ctx");
  3682. }));
  3683. $recv($recv(aClass)._traitUsers())._ifNotEmpty_((function(){
  3684. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3685. return $core.withContext(function($ctx2) {
  3686. //>>excludeEnd("ctx");
  3687. return $self._error_($recv($recv(aClass)._name()).__comma(" has trait users."));
  3688. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3689. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  3690. //>>excludeEnd("ctx");
  3691. }));
  3692. $self._deleteClass_(aClass);
  3693. $recv(aClass)._setTraitComposition_([]);
  3694. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3695. $ctx1.sendIdx["setTraitComposition:"]=1;
  3696. //>>excludeEnd("ctx");
  3697. $7=$recv(aClass)._theMetaClass();
  3698. if(($receiver = $7) == null || $receiver.a$nil){
  3699. $7;
  3700. } else {
  3701. var meta;
  3702. meta=$receiver;
  3703. $recv(meta)._setTraitComposition_([]);
  3704. }
  3705. $8=$recv($globals.SystemAnnouncer)._current();
  3706. $10=$recv($globals.ClassRemoved)._new();
  3707. $recv($10)._theClass_(aClass);
  3708. $9=$recv($10)._yourself();
  3709. $recv($8)._announce_($9);
  3710. return self;
  3711. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3712. }, function($ctx1) {$ctx1.fill(self,"removeClass:",{aClass:aClass},$globals.SmalltalkImage)});
  3713. //>>excludeEnd("ctx");
  3714. },
  3715. //>>excludeStart("ide", pragmas.excludeIdeData);
  3716. args: ["aClass"],
  3717. source: "removeClass: aClass\x0a\x09aClass isMetaclass ifTrue: [ self error: aClass asString, ' is a Metaclass and cannot be removed!' ].\x0a\x09aClass allSubclassesDo: [ :subclass | self error: aClass name, ' has a subclass: ', subclass name ].\x0a\x09aClass traitUsers ifNotEmpty: [ self error: aClass name, ' has trait users.' ].\x0a\x09\x0a\x09self deleteClass: aClass.\x0a\x09aClass setTraitComposition: #().\x0a\x09aClass theMetaClass ifNotNil: [ :meta | meta setTraitComposition: #() ].\x0a\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (ClassRemoved new\x0a\x09\x09\x09theClass: aClass;\x0a\x09\x09\x09yourself)",
  3718. referencedClasses: ["SystemAnnouncer", "ClassRemoved"],
  3719. //>>excludeEnd("ide");
  3720. messageSends: ["ifTrue:", "isMetaclass", "error:", ",", "asString", "allSubclassesDo:", "name", "ifNotEmpty:", "traitUsers", "deleteClass:", "setTraitComposition:", "ifNotNil:", "theMetaClass", "announce:", "current", "theClass:", "new", "yourself"]
  3721. }),
  3722. $globals.SmalltalkImage);
  3723. $core.addMethod(
  3724. $core.method({
  3725. selector: "removePackage:",
  3726. protocol: "packages",
  3727. fn: function (packageName){
  3728. var self=this,$self=this;
  3729. var pkg;
  3730. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3731. return $core.withContext(function($ctx1) {
  3732. //>>excludeEnd("ctx");
  3733. pkg=$self._packageAt_ifAbsent_(packageName,(function(){
  3734. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3735. return $core.withContext(function($ctx2) {
  3736. //>>excludeEnd("ctx");
  3737. return $self._error_("Missing package: ".__comma(packageName));
  3738. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3739. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  3740. //>>excludeEnd("ctx");
  3741. }));
  3742. $recv($recv(pkg)._classes())._do_((function(each){
  3743. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3744. return $core.withContext(function($ctx2) {
  3745. //>>excludeEnd("ctx");
  3746. return $self._removeClass_(each);
  3747. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3748. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  3749. //>>excludeEnd("ctx");
  3750. }));
  3751. $recv($self._packageDictionary())._removeKey_(packageName);
  3752. return self;
  3753. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3754. }, function($ctx1) {$ctx1.fill(self,"removePackage:",{packageName:packageName,pkg:pkg},$globals.SmalltalkImage)});
  3755. //>>excludeEnd("ctx");
  3756. },
  3757. //>>excludeStart("ide", pragmas.excludeIdeData);
  3758. args: ["packageName"],
  3759. 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 packageDictionary removeKey: packageName",
  3760. referencedClasses: [],
  3761. //>>excludeEnd("ide");
  3762. messageSends: ["packageAt:ifAbsent:", "error:", ",", "do:", "classes", "removeClass:", "removeKey:", "packageDictionary"]
  3763. }),
  3764. $globals.SmalltalkImage);
  3765. $core.addMethod(
  3766. $core.method({
  3767. selector: "renamePackage:to:",
  3768. protocol: "packages",
  3769. fn: function (packageName,newName){
  3770. var self=this,$self=this;
  3771. var pkg;
  3772. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3773. return $core.withContext(function($ctx1) {
  3774. //>>excludeEnd("ctx");
  3775. var $1,$2,$3;
  3776. pkg=$self._packageAt_ifAbsent_(packageName,(function(){
  3777. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3778. return $core.withContext(function($ctx2) {
  3779. //>>excludeEnd("ctx");
  3780. $1="Missing package: ".__comma(packageName);
  3781. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3782. $ctx2.sendIdx[","]=1;
  3783. //>>excludeEnd("ctx");
  3784. return $self._error_($1);
  3785. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3786. $ctx2.sendIdx["error:"]=1;
  3787. //>>excludeEnd("ctx");
  3788. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3789. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  3790. //>>excludeEnd("ctx");
  3791. }));
  3792. $self._packageAt_ifPresent_(newName,(function(){
  3793. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3794. return $core.withContext(function($ctx2) {
  3795. //>>excludeEnd("ctx");
  3796. return $self._error_("Already exists a package called: ".__comma(newName));
  3797. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3798. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  3799. //>>excludeEnd("ctx");
  3800. }));
  3801. $2=pkg;
  3802. $recv($2)._name_(newName);
  3803. $recv($2)._beDirty();
  3804. $3=$self._packageDictionary();
  3805. $recv($3)._at_put_(newName,pkg);
  3806. $recv($3)._removeKey_(packageName);
  3807. return self;
  3808. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3809. }, function($ctx1) {$ctx1.fill(self,"renamePackage:to:",{packageName:packageName,newName:newName,pkg:pkg},$globals.SmalltalkImage)});
  3810. //>>excludeEnd("ctx");
  3811. },
  3812. //>>excludeStart("ide", pragmas.excludeIdeData);
  3813. args: ["packageName", "newName"],
  3814. 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\x09self packageAt: newName ifPresent: [ self error: 'Already exists a package called: ', newName ].\x0a\x09pkg name: newName; beDirty.\x0a\x09self packageDictionary\x0a\x09\x09at: newName put: pkg;\x0a\x09\x09removeKey: packageName",
  3815. referencedClasses: [],
  3816. //>>excludeEnd("ide");
  3817. messageSends: ["packageAt:ifAbsent:", "error:", ",", "packageAt:ifPresent:", "name:", "beDirty", "at:put:", "packageDictionary", "removeKey:"]
  3818. }),
  3819. $globals.SmalltalkImage);
  3820. $core.addMethod(
  3821. $core.method({
  3822. selector: "reservedWords",
  3823. protocol: "accessing",
  3824. fn: function (){
  3825. var self=this,$self=this;
  3826. return ["break", "case", "catch", "class", "const", "continue", "debugger", "default", "delete", "do", "else", "export", "extends", "finally", "for", "function", "if", "import", "in", "instanceof", "new", "return", "super", "switch", "this", "throw", "try", "typeof", "var", "void", "while", "with", "yield", "let", "static", "arguments", "await", "enum", "implements", "interface", "package", "private", "protected", "public"];
  3827. },
  3828. //>>excludeStart("ide", pragmas.excludeIdeData);
  3829. args: [],
  3830. source: "reservedWords\x0a\x09^ #(\x0a\x09\x09\x22http://www.ecma-international.org/ecma-262/6.0/#sec-keywords\x22\x0a\x09\x09break case catch class const continue debugger\x0a\x09\x09default delete do else export extends finally\x0a\x09\x09for function if import in instanceof new\x0a\x09\x09return super switch this throw try typeof\x0a\x09\x09var void while with yield\x0a\x09\x09\x22in strict mode\x22\x0a\x09\x09let static\x0a\x09\x09\x22Amber protected words: these should not be compiled as-is when in code\x22\x0a\x09\x09arguments\x0a\x09\x09\x22http://www.ecma-international.org/ecma-262/6.0/#sec-future-reserved-words\x22\x0a\x09\x09await enum\x0a\x09\x09\x22in strict mode\x22\x0a\x09\x09implements interface package private protected public\x0a\x09)",
  3831. referencedClasses: [],
  3832. //>>excludeEnd("ide");
  3833. messageSends: []
  3834. }),
  3835. $globals.SmalltalkImage);
  3836. $core.addMethod(
  3837. $core.method({
  3838. selector: "settings",
  3839. protocol: "accessing",
  3840. fn: function (){
  3841. var self=this,$self=this;
  3842. return $globals.SmalltalkSettings;
  3843. },
  3844. //>>excludeStart("ide", pragmas.excludeIdeData);
  3845. args: [],
  3846. source: "settings\x0a\x09^ SmalltalkSettings",
  3847. referencedClasses: ["SmalltalkSettings"],
  3848. //>>excludeEnd("ide");
  3849. messageSends: []
  3850. }),
  3851. $globals.SmalltalkImage);
  3852. $core.addMethod(
  3853. $core.method({
  3854. selector: "sweepPackageDescriptors:",
  3855. protocol: "private",
  3856. fn: function (pkgs){
  3857. var self=this,$self=this;
  3858. var pd;
  3859. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3860. return $core.withContext(function($ctx1) {
  3861. //>>excludeEnd("ctx");
  3862. pd=$recv($self._core())._packageDescriptors();
  3863. $recv(pkgs)._do_((function(each){
  3864. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3865. return $core.withContext(function($ctx2) {
  3866. //>>excludeEnd("ctx");
  3867. return $recv(pd)._removeKey_($recv(each)._name());
  3868. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3869. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3870. //>>excludeEnd("ctx");
  3871. }));
  3872. return self;
  3873. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3874. }, function($ctx1) {$ctx1.fill(self,"sweepPackageDescriptors:",{pkgs:pkgs,pd:pd},$globals.SmalltalkImage)});
  3875. //>>excludeEnd("ctx");
  3876. },
  3877. //>>excludeStart("ide", pragmas.excludeIdeData);
  3878. args: ["pkgs"],
  3879. source: "sweepPackageDescriptors: pkgs\x0a\x09| pd |\x09\x0a\x09pd := self core packageDescriptors.\x0a\x09pkgs do: [ :each | pd removeKey: each name ]",
  3880. referencedClasses: [],
  3881. //>>excludeEnd("ide");
  3882. messageSends: ["packageDescriptors", "core", "do:", "removeKey:", "name"]
  3883. }),
  3884. $globals.SmalltalkImage);
  3885. $core.addMethod(
  3886. $core.method({
  3887. selector: "tryAdoptPackageDescriptorsBeyond:",
  3888. protocol: "private",
  3889. fn: function (aSet){
  3890. var self=this,$self=this;
  3891. var original;
  3892. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3893. return $core.withContext(function($ctx1) {
  3894. //>>excludeEnd("ctx");
  3895. var $1;
  3896. original=$recv(aSet)._copy();
  3897. $recv($recv($self._core())._packageDescriptors())._keysAndValuesDo_((function(key,value){
  3898. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3899. return $core.withContext(function($ctx2) {
  3900. //>>excludeEnd("ctx");
  3901. return $recv(aSet)._add_($recv($globals.Package)._named_javaScriptDescriptor_(key,value));
  3902. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3903. }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1,1)});
  3904. //>>excludeEnd("ctx");
  3905. }));
  3906. $1=$recv(aSet)._allSatisfy_((function(each){
  3907. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3908. return $core.withContext(function($ctx2) {
  3909. //>>excludeEnd("ctx");
  3910. return $recv(original)._includes_(each);
  3911. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3912. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  3913. //>>excludeEnd("ctx");
  3914. }));
  3915. if($core.assert($1)){
  3916. return $recv($globals.Promise)._value_(aSet);
  3917. } else {
  3918. return $recv($recv($globals.Promise)._all_($recv(aSet)._collect_("isReady")))._then_((function(){
  3919. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3920. return $core.withContext(function($ctx2) {
  3921. //>>excludeEnd("ctx");
  3922. return $self._tryAdoptPackageDescriptorsBeyond_(aSet);
  3923. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3924. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)});
  3925. //>>excludeEnd("ctx");
  3926. }));
  3927. }
  3928. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3929. }, function($ctx1) {$ctx1.fill(self,"tryAdoptPackageDescriptorsBeyond:",{aSet:aSet,original:original},$globals.SmalltalkImage)});
  3930. //>>excludeEnd("ctx");
  3931. },
  3932. //>>excludeStart("ide", pragmas.excludeIdeData);
  3933. args: ["aSet"],
  3934. source: "tryAdoptPackageDescriptorsBeyond: aSet\x0a\x09| original |\x0a\x09original := aSet copy.\x0a\x09self core packageDescriptors keysAndValuesDo: [ :key :value |\x0a\x09\x09aSet add: (Package named: key javaScriptDescriptor: value) ].\x0a\x09^ (aSet allSatisfy: [ :each | original includes: each ])\x0a\x09\x09ifFalse: [ (Promise all: (aSet collect: #isReady)) then: [ self tryAdoptPackageDescriptorsBeyond: aSet ] ]\x0a\x09\x09ifTrue: [ Promise value: aSet ]",
  3935. referencedClasses: ["Package", "Promise"],
  3936. //>>excludeEnd("ide");
  3937. messageSends: ["copy", "keysAndValuesDo:", "packageDescriptors", "core", "add:", "named:javaScriptDescriptor:", "ifFalse:ifTrue:", "allSatisfy:", "includes:", "then:", "all:", "collect:", "tryAdoptPackageDescriptorsBeyond:", "value:"]
  3938. }),
  3939. $globals.SmalltalkImage);
  3940. $core.addMethod(
  3941. $core.method({
  3942. selector: "version",
  3943. protocol: "accessing",
  3944. fn: function (){
  3945. var self=this,$self=this;
  3946. return "0.24.0-pre";
  3947. },
  3948. //>>excludeStart("ide", pragmas.excludeIdeData);
  3949. args: [],
  3950. source: "version\x0a\x09\x22Answer the version string of Amber\x22\x0a\x09\x0a\x09^ '0.24.0-pre'",
  3951. referencedClasses: [],
  3952. //>>excludeEnd("ide");
  3953. messageSends: []
  3954. }),
  3955. $globals.SmalltalkImage);
  3956. $core.setSlots($globals.SmalltalkImage.a$cls, ["current"]);
  3957. $core.addMethod(
  3958. $core.method({
  3959. selector: "current",
  3960. protocol: "instance creation",
  3961. fn: function (){
  3962. var self=this,$self=this;
  3963. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3964. return $core.withContext(function($ctx1) {
  3965. //>>excludeEnd("ctx");
  3966. var $1,$receiver;
  3967. $1=$self.current;
  3968. if(($receiver = $1) == null || $receiver.a$nil){
  3969. $self.current=(
  3970. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3971. $ctx1.supercall = true,
  3972. //>>excludeEnd("ctx");
  3973. ($globals.SmalltalkImage.a$cls.superclass||$boot.nilAsClass).fn.prototype._new.apply($self, []));
  3974. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3975. $ctx1.supercall = false;
  3976. //>>excludeEnd("ctx");;
  3977. return $self.current;
  3978. } else {
  3979. $self._deprecatedAPI();
  3980. return $self.current;
  3981. }
  3982. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3983. }, function($ctx1) {$ctx1.fill(self,"current",{},$globals.SmalltalkImage.a$cls)});
  3984. //>>excludeEnd("ctx");
  3985. },
  3986. //>>excludeStart("ide", pragmas.excludeIdeData);
  3987. args: [],
  3988. source: "current\x0a\x09^ current ifNil: [ current := super new ] ifNotNil: [ self deprecatedAPI. current ]",
  3989. referencedClasses: [],
  3990. //>>excludeEnd("ide");
  3991. messageSends: ["ifNil:ifNotNil:", "new", "deprecatedAPI"]
  3992. }),
  3993. $globals.SmalltalkImage.a$cls);
  3994. $core.addMethod(
  3995. $core.method({
  3996. selector: "initialize",
  3997. protocol: "initialization",
  3998. fn: function (){
  3999. var self=this,$self=this;
  4000. var st;
  4001. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4002. return $core.withContext(function($ctx1) {
  4003. //>>excludeEnd("ctx");
  4004. st=$self._current();
  4005. $recv($recv(st)._globals())._at_put_("Smalltalk",st);
  4006. return self;
  4007. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4008. }, function($ctx1) {$ctx1.fill(self,"initialize",{st:st},$globals.SmalltalkImage.a$cls)});
  4009. //>>excludeEnd("ctx");
  4010. },
  4011. //>>excludeStart("ide", pragmas.excludeIdeData);
  4012. args: [],
  4013. source: "initialize\x0a\x09| st |\x0a\x09st := self current.\x0a\x09st globals at: 'Smalltalk' put: st",
  4014. referencedClasses: [],
  4015. //>>excludeEnd("ide");
  4016. messageSends: ["current", "at:put:", "globals"]
  4017. }),
  4018. $globals.SmalltalkImage.a$cls);
  4019. $core.addMethod(
  4020. $core.method({
  4021. selector: "new",
  4022. protocol: "instance creation",
  4023. fn: function (){
  4024. var self=this,$self=this;
  4025. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4026. return $core.withContext(function($ctx1) {
  4027. //>>excludeEnd("ctx");
  4028. $self._shouldNotImplement();
  4029. return self;
  4030. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4031. }, function($ctx1) {$ctx1.fill(self,"new",{},$globals.SmalltalkImage.a$cls)});
  4032. //>>excludeEnd("ctx");
  4033. },
  4034. //>>excludeStart("ide", pragmas.excludeIdeData);
  4035. args: [],
  4036. source: "new\x0a\x09self shouldNotImplement",
  4037. referencedClasses: [],
  4038. //>>excludeEnd("ide");
  4039. messageSends: ["shouldNotImplement"]
  4040. }),
  4041. $globals.SmalltalkImage.a$cls);
  4042. $core.setTraitComposition([{trait: $globals.TThenable}], $globals.JSObjectProxy);
  4043. $core.addMethod(
  4044. $core.method({
  4045. selector: "nextPutJSObject:",
  4046. protocol: "*Kernel-Infrastructure",
  4047. fn: function (aJSObject){
  4048. var self=this,$self=this;
  4049. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4050. return $core.withContext(function($ctx1) {
  4051. //>>excludeEnd("ctx");
  4052. $self._nextPut_(aJSObject);
  4053. return self;
  4054. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4055. }, function($ctx1) {$ctx1.fill(self,"nextPutJSObject:",{aJSObject:aJSObject},$globals.ProtoStream)});
  4056. //>>excludeEnd("ctx");
  4057. },
  4058. //>>excludeStart("ide", pragmas.excludeIdeData);
  4059. args: ["aJSObject"],
  4060. source: "nextPutJSObject: aJSObject\x0a\x09self nextPut: aJSObject",
  4061. referencedClasses: [],
  4062. //>>excludeEnd("ide");
  4063. messageSends: ["nextPut:"]
  4064. }),
  4065. $globals.ProtoStream);
  4066. $core.addMethod(
  4067. $core.method({
  4068. selector: "asJavaScriptPropertyName",
  4069. protocol: "*Kernel-Infrastructure",
  4070. fn: function (){
  4071. var self=this,$self=this;
  4072. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4073. return $core.withContext(function($ctx1) {
  4074. //>>excludeEnd("ctx");
  4075. return $core.st2prop(self);
  4076. return self;
  4077. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4078. }, function($ctx1) {$ctx1.fill(self,"asJavaScriptPropertyName",{},$globals.String)});
  4079. //>>excludeEnd("ctx");
  4080. },
  4081. //>>excludeStart("ide", pragmas.excludeIdeData);
  4082. args: [],
  4083. source: "asJavaScriptPropertyName\x0a<inlineJS: 'return $core.st2prop(self)'>",
  4084. referencedClasses: [],
  4085. //>>excludeEnd("ide");
  4086. messageSends: []
  4087. }),
  4088. $globals.String);
  4089. $core.addMethod(
  4090. $core.method({
  4091. selector: "asSetting",
  4092. protocol: "*Kernel-Infrastructure",
  4093. fn: function (){
  4094. var self=this,$self=this;
  4095. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4096. return $core.withContext(function($ctx1) {
  4097. //>>excludeEnd("ctx");
  4098. return $recv($globals.Setting)._at_ifAbsent_(self,nil);
  4099. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4100. }, function($ctx1) {$ctx1.fill(self,"asSetting",{},$globals.String)});
  4101. //>>excludeEnd("ctx");
  4102. },
  4103. //>>excludeStart("ide", pragmas.excludeIdeData);
  4104. args: [],
  4105. source: "asSetting\x0a\x09\x22Answer aSetting dedicated to locally store a value using this string as key.\x0a\x09Nil will be the default value.\x22\x0a\x09^ Setting at: self ifAbsent: nil",
  4106. referencedClasses: ["Setting"],
  4107. //>>excludeEnd("ide");
  4108. messageSends: ["at:ifAbsent:"]
  4109. }),
  4110. $globals.String);
  4111. $core.addMethod(
  4112. $core.method({
  4113. selector: "asSettingIfAbsent:",
  4114. protocol: "*Kernel-Infrastructure",
  4115. fn: function (aDefaultValue){
  4116. var self=this,$self=this;
  4117. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4118. return $core.withContext(function($ctx1) {
  4119. //>>excludeEnd("ctx");
  4120. return $recv($globals.Setting)._at_ifAbsent_(self,aDefaultValue);
  4121. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4122. }, function($ctx1) {$ctx1.fill(self,"asSettingIfAbsent:",{aDefaultValue:aDefaultValue},$globals.String)});
  4123. //>>excludeEnd("ctx");
  4124. },
  4125. //>>excludeStart("ide", pragmas.excludeIdeData);
  4126. args: ["aDefaultValue"],
  4127. source: "asSettingIfAbsent: aDefaultValue\x0a\x09\x22Answer aSetting dedicated to locally store a value using this string as key.\x0a\x09Make this setting to have aDefaultValue.\x22\x0a\x09^ Setting at: self ifAbsent: aDefaultValue",
  4128. referencedClasses: ["Setting"],
  4129. //>>excludeEnd("ide");
  4130. messageSends: ["at:ifAbsent:"]
  4131. }),
  4132. $globals.String);
  4133. $core.addMethod(
  4134. $core.method({
  4135. selector: "settingValue",
  4136. protocol: "*Kernel-Infrastructure",
  4137. fn: function (){
  4138. var self=this,$self=this;
  4139. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4140. return $core.withContext(function($ctx1) {
  4141. //>>excludeEnd("ctx");
  4142. return $recv($self._asSetting())._value();
  4143. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4144. }, function($ctx1) {$ctx1.fill(self,"settingValue",{},$globals.String)});
  4145. //>>excludeEnd("ctx");
  4146. },
  4147. //>>excludeStart("ide", pragmas.excludeIdeData);
  4148. args: [],
  4149. source: "settingValue\x0a\x09^ self asSetting value",
  4150. referencedClasses: [],
  4151. //>>excludeEnd("ide");
  4152. messageSends: ["value", "asSetting"]
  4153. }),
  4154. $globals.String);
  4155. $core.addMethod(
  4156. $core.method({
  4157. selector: "settingValue:",
  4158. protocol: "*Kernel-Infrastructure",
  4159. fn: function (aValue){
  4160. var self=this,$self=this;
  4161. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4162. return $core.withContext(function($ctx1) {
  4163. //>>excludeEnd("ctx");
  4164. return $recv($self._asSetting())._value_(aValue);
  4165. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4166. }, function($ctx1) {$ctx1.fill(self,"settingValue:",{aValue:aValue},$globals.String)});
  4167. //>>excludeEnd("ctx");
  4168. },
  4169. //>>excludeStart("ide", pragmas.excludeIdeData);
  4170. args: ["aValue"],
  4171. source: "settingValue: aValue\x0a\x09\x22Sets the value of the setting that will be locally stored using this string as key.\x0a\x09Note that aValue can be any object that can be stringifyed\x22\x0a\x09^ self asSetting value: aValue",
  4172. referencedClasses: [],
  4173. //>>excludeEnd("ide");
  4174. messageSends: ["value:", "asSetting"]
  4175. }),
  4176. $globals.String);
  4177. $core.addMethod(
  4178. $core.method({
  4179. selector: "settingValueIfAbsent:",
  4180. protocol: "*Kernel-Infrastructure",
  4181. fn: function (aDefaultValue){
  4182. var self=this,$self=this;
  4183. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4184. return $core.withContext(function($ctx1) {
  4185. //>>excludeEnd("ctx");
  4186. return $recv($self._asSettingIfAbsent_(aDefaultValue))._value();
  4187. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4188. }, function($ctx1) {$ctx1.fill(self,"settingValueIfAbsent:",{aDefaultValue:aDefaultValue},$globals.String)});
  4189. //>>excludeEnd("ctx");
  4190. },
  4191. //>>excludeStart("ide", pragmas.excludeIdeData);
  4192. args: ["aDefaultValue"],
  4193. source: "settingValueIfAbsent: aDefaultValue\x0a\x09\x22Answer the value of the locally stored setting using this string as key.\x0a\x09Use aDefaultValue in case no setting is found\x22\x0a\x09^ (self asSettingIfAbsent: aDefaultValue) value",
  4194. referencedClasses: [],
  4195. //>>excludeEnd("ide");
  4196. messageSends: ["value", "asSettingIfAbsent:"]
  4197. }),
  4198. $globals.String);
  4199. });