Kernel-Infrastructure.js 129 KB

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