Kernel-Infrastructure.js 146 KB

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