Kernel-Infrastructure.js 150 KB

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