Kernel-Infrastructure.js 148 KB

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