Kernel-Infrastructure.js 150 KB

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