Kernel-Infrastructure.js 149 KB

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