Kernel-Infrastructure.js 150 KB

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