Platform-ImportExport.js 173 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571
  1. define(["amber/boot", "amber_core/Kernel-Classes", "amber_core/Kernel-Exceptions", "amber_core/Kernel-Infrastructure", "amber_core/Kernel-Objects"], function($boot){"use strict";
  2. if(!$boot.nilAsReceiver)$boot.nilAsReceiver=$boot.nil;
  3. if(!("nilAsValue" in $boot))$boot.nilAsValue=$boot.nilAsReceiver;
  4. var $core=$boot.api,nil=$boot.nilAsValue,$nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;
  5. if(!$boot.nilAsClass)$boot.nilAsClass=$boot.dnu;
  6. $core.addPackage("Platform-ImportExport");
  7. $core.packages["Platform-ImportExport"].innerEval = function (expr) { return eval(expr); };
  8. $core.packages["Platform-ImportExport"].transport = {"type":"amd","amdNamespace":"amber_core"};
  9. $core.addClass("AbstractExporter", $globals.Object, [], "Platform-ImportExport");
  10. //>>excludeStart("ide", pragmas.excludeIdeData);
  11. $globals.AbstractExporter.comment="I am an abstract exporter for Amber source code.\x0a\x0a## API\x0a\x0aUse `#exportPackage:on:` to export a given package on a Stream.";
  12. //>>excludeEnd("ide");
  13. $core.addMethod(
  14. $core.method({
  15. selector: "exportPackage:on:",
  16. protocol: "output",
  17. fn: function (aPackage,aStream){
  18. var self=this,$self=this;
  19. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  20. return $core.withContext(function($ctx1) {
  21. //>>excludeEnd("ctx");
  22. $self._subclassResponsibility();
  23. return self;
  24. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  25. }, function($ctx1) {$ctx1.fill(self,"exportPackage:on:",{aPackage:aPackage,aStream:aStream},$globals.AbstractExporter)});
  26. //>>excludeEnd("ctx");
  27. },
  28. //>>excludeStart("ide", pragmas.excludeIdeData);
  29. args: ["aPackage", "aStream"],
  30. source: "exportPackage: aPackage on: aStream\x0a\x09self subclassResponsibility",
  31. referencedClasses: [],
  32. //>>excludeEnd("ide");
  33. messageSends: ["subclassResponsibility"]
  34. }),
  35. $globals.AbstractExporter);
  36. $core.addMethod(
  37. $core.method({
  38. selector: "extensionMethodsOfPackage:",
  39. protocol: "accessing",
  40. fn: function (aPackage){
  41. var self=this,$self=this;
  42. var result;
  43. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  44. return $core.withContext(function($ctx1) {
  45. //>>excludeEnd("ctx");
  46. result=$recv($globals.OrderedCollection)._new();
  47. $recv($self._extensionProtocolsOfPackage_(aPackage))._do_((function(each){
  48. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  49. return $core.withContext(function($ctx2) {
  50. //>>excludeEnd("ctx");
  51. return $recv(result)._addAll_($recv(each)._ownMethods());
  52. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  53. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  54. //>>excludeEnd("ctx");
  55. }));
  56. return result;
  57. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  58. }, function($ctx1) {$ctx1.fill(self,"extensionMethodsOfPackage:",{aPackage:aPackage,result:result},$globals.AbstractExporter)});
  59. //>>excludeEnd("ctx");
  60. },
  61. //>>excludeStart("ide", pragmas.excludeIdeData);
  62. args: ["aPackage"],
  63. source: "extensionMethodsOfPackage: aPackage\x0a\x09| result |\x0a\x09\x0a\x09result := OrderedCollection new.\x0a\x09\x0a\x09(self extensionProtocolsOfPackage: aPackage) do: [ :each |\x0a\x09\x09result addAll: each ownMethods ].\x0a\x09\x09\x0a\x09^ result",
  64. referencedClasses: ["OrderedCollection"],
  65. //>>excludeEnd("ide");
  66. messageSends: ["new", "do:", "extensionProtocolsOfPackage:", "addAll:", "ownMethods"]
  67. }),
  68. $globals.AbstractExporter);
  69. $core.addMethod(
  70. $core.method({
  71. selector: "extensionProtocolsOfPackage:",
  72. protocol: "accessing",
  73. fn: function (aPackage){
  74. var self=this,$self=this;
  75. var extensionName,result;
  76. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  77. return $core.withContext(function($ctx1) {
  78. //>>excludeEnd("ctx");
  79. var $1,$2,$3;
  80. $1=$recv(aPackage)._name();
  81. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  82. $ctx1.sendIdx["name"]=1;
  83. //>>excludeEnd("ctx");
  84. extensionName="*".__comma($1);
  85. result=$recv($globals.OrderedCollection)._new();
  86. $recv($recv($recv($recv($globals.Smalltalk)._classes())._asArray())._sorted_((function(a,b){
  87. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  88. return $core.withContext(function($ctx2) {
  89. //>>excludeEnd("ctx");
  90. $2=$recv(a)._name();
  91. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  92. $ctx2.sendIdx["name"]=2;
  93. //>>excludeEnd("ctx");
  94. return $recv($2).__lt($recv(b)._name());
  95. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  96. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,1)});
  97. //>>excludeEnd("ctx");
  98. })))._do_((function(each){
  99. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  100. return $core.withContext(function($ctx2) {
  101. //>>excludeEnd("ctx");
  102. return $recv($recv([each,$recv(each)._theMetaClass()])._copyWithout_(nil))._do_((function(behavior){
  103. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  104. return $core.withContext(function($ctx3) {
  105. //>>excludeEnd("ctx");
  106. $3=$recv($recv(behavior)._protocols())._includes_(extensionName);
  107. if($core.assert($3)){
  108. return $recv(result)._add_($recv($globals.ExportMethodProtocol)._name_theClass_(extensionName,behavior));
  109. }
  110. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  111. }, function($ctx3) {$ctx3.fillBlock({behavior:behavior},$ctx2,3)});
  112. //>>excludeEnd("ctx");
  113. }));
  114. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  115. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  116. //>>excludeEnd("ctx");
  117. }));
  118. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  119. $ctx1.sendIdx["do:"]=1;
  120. //>>excludeEnd("ctx");
  121. return result;
  122. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  123. }, function($ctx1) {$ctx1.fill(self,"extensionProtocolsOfPackage:",{aPackage:aPackage,extensionName:extensionName,result:result},$globals.AbstractExporter)});
  124. //>>excludeEnd("ctx");
  125. },
  126. //>>excludeStart("ide", pragmas.excludeIdeData);
  127. args: ["aPackage"],
  128. source: "extensionProtocolsOfPackage: aPackage\x0a\x09| extensionName result |\x0a\x09\x0a\x09extensionName := '*', aPackage name.\x0a\x09result := OrderedCollection new.\x0a\x09\x0a\x09\x22The classes must be loaded since it is extensions only.\x0a\x09Therefore topological sorting (dependency resolution) does not matter here.\x0a\x09Not sorting topologically improves the speed by a number of magnitude.\x0a\x09\x0a\x09Not to shuffle diffs, classes are sorted by their name.\x22\x0a\x09\x0a\x09(Smalltalk classes asArray sorted: [ :a :b | a name < b name ]) do: [ :each |\x0a\x09\x09({each. each theMetaClass} copyWithout: nil) do: [ :behavior |\x0a\x09\x09\x09(behavior protocols includes: extensionName) ifTrue: [\x0a\x09\x09\x09\x09result add: (ExportMethodProtocol name: extensionName theClass: behavior) ] ] ].\x0a\x0a\x09^ result",
  129. referencedClasses: ["OrderedCollection", "Smalltalk", "ExportMethodProtocol"],
  130. //>>excludeEnd("ide");
  131. messageSends: [",", "name", "new", "do:", "sorted:", "asArray", "classes", "<", "copyWithout:", "theMetaClass", "ifTrue:", "includes:", "protocols", "add:", "name:theClass:"]
  132. }),
  133. $globals.AbstractExporter);
  134. $core.addClass("ChunkExporter", $globals.AbstractExporter, [], "Platform-ImportExport");
  135. //>>excludeStart("ide", pragmas.excludeIdeData);
  136. $globals.ChunkExporter.comment="I am an exporter dedicated to outputting Amber source code in the classic Smalltalk chunk format.\x0a\x0aI do not output any compiled code.";
  137. //>>excludeEnd("ide");
  138. $core.addMethod(
  139. $core.method({
  140. selector: "chunkEscape:",
  141. protocol: "convenience",
  142. fn: function (aString){
  143. var self=this,$self=this;
  144. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  145. return $core.withContext(function($ctx1) {
  146. //>>excludeEnd("ctx");
  147. return $recv($recv(aString)._replace_with_("!","!!"))._trimBoth();
  148. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  149. }, function($ctx1) {$ctx1.fill(self,"chunkEscape:",{aString:aString},$globals.ChunkExporter)});
  150. //>>excludeEnd("ctx");
  151. },
  152. //>>excludeStart("ide", pragmas.excludeIdeData);
  153. args: ["aString"],
  154. source: "chunkEscape: aString\x0a\x09\x22Replace all occurrences of ! with !! and trim at both ends.\x22\x0a\x0a\x09^ (aString replace: '!' with: '!!') trimBoth",
  155. referencedClasses: [],
  156. //>>excludeEnd("ide");
  157. messageSends: ["trimBoth", "replace:with:"]
  158. }),
  159. $globals.ChunkExporter);
  160. $core.addMethod(
  161. $core.method({
  162. selector: "exportBehavior:on:",
  163. protocol: "output",
  164. fn: function (aBehavior,aStream){
  165. var self=this,$self=this;
  166. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  167. return $core.withContext(function($ctx1) {
  168. //>>excludeEnd("ctx");
  169. $recv(aBehavior)._exportBehaviorDefinitionTo_using_(aStream,self);
  170. $self._exportProtocols_on_($self._ownMethodProtocolsOfClass_(aBehavior),aStream);
  171. return self;
  172. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  173. }, function($ctx1) {$ctx1.fill(self,"exportBehavior:on:",{aBehavior:aBehavior,aStream:aStream},$globals.ChunkExporter)});
  174. //>>excludeEnd("ctx");
  175. },
  176. //>>excludeStart("ide", pragmas.excludeIdeData);
  177. args: ["aBehavior", "aStream"],
  178. source: "exportBehavior: aBehavior on: aStream\x0a\x09aBehavior exportBehaviorDefinitionTo: aStream using: self.\x0a\x09self \x0a\x09\x09exportProtocols: (self ownMethodProtocolsOfClass: aBehavior)\x0a\x09\x09on: aStream",
  179. referencedClasses: [],
  180. //>>excludeEnd("ide");
  181. messageSends: ["exportBehaviorDefinitionTo:using:", "exportProtocols:on:", "ownMethodProtocolsOfClass:"]
  182. }),
  183. $globals.ChunkExporter);
  184. $core.addMethod(
  185. $core.method({
  186. selector: "exportCategoryEpilogueOf:on:",
  187. protocol: "output",
  188. fn: function (aCategory,aStream){
  189. var self=this,$self=this;
  190. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  191. return $core.withContext(function($ctx1) {
  192. //>>excludeEnd("ctx");
  193. $recv(aStream)._write_(" !");
  194. $recv(aStream)._lf();
  195. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  196. $ctx1.sendIdx["lf"]=1;
  197. //>>excludeEnd("ctx");
  198. $recv(aStream)._lf();
  199. return self;
  200. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  201. }, function($ctx1) {$ctx1.fill(self,"exportCategoryEpilogueOf:on:",{aCategory:aCategory,aStream:aStream},$globals.ChunkExporter)});
  202. //>>excludeEnd("ctx");
  203. },
  204. //>>excludeStart("ide", pragmas.excludeIdeData);
  205. args: ["aCategory", "aStream"],
  206. source: "exportCategoryEpilogueOf: aCategory on: aStream\x0a\x09aStream write: ' !'; lf; lf",
  207. referencedClasses: [],
  208. //>>excludeEnd("ide");
  209. messageSends: ["write:", "lf"]
  210. }),
  211. $globals.ChunkExporter);
  212. $core.addMethod(
  213. $core.method({
  214. selector: "exportCategoryPrologueOf:on:",
  215. protocol: "output",
  216. fn: function (aCategory,aStream){
  217. var self=this,$self=this;
  218. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  219. return $core.withContext(function($ctx1) {
  220. //>>excludeEnd("ctx");
  221. $recv(aStream)._write_("!");
  222. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  223. $ctx1.sendIdx["write:"]=1;
  224. //>>excludeEnd("ctx");
  225. $recv(aStream)._print_($recv(aCategory)._theClass());
  226. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  227. $ctx1.sendIdx["print:"]=1;
  228. //>>excludeEnd("ctx");
  229. $recv(aStream)._write_(" methodsFor: ");
  230. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  231. $ctx1.sendIdx["write:"]=2;
  232. //>>excludeEnd("ctx");
  233. $recv(aStream)._print_(aCategory);
  234. $recv(aStream)._write_("!");
  235. return self;
  236. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  237. }, function($ctx1) {$ctx1.fill(self,"exportCategoryPrologueOf:on:",{aCategory:aCategory,aStream:aStream},$globals.ChunkExporter)});
  238. //>>excludeEnd("ctx");
  239. },
  240. //>>excludeStart("ide", pragmas.excludeIdeData);
  241. args: ["aCategory", "aStream"],
  242. source: "exportCategoryPrologueOf: aCategory on: aStream\x0a\x09aStream\x0a\x09\x09write: '!';\x0a\x09\x09print: aCategory theClass;\x0a\x09\x09write: ' methodsFor: ';\x0a\x09\x09print: aCategory;\x0a\x09\x09write: '!'",
  243. referencedClasses: [],
  244. //>>excludeEnd("ide");
  245. messageSends: ["write:", "print:", "theClass"]
  246. }),
  247. $globals.ChunkExporter);
  248. $core.addMethod(
  249. $core.method({
  250. selector: "exportDefinitionOf:on:",
  251. protocol: "output",
  252. fn: function (aClass,aStream){
  253. var self=this,$self=this;
  254. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  255. return $core.withContext(function($ctx1) {
  256. //>>excludeEnd("ctx");
  257. var $1,$2,$3,$4;
  258. $recv(aStream)._print_($recv(aClass)._superclass());
  259. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  260. $ctx1.sendIdx["print:"]=1;
  261. //>>excludeEnd("ctx");
  262. $recv(aStream)._write_(" subclass: ");
  263. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  264. $ctx1.sendIdx["write:"]=1;
  265. //>>excludeEnd("ctx");
  266. $recv(aStream)._printSymbol_($recv(aClass)._name());
  267. $1=$recv(aStream)._lf();
  268. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  269. $ctx1.sendIdx["lf"]=1;
  270. //>>excludeEnd("ctx");
  271. $recv(aStream)._tab();
  272. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  273. $ctx1.sendIdx["tab"]=1;
  274. //>>excludeEnd("ctx");
  275. $recv(aStream)._write_("instanceVariableNames: ");
  276. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  277. $ctx1.sendIdx["write:"]=2;
  278. //>>excludeEnd("ctx");
  279. $recv(aStream)._print_(" "._join_($recv(aClass)._instanceVariableNames()));
  280. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  281. $ctx1.sendIdx["print:"]=2;
  282. //>>excludeEnd("ctx");
  283. $recv(aStream)._lf();
  284. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  285. $ctx1.sendIdx["lf"]=2;
  286. //>>excludeEnd("ctx");
  287. $recv(aStream)._tab();
  288. $recv(aStream)._write_("package: ");
  289. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  290. $ctx1.sendIdx["write:"]=3;
  291. //>>excludeEnd("ctx");
  292. $recv(aStream)._print_($recv(aClass)._category());
  293. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  294. $ctx1.sendIdx["print:"]=3;
  295. //>>excludeEnd("ctx");
  296. $recv(aStream)._write_("!");
  297. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  298. $ctx1.sendIdx["write:"]=4;
  299. //>>excludeEnd("ctx");
  300. $2=$recv(aStream)._lf();
  301. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  302. $ctx1.sendIdx["lf"]=3;
  303. //>>excludeEnd("ctx");
  304. $3=$recv(aClass)._comment();
  305. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  306. $ctx1.sendIdx["comment"]=1;
  307. //>>excludeEnd("ctx");
  308. $recv($3)._ifNotEmpty_((function(){
  309. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  310. return $core.withContext(function($ctx2) {
  311. //>>excludeEnd("ctx");
  312. $recv(aStream)._write_("!");
  313. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  314. $ctx2.sendIdx["write:"]=5;
  315. //>>excludeEnd("ctx");
  316. $recv(aStream)._print_(aClass);
  317. $recv(aStream)._write_(" commentStamp!");
  318. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  319. $ctx2.sendIdx["write:"]=6;
  320. //>>excludeEnd("ctx");
  321. $recv(aStream)._lf();
  322. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  323. $ctx2.sendIdx["lf"]=4;
  324. //>>excludeEnd("ctx");
  325. $recv(aStream)._write_([$self._chunkEscape_($recv(aClass)._comment()),"!"]);
  326. $4=$recv(aStream)._lf();
  327. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  328. $ctx2.sendIdx["lf"]=5;
  329. //>>excludeEnd("ctx");
  330. return $4;
  331. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  332. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  333. //>>excludeEnd("ctx");
  334. }));
  335. $recv(aStream)._lf();
  336. return self;
  337. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  338. }, function($ctx1) {$ctx1.fill(self,"exportDefinitionOf:on:",{aClass:aClass,aStream:aStream},$globals.ChunkExporter)});
  339. //>>excludeEnd("ctx");
  340. },
  341. //>>excludeStart("ide", pragmas.excludeIdeData);
  342. args: ["aClass", "aStream"],
  343. source: "exportDefinitionOf: aClass on: aStream\x0a\x09\x22Chunk format.\x22\x0a\x0a\x09aStream\x0a\x09\x09print: aClass superclass;\x0a\x09\x09write: ' subclass: ';\x0a\x09\x09printSymbol: aClass name;\x0a\x09\x09lf.\x0a\x09\x22aClass traitComposition\x0a\x09\x09ifNotEmpty: [ aStream tab; write: {'uses: '. aClass traitCompositionDefinition}; lf ].\x22\x0a\x09aStream\x0a\x09\x09tab;\x0a\x09\x09write: 'instanceVariableNames: ';\x0a\x09\x09print: (' ' join: aClass instanceVariableNames);\x0a\x09\x09lf;\x0a\x09\x09tab;\x0a\x09\x09write: 'package: ';\x0a\x09\x09print: aClass category;\x0a\x09\x09write: '!';\x0a\x09\x09lf.\x0a\x09aClass comment ifNotEmpty: [ aStream\x0a\x09\x09write: '!'; print: aClass; write: ' commentStamp!'; lf;\x0a\x09\x09write: { self chunkEscape: aClass comment. '!' }; lf ].\x0a\x09aStream lf",
  344. referencedClasses: [],
  345. //>>excludeEnd("ide");
  346. messageSends: ["print:", "superclass", "write:", "printSymbol:", "name", "lf", "tab", "join:", "instanceVariableNames", "category", "ifNotEmpty:", "comment", "chunkEscape:"]
  347. }),
  348. $globals.ChunkExporter);
  349. $core.addMethod(
  350. $core.method({
  351. selector: "exportMetaDefinitionOf:on:",
  352. protocol: "output",
  353. fn: function (aClass,aStream){
  354. var self=this,$self=this;
  355. var classIvars,classTraitComposition;
  356. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  357. return $core.withContext(function($ctx1) {
  358. //>>excludeEnd("ctx");
  359. var $1,$2;
  360. $1=$recv(aClass)._class();
  361. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  362. $ctx1.sendIdx["class"]=1;
  363. //>>excludeEnd("ctx");
  364. classIvars=$recv($1)._instanceVariableNames();
  365. classTraitComposition=$recv($recv(aClass)._class())._traitComposition();
  366. $2=$recv(classIvars)._notEmpty();
  367. if($core.assert($2)){
  368. $recv(aStream)._print_($recv(aClass)._theMetaClass());
  369. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  370. $ctx1.sendIdx["print:"]=1;
  371. //>>excludeEnd("ctx");
  372. $recv(aStream)._space();
  373. $recv(aStream)._write_("instanceVariableNames: ");
  374. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  375. $ctx1.sendIdx["write:"]=1;
  376. //>>excludeEnd("ctx");
  377. $recv(aStream)._print_(" "._join_(classIvars));
  378. $recv(aStream)._write_("!");
  379. $recv(aStream)._lf();
  380. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  381. $ctx1.sendIdx["lf"]=1;
  382. //>>excludeEnd("ctx");
  383. $recv(aStream)._lf();
  384. }
  385. return self;
  386. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  387. }, function($ctx1) {$ctx1.fill(self,"exportMetaDefinitionOf:on:",{aClass:aClass,aStream:aStream,classIvars:classIvars,classTraitComposition:classTraitComposition},$globals.ChunkExporter)});
  388. //>>excludeEnd("ctx");
  389. },
  390. //>>excludeStart("ide", pragmas.excludeIdeData);
  391. args: ["aClass", "aStream"],
  392. source: "exportMetaDefinitionOf: aClass on: aStream\x0a\x0a\x09| classIvars classTraitComposition |\x0a\x09classIvars := aClass class instanceVariableNames.\x0a\x09classTraitComposition := aClass class traitComposition.\x0a\x0a\x09(classIvars notEmpty \x22or: [classTraitComposition notEmpty]\x22) ifTrue: [\x0a\x09\x09aStream\x0a\x09\x09\x09print: aClass theMetaClass.\x0a\x09\x09aStream space. \x22classTraitComposition\x0a\x09\x09\x09ifEmpty: [ aStream space ]\x0a\x09\x09\x09ifNotEmpty: [ aStream lf; tab; write: {'uses: '. aClass class traitCompositionDefinition}; lf; tab ].\x22\x0a\x09\x09aStream\x0a\x09\x09\x09write: 'instanceVariableNames: ';\x0a\x09\x09\x09print: (' ' join: classIvars);\x0a\x09\x09\x09write: '!'; lf; lf ]",
  393. referencedClasses: [],
  394. //>>excludeEnd("ide");
  395. messageSends: ["instanceVariableNames", "class", "traitComposition", "ifTrue:", "notEmpty", "print:", "theMetaClass", "space", "write:", "join:", "lf"]
  396. }),
  397. $globals.ChunkExporter);
  398. $core.addMethod(
  399. $core.method({
  400. selector: "exportMethod:on:",
  401. protocol: "output",
  402. fn: function (aMethod,aStream){
  403. var self=this,$self=this;
  404. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  405. return $core.withContext(function($ctx1) {
  406. //>>excludeEnd("ctx");
  407. $recv(aStream)._lf();
  408. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  409. $ctx1.sendIdx["lf"]=1;
  410. //>>excludeEnd("ctx");
  411. $recv(aStream)._lf();
  412. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  413. $ctx1.sendIdx["lf"]=2;
  414. //>>excludeEnd("ctx");
  415. $recv(aStream)._write_($self._chunkEscape_($recv(aMethod)._source()));
  416. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  417. $ctx1.sendIdx["write:"]=1;
  418. //>>excludeEnd("ctx");
  419. $recv(aStream)._lf();
  420. $recv(aStream)._write_("!");
  421. return self;
  422. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  423. }, function($ctx1) {$ctx1.fill(self,"exportMethod:on:",{aMethod:aMethod,aStream:aStream},$globals.ChunkExporter)});
  424. //>>excludeEnd("ctx");
  425. },
  426. //>>excludeStart("ide", pragmas.excludeIdeData);
  427. args: ["aMethod", "aStream"],
  428. source: "exportMethod: aMethod on: aStream\x0a\x09aStream\x0a\x09\x09lf; lf; write: (self chunkEscape: aMethod source); lf;\x0a\x09\x09write: '!'",
  429. referencedClasses: [],
  430. //>>excludeEnd("ide");
  431. messageSends: ["lf", "write:", "chunkEscape:", "source"]
  432. }),
  433. $globals.ChunkExporter);
  434. $core.addMethod(
  435. $core.method({
  436. selector: "exportPackage:on:",
  437. protocol: "output",
  438. fn: function (aPackage,aStream){
  439. var self=this,$self=this;
  440. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  441. return $core.withContext(function($ctx1) {
  442. //>>excludeEnd("ctx");
  443. var $1,$receiver;
  444. $self._exportPackageDefinitionOf_on_(aPackage,aStream);
  445. $self._exportPackageImportsOf_on_(aPackage,aStream);
  446. $recv($recv(aPackage)._sortedClasses())._do_((function(each){
  447. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  448. return $core.withContext(function($ctx2) {
  449. //>>excludeEnd("ctx");
  450. $self._exportBehavior_on_(each,aStream);
  451. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  452. $ctx2.sendIdx["exportBehavior:on:"]=1;
  453. //>>excludeEnd("ctx");
  454. $1=$recv(each)._theMetaClass();
  455. if(($receiver = $1) == null || $receiver.a$nil){
  456. return $1;
  457. } else {
  458. var meta;
  459. meta=$receiver;
  460. return $self._exportBehavior_on_(meta,aStream);
  461. }
  462. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  463. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  464. //>>excludeEnd("ctx");
  465. }));
  466. $self._exportPackageTraitCompositionsOf_on_(aPackage,aStream);
  467. $self._exportProtocols_on_($self._extensionProtocolsOfPackage_(aPackage),aStream);
  468. return self;
  469. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  470. }, function($ctx1) {$ctx1.fill(self,"exportPackage:on:",{aPackage:aPackage,aStream:aStream},$globals.ChunkExporter)});
  471. //>>excludeEnd("ctx");
  472. },
  473. //>>excludeStart("ide", pragmas.excludeIdeData);
  474. args: ["aPackage", "aStream"],
  475. source: "exportPackage: aPackage on: aStream\x0a\x0a\x09self\x0a\x09\x09exportPackageDefinitionOf: aPackage on: aStream;\x0a\x09\x09exportPackageImportsOf: aPackage on: aStream.\x0a\x09\x0a\x09aPackage sortedClasses do: [ :each |\x0a\x09\x09self exportBehavior: each on: aStream.\x0a\x09\x09each theMetaClass ifNotNil: [ :meta | self exportBehavior: meta on: aStream ] ].\x0a\x09\x0a\x09self exportPackageTraitCompositionsOf: aPackage on: aStream.\x0a\x0a\x09self \x0a\x09\x09exportProtocols: (self extensionProtocolsOfPackage: aPackage)\x0a\x09\x09on: aStream",
  476. referencedClasses: [],
  477. //>>excludeEnd("ide");
  478. messageSends: ["exportPackageDefinitionOf:on:", "exportPackageImportsOf:on:", "do:", "sortedClasses", "exportBehavior:on:", "ifNotNil:", "theMetaClass", "exportPackageTraitCompositionsOf:on:", "exportProtocols:on:", "extensionProtocolsOfPackage:"]
  479. }),
  480. $globals.ChunkExporter);
  481. $core.addMethod(
  482. $core.method({
  483. selector: "exportPackageDefinitionOf:on:",
  484. protocol: "output",
  485. fn: function (aPackage,aStream){
  486. var self=this,$self=this;
  487. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  488. return $core.withContext(function($ctx1) {
  489. //>>excludeEnd("ctx");
  490. $recv(aStream)._write_("Smalltalk createPackage: ");
  491. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  492. $ctx1.sendIdx["write:"]=1;
  493. //>>excludeEnd("ctx");
  494. $recv(aStream)._print_($recv(aPackage)._name());
  495. $recv(aStream)._write_("!");
  496. $recv(aStream)._lf();
  497. return self;
  498. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  499. }, function($ctx1) {$ctx1.fill(self,"exportPackageDefinitionOf:on:",{aPackage:aPackage,aStream:aStream},$globals.ChunkExporter)});
  500. //>>excludeEnd("ctx");
  501. },
  502. //>>excludeStart("ide", pragmas.excludeIdeData);
  503. args: ["aPackage", "aStream"],
  504. source: "exportPackageDefinitionOf: aPackage on: aStream\x0a\x09aStream\x0a\x09\x09write: 'Smalltalk createPackage: ';\x0a\x09\x09print: aPackage name;\x0a\x09\x09write: '!';\x0a\x09\x09lf",
  505. referencedClasses: [],
  506. //>>excludeEnd("ide");
  507. messageSends: ["write:", "print:", "name", "lf"]
  508. }),
  509. $globals.ChunkExporter);
  510. $core.addMethod(
  511. $core.method({
  512. selector: "exportPackageImportsOf:on:",
  513. protocol: "output",
  514. fn: function (aPackage,aStream){
  515. var self=this,$self=this;
  516. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  517. return $core.withContext(function($ctx1) {
  518. //>>excludeEnd("ctx");
  519. $recv($recv(aPackage)._imports())._ifNotEmpty_((function(imports){
  520. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  521. return $core.withContext(function($ctx2) {
  522. //>>excludeEnd("ctx");
  523. $recv(aStream)._write_("(Smalltalk packageAt: ");
  524. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  525. $ctx2.sendIdx["write:"]=1;
  526. //>>excludeEnd("ctx");
  527. $recv(aStream)._print_($recv(aPackage)._name());
  528. $recv(aStream)._write_([") imports: ",$self._chunkEscape_($recv(aPackage)._importsDefinition()),"!"]);
  529. return $recv(aStream)._lf();
  530. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  531. }, function($ctx2) {$ctx2.fillBlock({imports:imports},$ctx1,1)});
  532. //>>excludeEnd("ctx");
  533. }));
  534. return self;
  535. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  536. }, function($ctx1) {$ctx1.fill(self,"exportPackageImportsOf:on:",{aPackage:aPackage,aStream:aStream},$globals.ChunkExporter)});
  537. //>>excludeEnd("ctx");
  538. },
  539. //>>excludeStart("ide", pragmas.excludeIdeData);
  540. args: ["aPackage", "aStream"],
  541. source: "exportPackageImportsOf: aPackage on: aStream\x0a\x09aPackage imports ifNotEmpty: [ :imports | aStream\x0a\x09\x09write: '(Smalltalk packageAt: ';\x0a\x09\x09print: aPackage name;\x0a\x09\x09write: { ') imports: '. self chunkEscape: aPackage importsDefinition. '!' };\x0a\x09\x09lf ]",
  542. referencedClasses: [],
  543. //>>excludeEnd("ide");
  544. messageSends: ["ifNotEmpty:", "imports", "write:", "print:", "name", "chunkEscape:", "importsDefinition", "lf"]
  545. }),
  546. $globals.ChunkExporter);
  547. $core.addMethod(
  548. $core.method({
  549. selector: "exportPackageTraitCompositionsOf:on:",
  550. protocol: "output",
  551. fn: function (aPackage,aStream){
  552. var self=this,$self=this;
  553. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  554. return $core.withContext(function($ctx1) {
  555. //>>excludeEnd("ctx");
  556. $recv($recv(aPackage)._traitCompositions())._ifNotEmpty_((function(traitCompositions){
  557. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  558. return $core.withContext(function($ctx2) {
  559. //>>excludeEnd("ctx");
  560. $recv(traitCompositions)._keysAndValuesDo_((function(key,value){
  561. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  562. return $core.withContext(function($ctx3) {
  563. //>>excludeEnd("ctx");
  564. return $self._exportTraitComposition_of_on_(value,key,aStream);
  565. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  566. }, function($ctx3) {$ctx3.fillBlock({key:key,value:value},$ctx2,2)});
  567. //>>excludeEnd("ctx");
  568. }));
  569. $recv(aStream)._write_("! !");
  570. $recv(aStream)._lf();
  571. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  572. $ctx2.sendIdx["lf"]=1;
  573. //>>excludeEnd("ctx");
  574. return $recv(aStream)._lf();
  575. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  576. }, function($ctx2) {$ctx2.fillBlock({traitCompositions:traitCompositions},$ctx1,1)});
  577. //>>excludeEnd("ctx");
  578. }));
  579. return self;
  580. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  581. }, function($ctx1) {$ctx1.fill(self,"exportPackageTraitCompositionsOf:on:",{aPackage:aPackage,aStream:aStream},$globals.ChunkExporter)});
  582. //>>excludeEnd("ctx");
  583. },
  584. //>>excludeStart("ide", pragmas.excludeIdeData);
  585. args: ["aPackage", "aStream"],
  586. source: "exportPackageTraitCompositionsOf: aPackage on: aStream\x0a\x09aPackage traitCompositions ifNotEmpty: [ :traitCompositions |\x0a\x09\x09traitCompositions keysAndValuesDo: [ :key :value | self exportTraitComposition: value of: key on: aStream ].\x0a\x09\x09aStream write: '! !'; lf; lf ]",
  587. referencedClasses: [],
  588. //>>excludeEnd("ide");
  589. messageSends: ["ifNotEmpty:", "traitCompositions", "keysAndValuesDo:", "exportTraitComposition:of:on:", "write:", "lf"]
  590. }),
  591. $globals.ChunkExporter);
  592. $core.addMethod(
  593. $core.method({
  594. selector: "exportProtocol:on:",
  595. protocol: "output",
  596. fn: function (aProtocol,aStream){
  597. var self=this,$self=this;
  598. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  599. return $core.withContext(function($ctx1) {
  600. //>>excludeEnd("ctx");
  601. $recv($recv(aProtocol)._ownMethods())._ifNotEmpty_((function(methods){
  602. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  603. return $core.withContext(function($ctx2) {
  604. //>>excludeEnd("ctx");
  605. $self._exportProtocolPrologueOf_on_(aProtocol,aStream);
  606. $recv(methods)._do_((function(method){
  607. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  608. return $core.withContext(function($ctx3) {
  609. //>>excludeEnd("ctx");
  610. return $self._exportMethod_on_(method,aStream);
  611. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  612. }, function($ctx3) {$ctx3.fillBlock({method:method},$ctx2,2)});
  613. //>>excludeEnd("ctx");
  614. }));
  615. return $self._exportProtocolEpilogueOf_on_(aProtocol,aStream);
  616. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  617. }, function($ctx2) {$ctx2.fillBlock({methods:methods},$ctx1,1)});
  618. //>>excludeEnd("ctx");
  619. }));
  620. return self;
  621. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  622. }, function($ctx1) {$ctx1.fill(self,"exportProtocol:on:",{aProtocol:aProtocol,aStream:aStream},$globals.ChunkExporter)});
  623. //>>excludeEnd("ctx");
  624. },
  625. //>>excludeStart("ide", pragmas.excludeIdeData);
  626. args: ["aProtocol", "aStream"],
  627. source: "exportProtocol: aProtocol on: aStream\x0a\x09aProtocol ownMethods ifNotEmpty: [ :methods |\x0a\x09\x09self exportProtocolPrologueOf: aProtocol on: aStream.\x0a\x09\x09methods do: [ :method | \x0a\x09\x09\x09self exportMethod: method on: aStream ].\x0a\x09\x09self exportProtocolEpilogueOf: aProtocol on: aStream ]",
  628. referencedClasses: [],
  629. //>>excludeEnd("ide");
  630. messageSends: ["ifNotEmpty:", "ownMethods", "exportProtocolPrologueOf:on:", "do:", "exportMethod:on:", "exportProtocolEpilogueOf:on:"]
  631. }),
  632. $globals.ChunkExporter);
  633. $core.addMethod(
  634. $core.method({
  635. selector: "exportProtocolEpilogueOf:on:",
  636. protocol: "output",
  637. fn: function (aProtocol,aStream){
  638. var self=this,$self=this;
  639. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  640. return $core.withContext(function($ctx1) {
  641. //>>excludeEnd("ctx");
  642. $recv(aStream)._write_(" !");
  643. $recv(aStream)._lf();
  644. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  645. $ctx1.sendIdx["lf"]=1;
  646. //>>excludeEnd("ctx");
  647. $recv(aStream)._lf();
  648. return self;
  649. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  650. }, function($ctx1) {$ctx1.fill(self,"exportProtocolEpilogueOf:on:",{aProtocol:aProtocol,aStream:aStream},$globals.ChunkExporter)});
  651. //>>excludeEnd("ctx");
  652. },
  653. //>>excludeStart("ide", pragmas.excludeIdeData);
  654. args: ["aProtocol", "aStream"],
  655. source: "exportProtocolEpilogueOf: aProtocol on: aStream\x0a\x09aStream write: ' !'; lf; lf",
  656. referencedClasses: [],
  657. //>>excludeEnd("ide");
  658. messageSends: ["write:", "lf"]
  659. }),
  660. $globals.ChunkExporter);
  661. $core.addMethod(
  662. $core.method({
  663. selector: "exportProtocolPrologueOf:on:",
  664. protocol: "output",
  665. fn: function (aProtocol,aStream){
  666. var self=this,$self=this;
  667. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  668. return $core.withContext(function($ctx1) {
  669. //>>excludeEnd("ctx");
  670. $recv(aStream)._write_("!");
  671. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  672. $ctx1.sendIdx["write:"]=1;
  673. //>>excludeEnd("ctx");
  674. $recv(aStream)._print_($recv(aProtocol)._theClass());
  675. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  676. $ctx1.sendIdx["print:"]=1;
  677. //>>excludeEnd("ctx");
  678. $recv(aStream)._write_(" methodsFor: ");
  679. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  680. $ctx1.sendIdx["write:"]=2;
  681. //>>excludeEnd("ctx");
  682. $recv(aStream)._print_($recv(aProtocol)._name());
  683. $recv(aStream)._write_("!");
  684. return self;
  685. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  686. }, function($ctx1) {$ctx1.fill(self,"exportProtocolPrologueOf:on:",{aProtocol:aProtocol,aStream:aStream},$globals.ChunkExporter)});
  687. //>>excludeEnd("ctx");
  688. },
  689. //>>excludeStart("ide", pragmas.excludeIdeData);
  690. args: ["aProtocol", "aStream"],
  691. source: "exportProtocolPrologueOf: aProtocol on: aStream\x0a\x09aStream\x0a\x09\x09write: '!';\x0a\x09\x09print: aProtocol theClass;\x0a\x09\x09write: ' methodsFor: ';\x0a\x09\x09print: aProtocol name;\x0a\x09\x09write: '!'",
  692. referencedClasses: [],
  693. //>>excludeEnd("ide");
  694. messageSends: ["write:", "print:", "theClass", "name"]
  695. }),
  696. $globals.ChunkExporter);
  697. $core.addMethod(
  698. $core.method({
  699. selector: "exportProtocols:on:",
  700. protocol: "output",
  701. fn: function (aCollection,aStream){
  702. var self=this,$self=this;
  703. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  704. return $core.withContext(function($ctx1) {
  705. //>>excludeEnd("ctx");
  706. $recv(aCollection)._do_((function(each){
  707. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  708. return $core.withContext(function($ctx2) {
  709. //>>excludeEnd("ctx");
  710. return $self._exportProtocol_on_(each,aStream);
  711. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  712. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  713. //>>excludeEnd("ctx");
  714. }));
  715. return self;
  716. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  717. }, function($ctx1) {$ctx1.fill(self,"exportProtocols:on:",{aCollection:aCollection,aStream:aStream},$globals.ChunkExporter)});
  718. //>>excludeEnd("ctx");
  719. },
  720. //>>excludeStart("ide", pragmas.excludeIdeData);
  721. args: ["aCollection", "aStream"],
  722. source: "exportProtocols: aCollection on: aStream\x0a\x09aCollection do: [ :each |\x0a\x09\x09self exportProtocol: each on: aStream ]",
  723. referencedClasses: [],
  724. //>>excludeEnd("ide");
  725. messageSends: ["do:", "exportProtocol:on:"]
  726. }),
  727. $globals.ChunkExporter);
  728. $core.addMethod(
  729. $core.method({
  730. selector: "exportTraitComposition:of:on:",
  731. protocol: "output",
  732. fn: function (aTraitComposition,aBehavior,aStream){
  733. var self=this,$self=this;
  734. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  735. return $core.withContext(function($ctx1) {
  736. //>>excludeEnd("ctx");
  737. $recv(aStream)._print_(aBehavior);
  738. $recv(aStream)._write_(" setTraitComposition: ");
  739. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  740. $ctx1.sendIdx["write:"]=1;
  741. //>>excludeEnd("ctx");
  742. $recv(aStream)._write_($recv(aBehavior)._traitCompositionDefinition());
  743. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  744. $ctx1.sendIdx["write:"]=2;
  745. //>>excludeEnd("ctx");
  746. $recv(aStream)._write_(" asTraitComposition!");
  747. $recv(aStream)._lf();
  748. return self;
  749. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  750. }, function($ctx1) {$ctx1.fill(self,"exportTraitComposition:of:on:",{aTraitComposition:aTraitComposition,aBehavior:aBehavior,aStream:aStream},$globals.ChunkExporter)});
  751. //>>excludeEnd("ctx");
  752. },
  753. //>>excludeStart("ide", pragmas.excludeIdeData);
  754. args: ["aTraitComposition", "aBehavior", "aStream"],
  755. source: "exportTraitComposition: aTraitComposition of: aBehavior on: aStream\x0a\x09aStream \x0a\x09\x09print: aBehavior;\x0a\x09\x09write: ' setTraitComposition: ';\x0a\x09\x09write: aBehavior traitCompositionDefinition;\x0a\x09\x09write: ' asTraitComposition!';\x0a\x09\x09lf",
  756. referencedClasses: [],
  757. //>>excludeEnd("ide");
  758. messageSends: ["print:", "write:", "traitCompositionDefinition", "lf"]
  759. }),
  760. $globals.ChunkExporter);
  761. $core.addMethod(
  762. $core.method({
  763. selector: "exportTraitDefinitionOf:on:",
  764. protocol: "output",
  765. fn: function (aClass,aStream){
  766. var self=this,$self=this;
  767. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  768. return $core.withContext(function($ctx1) {
  769. //>>excludeEnd("ctx");
  770. var $1,$2,$3,$4;
  771. $recv(aStream)._write_("Trait named: ");
  772. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  773. $ctx1.sendIdx["write:"]=1;
  774. //>>excludeEnd("ctx");
  775. $recv(aStream)._printSymbol_($recv(aClass)._name());
  776. $1=$recv(aStream)._lf();
  777. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  778. $ctx1.sendIdx["lf"]=1;
  779. //>>excludeEnd("ctx");
  780. $recv(aStream)._tab();
  781. $recv(aStream)._write_("package: ");
  782. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  783. $ctx1.sendIdx["write:"]=2;
  784. //>>excludeEnd("ctx");
  785. $recv(aStream)._print_($recv(aClass)._category());
  786. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  787. $ctx1.sendIdx["print:"]=1;
  788. //>>excludeEnd("ctx");
  789. $recv(aStream)._write_("!");
  790. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  791. $ctx1.sendIdx["write:"]=3;
  792. //>>excludeEnd("ctx");
  793. $2=$recv(aStream)._lf();
  794. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  795. $ctx1.sendIdx["lf"]=2;
  796. //>>excludeEnd("ctx");
  797. $3=$recv(aClass)._comment();
  798. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  799. $ctx1.sendIdx["comment"]=1;
  800. //>>excludeEnd("ctx");
  801. $recv($3)._ifNotEmpty_((function(){
  802. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  803. return $core.withContext(function($ctx2) {
  804. //>>excludeEnd("ctx");
  805. $recv(aStream)._write_("!");
  806. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  807. $ctx2.sendIdx["write:"]=4;
  808. //>>excludeEnd("ctx");
  809. $recv(aStream)._print_(aClass);
  810. $recv(aStream)._write_(" commentStamp!");
  811. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  812. $ctx2.sendIdx["write:"]=5;
  813. //>>excludeEnd("ctx");
  814. $recv(aStream)._lf();
  815. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  816. $ctx2.sendIdx["lf"]=3;
  817. //>>excludeEnd("ctx");
  818. $recv(aStream)._write_([$self._chunkEscape_($recv(aClass)._comment()),"!"]);
  819. $4=$recv(aStream)._lf();
  820. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  821. $ctx2.sendIdx["lf"]=4;
  822. //>>excludeEnd("ctx");
  823. return $4;
  824. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  825. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  826. //>>excludeEnd("ctx");
  827. }));
  828. $recv(aStream)._lf();
  829. return self;
  830. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  831. }, function($ctx1) {$ctx1.fill(self,"exportTraitDefinitionOf:on:",{aClass:aClass,aStream:aStream},$globals.ChunkExporter)});
  832. //>>excludeEnd("ctx");
  833. },
  834. //>>excludeStart("ide", pragmas.excludeIdeData);
  835. args: ["aClass", "aStream"],
  836. source: "exportTraitDefinitionOf: aClass on: aStream\x0a\x09\x22Chunk format.\x22\x0a\x0a\x09aStream\x0a\x09\x09write: 'Trait named: '; printSymbol: aClass name; lf.\x0a\x09\x22aClass traitComposition\x0a\x09\x09ifNotEmpty: [ aStream tab; write: {'uses: '. aClass traitCompositionDefinition}; lf ].\x22\x0a\x09aStream\x0a\x09\x09tab; write: 'package: '; print:\x09aClass category; write: '!'; lf.\x0a\x09aClass comment ifNotEmpty: [\x0a\x09\x09aStream\x0a\x09\x09write: '!'; print: aClass; write: ' commentStamp!'; lf;\x0a\x09\x09write: { self chunkEscape: aClass comment. '!' }; lf ].\x0a\x09aStream lf",
  837. referencedClasses: [],
  838. //>>excludeEnd("ide");
  839. messageSends: ["write:", "printSymbol:", "name", "lf", "tab", "print:", "category", "ifNotEmpty:", "comment", "chunkEscape:"]
  840. }),
  841. $globals.ChunkExporter);
  842. $core.addMethod(
  843. $core.method({
  844. selector: "extensionCategoriesOfPackage:",
  845. protocol: "accessing",
  846. fn: function (aPackage){
  847. var self=this,$self=this;
  848. var name,map,result;
  849. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  850. return $core.withContext(function($ctx1) {
  851. //>>excludeEnd("ctx");
  852. var $1;
  853. name=$recv(aPackage)._name();
  854. result=$recv($globals.OrderedCollection)._new();
  855. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  856. $ctx1.sendIdx["new"]=1;
  857. //>>excludeEnd("ctx");
  858. $recv($recv($globals.Package)._sortedClasses_($recv($globals.Smalltalk)._classes()))._do_((function(each){
  859. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  860. return $core.withContext(function($ctx2) {
  861. //>>excludeEnd("ctx");
  862. return $recv([each,$recv(each)._theMetaClass()])._do_((function(aClass){
  863. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  864. return $core.withContext(function($ctx3) {
  865. //>>excludeEnd("ctx");
  866. map=$recv($globals.Dictionary)._new();
  867. map;
  868. $recv(aClass)._protocolsDo_((function(category,methods){
  869. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  870. return $core.withContext(function($ctx4) {
  871. //>>excludeEnd("ctx");
  872. $1=$recv(category).__eq("*".__comma(name));
  873. if($core.assert($1)){
  874. return $recv(map)._at_put_(category,methods);
  875. }
  876. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  877. }, function($ctx4) {$ctx4.fillBlock({category:category,methods:methods},$ctx3,3)});
  878. //>>excludeEnd("ctx");
  879. }));
  880. return $recv(result)._addAll_($recv($recv($recv(map)._keys())._sorted_((function(a,b){
  881. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  882. return $core.withContext(function($ctx4) {
  883. //>>excludeEnd("ctx");
  884. return $recv(a).__lt_eq(b);
  885. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  886. }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx3,5)});
  887. //>>excludeEnd("ctx");
  888. })))._collect_((function(category){
  889. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  890. return $core.withContext(function($ctx4) {
  891. //>>excludeEnd("ctx");
  892. return $recv($globals.MethodCategory)._name_theClass_methods_(category,aClass,$recv(map)._at_(category));
  893. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  894. }, function($ctx4) {$ctx4.fillBlock({category:category},$ctx3,6)});
  895. //>>excludeEnd("ctx");
  896. })));
  897. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  898. }, function($ctx3) {$ctx3.fillBlock({aClass:aClass},$ctx2,2)});
  899. //>>excludeEnd("ctx");
  900. }));
  901. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  902. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  903. //>>excludeEnd("ctx");
  904. }));
  905. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  906. $ctx1.sendIdx["do:"]=1;
  907. //>>excludeEnd("ctx");
  908. return result;
  909. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  910. }, function($ctx1) {$ctx1.fill(self,"extensionCategoriesOfPackage:",{aPackage:aPackage,name:name,map:map,result:result},$globals.ChunkExporter)});
  911. //>>excludeEnd("ctx");
  912. },
  913. //>>excludeStart("ide", pragmas.excludeIdeData);
  914. args: ["aPackage"],
  915. source: "extensionCategoriesOfPackage: aPackage\x0a\x09\x22Issue #143: sort protocol alphabetically\x22\x0a\x0a\x09| name map result |\x0a\x09name := aPackage name.\x0a\x09result := OrderedCollection new.\x0a\x09(Package sortedClasses: Smalltalk classes) do: [ :each |\x0a\x09\x09{each. each theMetaClass} do: [ :aClass |\x0a\x09\x09\x09map := Dictionary new.\x0a\x09\x09\x09aClass protocolsDo: [ :category :methods |\x0a\x09\x09\x09\x09category = ('*', name) ifTrue: [ map at: category put: methods ] ].\x0a\x09\x09\x09result addAll: ((map keys sorted: [ :a :b | a <= b ]) collect: [ :category |\x0a\x09\x09\x09\x09MethodCategory name: category theClass: aClass methods: (map at: category) ]) ] ].\x0a\x09^ result",
  916. referencedClasses: ["OrderedCollection", "Package", "Smalltalk", "Dictionary", "MethodCategory"],
  917. //>>excludeEnd("ide");
  918. messageSends: ["name", "new", "do:", "sortedClasses:", "classes", "theMetaClass", "protocolsDo:", "ifTrue:", "=", ",", "at:put:", "addAll:", "collect:", "sorted:", "keys", "<=", "name:theClass:methods:", "at:"]
  919. }),
  920. $globals.ChunkExporter);
  921. $core.addMethod(
  922. $core.method({
  923. selector: "ownCategoriesOfClass:",
  924. protocol: "accessing",
  925. fn: function (aClass){
  926. var self=this,$self=this;
  927. var map;
  928. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  929. return $core.withContext(function($ctx1) {
  930. //>>excludeEnd("ctx");
  931. var $1;
  932. map=$recv($globals.Dictionary)._new();
  933. $recv(aClass)._protocolsDo_((function(each,methods){
  934. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  935. return $core.withContext(function($ctx2) {
  936. //>>excludeEnd("ctx");
  937. $1=$recv(each)._match_("^\x5c*");
  938. if(!$core.assert($1)){
  939. return $recv(map)._at_put_(each,methods);
  940. }
  941. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  942. }, function($ctx2) {$ctx2.fillBlock({each:each,methods:methods},$ctx1,1)});
  943. //>>excludeEnd("ctx");
  944. }));
  945. return $recv($recv($recv(map)._keys())._sorted_((function(a,b){
  946. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  947. return $core.withContext(function($ctx2) {
  948. //>>excludeEnd("ctx");
  949. return $recv(a).__lt_eq(b);
  950. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  951. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,3)});
  952. //>>excludeEnd("ctx");
  953. })))._collect_((function(each){
  954. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  955. return $core.withContext(function($ctx2) {
  956. //>>excludeEnd("ctx");
  957. return $recv($globals.MethodCategory)._name_theClass_methods_(each,aClass,$recv(map)._at_(each));
  958. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  959. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)});
  960. //>>excludeEnd("ctx");
  961. }));
  962. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  963. }, function($ctx1) {$ctx1.fill(self,"ownCategoriesOfClass:",{aClass:aClass,map:map},$globals.ChunkExporter)});
  964. //>>excludeEnd("ctx");
  965. },
  966. //>>excludeStart("ide", pragmas.excludeIdeData);
  967. args: ["aClass"],
  968. source: "ownCategoriesOfClass: aClass\x0a\x09\x22Answer the protocols of aClass that are not package extensions\x22\x0a\x09\x0a\x09\x22Issue #143: sort protocol alphabetically\x22\x0a\x0a\x09| map |\x0a\x09map := Dictionary new.\x0a\x09aClass protocolsDo: [ :each :methods |\x0a\x09\x09(each match: '^\x5c*') ifFalse: [ map at: each put: methods ] ].\x0a\x09^ (map keys sorted: [ :a :b | a <= b ]) collect: [ :each |\x0a\x09\x09MethodCategory name: each theClass: aClass methods: (map at: each) ]",
  969. referencedClasses: ["Dictionary", "MethodCategory"],
  970. //>>excludeEnd("ide");
  971. messageSends: ["new", "protocolsDo:", "ifFalse:", "match:", "at:put:", "collect:", "sorted:", "keys", "<=", "name:theClass:methods:", "at:"]
  972. }),
  973. $globals.ChunkExporter);
  974. $core.addMethod(
  975. $core.method({
  976. selector: "ownCategoriesOfMetaClass:",
  977. protocol: "accessing",
  978. fn: function (aClass){
  979. var self=this,$self=this;
  980. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  981. return $core.withContext(function($ctx1) {
  982. //>>excludeEnd("ctx");
  983. return $self._ownCategoriesOfClass_($recv(aClass)._theMetaClass());
  984. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  985. }, function($ctx1) {$ctx1.fill(self,"ownCategoriesOfMetaClass:",{aClass:aClass},$globals.ChunkExporter)});
  986. //>>excludeEnd("ctx");
  987. },
  988. //>>excludeStart("ide", pragmas.excludeIdeData);
  989. args: ["aClass"],
  990. source: "ownCategoriesOfMetaClass: aClass\x0a\x09\x22Issue #143: sort protocol alphabetically\x22\x0a\x0a\x09^ self ownCategoriesOfClass: aClass theMetaClass",
  991. referencedClasses: [],
  992. //>>excludeEnd("ide");
  993. messageSends: ["ownCategoriesOfClass:", "theMetaClass"]
  994. }),
  995. $globals.ChunkExporter);
  996. $core.addMethod(
  997. $core.method({
  998. selector: "ownMethodProtocolsOfClass:",
  999. protocol: "accessing",
  1000. fn: function (aClass){
  1001. var self=this,$self=this;
  1002. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1003. return $core.withContext(function($ctx1) {
  1004. //>>excludeEnd("ctx");
  1005. return $recv($recv(aClass)._ownProtocols())._collect_((function(each){
  1006. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1007. return $core.withContext(function($ctx2) {
  1008. //>>excludeEnd("ctx");
  1009. return $recv($globals.ExportMethodProtocol)._name_theClass_(each,aClass);
  1010. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1011. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  1012. //>>excludeEnd("ctx");
  1013. }));
  1014. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1015. }, function($ctx1) {$ctx1.fill(self,"ownMethodProtocolsOfClass:",{aClass:aClass},$globals.ChunkExporter)});
  1016. //>>excludeEnd("ctx");
  1017. },
  1018. //>>excludeStart("ide", pragmas.excludeIdeData);
  1019. args: ["aClass"],
  1020. source: "ownMethodProtocolsOfClass: aClass\x0a\x09\x22Answer a collection of ExportMethodProtocol object of aClass that are not package extensions\x22\x0a\x09\x0a\x09^ aClass ownProtocols collect: [ :each |\x0a\x09\x09ExportMethodProtocol name: each theClass: aClass ]",
  1021. referencedClasses: ["ExportMethodProtocol"],
  1022. //>>excludeEnd("ide");
  1023. messageSends: ["collect:", "ownProtocols", "name:theClass:"]
  1024. }),
  1025. $globals.ChunkExporter);
  1026. $core.addClass("Exporter", $globals.AbstractExporter, [], "Platform-ImportExport");
  1027. //>>excludeStart("ide", pragmas.excludeIdeData);
  1028. $globals.Exporter.comment="I am responsible for outputting Amber code into a JavaScript string.\x0a\x0aThe generated output is enough to reconstruct the exported data, including Smalltalk source code and other metadata.\x0a\x0a## Use case\x0a\x0aI am typically used to save code outside of the Amber runtime (committing to disk, etc.).";
  1029. //>>excludeEnd("ide");
  1030. $core.addMethod(
  1031. $core.method({
  1032. selector: "exportBehavior:on:",
  1033. protocol: "output",
  1034. fn: function (aBehavior,aStream){
  1035. var self=this,$self=this;
  1036. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1037. return $core.withContext(function($ctx1) {
  1038. //>>excludeEnd("ctx");
  1039. $recv(aBehavior)._exportBehaviorDefinitionTo_using_(aStream,self);
  1040. $recv($recv(aBehavior)._ownMethods())._do_((function(method){
  1041. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1042. return $core.withContext(function($ctx2) {
  1043. //>>excludeEnd("ctx");
  1044. return $self._exportMethod_on_(method,aStream);
  1045. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1046. }, function($ctx2) {$ctx2.fillBlock({method:method},$ctx1,1)});
  1047. //>>excludeEnd("ctx");
  1048. }));
  1049. return self;
  1050. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1051. }, function($ctx1) {$ctx1.fill(self,"exportBehavior:on:",{aBehavior:aBehavior,aStream:aStream},$globals.Exporter)});
  1052. //>>excludeEnd("ctx");
  1053. },
  1054. //>>excludeStart("ide", pragmas.excludeIdeData);
  1055. args: ["aBehavior", "aStream"],
  1056. source: "exportBehavior: aBehavior on: aStream\x0a\x09aBehavior exportBehaviorDefinitionTo: aStream using: self.\x0a\x09aBehavior ownMethods do: [ :method |\x0a\x09\x09self exportMethod: method on: aStream ]",
  1057. referencedClasses: [],
  1058. //>>excludeEnd("ide");
  1059. messageSends: ["exportBehaviorDefinitionTo:using:", "do:", "ownMethods", "exportMethod:on:"]
  1060. }),
  1061. $globals.Exporter);
  1062. $core.addMethod(
  1063. $core.method({
  1064. selector: "exportDefinitionOf:on:",
  1065. protocol: "output",
  1066. fn: function (aClass,aStream){
  1067. var self=this,$self=this;
  1068. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1069. return $core.withContext(function($ctx1) {
  1070. //>>excludeEnd("ctx");
  1071. var $3,$5,$4,$6,$7,$2,$1,$8,$10,$9,$receiver;
  1072. $recv(aStream)._lf();
  1073. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1074. $ctx1.sendIdx["lf"]=1;
  1075. //>>excludeEnd("ctx");
  1076. $3=$recv($recv(aClass)._name())._asJavaScriptSource();
  1077. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1078. $ctx1.sendIdx["asJavaScriptSource"]=1;
  1079. //>>excludeEnd("ctx");
  1080. $5=$recv(aClass)._superclass();
  1081. if(($receiver = $5) == null || $receiver.a$nil){
  1082. $4="null";
  1083. } else {
  1084. var superclass;
  1085. superclass=$receiver;
  1086. $4=$recv(superclass)._asJavaScriptSource();
  1087. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1088. $ctx1.sendIdx["asJavaScriptSource"]=2;
  1089. //>>excludeEnd("ctx");
  1090. }
  1091. $6=$recv($recv(aClass)._instanceVariableNames())._asJavaScriptSource();
  1092. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1093. $ctx1.sendIdx["asJavaScriptSource"]=3;
  1094. //>>excludeEnd("ctx");
  1095. $7=$recv($recv(aClass)._category())._asJavaScriptSource();
  1096. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1097. $ctx1.sendIdx["asJavaScriptSource"]=4;
  1098. //>>excludeEnd("ctx");
  1099. $2=["$core.addClass(",$3,", ",$4,", ",$6,", ",$7,");"];
  1100. $1=$recv(aStream)._write_($2);
  1101. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1102. $ctx1.sendIdx["write:"]=1;
  1103. //>>excludeEnd("ctx");
  1104. $8=$recv(aClass)._comment();
  1105. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1106. $ctx1.sendIdx["comment"]=1;
  1107. //>>excludeEnd("ctx");
  1108. $recv($8)._ifNotEmpty_((function(){
  1109. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1110. return $core.withContext(function($ctx2) {
  1111. //>>excludeEnd("ctx");
  1112. $recv(aStream)._lf();
  1113. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1114. $ctx2.sendIdx["lf"]=2;
  1115. //>>excludeEnd("ctx");
  1116. $recv(aStream)._write_("//>>excludeStart(\x22ide\x22, pragmas.excludeIdeData);");
  1117. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1118. $ctx2.sendIdx["write:"]=2;
  1119. //>>excludeEnd("ctx");
  1120. $recv(aStream)._lf();
  1121. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1122. $ctx2.sendIdx["lf"]=3;
  1123. //>>excludeEnd("ctx");
  1124. $10=$recv(aClass)._asJavaScriptSource();
  1125. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1126. $ctx2.sendIdx["asJavaScriptSource"]=5;
  1127. //>>excludeEnd("ctx");
  1128. $9=[$10,".comment=",$recv($recv($recv(aClass)._comment())._crlfSanitized())._asJavaScriptSource(),";"];
  1129. $recv(aStream)._write_($9);
  1130. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1131. $ctx2.sendIdx["write:"]=3;
  1132. //>>excludeEnd("ctx");
  1133. $recv(aStream)._lf();
  1134. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1135. $ctx2.sendIdx["lf"]=4;
  1136. //>>excludeEnd("ctx");
  1137. return $recv(aStream)._write_("//>>excludeEnd(\x22ide\x22);");
  1138. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1139. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  1140. //>>excludeEnd("ctx");
  1141. }));
  1142. $recv(aStream)._lf();
  1143. return self;
  1144. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1145. }, function($ctx1) {$ctx1.fill(self,"exportDefinitionOf:on:",{aClass:aClass,aStream:aStream},$globals.Exporter)});
  1146. //>>excludeEnd("ctx");
  1147. },
  1148. //>>excludeStart("ide", pragmas.excludeIdeData);
  1149. args: ["aClass", "aStream"],
  1150. source: "exportDefinitionOf: aClass on: aStream\x0a\x09aStream\x0a\x09\x09lf;\x0a\x09\x09write: {\x0a\x09\x09\x09'$core.addClass('.\x0a\x09\x09\x09aClass name asJavaScriptSource. ', '.\x0a\x09\x09\x09aClass superclass ifNil: [ 'null' ] ifNotNil: [ :superclass | superclass asJavaScriptSource ]. ', '.\x0a\x09\x09\x09aClass instanceVariableNames asJavaScriptSource. ', '.\x0a\x09\x09\x09aClass category asJavaScriptSource.\x0a\x09\x09\x09');' }.\x0a\x09aClass comment ifNotEmpty: [\x0a\x09\x09aStream\x0a\x09\x09\x09lf;\x0a\x09\x09\x09write: '//>>excludeStart(\x22ide\x22, pragmas.excludeIdeData);'; lf;\x0a\x09\x09\x09write: { aClass asJavaScriptSource. '.comment='. aClass comment crlfSanitized asJavaScriptSource. ';' }; lf;\x0a\x09\x09\x09write: '//>>excludeEnd(\x22ide\x22);' ].\x0a\x09aStream lf",
  1151. referencedClasses: [],
  1152. //>>excludeEnd("ide");
  1153. messageSends: ["lf", "write:", "asJavaScriptSource", "name", "ifNil:ifNotNil:", "superclass", "instanceVariableNames", "category", "ifNotEmpty:", "comment", "crlfSanitized"]
  1154. }),
  1155. $globals.Exporter);
  1156. $core.addMethod(
  1157. $core.method({
  1158. selector: "exportMetaDefinitionOf:on:",
  1159. protocol: "output",
  1160. fn: function (aClass,aStream){
  1161. var self=this,$self=this;
  1162. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1163. return $core.withContext(function($ctx1) {
  1164. //>>excludeEnd("ctx");
  1165. var $2,$1,$4,$3;
  1166. $recv(aStream)._lf();
  1167. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1168. $ctx1.sendIdx["lf"]=1;
  1169. //>>excludeEnd("ctx");
  1170. $2=$recv(aClass)._theMetaClass();
  1171. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1172. $ctx1.sendIdx["theMetaClass"]=1;
  1173. //>>excludeEnd("ctx");
  1174. $1=$recv($2)._instanceVariableNames();
  1175. $recv($1)._ifNotEmpty_((function(classIvars){
  1176. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1177. return $core.withContext(function($ctx2) {
  1178. //>>excludeEnd("ctx");
  1179. $4=$recv($recv(aClass)._theMetaClass())._asJavaScriptSource();
  1180. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1181. $ctx2.sendIdx["asJavaScriptSource"]=1;
  1182. //>>excludeEnd("ctx");
  1183. $3=[$4,".iVarNames = ",$recv(classIvars)._asJavaScriptSource(),";"];
  1184. $recv(aStream)._write_($3);
  1185. return $recv(aStream)._lf();
  1186. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1187. }, function($ctx2) {$ctx2.fillBlock({classIvars:classIvars},$ctx1,1)});
  1188. //>>excludeEnd("ctx");
  1189. }));
  1190. return self;
  1191. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1192. }, function($ctx1) {$ctx1.fill(self,"exportMetaDefinitionOf:on:",{aClass:aClass,aStream:aStream},$globals.Exporter)});
  1193. //>>excludeEnd("ctx");
  1194. },
  1195. //>>excludeStart("ide", pragmas.excludeIdeData);
  1196. args: ["aClass", "aStream"],
  1197. source: "exportMetaDefinitionOf: aClass on: aStream\x0a\x09aStream lf.\x0a\x09aClass theMetaClass instanceVariableNames ifNotEmpty: [ :classIvars | aStream\x0a\x09\x09write: { aClass theMetaClass asJavaScriptSource. '.iVarNames = '. classIvars asJavaScriptSource. ';' };\x0a\x09\x09lf ]",
  1198. referencedClasses: [],
  1199. //>>excludeEnd("ide");
  1200. messageSends: ["lf", "ifNotEmpty:", "instanceVariableNames", "theMetaClass", "write:", "asJavaScriptSource"]
  1201. }),
  1202. $globals.Exporter);
  1203. $core.addMethod(
  1204. $core.method({
  1205. selector: "exportMethod:on:",
  1206. protocol: "output",
  1207. fn: function (aMethod,aStream){
  1208. var self=this,$self=this;
  1209. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1210. return $core.withContext(function($ctx1) {
  1211. //>>excludeEnd("ctx");
  1212. var $2,$1,$4,$3,$6,$5,$8,$7,$10,$9,$12,$11;
  1213. $recv(aStream)._write_("$core.addMethod(");
  1214. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1215. $ctx1.sendIdx["write:"]=1;
  1216. //>>excludeEnd("ctx");
  1217. $recv(aStream)._lf();
  1218. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1219. $ctx1.sendIdx["lf"]=1;
  1220. //>>excludeEnd("ctx");
  1221. $recv(aStream)._write_("$core.method({");
  1222. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1223. $ctx1.sendIdx["write:"]=2;
  1224. //>>excludeEnd("ctx");
  1225. $recv(aStream)._lf();
  1226. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1227. $ctx1.sendIdx["lf"]=2;
  1228. //>>excludeEnd("ctx");
  1229. $2=$recv($recv(aMethod)._selector())._asJavaScriptSource();
  1230. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1231. $ctx1.sendIdx["asJavaScriptSource"]=1;
  1232. //>>excludeEnd("ctx");
  1233. $1=["selector: ",$2,","];
  1234. $recv(aStream)._write_($1);
  1235. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1236. $ctx1.sendIdx["write:"]=3;
  1237. //>>excludeEnd("ctx");
  1238. $recv(aStream)._lf();
  1239. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1240. $ctx1.sendIdx["lf"]=3;
  1241. //>>excludeEnd("ctx");
  1242. $4=$recv($recv(aMethod)._protocol())._asJavaScriptSource();
  1243. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1244. $ctx1.sendIdx["asJavaScriptSource"]=2;
  1245. //>>excludeEnd("ctx");
  1246. $3=["protocol: ",$4,","];
  1247. $recv(aStream)._write_($3);
  1248. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1249. $ctx1.sendIdx["write:"]=4;
  1250. //>>excludeEnd("ctx");
  1251. $recv(aStream)._lf();
  1252. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1253. $ctx1.sendIdx["lf"]=4;
  1254. //>>excludeEnd("ctx");
  1255. $recv(aStream)._write_(["fn: ",$recv($recv(aMethod)._fn())._compiledSource(),","]);
  1256. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1257. $ctx1.sendIdx["write:"]=5;
  1258. //>>excludeEnd("ctx");
  1259. $recv(aStream)._lf();
  1260. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1261. $ctx1.sendIdx["lf"]=5;
  1262. //>>excludeEnd("ctx");
  1263. $recv(aStream)._write_("//>>excludeStart(\x22ide\x22, pragmas.excludeIdeData);");
  1264. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1265. $ctx1.sendIdx["write:"]=6;
  1266. //>>excludeEnd("ctx");
  1267. $recv(aStream)._lf();
  1268. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1269. $ctx1.sendIdx["lf"]=6;
  1270. //>>excludeEnd("ctx");
  1271. $6=$recv($recv(aMethod)._arguments())._asJavaScriptSource();
  1272. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1273. $ctx1.sendIdx["asJavaScriptSource"]=3;
  1274. //>>excludeEnd("ctx");
  1275. $5=["args: ",$6,","];
  1276. $recv(aStream)._write_($5);
  1277. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1278. $ctx1.sendIdx["write:"]=7;
  1279. //>>excludeEnd("ctx");
  1280. $recv(aStream)._lf();
  1281. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1282. $ctx1.sendIdx["lf"]=7;
  1283. //>>excludeEnd("ctx");
  1284. $8=$recv($recv(aMethod)._source())._asJavaScriptSource();
  1285. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1286. $ctx1.sendIdx["asJavaScriptSource"]=4;
  1287. //>>excludeEnd("ctx");
  1288. $7=["source: ",$8,","];
  1289. $recv(aStream)._write_($7);
  1290. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1291. $ctx1.sendIdx["write:"]=8;
  1292. //>>excludeEnd("ctx");
  1293. $recv(aStream)._lf();
  1294. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1295. $ctx1.sendIdx["lf"]=8;
  1296. //>>excludeEnd("ctx");
  1297. $10=$recv($recv(aMethod)._referencedClasses())._asJavaScriptSource();
  1298. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1299. $ctx1.sendIdx["asJavaScriptSource"]=5;
  1300. //>>excludeEnd("ctx");
  1301. $9=["referencedClasses: ",$10,","];
  1302. $recv(aStream)._write_($9);
  1303. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1304. $ctx1.sendIdx["write:"]=9;
  1305. //>>excludeEnd("ctx");
  1306. $recv(aStream)._lf();
  1307. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1308. $ctx1.sendIdx["lf"]=9;
  1309. //>>excludeEnd("ctx");
  1310. $recv(aStream)._write_("//>>excludeEnd(\x22ide\x22);");
  1311. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1312. $ctx1.sendIdx["write:"]=10;
  1313. //>>excludeEnd("ctx");
  1314. $recv(aStream)._lf();
  1315. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1316. $ctx1.sendIdx["lf"]=10;
  1317. //>>excludeEnd("ctx");
  1318. $12=$recv($recv(aMethod)._messageSends())._asJavaScriptSource();
  1319. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1320. $ctx1.sendIdx["asJavaScriptSource"]=6;
  1321. //>>excludeEnd("ctx");
  1322. $11=["messageSends: ",$12];
  1323. $recv(aStream)._write_($11);
  1324. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1325. $ctx1.sendIdx["write:"]=11;
  1326. //>>excludeEnd("ctx");
  1327. $recv(aStream)._lf();
  1328. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1329. $ctx1.sendIdx["lf"]=11;
  1330. //>>excludeEnd("ctx");
  1331. $recv(aStream)._write_("}),");
  1332. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1333. $ctx1.sendIdx["write:"]=12;
  1334. //>>excludeEnd("ctx");
  1335. $recv(aStream)._lf();
  1336. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1337. $ctx1.sendIdx["lf"]=12;
  1338. //>>excludeEnd("ctx");
  1339. $recv(aStream)._write_([$recv($recv(aMethod)._methodClass())._asJavaScriptSource(),");"]);
  1340. $recv(aStream)._lf();
  1341. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1342. $ctx1.sendIdx["lf"]=13;
  1343. //>>excludeEnd("ctx");
  1344. $recv(aStream)._lf();
  1345. return self;
  1346. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1347. }, function($ctx1) {$ctx1.fill(self,"exportMethod:on:",{aMethod:aMethod,aStream:aStream},$globals.Exporter)});
  1348. //>>excludeEnd("ctx");
  1349. },
  1350. //>>excludeStart("ide", pragmas.excludeIdeData);
  1351. args: ["aMethod", "aStream"],
  1352. source: "exportMethod: aMethod on: aStream\x0a\x09aStream\x0a\x09\x09write: '$core.addMethod('; lf;\x0a\x09\x09write: '$core.method({'; lf;\x0a\x09\x09write: { 'selector: '. aMethod selector asJavaScriptSource. ',' }; lf;\x0a\x09\x09write: { 'protocol: '. aMethod protocol asJavaScriptSource. ',' }; lf;\x0a\x09\x09write: { 'fn: '. aMethod fn compiledSource. ',' }; lf;\x0a\x09\x09write: '//>>excludeStart(\x22ide\x22, pragmas.excludeIdeData);'; lf;\x0a\x09\x09write: { 'args: '. aMethod arguments asJavaScriptSource. ',' }; lf;\x0a\x09\x09write: { 'source: '. aMethod source asJavaScriptSource. ',' }; lf;\x0a\x09\x09write: { 'referencedClasses: '. aMethod referencedClasses asJavaScriptSource. ',' }; lf;\x0a\x09\x09write: '//>>excludeEnd(\x22ide\x22);'; lf;\x0a\x09\x09write: { 'messageSends: '. aMethod messageSends asJavaScriptSource }; lf;\x0a\x09\x09write: '}),'; lf;\x0a\x09\x09write: { aMethod methodClass asJavaScriptSource. ');' }; lf; lf",
  1353. referencedClasses: [],
  1354. //>>excludeEnd("ide");
  1355. messageSends: ["write:", "lf", "asJavaScriptSource", "selector", "protocol", "compiledSource", "fn", "arguments", "source", "referencedClasses", "messageSends", "methodClass"]
  1356. }),
  1357. $globals.Exporter);
  1358. $core.addMethod(
  1359. $core.method({
  1360. selector: "exportPackage:on:",
  1361. protocol: "output",
  1362. fn: function (aPackage,aStream){
  1363. var self=this,$self=this;
  1364. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1365. return $core.withContext(function($ctx1) {
  1366. //>>excludeEnd("ctx");
  1367. var $1,$receiver;
  1368. $self._exportPackagePrologueOf_on_(aPackage,aStream);
  1369. $self._exportPackageDefinitionOf_on_(aPackage,aStream);
  1370. $self._exportPackageContextOf_on_(aPackage,aStream);
  1371. $self._exportPackageImportsOf_on_(aPackage,aStream);
  1372. $self._exportPackageTransportOf_on_(aPackage,aStream);
  1373. $recv($recv(aPackage)._sortedClasses())._do_((function(each){
  1374. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1375. return $core.withContext(function($ctx2) {
  1376. //>>excludeEnd("ctx");
  1377. $self._exportBehavior_on_(each,aStream);
  1378. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1379. $ctx2.sendIdx["exportBehavior:on:"]=1;
  1380. //>>excludeEnd("ctx");
  1381. $1=$recv(each)._theMetaClass();
  1382. if(($receiver = $1) == null || $receiver.a$nil){
  1383. return $1;
  1384. } else {
  1385. var meta;
  1386. meta=$receiver;
  1387. return $self._exportBehavior_on_(meta,aStream);
  1388. }
  1389. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1390. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  1391. //>>excludeEnd("ctx");
  1392. }));
  1393. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1394. $ctx1.sendIdx["do:"]=1;
  1395. //>>excludeEnd("ctx");
  1396. $self._exportPackageTraitCompositionsOf_on_(aPackage,aStream);
  1397. $recv($self._extensionMethodsOfPackage_(aPackage))._do_((function(each){
  1398. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1399. return $core.withContext(function($ctx2) {
  1400. //>>excludeEnd("ctx");
  1401. return $self._exportMethod_on_(each,aStream);
  1402. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1403. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
  1404. //>>excludeEnd("ctx");
  1405. }));
  1406. $self._exportPackageEpilogueOf_on_(aPackage,aStream);
  1407. return self;
  1408. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1409. }, function($ctx1) {$ctx1.fill(self,"exportPackage:on:",{aPackage:aPackage,aStream:aStream},$globals.Exporter)});
  1410. //>>excludeEnd("ctx");
  1411. },
  1412. //>>excludeStart("ide", pragmas.excludeIdeData);
  1413. args: ["aPackage", "aStream"],
  1414. source: "exportPackage: aPackage on: aStream\x0a\x09\x0a\x09self \x0a\x09\x09exportPackagePrologueOf: aPackage on: aStream;\x0a\x09\x09exportPackageDefinitionOf: aPackage on: aStream;\x0a\x09\x09exportPackageContextOf: aPackage on: aStream;\x0a\x09\x09exportPackageImportsOf: aPackage on: aStream;\x0a\x09\x09exportPackageTransportOf: aPackage on: aStream.\x0a\x09\x0a\x09aPackage sortedClasses do: [ :each |\x0a\x09\x09self exportBehavior: each on: aStream.\x0a\x09\x09each theMetaClass ifNotNil: [ :meta | self exportBehavior: meta on: aStream ] ].\x0a\x09\x09\x09\x0a\x09self exportPackageTraitCompositionsOf: aPackage on: aStream.\x0a\x0a\x09(self extensionMethodsOfPackage: aPackage) do: [ :each |\x0a\x09\x09self exportMethod: each on: aStream ].\x0a\x09\x09\x0a\x09self exportPackageEpilogueOf: aPackage on: aStream",
  1415. referencedClasses: [],
  1416. //>>excludeEnd("ide");
  1417. messageSends: ["exportPackagePrologueOf:on:", "exportPackageDefinitionOf:on:", "exportPackageContextOf:on:", "exportPackageImportsOf:on:", "exportPackageTransportOf:on:", "do:", "sortedClasses", "exportBehavior:on:", "ifNotNil:", "theMetaClass", "exportPackageTraitCompositionsOf:on:", "extensionMethodsOfPackage:", "exportMethod:on:", "exportPackageEpilogueOf:on:"]
  1418. }),
  1419. $globals.Exporter);
  1420. $core.addMethod(
  1421. $core.method({
  1422. selector: "exportPackageBodyBlockPrologueOf:on:",
  1423. protocol: "output",
  1424. fn: function (aPackage,aStream){
  1425. var self=this,$self=this;
  1426. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1427. return $core.withContext(function($ctx1) {
  1428. //>>excludeEnd("ctx");
  1429. $recv(aStream)._write_("if(!$boot.nilAsReceiver)$boot.nilAsReceiver=$boot.nil;");
  1430. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1431. $ctx1.sendIdx["write:"]=1;
  1432. //>>excludeEnd("ctx");
  1433. $recv(aStream)._lf();
  1434. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1435. $ctx1.sendIdx["lf"]=1;
  1436. //>>excludeEnd("ctx");
  1437. $recv(aStream)._write_("if(!(\x22nilAsValue\x22 in $boot))$boot.nilAsValue=$boot.nilAsReceiver;");
  1438. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1439. $ctx1.sendIdx["write:"]=2;
  1440. //>>excludeEnd("ctx");
  1441. $recv(aStream)._lf();
  1442. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1443. $ctx1.sendIdx["lf"]=2;
  1444. //>>excludeEnd("ctx");
  1445. $recv(aStream)._write_("var $core=$boot.api,nil=$boot.nilAsValue,$nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;");
  1446. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1447. $ctx1.sendIdx["write:"]=3;
  1448. //>>excludeEnd("ctx");
  1449. $recv(aStream)._lf();
  1450. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1451. $ctx1.sendIdx["lf"]=3;
  1452. //>>excludeEnd("ctx");
  1453. $recv(aStream)._write_("if(!$boot.nilAsClass)$boot.nilAsClass=$boot.dnu;");
  1454. $recv(aStream)._lf();
  1455. return self;
  1456. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1457. }, function($ctx1) {$ctx1.fill(self,"exportPackageBodyBlockPrologueOf:on:",{aPackage:aPackage,aStream:aStream},$globals.Exporter)});
  1458. //>>excludeEnd("ctx");
  1459. },
  1460. //>>excludeStart("ide", pragmas.excludeIdeData);
  1461. args: ["aPackage", "aStream"],
  1462. source: "exportPackageBodyBlockPrologueOf: aPackage on: aStream\x0a\x09aStream\x0a\x09\x09write: 'if(!$boot.nilAsReceiver)$boot.nilAsReceiver=$boot.nil;'; lf;\x0a\x09\x09write: 'if(!(\x22nilAsValue\x22 in $boot))$boot.nilAsValue=$boot.nilAsReceiver;'; lf;\x0a\x09\x09write: 'var $core=$boot.api,nil=$boot.nilAsValue,$nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;'; lf;\x0a\x09\x09write: 'if(!$boot.nilAsClass)$boot.nilAsClass=$boot.dnu;'; lf",
  1463. referencedClasses: [],
  1464. //>>excludeEnd("ide");
  1465. messageSends: ["write:", "lf"]
  1466. }),
  1467. $globals.Exporter);
  1468. $core.addMethod(
  1469. $core.method({
  1470. selector: "exportPackageContextOf:on:",
  1471. protocol: "output",
  1472. fn: function (aPackage,aStream){
  1473. var self=this,$self=this;
  1474. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1475. return $core.withContext(function($ctx1) {
  1476. //>>excludeEnd("ctx");
  1477. $recv(aStream)._write_(["$core.packages[",$recv($recv(aPackage)._name())._asJavaScriptSource(),"].innerEval = ","function (expr) { return eval(expr); }",";"]);
  1478. $recv(aStream)._lf();
  1479. return self;
  1480. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1481. }, function($ctx1) {$ctx1.fill(self,"exportPackageContextOf:on:",{aPackage:aPackage,aStream:aStream},$globals.Exporter)});
  1482. //>>excludeEnd("ctx");
  1483. },
  1484. //>>excludeStart("ide", pragmas.excludeIdeData);
  1485. args: ["aPackage", "aStream"],
  1486. source: "exportPackageContextOf: aPackage on: aStream\x0a\x09aStream\x0a\x09\x09write: {\x0a\x09\x09\x09'$core.packages['.\x0a\x09\x09\x09aPackage name asJavaScriptSource.\x0a\x09\x09\x09'].innerEval = '.\x0a\x09\x09\x09'function (expr) { return eval(expr); }'.\x0a\x09\x09\x09';' };\x0a\x09\x09lf",
  1487. referencedClasses: [],
  1488. //>>excludeEnd("ide");
  1489. messageSends: ["write:", "asJavaScriptSource", "name", "lf"]
  1490. }),
  1491. $globals.Exporter);
  1492. $core.addMethod(
  1493. $core.method({
  1494. selector: "exportPackageDefinitionOf:on:",
  1495. protocol: "output",
  1496. fn: function (aPackage,aStream){
  1497. var self=this,$self=this;
  1498. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1499. return $core.withContext(function($ctx1) {
  1500. //>>excludeEnd("ctx");
  1501. $recv(aStream)._write_(["$core.addPackage(",$recv($recv(aPackage)._name())._asJavaScriptSource(),");"]);
  1502. $recv(aStream)._lf();
  1503. return self;
  1504. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1505. }, function($ctx1) {$ctx1.fill(self,"exportPackageDefinitionOf:on:",{aPackage:aPackage,aStream:aStream},$globals.Exporter)});
  1506. //>>excludeEnd("ctx");
  1507. },
  1508. //>>excludeStart("ide", pragmas.excludeIdeData);
  1509. args: ["aPackage", "aStream"],
  1510. source: "exportPackageDefinitionOf: aPackage on: aStream\x0a\x09aStream\x0a\x09\x09write: { '$core.addPackage('. aPackage name asJavaScriptSource. ');' };\x0a\x09\x09lf",
  1511. referencedClasses: [],
  1512. //>>excludeEnd("ide");
  1513. messageSends: ["write:", "asJavaScriptSource", "name", "lf"]
  1514. }),
  1515. $globals.Exporter);
  1516. $core.addMethod(
  1517. $core.method({
  1518. selector: "exportPackageEpilogueOf:on:",
  1519. protocol: "output",
  1520. fn: function (aPackage,aStream){
  1521. var self=this,$self=this;
  1522. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1523. return $core.withContext(function($ctx1) {
  1524. //>>excludeEnd("ctx");
  1525. $self._subclassResponsibility();
  1526. return self;
  1527. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1528. }, function($ctx1) {$ctx1.fill(self,"exportPackageEpilogueOf:on:",{aPackage:aPackage,aStream:aStream},$globals.Exporter)});
  1529. //>>excludeEnd("ctx");
  1530. },
  1531. //>>excludeStart("ide", pragmas.excludeIdeData);
  1532. args: ["aPackage", "aStream"],
  1533. source: "exportPackageEpilogueOf: aPackage on: aStream\x0a\x09self subclassResponsibility",
  1534. referencedClasses: [],
  1535. //>>excludeEnd("ide");
  1536. messageSends: ["subclassResponsibility"]
  1537. }),
  1538. $globals.Exporter);
  1539. $core.addMethod(
  1540. $core.method({
  1541. selector: "exportPackageImportsOf:on:",
  1542. protocol: "output",
  1543. fn: function (aPackage,aStream){
  1544. var self=this,$self=this;
  1545. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1546. return $core.withContext(function($ctx1) {
  1547. //>>excludeEnd("ctx");
  1548. var $2,$1;
  1549. $recv($recv(aPackage)._importsAsJson())._ifNotEmpty_((function(imports){
  1550. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1551. return $core.withContext(function($ctx2) {
  1552. //>>excludeEnd("ctx");
  1553. $2=$recv($recv(aPackage)._name())._asJavaScriptSource();
  1554. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1555. $ctx2.sendIdx["asJavaScriptSource"]=1;
  1556. //>>excludeEnd("ctx");
  1557. $1=["$core.packages[",$2,"].imports = ",$recv(imports)._asJavaScriptSource(),";"];
  1558. $recv(aStream)._write_($1);
  1559. return $recv(aStream)._lf();
  1560. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1561. }, function($ctx2) {$ctx2.fillBlock({imports:imports},$ctx1,1)});
  1562. //>>excludeEnd("ctx");
  1563. }));
  1564. return self;
  1565. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1566. }, function($ctx1) {$ctx1.fill(self,"exportPackageImportsOf:on:",{aPackage:aPackage,aStream:aStream},$globals.Exporter)});
  1567. //>>excludeEnd("ctx");
  1568. },
  1569. //>>excludeStart("ide", pragmas.excludeIdeData);
  1570. args: ["aPackage", "aStream"],
  1571. source: "exportPackageImportsOf: aPackage on: aStream\x0a\x09aPackage importsAsJson ifNotEmpty: [ :imports |\x0a\x09\x09aStream\x0a\x09\x09\x09write: {\x0a\x09\x09\x09\x09'$core.packages['.\x0a\x09\x09\x09\x09aPackage name asJavaScriptSource.\x0a\x09\x09\x09\x09'].imports = '.\x0a\x09\x09\x09\x09imports asJavaScriptSource.\x0a\x09\x09\x09\x09';' };\x0a\x09\x09\x09lf ]",
  1572. referencedClasses: [],
  1573. //>>excludeEnd("ide");
  1574. messageSends: ["ifNotEmpty:", "importsAsJson", "write:", "asJavaScriptSource", "name", "lf"]
  1575. }),
  1576. $globals.Exporter);
  1577. $core.addMethod(
  1578. $core.method({
  1579. selector: "exportPackagePrologueOf:on:",
  1580. protocol: "output",
  1581. fn: function (aPackage,aStream){
  1582. var self=this,$self=this;
  1583. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1584. return $core.withContext(function($ctx1) {
  1585. //>>excludeEnd("ctx");
  1586. $self._subclassResponsibility();
  1587. return self;
  1588. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1589. }, function($ctx1) {$ctx1.fill(self,"exportPackagePrologueOf:on:",{aPackage:aPackage,aStream:aStream},$globals.Exporter)});
  1590. //>>excludeEnd("ctx");
  1591. },
  1592. //>>excludeStart("ide", pragmas.excludeIdeData);
  1593. args: ["aPackage", "aStream"],
  1594. source: "exportPackagePrologueOf: aPackage on: aStream\x0a\x09self subclassResponsibility",
  1595. referencedClasses: [],
  1596. //>>excludeEnd("ide");
  1597. messageSends: ["subclassResponsibility"]
  1598. }),
  1599. $globals.Exporter);
  1600. $core.addMethod(
  1601. $core.method({
  1602. selector: "exportPackageTraitCompositionsOf:on:",
  1603. protocol: "output",
  1604. fn: function (aPackage,aStream){
  1605. var self=this,$self=this;
  1606. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1607. return $core.withContext(function($ctx1) {
  1608. //>>excludeEnd("ctx");
  1609. $recv($recv(aPackage)._traitCompositions())._ifNotEmpty_((function(traitCompositions){
  1610. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1611. return $core.withContext(function($ctx2) {
  1612. //>>excludeEnd("ctx");
  1613. $recv(traitCompositions)._keysAndValuesDo_((function(key,value){
  1614. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1615. return $core.withContext(function($ctx3) {
  1616. //>>excludeEnd("ctx");
  1617. return $self._exportTraitComposition_of_on_(value,key,aStream);
  1618. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1619. }, function($ctx3) {$ctx3.fillBlock({key:key,value:value},$ctx2,2)});
  1620. //>>excludeEnd("ctx");
  1621. }));
  1622. return $recv(aStream)._lf();
  1623. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1624. }, function($ctx2) {$ctx2.fillBlock({traitCompositions:traitCompositions},$ctx1,1)});
  1625. //>>excludeEnd("ctx");
  1626. }));
  1627. return self;
  1628. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1629. }, function($ctx1) {$ctx1.fill(self,"exportPackageTraitCompositionsOf:on:",{aPackage:aPackage,aStream:aStream},$globals.Exporter)});
  1630. //>>excludeEnd("ctx");
  1631. },
  1632. //>>excludeStart("ide", pragmas.excludeIdeData);
  1633. args: ["aPackage", "aStream"],
  1634. source: "exportPackageTraitCompositionsOf: aPackage on: aStream\x0a\x09aPackage traitCompositions ifNotEmpty: [ :traitCompositions |\x0a\x09\x09traitCompositions keysAndValuesDo: [ :key :value | self exportTraitComposition: value of: key on: aStream ].\x0a\x09\x09aStream lf ]",
  1635. referencedClasses: [],
  1636. //>>excludeEnd("ide");
  1637. messageSends: ["ifNotEmpty:", "traitCompositions", "keysAndValuesDo:", "exportTraitComposition:of:on:", "lf"]
  1638. }),
  1639. $globals.Exporter);
  1640. $core.addMethod(
  1641. $core.method({
  1642. selector: "exportPackageTransportOf:on:",
  1643. protocol: "output",
  1644. fn: function (aPackage,aStream){
  1645. var self=this,$self=this;
  1646. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1647. return $core.withContext(function($ctx1) {
  1648. //>>excludeEnd("ctx");
  1649. $recv(aStream)._write_(["$core.packages[",$recv($recv(aPackage)._name())._asJavaScriptSource(),"].transport = ",$recv($recv(aPackage)._transport())._asJSONString(),";"]);
  1650. $recv(aStream)._lf();
  1651. return self;
  1652. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1653. }, function($ctx1) {$ctx1.fill(self,"exportPackageTransportOf:on:",{aPackage:aPackage,aStream:aStream},$globals.Exporter)});
  1654. //>>excludeEnd("ctx");
  1655. },
  1656. //>>excludeStart("ide", pragmas.excludeIdeData);
  1657. args: ["aPackage", "aStream"],
  1658. source: "exportPackageTransportOf: aPackage on: aStream\x0a\x09aStream\x0a\x09\x09write: {\x0a\x09\x09\x09'$core.packages['.\x0a\x09\x09\x09aPackage name asJavaScriptSource.\x0a\x09\x09\x09'].transport = '.\x0a\x09\x09\x09aPackage transport asJSONString.\x0a\x09\x09\x09';' };\x0a\x09\x09lf",
  1659. referencedClasses: [],
  1660. //>>excludeEnd("ide");
  1661. messageSends: ["write:", "asJavaScriptSource", "name", "asJSONString", "transport", "lf"]
  1662. }),
  1663. $globals.Exporter);
  1664. $core.addMethod(
  1665. $core.method({
  1666. selector: "exportTraitComposition:of:on:",
  1667. protocol: "output",
  1668. fn: function (aTraitComposition,aBehavior,aStream){
  1669. var self=this,$self=this;
  1670. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1671. return $core.withContext(function($ctx1) {
  1672. //>>excludeEnd("ctx");
  1673. var $2,$1;
  1674. $2=$recv(aTraitComposition)._asJavaScriptSource();
  1675. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1676. $ctx1.sendIdx["asJavaScriptSource"]=1;
  1677. //>>excludeEnd("ctx");
  1678. $1=["$core.setTraitComposition(",$2,", ",$recv(aBehavior)._asJavaScriptSource(),");"];
  1679. $recv(aStream)._write_($1);
  1680. $recv(aStream)._lf();
  1681. return self;
  1682. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1683. }, function($ctx1) {$ctx1.fill(self,"exportTraitComposition:of:on:",{aTraitComposition:aTraitComposition,aBehavior:aBehavior,aStream:aStream},$globals.Exporter)});
  1684. //>>excludeEnd("ctx");
  1685. },
  1686. //>>excludeStart("ide", pragmas.excludeIdeData);
  1687. args: ["aTraitComposition", "aBehavior", "aStream"],
  1688. source: "exportTraitComposition: aTraitComposition of: aBehavior on: aStream\x0a\x09aStream write: {\x0a\x09\x09'$core.setTraitComposition('.\x0a\x09\x09aTraitComposition asJavaScriptSource.\x0a\x09\x09', '.\x0a\x09\x09aBehavior asJavaScriptSource.\x0a\x09\x09');' };\x0a\x09lf",
  1689. referencedClasses: [],
  1690. //>>excludeEnd("ide");
  1691. messageSends: ["write:", "asJavaScriptSource", "lf"]
  1692. }),
  1693. $globals.Exporter);
  1694. $core.addMethod(
  1695. $core.method({
  1696. selector: "exportTraitDefinitionOf:on:",
  1697. protocol: "output",
  1698. fn: function (aClass,aStream){
  1699. var self=this,$self=this;
  1700. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1701. return $core.withContext(function($ctx1) {
  1702. //>>excludeEnd("ctx");
  1703. var $3,$4,$2,$1,$5,$7,$6;
  1704. $recv(aStream)._lf();
  1705. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1706. $ctx1.sendIdx["lf"]=1;
  1707. //>>excludeEnd("ctx");
  1708. $3=$recv($recv(aClass)._name())._asJavaScriptSource();
  1709. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1710. $ctx1.sendIdx["asJavaScriptSource"]=1;
  1711. //>>excludeEnd("ctx");
  1712. $4=$recv($recv(aClass)._category())._asJavaScriptSource();
  1713. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1714. $ctx1.sendIdx["asJavaScriptSource"]=2;
  1715. //>>excludeEnd("ctx");
  1716. $2=["$core.addTrait(",$3,", ",$4,");"];
  1717. $1=$recv(aStream)._write_($2);
  1718. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1719. $ctx1.sendIdx["write:"]=1;
  1720. //>>excludeEnd("ctx");
  1721. $5=$recv(aClass)._comment();
  1722. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1723. $ctx1.sendIdx["comment"]=1;
  1724. //>>excludeEnd("ctx");
  1725. $recv($5)._ifNotEmpty_((function(){
  1726. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1727. return $core.withContext(function($ctx2) {
  1728. //>>excludeEnd("ctx");
  1729. $recv(aStream)._lf();
  1730. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1731. $ctx2.sendIdx["lf"]=2;
  1732. //>>excludeEnd("ctx");
  1733. $recv(aStream)._write_("//>>excludeStart(\x22ide\x22, pragmas.excludeIdeData);");
  1734. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1735. $ctx2.sendIdx["write:"]=2;
  1736. //>>excludeEnd("ctx");
  1737. $recv(aStream)._lf();
  1738. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1739. $ctx2.sendIdx["lf"]=3;
  1740. //>>excludeEnd("ctx");
  1741. $7=$recv(aClass)._asJavaScriptSource();
  1742. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1743. $ctx2.sendIdx["asJavaScriptSource"]=3;
  1744. //>>excludeEnd("ctx");
  1745. $6=[$7,".comment=",$recv($recv($recv(aClass)._comment())._crlfSanitized())._asJavaScriptSource(),";"];
  1746. $recv(aStream)._write_($6);
  1747. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1748. $ctx2.sendIdx["write:"]=3;
  1749. //>>excludeEnd("ctx");
  1750. $recv(aStream)._lf();
  1751. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1752. $ctx2.sendIdx["lf"]=4;
  1753. //>>excludeEnd("ctx");
  1754. return $recv(aStream)._write_("//>>excludeEnd(\x22ide\x22);");
  1755. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1756. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  1757. //>>excludeEnd("ctx");
  1758. }));
  1759. $recv(aStream)._lf();
  1760. return self;
  1761. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1762. }, function($ctx1) {$ctx1.fill(self,"exportTraitDefinitionOf:on:",{aClass:aClass,aStream:aStream},$globals.Exporter)});
  1763. //>>excludeEnd("ctx");
  1764. },
  1765. //>>excludeStart("ide", pragmas.excludeIdeData);
  1766. args: ["aClass", "aStream"],
  1767. source: "exportTraitDefinitionOf: aClass on: aStream\x0a\x09aStream\x0a\x09\x09lf;\x0a\x09\x09write: {\x0a\x09\x09\x09'$core.addTrait('.\x0a\x09\x09\x09aClass name asJavaScriptSource. ', '.\x0a\x09\x09\x09aClass category asJavaScriptSource.\x0a\x09\x09\x09');' }.\x0a\x09aClass comment ifNotEmpty: [\x0a\x09\x09aStream\x0a\x09\x09\x09lf;\x0a\x09\x09\x09write: '//>>excludeStart(\x22ide\x22, pragmas.excludeIdeData);'; lf;\x0a\x09\x09\x09write: { aClass asJavaScriptSource. '.comment='. aClass comment crlfSanitized asJavaScriptSource. ';' }; lf;\x0a\x09\x09\x09write: '//>>excludeEnd(\x22ide\x22);' ].\x0a\x09aStream lf",
  1768. referencedClasses: [],
  1769. //>>excludeEnd("ide");
  1770. messageSends: ["lf", "write:", "asJavaScriptSource", "name", "category", "ifNotEmpty:", "comment", "crlfSanitized"]
  1771. }),
  1772. $globals.Exporter);
  1773. $core.addMethod(
  1774. $core.method({
  1775. selector: "ownMethodsOfClass:",
  1776. protocol: "accessing",
  1777. fn: function (aClass){
  1778. var self=this,$self=this;
  1779. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1780. return $core.withContext(function($ctx1) {
  1781. //>>excludeEnd("ctx");
  1782. var $1;
  1783. return $recv($recv($recv($recv(aClass)._methodDictionary())._values())._sorted_((function(a,b){
  1784. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1785. return $core.withContext(function($ctx2) {
  1786. //>>excludeEnd("ctx");
  1787. $1=$recv(a)._selector();
  1788. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1789. $ctx2.sendIdx["selector"]=1;
  1790. //>>excludeEnd("ctx");
  1791. return $recv($1).__lt_eq($recv(b)._selector());
  1792. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1793. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,1)});
  1794. //>>excludeEnd("ctx");
  1795. })))._reject_((function(each){
  1796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1797. return $core.withContext(function($ctx2) {
  1798. //>>excludeEnd("ctx");
  1799. return $recv($recv(each)._protocol())._match_("^\x5c*");
  1800. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1801. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  1802. //>>excludeEnd("ctx");
  1803. }));
  1804. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1805. }, function($ctx1) {$ctx1.fill(self,"ownMethodsOfClass:",{aClass:aClass},$globals.Exporter)});
  1806. //>>excludeEnd("ctx");
  1807. },
  1808. //>>excludeStart("ide", pragmas.excludeIdeData);
  1809. args: ["aClass"],
  1810. source: "ownMethodsOfClass: aClass\x0a\x09\x22Issue #143: sort methods alphabetically\x22\x0a\x0a\x09^ ((aClass methodDictionary values) sorted: [ :a :b | a selector <= b selector ])\x0a\x09\x09reject: [ :each | (each protocol match: '^\x5c*') ]",
  1811. referencedClasses: [],
  1812. //>>excludeEnd("ide");
  1813. messageSends: ["reject:", "sorted:", "values", "methodDictionary", "<=", "selector", "match:", "protocol"]
  1814. }),
  1815. $globals.Exporter);
  1816. $core.addMethod(
  1817. $core.method({
  1818. selector: "ownMethodsOfMetaClass:",
  1819. protocol: "accessing",
  1820. fn: function (aClass){
  1821. var self=this,$self=this;
  1822. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1823. return $core.withContext(function($ctx1) {
  1824. //>>excludeEnd("ctx");
  1825. return $self._ownMethodsOfClass_($recv(aClass)._theMetaClass());
  1826. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1827. }, function($ctx1) {$ctx1.fill(self,"ownMethodsOfMetaClass:",{aClass:aClass},$globals.Exporter)});
  1828. //>>excludeEnd("ctx");
  1829. },
  1830. //>>excludeStart("ide", pragmas.excludeIdeData);
  1831. args: ["aClass"],
  1832. source: "ownMethodsOfMetaClass: aClass\x0a\x09\x22Issue #143: sort methods alphabetically\x22\x0a\x0a\x09^ self ownMethodsOfClass: aClass theMetaClass",
  1833. referencedClasses: [],
  1834. //>>excludeEnd("ide");
  1835. messageSends: ["ownMethodsOfClass:", "theMetaClass"]
  1836. }),
  1837. $globals.Exporter);
  1838. $core.addClass("AmdExporter", $globals.Exporter, ["namespace"], "Platform-ImportExport");
  1839. //>>excludeStart("ide", pragmas.excludeIdeData);
  1840. $globals.AmdExporter.comment="I am used to export Packages in an AMD (Asynchronous Module Definition) JavaScript format.";
  1841. //>>excludeEnd("ide");
  1842. $core.addMethod(
  1843. $core.method({
  1844. selector: "amdNamesOfPackages:",
  1845. protocol: "private",
  1846. fn: function (anArray){
  1847. var self=this,$self=this;
  1848. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1849. return $core.withContext(function($ctx1) {
  1850. //>>excludeEnd("ctx");
  1851. var $1;
  1852. return $recv($recv(anArray)._select_((function(each){
  1853. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1854. return $core.withContext(function($ctx2) {
  1855. //>>excludeEnd("ctx");
  1856. $1=$self._amdNamespaceOfPackage_(each);
  1857. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1858. $ctx2.sendIdx["amdNamespaceOfPackage:"]=1;
  1859. //>>excludeEnd("ctx");
  1860. return $recv($1)._notNil();
  1861. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1862. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  1863. //>>excludeEnd("ctx");
  1864. })))._collect_((function(each){
  1865. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1866. return $core.withContext(function($ctx2) {
  1867. //>>excludeEnd("ctx");
  1868. return $recv($recv($self._amdNamespaceOfPackage_(each)).__comma("/")).__comma($recv(each)._name());
  1869. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1870. $ctx2.sendIdx[","]=1;
  1871. //>>excludeEnd("ctx");
  1872. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1873. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  1874. //>>excludeEnd("ctx");
  1875. }));
  1876. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1877. }, function($ctx1) {$ctx1.fill(self,"amdNamesOfPackages:",{anArray:anArray},$globals.AmdExporter)});
  1878. //>>excludeEnd("ctx");
  1879. },
  1880. //>>excludeStart("ide", pragmas.excludeIdeData);
  1881. args: ["anArray"],
  1882. source: "amdNamesOfPackages: anArray\x0a\x09^ (anArray\x0a\x09\x09select: [ :each | (self amdNamespaceOfPackage: each) notNil ])\x0a\x09\x09collect: [ :each | (self amdNamespaceOfPackage: each), '/', each name ]",
  1883. referencedClasses: [],
  1884. //>>excludeEnd("ide");
  1885. messageSends: ["collect:", "select:", "notNil", "amdNamespaceOfPackage:", ",", "name"]
  1886. }),
  1887. $globals.AmdExporter);
  1888. $core.addMethod(
  1889. $core.method({
  1890. selector: "amdNamespaceOfPackage:",
  1891. protocol: "private",
  1892. fn: function (aPackage){
  1893. var self=this,$self=this;
  1894. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1895. return $core.withContext(function($ctx1) {
  1896. //>>excludeEnd("ctx");
  1897. var $3,$2,$1;
  1898. $3=$recv(aPackage)._transport();
  1899. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1900. $ctx1.sendIdx["transport"]=1;
  1901. //>>excludeEnd("ctx");
  1902. $2=$recv($3)._type();
  1903. $1=$recv($2).__eq("amd");
  1904. if($core.assert($1)){
  1905. return $recv($recv(aPackage)._transport())._namespace();
  1906. } else {
  1907. return nil;
  1908. }
  1909. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1910. }, function($ctx1) {$ctx1.fill(self,"amdNamespaceOfPackage:",{aPackage:aPackage},$globals.AmdExporter)});
  1911. //>>excludeEnd("ctx");
  1912. },
  1913. //>>excludeStart("ide", pragmas.excludeIdeData);
  1914. args: ["aPackage"],
  1915. source: "amdNamespaceOfPackage: aPackage\x0a\x09^ (aPackage transport type = 'amd')\x0a\x09\x09ifTrue: [ aPackage transport namespace ]\x0a\x09\x09ifFalse: [ nil ]",
  1916. referencedClasses: [],
  1917. //>>excludeEnd("ide");
  1918. messageSends: ["ifTrue:ifFalse:", "=", "type", "transport", "namespace"]
  1919. }),
  1920. $globals.AmdExporter);
  1921. $core.addMethod(
  1922. $core.method({
  1923. selector: "exportPackageEpilogueOf:on:",
  1924. protocol: "output",
  1925. fn: function (aPackage,aStream){
  1926. var self=this,$self=this;
  1927. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1928. return $core.withContext(function($ctx1) {
  1929. //>>excludeEnd("ctx");
  1930. $recv(aStream)._write_("});");
  1931. $recv(aStream)._lf();
  1932. return self;
  1933. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1934. }, function($ctx1) {$ctx1.fill(self,"exportPackageEpilogueOf:on:",{aPackage:aPackage,aStream:aStream},$globals.AmdExporter)});
  1935. //>>excludeEnd("ctx");
  1936. },
  1937. //>>excludeStart("ide", pragmas.excludeIdeData);
  1938. args: ["aPackage", "aStream"],
  1939. source: "exportPackageEpilogueOf: aPackage on: aStream\x0a\x09aStream\x0a\x09\x09write: '});';\x0a\x09\x09lf",
  1940. referencedClasses: [],
  1941. //>>excludeEnd("ide");
  1942. messageSends: ["write:", "lf"]
  1943. }),
  1944. $globals.AmdExporter);
  1945. $core.addMethod(
  1946. $core.method({
  1947. selector: "exportPackagePrologueOf:on:",
  1948. protocol: "output",
  1949. fn: function (aPackage,aStream){
  1950. var self=this,$self=this;
  1951. var importsForOutput,loadDependencies,pragmaStart,pragmaEnd;
  1952. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1953. return $core.withContext(function($ctx1) {
  1954. //>>excludeEnd("ctx");
  1955. var $1,$3,$2,$4,$6,$5,$7,$14,$13,$12,$11,$10,$9,$18,$17,$16,$15,$8;
  1956. pragmaStart="";
  1957. pragmaEnd="";
  1958. importsForOutput=$self._importsForOutput_(aPackage);
  1959. loadDependencies=$self._amdNamesOfPackages_($recv(aPackage)._loadDependencies());
  1960. $1=$recv(importsForOutput)._value();
  1961. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1962. $ctx1.sendIdx["value"]=1;
  1963. //>>excludeEnd("ctx");
  1964. $recv($1)._ifNotEmpty_((function(){
  1965. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1966. return $core.withContext(function($ctx2) {
  1967. //>>excludeEnd("ctx");
  1968. $3=$recv($globals.String)._lf();
  1969. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1970. $ctx2.sendIdx["lf"]=1;
  1971. //>>excludeEnd("ctx");
  1972. $2=$recv($3).__comma("//>>excludeStart(\x22imports\x22, pragmas.excludeImports);");
  1973. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1974. $ctx2.sendIdx[","]=2;
  1975. //>>excludeEnd("ctx");
  1976. $4=$recv($globals.String)._lf();
  1977. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1978. $ctx2.sendIdx["lf"]=2;
  1979. //>>excludeEnd("ctx");
  1980. pragmaStart=$recv($2).__comma($4);
  1981. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1982. $ctx2.sendIdx[","]=1;
  1983. //>>excludeEnd("ctx");
  1984. pragmaStart;
  1985. $6=$recv($globals.String)._lf();
  1986. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1987. $ctx2.sendIdx["lf"]=3;
  1988. //>>excludeEnd("ctx");
  1989. $5=$recv($6).__comma("//>>excludeEnd(\x22imports\x22);");
  1990. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1991. $ctx2.sendIdx[","]=4;
  1992. //>>excludeEnd("ctx");
  1993. $7=$recv($globals.String)._lf();
  1994. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1995. $ctx2.sendIdx["lf"]=4;
  1996. //>>excludeEnd("ctx");
  1997. pragmaEnd=$recv($5).__comma($7);
  1998. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1999. $ctx2.sendIdx[","]=3;
  2000. //>>excludeEnd("ctx");
  2001. return pragmaEnd;
  2002. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2003. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2004. //>>excludeEnd("ctx");
  2005. }));
  2006. $14=["amber/boot", ":1:"].__comma($recv(importsForOutput)._value());
  2007. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2008. $ctx1.sendIdx[","]=7;
  2009. //>>excludeEnd("ctx");
  2010. $13=$recv($14).__comma([":2:"]);
  2011. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2012. $ctx1.sendIdx[","]=6;
  2013. //>>excludeEnd("ctx");
  2014. $12=$recv($13).__comma($recv($recv(loadDependencies)._asArray())._sorted());
  2015. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2016. $ctx1.sendIdx[","]=5;
  2017. //>>excludeEnd("ctx");
  2018. $11=$recv($12)._asJavaScriptSource();
  2019. $10=$recv($11)._replace_with_(",\x5cs*[\x22']:1:[\x22']",pragmaStart);
  2020. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2021. $ctx1.sendIdx["replace:with:"]=2;
  2022. //>>excludeEnd("ctx");
  2023. $9=$recv($10)._replace_with_(",\x5cs*[\x22']:2:[\x22']",pragmaEnd);
  2024. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2025. $ctx1.sendIdx["replace:with:"]=1;
  2026. //>>excludeEnd("ctx");
  2027. $18=$recv(["$boot", ":1:"].__comma($recv(importsForOutput)._key())).__comma([":2:"]);
  2028. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2029. $ctx1.sendIdx[","]=8;
  2030. //>>excludeEnd("ctx");
  2031. $17=$recv($18)._join_(",");
  2032. $16=$recv($17)._replace_with_(",\x5cs*:1:",pragmaStart);
  2033. $15=$recv($16)._replace_with_(",\x5cs*:2:",pragmaEnd);
  2034. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2035. $ctx1.sendIdx["replace:with:"]=3;
  2036. //>>excludeEnd("ctx");
  2037. $8=["define(",$9,", function(",$15,"){\x22use strict\x22;"];
  2038. $recv(aStream)._write_($8);
  2039. $recv(aStream)._lf();
  2040. $self._exportPackageBodyBlockPrologueOf_on_(aPackage,aStream);
  2041. return self;
  2042. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2043. }, function($ctx1) {$ctx1.fill(self,"exportPackagePrologueOf:on:",{aPackage:aPackage,aStream:aStream,importsForOutput:importsForOutput,loadDependencies:loadDependencies,pragmaStart:pragmaStart,pragmaEnd:pragmaEnd},$globals.AmdExporter)});
  2044. //>>excludeEnd("ctx");
  2045. },
  2046. //>>excludeStart("ide", pragmas.excludeIdeData);
  2047. args: ["aPackage", "aStream"],
  2048. source: "exportPackagePrologueOf: aPackage on: aStream\x0a\x09| importsForOutput loadDependencies pragmaStart pragmaEnd |\x0a\x09pragmaStart := ''.\x0a\x09pragmaEnd := ''.\x0a\x09importsForOutput := self importsForOutput: aPackage.\x0a\x09loadDependencies := self amdNamesOfPackages: aPackage loadDependencies.\x0a\x09importsForOutput value ifNotEmpty: [\x0a\x09\x09pragmaStart := String lf, '//>>excludeStart(\x22imports\x22, pragmas.excludeImports);', String lf.\x0a\x09\x09pragmaEnd := String lf, '//>>excludeEnd(\x22imports\x22);', String lf ].\x0a\x09aStream\x0a\x09\x09write: {\x0a\x09\x09\x09'define('.\x0a\x09\x09\x09((#('amber/boot' ':1:'), importsForOutput value, #(':2:'), loadDependencies asArray sorted) asJavaScriptSource\x0a\x09\x09\x09\x09replace: ',\x5cs*[\x22'']:1:[\x22'']' with: pragmaStart)\x0a\x09\x09\x09\x09replace: ',\x5cs*[\x22'']:2:[\x22'']' with: pragmaEnd.\x0a\x09\x09\x09', function('.\x0a\x09\x09\x09((((#('$boot' ':1:'), importsForOutput key, #(':2:')) join: ',') \x0a\x09\x09\x09\x09replace: ',\x5cs*:1:' with: pragmaStart)\x0a\x09\x09\x09\x09replace: ',\x5cs*:2:' with: pragmaEnd).\x0a\x09\x09\x09'){\x22use strict\x22;' };\x0a\x09\x09lf.\x0a\x09self exportPackageBodyBlockPrologueOf: aPackage on: aStream",
  2049. referencedClasses: ["String"],
  2050. //>>excludeEnd("ide");
  2051. messageSends: ["importsForOutput:", "amdNamesOfPackages:", "loadDependencies", "ifNotEmpty:", "value", ",", "lf", "write:", "replace:with:", "asJavaScriptSource", "sorted", "asArray", "join:", "key", "exportPackageBodyBlockPrologueOf:on:"]
  2052. }),
  2053. $globals.AmdExporter);
  2054. $core.addMethod(
  2055. $core.method({
  2056. selector: "importsForOutput:",
  2057. protocol: "private",
  2058. fn: function (aPackage){
  2059. var self=this,$self=this;
  2060. var namedImports,anonImports,importVarNames;
  2061. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2062. return $core.withContext(function($ctx1) {
  2063. //>>excludeEnd("ctx");
  2064. var $1;
  2065. namedImports=[];
  2066. anonImports=[];
  2067. importVarNames=[];
  2068. $recv($recv(aPackage)._imports())._do_((function(each){
  2069. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2070. return $core.withContext(function($ctx2) {
  2071. //>>excludeEnd("ctx");
  2072. $1=$recv(each)._isString();
  2073. if($core.assert($1)){
  2074. return $recv(anonImports)._add_(each);
  2075. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2076. $ctx2.sendIdx["add:"]=1;
  2077. //>>excludeEnd("ctx");
  2078. } else {
  2079. $recv(namedImports)._add_($recv(each)._value());
  2080. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2081. $ctx2.sendIdx["add:"]=2;
  2082. //>>excludeEnd("ctx");
  2083. return $recv(importVarNames)._add_($recv(each)._key());
  2084. }
  2085. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2086. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2087. //>>excludeEnd("ctx");
  2088. }));
  2089. return $recv(importVarNames).__minus_gt($recv(namedImports).__comma(anonImports));
  2090. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2091. }, function($ctx1) {$ctx1.fill(self,"importsForOutput:",{aPackage:aPackage,namedImports:namedImports,anonImports:anonImports,importVarNames:importVarNames},$globals.AmdExporter)});
  2092. //>>excludeEnd("ctx");
  2093. },
  2094. //>>excludeStart("ide", pragmas.excludeIdeData);
  2095. args: ["aPackage"],
  2096. source: "importsForOutput: aPackage\x0a\x09\x22Returns an association where key is list of import variables\x0a\x09and value is list of external dependencies, with ones imported as variables\x0a\x09put at the beginning with same order as is in key.\x0a\x09\x0a\x09For example imports:{'jQuery'->'jquery'. 'bootstrap'} would yield\x0a\x09#('jQuery') -> #('jquery' 'bootstrap')\x22\x0a\x09| namedImports anonImports importVarNames |\x0a\x09namedImports := #().\x0a\x09anonImports := #().\x0a\x09importVarNames := #().\x0a\x09aPackage imports do: [ :each | each isString\x0a\x09\x09ifTrue: [ anonImports add: each ]\x0a\x09\x09ifFalse: [ namedImports add: each value.\x0a\x09\x09\x09importVarNames add: each key ]].\x0a\x09^ importVarNames -> (namedImports, anonImports)",
  2097. referencedClasses: [],
  2098. //>>excludeEnd("ide");
  2099. messageSends: ["do:", "imports", "ifTrue:ifFalse:", "isString", "add:", "value", "key", "->", ","]
  2100. }),
  2101. $globals.AmdExporter);
  2102. $core.addClass("ChunkParser", $globals.Object, ["stream", "last"], "Platform-ImportExport");
  2103. //>>excludeStart("ide", pragmas.excludeIdeData);
  2104. $globals.ChunkParser.comment="I am responsible for parsing aStream contents in the chunk format.\x0a\x0a## API\x0a\x0a ChunkParser new\x0a stream: aStream;\x0a nextChunk";
  2105. //>>excludeEnd("ide");
  2106. $core.addMethod(
  2107. $core.method({
  2108. selector: "last",
  2109. protocol: "accessing",
  2110. fn: function (){
  2111. var self=this,$self=this;
  2112. return $self["@last"];
  2113. },
  2114. //>>excludeStart("ide", pragmas.excludeIdeData);
  2115. args: [],
  2116. source: "last\x0a\x09^ last",
  2117. referencedClasses: [],
  2118. //>>excludeEnd("ide");
  2119. messageSends: []
  2120. }),
  2121. $globals.ChunkParser);
  2122. $core.addMethod(
  2123. $core.method({
  2124. selector: "nextChunk",
  2125. protocol: "reading",
  2126. fn: function (){
  2127. var self=this,$self=this;
  2128. var char,result,chunk;
  2129. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2130. return $core.withContext(function($ctx1) {
  2131. //>>excludeEnd("ctx");
  2132. var $1,$2,$3,$4;
  2133. var $early={};
  2134. try {
  2135. result=""._writeStream();
  2136. $recv((function(){
  2137. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2138. return $core.withContext(function($ctx2) {
  2139. //>>excludeEnd("ctx");
  2140. char=$recv($self["@stream"])._next();
  2141. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2142. $ctx2.sendIdx["next"]=1;
  2143. //>>excludeEnd("ctx");
  2144. char;
  2145. return $recv(char)._notNil();
  2146. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2147. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2148. //>>excludeEnd("ctx");
  2149. }))._whileTrue_((function(){
  2150. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2151. return $core.withContext(function($ctx2) {
  2152. //>>excludeEnd("ctx");
  2153. $1=$recv(char).__eq("!");
  2154. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2155. $ctx2.sendIdx["="]=1;
  2156. //>>excludeEnd("ctx");
  2157. if($core.assert($1)){
  2158. $2=$recv($recv($self["@stream"])._peek()).__eq("!");
  2159. if($core.assert($2)){
  2160. $recv($self["@stream"])._next();
  2161. } else {
  2162. $self["@last"]=$recv($recv(result)._contents())._trimBoth();
  2163. $3=$self["@last"];
  2164. throw $early=[$3];
  2165. }
  2166. }
  2167. return $recv(result)._nextPut_(char);
  2168. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2169. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  2170. //>>excludeEnd("ctx");
  2171. }));
  2172. $self["@last"]=nil;
  2173. $4=$self["@last"];
  2174. return $4;
  2175. }
  2176. catch(e) {if(e===$early)return e[0]; throw e}
  2177. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2178. }, function($ctx1) {$ctx1.fill(self,"nextChunk",{char:char,result:result,chunk:chunk},$globals.ChunkParser)});
  2179. //>>excludeEnd("ctx");
  2180. },
  2181. //>>excludeStart("ide", pragmas.excludeIdeData);
  2182. args: [],
  2183. source: "nextChunk\x0a\x09\x22The chunk format (Smalltalk Interchange Format or Fileout format)\x0a\x09is a trivial format but can be a bit tricky to understand:\x0a\x09\x09- Uses the exclamation mark as delimiter of chunks.\x0a\x09\x09- Inside a chunk a normal exclamation mark must be doubled.\x0a\x09\x09- A non empty chunk must be a valid Smalltalk expression.\x0a\x09\x09- A chunk on top level with a preceding empty chunk is an instruction chunk:\x0a\x09\x09\x09- The object created by the expression then takes over reading chunks.\x0a\x0a\x09This method returns next chunk as a String (trimmed), empty String (all whitespace) or nil.\x22\x0a\x0a\x09| char result chunk |\x0a\x09result := '' writeStream.\x0a\x09\x09[ char := stream next.\x0a\x09\x09char notNil ] whileTrue: [\x0a\x09\x09\x09\x09char = '!' ifTrue: [\x0a\x09\x09\x09\x09\x09\x09stream peek = '!'\x0a\x09\x09\x09\x09\x09\x09\x09\x09ifTrue: [ stream next \x22skipping the escape double\x22 ]\x0a\x09\x09\x09\x09\x09\x09\x09\x09ifFalse: [ ^ last := result contents trimBoth \x22chunk end marker found\x22 ]].\x0a\x09\x09\x09\x09result nextPut: char ].\x0a\x09^ last := nil \x22a chunk needs to end with !\x22",
  2184. referencedClasses: [],
  2185. //>>excludeEnd("ide");
  2186. messageSends: ["writeStream", "whileTrue:", "next", "notNil", "ifTrue:", "=", "ifTrue:ifFalse:", "peek", "trimBoth", "contents", "nextPut:"]
  2187. }),
  2188. $globals.ChunkParser);
  2189. $core.addMethod(
  2190. $core.method({
  2191. selector: "stream:",
  2192. protocol: "accessing",
  2193. fn: function (aStream){
  2194. var self=this,$self=this;
  2195. $self["@stream"]=aStream;
  2196. return self;
  2197. },
  2198. //>>excludeStart("ide", pragmas.excludeIdeData);
  2199. args: ["aStream"],
  2200. source: "stream: aStream\x0a\x09stream := aStream",
  2201. referencedClasses: [],
  2202. //>>excludeEnd("ide");
  2203. messageSends: []
  2204. }),
  2205. $globals.ChunkParser);
  2206. $core.addMethod(
  2207. $core.method({
  2208. selector: "on:",
  2209. protocol: "instance creation",
  2210. fn: function (aStream){
  2211. var self=this,$self=this;
  2212. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2213. return $core.withContext(function($ctx1) {
  2214. //>>excludeEnd("ctx");
  2215. return $recv($self._new())._stream_(aStream);
  2216. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2217. }, function($ctx1) {$ctx1.fill(self,"on:",{aStream:aStream},$globals.ChunkParser.a$cls)});
  2218. //>>excludeEnd("ctx");
  2219. },
  2220. //>>excludeStart("ide", pragmas.excludeIdeData);
  2221. args: ["aStream"],
  2222. source: "on: aStream\x0a\x09^ self new stream: aStream",
  2223. referencedClasses: [],
  2224. //>>excludeEnd("ide");
  2225. messageSends: ["stream:", "new"]
  2226. }),
  2227. $globals.ChunkParser.a$cls);
  2228. $core.addClass("ClassCommentReader", $globals.Object, ["class"], "Platform-ImportExport");
  2229. //>>excludeStart("ide", pragmas.excludeIdeData);
  2230. $globals.ClassCommentReader.comment="I provide a mechanism for retrieving class comments stored on a file.\x0a\x0aSee also `ClassCategoryReader`.";
  2231. //>>excludeEnd("ide");
  2232. $core.addMethod(
  2233. $core.method({
  2234. selector: "class:",
  2235. protocol: "accessing",
  2236. fn: function (aClass){
  2237. var self=this,$self=this;
  2238. $self["@class"]=aClass;
  2239. return self;
  2240. },
  2241. //>>excludeStart("ide", pragmas.excludeIdeData);
  2242. args: ["aClass"],
  2243. source: "class: aClass\x0a\x09class := aClass",
  2244. referencedClasses: [],
  2245. //>>excludeEnd("ide");
  2246. messageSends: []
  2247. }),
  2248. $globals.ClassCommentReader);
  2249. $core.addMethod(
  2250. $core.method({
  2251. selector: "initialize",
  2252. protocol: "initialization",
  2253. fn: function (){
  2254. var self=this,$self=this;
  2255. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2256. return $core.withContext(function($ctx1) {
  2257. //>>excludeEnd("ctx");
  2258. (
  2259. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2260. $ctx1.supercall = true,
  2261. //>>excludeEnd("ctx");
  2262. ($globals.ClassCommentReader.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($self, []));
  2263. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2264. $ctx1.supercall = false;
  2265. //>>excludeEnd("ctx");;
  2266. return self;
  2267. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2268. }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.ClassCommentReader)});
  2269. //>>excludeEnd("ctx");
  2270. },
  2271. //>>excludeStart("ide", pragmas.excludeIdeData);
  2272. args: [],
  2273. source: "initialize\x0a\x09super initialize.",
  2274. referencedClasses: [],
  2275. //>>excludeEnd("ide");
  2276. messageSends: ["initialize"]
  2277. }),
  2278. $globals.ClassCommentReader);
  2279. $core.addMethod(
  2280. $core.method({
  2281. selector: "scanFrom:",
  2282. protocol: "fileIn",
  2283. fn: function (aChunkParser){
  2284. var self=this,$self=this;
  2285. var chunk;
  2286. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2287. return $core.withContext(function($ctx1) {
  2288. //>>excludeEnd("ctx");
  2289. chunk=$recv(aChunkParser)._nextChunk();
  2290. $recv(chunk)._ifNotEmpty_((function(){
  2291. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2292. return $core.withContext(function($ctx2) {
  2293. //>>excludeEnd("ctx");
  2294. return $self._setComment_(chunk);
  2295. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2296. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2297. //>>excludeEnd("ctx");
  2298. }));
  2299. return self;
  2300. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2301. }, function($ctx1) {$ctx1.fill(self,"scanFrom:",{aChunkParser:aChunkParser,chunk:chunk},$globals.ClassCommentReader)});
  2302. //>>excludeEnd("ctx");
  2303. },
  2304. //>>excludeStart("ide", pragmas.excludeIdeData);
  2305. args: ["aChunkParser"],
  2306. source: "scanFrom: aChunkParser\x0a\x09| chunk |\x0a\x09chunk := aChunkParser nextChunk.\x0a\x09chunk ifNotEmpty: [\x0a\x09\x09self setComment: chunk ].",
  2307. referencedClasses: [],
  2308. //>>excludeEnd("ide");
  2309. messageSends: ["nextChunk", "ifNotEmpty:", "setComment:"]
  2310. }),
  2311. $globals.ClassCommentReader);
  2312. $core.addMethod(
  2313. $core.method({
  2314. selector: "setComment:",
  2315. protocol: "private",
  2316. fn: function (aString){
  2317. var self=this,$self=this;
  2318. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2319. return $core.withContext(function($ctx1) {
  2320. //>>excludeEnd("ctx");
  2321. $recv($self["@class"])._comment_(aString);
  2322. return self;
  2323. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2324. }, function($ctx1) {$ctx1.fill(self,"setComment:",{aString:aString},$globals.ClassCommentReader)});
  2325. //>>excludeEnd("ctx");
  2326. },
  2327. //>>excludeStart("ide", pragmas.excludeIdeData);
  2328. args: ["aString"],
  2329. source: "setComment: aString\x0a\x09class comment: aString",
  2330. referencedClasses: [],
  2331. //>>excludeEnd("ide");
  2332. messageSends: ["comment:"]
  2333. }),
  2334. $globals.ClassCommentReader);
  2335. $core.addClass("ClassProtocolReader", $globals.Object, ["class", "category"], "Platform-ImportExport");
  2336. //>>excludeStart("ide", pragmas.excludeIdeData);
  2337. $globals.ClassProtocolReader.comment="I provide a mechanism for retrieving class descriptions stored on a file in the Smalltalk chunk format.";
  2338. //>>excludeEnd("ide");
  2339. $core.addMethod(
  2340. $core.method({
  2341. selector: "class:category:",
  2342. protocol: "accessing",
  2343. fn: function (aClass,aString){
  2344. var self=this,$self=this;
  2345. $self["@class"]=aClass;
  2346. $self["@category"]=aString;
  2347. return self;
  2348. },
  2349. //>>excludeStart("ide", pragmas.excludeIdeData);
  2350. args: ["aClass", "aString"],
  2351. source: "class: aClass category: aString\x0a\x09class := aClass.\x0a\x09category := aString",
  2352. referencedClasses: [],
  2353. //>>excludeEnd("ide");
  2354. messageSends: []
  2355. }),
  2356. $globals.ClassProtocolReader);
  2357. $core.addMethod(
  2358. $core.method({
  2359. selector: "compileMethod:",
  2360. protocol: "private",
  2361. fn: function (aString){
  2362. var self=this,$self=this;
  2363. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2364. return $core.withContext(function($ctx1) {
  2365. //>>excludeEnd("ctx");
  2366. $recv($recv($globals.Compiler)._new())._install_forClass_protocol_(aString,$self["@class"],$self["@category"]);
  2367. return self;
  2368. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2369. }, function($ctx1) {$ctx1.fill(self,"compileMethod:",{aString:aString},$globals.ClassProtocolReader)});
  2370. //>>excludeEnd("ctx");
  2371. },
  2372. //>>excludeStart("ide", pragmas.excludeIdeData);
  2373. args: ["aString"],
  2374. source: "compileMethod: aString\x0a\x09Compiler new install: aString forClass: class protocol: category",
  2375. referencedClasses: ["Compiler"],
  2376. //>>excludeEnd("ide");
  2377. messageSends: ["install:forClass:protocol:", "new"]
  2378. }),
  2379. $globals.ClassProtocolReader);
  2380. $core.addMethod(
  2381. $core.method({
  2382. selector: "initialize",
  2383. protocol: "initialization",
  2384. fn: function (){
  2385. var self=this,$self=this;
  2386. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2387. return $core.withContext(function($ctx1) {
  2388. //>>excludeEnd("ctx");
  2389. (
  2390. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2391. $ctx1.supercall = true,
  2392. //>>excludeEnd("ctx");
  2393. ($globals.ClassProtocolReader.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($self, []));
  2394. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2395. $ctx1.supercall = false;
  2396. //>>excludeEnd("ctx");;
  2397. return self;
  2398. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2399. }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.ClassProtocolReader)});
  2400. //>>excludeEnd("ctx");
  2401. },
  2402. //>>excludeStart("ide", pragmas.excludeIdeData);
  2403. args: [],
  2404. source: "initialize\x0a\x09super initialize.",
  2405. referencedClasses: [],
  2406. //>>excludeEnd("ide");
  2407. messageSends: ["initialize"]
  2408. }),
  2409. $globals.ClassProtocolReader);
  2410. $core.addMethod(
  2411. $core.method({
  2412. selector: "scanFrom:",
  2413. protocol: "fileIn",
  2414. fn: function (aChunkParser){
  2415. var self=this,$self=this;
  2416. var chunk;
  2417. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2418. return $core.withContext(function($ctx1) {
  2419. //>>excludeEnd("ctx");
  2420. $recv((function(){
  2421. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2422. return $core.withContext(function($ctx2) {
  2423. //>>excludeEnd("ctx");
  2424. chunk=$recv(aChunkParser)._nextChunk();
  2425. chunk;
  2426. return $recv(chunk)._isEmpty();
  2427. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2428. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2429. //>>excludeEnd("ctx");
  2430. }))._whileFalse_((function(){
  2431. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2432. return $core.withContext(function($ctx2) {
  2433. //>>excludeEnd("ctx");
  2434. return $self._compileMethod_(chunk);
  2435. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2436. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  2437. //>>excludeEnd("ctx");
  2438. }));
  2439. return self;
  2440. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2441. }, function($ctx1) {$ctx1.fill(self,"scanFrom:",{aChunkParser:aChunkParser,chunk:chunk},$globals.ClassProtocolReader)});
  2442. //>>excludeEnd("ctx");
  2443. },
  2444. //>>excludeStart("ide", pragmas.excludeIdeData);
  2445. args: ["aChunkParser"],
  2446. source: "scanFrom: aChunkParser\x0a\x09| chunk |\x0a\x09[ chunk := aChunkParser nextChunk.\x0a\x09chunk isEmpty ] whileFalse: [\x0a\x09\x09self compileMethod: chunk ]",
  2447. referencedClasses: [],
  2448. //>>excludeEnd("ide");
  2449. messageSends: ["whileFalse:", "nextChunk", "isEmpty", "compileMethod:"]
  2450. }),
  2451. $globals.ClassProtocolReader);
  2452. $core.addClass("ExportMethodProtocol", $globals.Object, ["name", "theClass"], "Platform-ImportExport");
  2453. //>>excludeStart("ide", pragmas.excludeIdeData);
  2454. $globals.ExportMethodProtocol.comment="I am an abstraction for a method protocol in a class / metaclass.\x0a\x0aI know of my class, name and methods.\x0aI am used when exporting a package.";
  2455. //>>excludeEnd("ide");
  2456. $core.addMethod(
  2457. $core.method({
  2458. selector: "methods",
  2459. protocol: "accessing",
  2460. fn: function (){
  2461. var self=this,$self=this;
  2462. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2463. return $core.withContext(function($ctx1) {
  2464. //>>excludeEnd("ctx");
  2465. var $1;
  2466. return $recv($recv($self._theClass())._methodsInProtocol_($self._name()))._sorted_((function(a,b){
  2467. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2468. return $core.withContext(function($ctx2) {
  2469. //>>excludeEnd("ctx");
  2470. $1=$recv(a)._selector();
  2471. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2472. $ctx2.sendIdx["selector"]=1;
  2473. //>>excludeEnd("ctx");
  2474. return $recv($1).__lt_eq($recv(b)._selector());
  2475. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2476. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,1)});
  2477. //>>excludeEnd("ctx");
  2478. }));
  2479. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2480. }, function($ctx1) {$ctx1.fill(self,"methods",{},$globals.ExportMethodProtocol)});
  2481. //>>excludeEnd("ctx");
  2482. },
  2483. //>>excludeStart("ide", pragmas.excludeIdeData);
  2484. args: [],
  2485. source: "methods\x0a\x09^ (self theClass methodsInProtocol: self name)\x0a\x09\x09sorted: [ :a :b | a selector <= b selector ]",
  2486. referencedClasses: [],
  2487. //>>excludeEnd("ide");
  2488. messageSends: ["sorted:", "methodsInProtocol:", "theClass", "name", "<=", "selector"]
  2489. }),
  2490. $globals.ExportMethodProtocol);
  2491. $core.addMethod(
  2492. $core.method({
  2493. selector: "name",
  2494. protocol: "accessing",
  2495. fn: function (){
  2496. var self=this,$self=this;
  2497. return $self["@name"];
  2498. },
  2499. //>>excludeStart("ide", pragmas.excludeIdeData);
  2500. args: [],
  2501. source: "name\x0a\x09^ name",
  2502. referencedClasses: [],
  2503. //>>excludeEnd("ide");
  2504. messageSends: []
  2505. }),
  2506. $globals.ExportMethodProtocol);
  2507. $core.addMethod(
  2508. $core.method({
  2509. selector: "name:",
  2510. protocol: "accessing",
  2511. fn: function (aString){
  2512. var self=this,$self=this;
  2513. $self["@name"]=aString;
  2514. return self;
  2515. },
  2516. //>>excludeStart("ide", pragmas.excludeIdeData);
  2517. args: ["aString"],
  2518. source: "name: aString\x0a\x09name := aString",
  2519. referencedClasses: [],
  2520. //>>excludeEnd("ide");
  2521. messageSends: []
  2522. }),
  2523. $globals.ExportMethodProtocol);
  2524. $core.addMethod(
  2525. $core.method({
  2526. selector: "ownMethods",
  2527. protocol: "accessing",
  2528. fn: function (){
  2529. var self=this,$self=this;
  2530. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2531. return $core.withContext(function($ctx1) {
  2532. //>>excludeEnd("ctx");
  2533. var $1;
  2534. return $recv($recv($self._theClass())._ownMethodsInProtocol_($self._name()))._sorted_((function(a,b){
  2535. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2536. return $core.withContext(function($ctx2) {
  2537. //>>excludeEnd("ctx");
  2538. $1=$recv(a)._selector();
  2539. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2540. $ctx2.sendIdx["selector"]=1;
  2541. //>>excludeEnd("ctx");
  2542. return $recv($1).__lt_eq($recv(b)._selector());
  2543. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2544. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,1)});
  2545. //>>excludeEnd("ctx");
  2546. }));
  2547. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2548. }, function($ctx1) {$ctx1.fill(self,"ownMethods",{},$globals.ExportMethodProtocol)});
  2549. //>>excludeEnd("ctx");
  2550. },
  2551. //>>excludeStart("ide", pragmas.excludeIdeData);
  2552. args: [],
  2553. source: "ownMethods\x0a\x09^ (self theClass ownMethodsInProtocol: self name)\x0a\x09\x09sorted: [ :a :b | a selector <= b selector ]",
  2554. referencedClasses: [],
  2555. //>>excludeEnd("ide");
  2556. messageSends: ["sorted:", "ownMethodsInProtocol:", "theClass", "name", "<=", "selector"]
  2557. }),
  2558. $globals.ExportMethodProtocol);
  2559. $core.addMethod(
  2560. $core.method({
  2561. selector: "theClass",
  2562. protocol: "accessing",
  2563. fn: function (){
  2564. var self=this,$self=this;
  2565. return $self["@theClass"];
  2566. },
  2567. //>>excludeStart("ide", pragmas.excludeIdeData);
  2568. args: [],
  2569. source: "theClass\x0a\x09^ theClass",
  2570. referencedClasses: [],
  2571. //>>excludeEnd("ide");
  2572. messageSends: []
  2573. }),
  2574. $globals.ExportMethodProtocol);
  2575. $core.addMethod(
  2576. $core.method({
  2577. selector: "theClass:",
  2578. protocol: "accessing",
  2579. fn: function (aClass){
  2580. var self=this,$self=this;
  2581. $self["@theClass"]=aClass;
  2582. return self;
  2583. },
  2584. //>>excludeStart("ide", pragmas.excludeIdeData);
  2585. args: ["aClass"],
  2586. source: "theClass: aClass\x0a\x09theClass := aClass",
  2587. referencedClasses: [],
  2588. //>>excludeEnd("ide");
  2589. messageSends: []
  2590. }),
  2591. $globals.ExportMethodProtocol);
  2592. $core.addMethod(
  2593. $core.method({
  2594. selector: "name:theClass:",
  2595. protocol: "instance creation",
  2596. fn: function (aString,aClass){
  2597. var self=this,$self=this;
  2598. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2599. return $core.withContext(function($ctx1) {
  2600. //>>excludeEnd("ctx");
  2601. var $1;
  2602. $1=$self._new();
  2603. $recv($1)._name_(aString);
  2604. $recv($1)._theClass_(aClass);
  2605. return $recv($1)._yourself();
  2606. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2607. }, function($ctx1) {$ctx1.fill(self,"name:theClass:",{aString:aString,aClass:aClass},$globals.ExportMethodProtocol.a$cls)});
  2608. //>>excludeEnd("ctx");
  2609. },
  2610. //>>excludeStart("ide", pragmas.excludeIdeData);
  2611. args: ["aString", "aClass"],
  2612. source: "name: aString theClass: aClass\x0a\x09^ self new\x0a\x09\x09name: aString;\x0a\x09\x09theClass: aClass;\x0a\x09\x09yourself",
  2613. referencedClasses: [],
  2614. //>>excludeEnd("ide");
  2615. messageSends: ["name:", "new", "theClass:", "yourself"]
  2616. }),
  2617. $globals.ExportMethodProtocol.a$cls);
  2618. $core.addClass("Importer", $globals.Object, ["lastSection", "lastChunk"], "Platform-ImportExport");
  2619. //>>excludeStart("ide", pragmas.excludeIdeData);
  2620. $globals.Importer.comment="I can import Amber code from a string in the chunk format.\x0a\x0a## API\x0a\x0a Importer new import: aString";
  2621. //>>excludeEnd("ide");
  2622. $core.addMethod(
  2623. $core.method({
  2624. selector: "import:",
  2625. protocol: "fileIn",
  2626. fn: function (aStream){
  2627. var self=this,$self=this;
  2628. var chunk,result,parser,lastEmpty;
  2629. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2630. return $core.withContext(function($ctx1) {
  2631. //>>excludeEnd("ctx");
  2632. var $1;
  2633. parser=$recv($globals.ChunkParser)._on_(aStream);
  2634. lastEmpty=false;
  2635. $self["@lastSection"]="n/a, not started";
  2636. $self["@lastChunk"]=nil;
  2637. $recv((function(){
  2638. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2639. return $core.withContext(function($ctx2) {
  2640. //>>excludeEnd("ctx");
  2641. $recv((function(){
  2642. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2643. return $core.withContext(function($ctx3) {
  2644. //>>excludeEnd("ctx");
  2645. chunk=$recv(parser)._nextChunk();
  2646. chunk;
  2647. return $recv(chunk)._isNil();
  2648. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2649. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  2650. //>>excludeEnd("ctx");
  2651. }))._whileFalse_((function(){
  2652. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2653. return $core.withContext(function($ctx3) {
  2654. //>>excludeEnd("ctx");
  2655. return $recv(chunk)._ifEmpty_ifNotEmpty_((function(){
  2656. lastEmpty=true;
  2657. return lastEmpty;
  2658. }),(function(){
  2659. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2660. return $core.withContext(function($ctx4) {
  2661. //>>excludeEnd("ctx");
  2662. $self["@lastSection"]=chunk;
  2663. $self["@lastSection"];
  2664. result=$recv($recv($globals.Compiler)._new())._evaluateExpression_(chunk);
  2665. result;
  2666. $1=lastEmpty;
  2667. if($core.assert($1)){
  2668. lastEmpty=false;
  2669. lastEmpty;
  2670. return $recv(result)._scanFrom_(parser);
  2671. }
  2672. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2673. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,5)});
  2674. //>>excludeEnd("ctx");
  2675. }));
  2676. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2677. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)});
  2678. //>>excludeEnd("ctx");
  2679. }));
  2680. $self["@lastSection"]="n/a, finished";
  2681. return $self["@lastSection"];
  2682. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2683. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2684. //>>excludeEnd("ctx");
  2685. }))._on_do_($globals.Error,(function(e){
  2686. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2687. return $core.withContext(function($ctx2) {
  2688. //>>excludeEnd("ctx");
  2689. $self["@lastChunk"]=$recv(parser)._last();
  2690. $self["@lastChunk"];
  2691. return $recv(e)._resignal();
  2692. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2693. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1,7)});
  2694. //>>excludeEnd("ctx");
  2695. }));
  2696. return self;
  2697. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2698. }, function($ctx1) {$ctx1.fill(self,"import:",{aStream:aStream,chunk:chunk,result:result,parser:parser,lastEmpty:lastEmpty},$globals.Importer)});
  2699. //>>excludeEnd("ctx");
  2700. },
  2701. //>>excludeStart("ide", pragmas.excludeIdeData);
  2702. args: ["aStream"],
  2703. source: "import: aStream\x0a\x09| chunk result parser lastEmpty |\x0a\x09parser := ChunkParser on: aStream.\x0a\x09lastEmpty := false.\x0a\x09lastSection := 'n/a, not started'.\x0a\x09lastChunk := nil.\x0a\x09[\x0a\x09[ chunk := parser nextChunk.\x0a\x09chunk isNil ] whileFalse: [\x0a\x09\x09chunk\x0a\x09\x09\x09ifEmpty: [ lastEmpty := true ]\x0a\x09\x09\x09ifNotEmpty: [\x0a\x09\x09\x09\x09lastSection := chunk.\x0a\x09\x09\x09\x09result := Compiler new evaluateExpression: chunk.\x0a\x09\x09\x09\x09lastEmpty\x0a\x09\x09\x09\x09\x09\x09ifTrue: [\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09lastEmpty := false.\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09result scanFrom: parser ]] ].\x0a\x09lastSection := 'n/a, finished'\x0a\x09] on: Error do: [:e | lastChunk := parser last. e resignal ].",
  2704. referencedClasses: ["ChunkParser", "Compiler", "Error"],
  2705. //>>excludeEnd("ide");
  2706. messageSends: ["on:", "on:do:", "whileFalse:", "nextChunk", "isNil", "ifEmpty:ifNotEmpty:", "evaluateExpression:", "new", "ifTrue:", "scanFrom:", "last", "resignal"]
  2707. }),
  2708. $globals.Importer);
  2709. $core.addMethod(
  2710. $core.method({
  2711. selector: "lastChunk",
  2712. protocol: "accessing",
  2713. fn: function (){
  2714. var self=this,$self=this;
  2715. return $self["@lastChunk"];
  2716. },
  2717. //>>excludeStart("ide", pragmas.excludeIdeData);
  2718. args: [],
  2719. source: "lastChunk\x0a\x09^ lastChunk",
  2720. referencedClasses: [],
  2721. //>>excludeEnd("ide");
  2722. messageSends: []
  2723. }),
  2724. $globals.Importer);
  2725. $core.addMethod(
  2726. $core.method({
  2727. selector: "lastSection",
  2728. protocol: "accessing",
  2729. fn: function (){
  2730. var self=this,$self=this;
  2731. return $self["@lastSection"];
  2732. },
  2733. //>>excludeStart("ide", pragmas.excludeIdeData);
  2734. args: [],
  2735. source: "lastSection\x0a\x09^ lastSection",
  2736. referencedClasses: [],
  2737. //>>excludeEnd("ide");
  2738. messageSends: []
  2739. }),
  2740. $globals.Importer);
  2741. $core.addClass("PackageCommitError", $globals.Error, [], "Platform-ImportExport");
  2742. //>>excludeStart("ide", pragmas.excludeIdeData);
  2743. $globals.PackageCommitError.comment="I get signaled when an attempt to commit a package has failed.";
  2744. //>>excludeEnd("ide");
  2745. $core.addClass("PackageHandler", $globals.Object, [], "Platform-ImportExport");
  2746. //>>excludeStart("ide", pragmas.excludeIdeData);
  2747. $globals.PackageHandler.comment="I am responsible for handling package loading and committing.\x0a\x0aI should not be used directly. Instead, use the corresponding `Package` methods.";
  2748. //>>excludeEnd("ide");
  2749. $core.addMethod(
  2750. $core.method({
  2751. selector: "ajaxPutAt:data:onSuccess:onError:",
  2752. protocol: "private",
  2753. fn: function (aURL,aString,aBlock,anotherBlock){
  2754. var self=this,$self=this;
  2755. var xhr;
  2756. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2757. return $core.withContext(function($ctx1) {
  2758. //>>excludeEnd("ctx");
  2759. var $1,$4,$3,$2;
  2760. xhr=$recv($globals.Platform)._newXhr();
  2761. $recv(xhr)._open_url_async_("PUT",aURL,true);
  2762. $recv(xhr)._onreadystatechange_((function(){
  2763. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2764. return $core.withContext(function($ctx2) {
  2765. //>>excludeEnd("ctx");
  2766. $1=$recv($recv(xhr)._readyState()).__eq((4));
  2767. if($core.assert($1)){
  2768. $4=$recv(xhr)._status();
  2769. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2770. $ctx2.sendIdx["status"]=1;
  2771. //>>excludeEnd("ctx");
  2772. $3=$recv($4).__gt_eq((200));
  2773. $2=$recv($3)._and_((function(){
  2774. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2775. return $core.withContext(function($ctx3) {
  2776. //>>excludeEnd("ctx");
  2777. return $recv($recv(xhr)._status()).__lt((300));
  2778. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2779. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)});
  2780. //>>excludeEnd("ctx");
  2781. }));
  2782. return $recv($2)._ifTrue_ifFalse_(aBlock,anotherBlock);
  2783. }
  2784. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2785. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2786. //>>excludeEnd("ctx");
  2787. }));
  2788. $recv(xhr)._send_(aString);
  2789. return self;
  2790. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2791. }, function($ctx1) {$ctx1.fill(self,"ajaxPutAt:data:onSuccess:onError:",{aURL:aURL,aString:aString,aBlock:aBlock,anotherBlock:anotherBlock,xhr:xhr},$globals.PackageHandler)});
  2792. //>>excludeEnd("ctx");
  2793. },
  2794. //>>excludeStart("ide", pragmas.excludeIdeData);
  2795. args: ["aURL", "aString", "aBlock", "anotherBlock"],
  2796. source: "ajaxPutAt: aURL data: aString onSuccess: aBlock onError: anotherBlock\x0a\x09| xhr |\x0a\x09xhr := Platform newXhr.\x0a\x09xhr open: 'PUT' url: aURL async: true.\x0a\x09xhr onreadystatechange: [\x0a\x09\x09xhr readyState = 4 ifTrue: [\x0a\x09\x09\x09(xhr status >= 200 and: [ xhr status < 300 ])\x0a\x09\x09\x09\x09ifTrue: aBlock\x0a\x09\x09\x09\x09ifFalse: anotherBlock ]].\x0a\x09xhr send: aString",
  2797. referencedClasses: ["Platform"],
  2798. //>>excludeEnd("ide");
  2799. messageSends: ["newXhr", "open:url:async:", "onreadystatechange:", "ifTrue:", "=", "readyState", "ifTrue:ifFalse:", "and:", ">=", "status", "<", "send:"]
  2800. }),
  2801. $globals.PackageHandler);
  2802. $core.addMethod(
  2803. $core.method({
  2804. selector: "chunkContentsFor:",
  2805. protocol: "accessing",
  2806. fn: function (aPackage){
  2807. var self=this,$self=this;
  2808. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2809. return $core.withContext(function($ctx1) {
  2810. //>>excludeEnd("ctx");
  2811. return $recv($globals.String)._streamContents_((function(str){
  2812. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2813. return $core.withContext(function($ctx2) {
  2814. //>>excludeEnd("ctx");
  2815. return $recv($self._chunkExporter())._exportPackage_on_(aPackage,str);
  2816. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2817. }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1,1)});
  2818. //>>excludeEnd("ctx");
  2819. }));
  2820. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2821. }, function($ctx1) {$ctx1.fill(self,"chunkContentsFor:",{aPackage:aPackage},$globals.PackageHandler)});
  2822. //>>excludeEnd("ctx");
  2823. },
  2824. //>>excludeStart("ide", pragmas.excludeIdeData);
  2825. args: ["aPackage"],
  2826. source: "chunkContentsFor: aPackage\x0a\x09^ String streamContents: [ :str |\x0a\x09\x09self chunkExporter exportPackage: aPackage on: str ]",
  2827. referencedClasses: ["String"],
  2828. //>>excludeEnd("ide");
  2829. messageSends: ["streamContents:", "exportPackage:on:", "chunkExporter"]
  2830. }),
  2831. $globals.PackageHandler);
  2832. $core.addMethod(
  2833. $core.method({
  2834. selector: "chunkExporter",
  2835. protocol: "factory",
  2836. fn: function (){
  2837. var self=this,$self=this;
  2838. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2839. return $core.withContext(function($ctx1) {
  2840. //>>excludeEnd("ctx");
  2841. return $recv($self._chunkExporterClass())._new();
  2842. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2843. }, function($ctx1) {$ctx1.fill(self,"chunkExporter",{},$globals.PackageHandler)});
  2844. //>>excludeEnd("ctx");
  2845. },
  2846. //>>excludeStart("ide", pragmas.excludeIdeData);
  2847. args: [],
  2848. source: "chunkExporter\x0a\x09^ self chunkExporterClass new",
  2849. referencedClasses: [],
  2850. //>>excludeEnd("ide");
  2851. messageSends: ["new", "chunkExporterClass"]
  2852. }),
  2853. $globals.PackageHandler);
  2854. $core.addMethod(
  2855. $core.method({
  2856. selector: "chunkExporterClass",
  2857. protocol: "accessing",
  2858. fn: function (){
  2859. var self=this,$self=this;
  2860. return $globals.ChunkExporter;
  2861. },
  2862. //>>excludeStart("ide", pragmas.excludeIdeData);
  2863. args: [],
  2864. source: "chunkExporterClass\x0a\x09^ ChunkExporter",
  2865. referencedClasses: ["ChunkExporter"],
  2866. //>>excludeEnd("ide");
  2867. messageSends: []
  2868. }),
  2869. $globals.PackageHandler);
  2870. $core.addMethod(
  2871. $core.method({
  2872. selector: "commit:",
  2873. protocol: "committing",
  2874. fn: function (aPackage){
  2875. var self=this,$self=this;
  2876. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2877. return $core.withContext(function($ctx1) {
  2878. //>>excludeEnd("ctx");
  2879. var $1,$2;
  2880. $self._commit_onSuccess_onError_(aPackage,(function(){
  2881. }),(function(error){
  2882. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2883. return $core.withContext(function($ctx2) {
  2884. //>>excludeEnd("ctx");
  2885. $1=$recv($globals.PackageCommitError)._new();
  2886. $2=$recv("Commiting failed with reason: \x22".__comma($recv(error)._responseText())).__comma("\x22");
  2887. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2888. $ctx2.sendIdx[","]=1;
  2889. //>>excludeEnd("ctx");
  2890. $recv($1)._messageText_($2);
  2891. return $recv($1)._signal();
  2892. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2893. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1,2)});
  2894. //>>excludeEnd("ctx");
  2895. }));
  2896. return self;
  2897. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2898. }, function($ctx1) {$ctx1.fill(self,"commit:",{aPackage:aPackage},$globals.PackageHandler)});
  2899. //>>excludeEnd("ctx");
  2900. },
  2901. //>>excludeStart("ide", pragmas.excludeIdeData);
  2902. args: ["aPackage"],
  2903. source: "commit: aPackage\x0a\x09self \x0a\x09\x09commit: aPackage\x0a\x09\x09onSuccess: []\x0a\x09\x09onError: [ :error |\x0a\x09\x09\x09PackageCommitError new\x0a\x09\x09\x09\x09messageText: 'Commiting failed with reason: \x22' , (error responseText) , '\x22';\x0a\x09\x09\x09\x09signal ]",
  2904. referencedClasses: ["PackageCommitError"],
  2905. //>>excludeEnd("ide");
  2906. messageSends: ["commit:onSuccess:onError:", "messageText:", "new", ",", "responseText", "signal"]
  2907. }),
  2908. $globals.PackageHandler);
  2909. $core.addMethod(
  2910. $core.method({
  2911. selector: "commit:onSuccess:onError:",
  2912. protocol: "committing",
  2913. fn: function (aPackage,aBlock,anotherBlock){
  2914. var self=this,$self=this;
  2915. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2916. return $core.withContext(function($ctx1) {
  2917. //>>excludeEnd("ctx");
  2918. $self._commitJsFileFor_onSuccess_onError_(aPackage,(function(){
  2919. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2920. return $core.withContext(function($ctx2) {
  2921. //>>excludeEnd("ctx");
  2922. return $self._commitStFileFor_onSuccess_onError_(aPackage,(function(){
  2923. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2924. return $core.withContext(function($ctx3) {
  2925. //>>excludeEnd("ctx");
  2926. $recv(aPackage)._beClean();
  2927. return $recv(aBlock)._value();
  2928. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2929. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  2930. //>>excludeEnd("ctx");
  2931. }),anotherBlock);
  2932. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2933. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2934. //>>excludeEnd("ctx");
  2935. }),anotherBlock);
  2936. return self;
  2937. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2938. }, function($ctx1) {$ctx1.fill(self,"commit:onSuccess:onError:",{aPackage:aPackage,aBlock:aBlock,anotherBlock:anotherBlock},$globals.PackageHandler)});
  2939. //>>excludeEnd("ctx");
  2940. },
  2941. //>>excludeStart("ide", pragmas.excludeIdeData);
  2942. args: ["aPackage", "aBlock", "anotherBlock"],
  2943. source: "commit: aPackage onSuccess: aBlock onError: anotherBlock\x0a\x09self \x0a\x09\x09commitJsFileFor: aPackage \x0a\x09\x09onSuccess: [\x0a\x09\x09\x09self \x0a\x09\x09\x09\x09commitStFileFor: aPackage \x0a\x09\x09\x09\x09onSuccess: [ aPackage beClean. aBlock value ]\x0a\x09\x09\x09\x09onError: anotherBlock ] \x0a\x09\x09onError: anotherBlock",
  2944. referencedClasses: [],
  2945. //>>excludeEnd("ide");
  2946. messageSends: ["commitJsFileFor:onSuccess:onError:", "commitStFileFor:onSuccess:onError:", "beClean", "value"]
  2947. }),
  2948. $globals.PackageHandler);
  2949. $core.addMethod(
  2950. $core.method({
  2951. selector: "commitJsFileFor:onSuccess:onError:",
  2952. protocol: "committing",
  2953. fn: function (aPackage,aBlock,anotherBlock){
  2954. var self=this,$self=this;
  2955. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2956. return $core.withContext(function($ctx1) {
  2957. //>>excludeEnd("ctx");
  2958. var $2,$1;
  2959. $2=$recv($recv($self._commitPathJsFor_(aPackage)).__comma("/")).__comma($recv(aPackage)._name());
  2960. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2961. $ctx1.sendIdx[","]=2;
  2962. //>>excludeEnd("ctx");
  2963. $1=$recv($2).__comma(".js");
  2964. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2965. $ctx1.sendIdx[","]=1;
  2966. //>>excludeEnd("ctx");
  2967. $self._ajaxPutAt_data_onSuccess_onError_($1,$self._contentsFor_(aPackage),aBlock,anotherBlock);
  2968. return self;
  2969. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2970. }, function($ctx1) {$ctx1.fill(self,"commitJsFileFor:onSuccess:onError:",{aPackage:aPackage,aBlock:aBlock,anotherBlock:anotherBlock},$globals.PackageHandler)});
  2971. //>>excludeEnd("ctx");
  2972. },
  2973. //>>excludeStart("ide", pragmas.excludeIdeData);
  2974. args: ["aPackage", "aBlock", "anotherBlock"],
  2975. source: "commitJsFileFor: aPackage onSuccess: aBlock onError: anotherBlock\x0a\x09self \x0a\x09\x09ajaxPutAt: (self commitPathJsFor: aPackage), '/', aPackage name, '.js'\x0a\x09\x09data: (self contentsFor: aPackage)\x0a\x09\x09onSuccess: aBlock\x0a\x09\x09onError: anotherBlock",
  2976. referencedClasses: [],
  2977. //>>excludeEnd("ide");
  2978. messageSends: ["ajaxPutAt:data:onSuccess:onError:", ",", "commitPathJsFor:", "name", "contentsFor:"]
  2979. }),
  2980. $globals.PackageHandler);
  2981. $core.addMethod(
  2982. $core.method({
  2983. selector: "commitPathJsFor:",
  2984. protocol: "accessing",
  2985. fn: function (aPackage){
  2986. var self=this,$self=this;
  2987. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2988. return $core.withContext(function($ctx1) {
  2989. //>>excludeEnd("ctx");
  2990. $self._subclassResponsibility();
  2991. return self;
  2992. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2993. }, function($ctx1) {$ctx1.fill(self,"commitPathJsFor:",{aPackage:aPackage},$globals.PackageHandler)});
  2994. //>>excludeEnd("ctx");
  2995. },
  2996. //>>excludeStart("ide", pragmas.excludeIdeData);
  2997. args: ["aPackage"],
  2998. source: "commitPathJsFor: aPackage\x0a\x09self subclassResponsibility",
  2999. referencedClasses: [],
  3000. //>>excludeEnd("ide");
  3001. messageSends: ["subclassResponsibility"]
  3002. }),
  3003. $globals.PackageHandler);
  3004. $core.addMethod(
  3005. $core.method({
  3006. selector: "commitPathStFor:",
  3007. protocol: "accessing",
  3008. fn: function (aPackage){
  3009. var self=this,$self=this;
  3010. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3011. return $core.withContext(function($ctx1) {
  3012. //>>excludeEnd("ctx");
  3013. $self._subclassResponsibility();
  3014. return self;
  3015. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3016. }, function($ctx1) {$ctx1.fill(self,"commitPathStFor:",{aPackage:aPackage},$globals.PackageHandler)});
  3017. //>>excludeEnd("ctx");
  3018. },
  3019. //>>excludeStart("ide", pragmas.excludeIdeData);
  3020. args: ["aPackage"],
  3021. source: "commitPathStFor: aPackage\x0a\x09self subclassResponsibility",
  3022. referencedClasses: [],
  3023. //>>excludeEnd("ide");
  3024. messageSends: ["subclassResponsibility"]
  3025. }),
  3026. $globals.PackageHandler);
  3027. $core.addMethod(
  3028. $core.method({
  3029. selector: "commitStFileFor:onSuccess:onError:",
  3030. protocol: "committing",
  3031. fn: function (aPackage,aBlock,anotherBlock){
  3032. var self=this,$self=this;
  3033. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3034. return $core.withContext(function($ctx1) {
  3035. //>>excludeEnd("ctx");
  3036. var $2,$1;
  3037. $2=$recv($recv($self._commitPathStFor_(aPackage)).__comma("/")).__comma($recv(aPackage)._name());
  3038. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3039. $ctx1.sendIdx[","]=2;
  3040. //>>excludeEnd("ctx");
  3041. $1=$recv($2).__comma(".st");
  3042. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3043. $ctx1.sendIdx[","]=1;
  3044. //>>excludeEnd("ctx");
  3045. $self._ajaxPutAt_data_onSuccess_onError_($1,$self._chunkContentsFor_(aPackage),aBlock,anotherBlock);
  3046. return self;
  3047. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3048. }, function($ctx1) {$ctx1.fill(self,"commitStFileFor:onSuccess:onError:",{aPackage:aPackage,aBlock:aBlock,anotherBlock:anotherBlock},$globals.PackageHandler)});
  3049. //>>excludeEnd("ctx");
  3050. },
  3051. //>>excludeStart("ide", pragmas.excludeIdeData);
  3052. args: ["aPackage", "aBlock", "anotherBlock"],
  3053. source: "commitStFileFor: aPackage onSuccess: aBlock onError: anotherBlock\x0a\x09self \x0a\x09\x09ajaxPutAt: (self commitPathStFor: aPackage), '/', aPackage name, '.st'\x0a\x09\x09data: (self chunkContentsFor: aPackage)\x0a\x09\x09onSuccess: aBlock\x0a\x09\x09onError: anotherBlock",
  3054. referencedClasses: [],
  3055. //>>excludeEnd("ide");
  3056. messageSends: ["ajaxPutAt:data:onSuccess:onError:", ",", "commitPathStFor:", "name", "chunkContentsFor:"]
  3057. }),
  3058. $globals.PackageHandler);
  3059. $core.addMethod(
  3060. $core.method({
  3061. selector: "contentsFor:",
  3062. protocol: "accessing",
  3063. fn: function (aPackage){
  3064. var self=this,$self=this;
  3065. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3066. return $core.withContext(function($ctx1) {
  3067. //>>excludeEnd("ctx");
  3068. return $recv($globals.String)._streamContents_((function(str){
  3069. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3070. return $core.withContext(function($ctx2) {
  3071. //>>excludeEnd("ctx");
  3072. return $recv($self._exporter())._exportPackage_on_(aPackage,str);
  3073. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3074. }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1,1)});
  3075. //>>excludeEnd("ctx");
  3076. }));
  3077. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3078. }, function($ctx1) {$ctx1.fill(self,"contentsFor:",{aPackage:aPackage},$globals.PackageHandler)});
  3079. //>>excludeEnd("ctx");
  3080. },
  3081. //>>excludeStart("ide", pragmas.excludeIdeData);
  3082. args: ["aPackage"],
  3083. source: "contentsFor: aPackage\x0a\x09^ String streamContents: [ :str |\x0a\x09\x09self exporter exportPackage: aPackage on: str ]",
  3084. referencedClasses: ["String"],
  3085. //>>excludeEnd("ide");
  3086. messageSends: ["streamContents:", "exportPackage:on:", "exporter"]
  3087. }),
  3088. $globals.PackageHandler);
  3089. $core.addMethod(
  3090. $core.method({
  3091. selector: "exporter",
  3092. protocol: "factory",
  3093. fn: function (){
  3094. var self=this,$self=this;
  3095. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3096. return $core.withContext(function($ctx1) {
  3097. //>>excludeEnd("ctx");
  3098. return $recv($self._exporterClass())._new();
  3099. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3100. }, function($ctx1) {$ctx1.fill(self,"exporter",{},$globals.PackageHandler)});
  3101. //>>excludeEnd("ctx");
  3102. },
  3103. //>>excludeStart("ide", pragmas.excludeIdeData);
  3104. args: [],
  3105. source: "exporter\x0a\x09^ self exporterClass new",
  3106. referencedClasses: [],
  3107. //>>excludeEnd("ide");
  3108. messageSends: ["new", "exporterClass"]
  3109. }),
  3110. $globals.PackageHandler);
  3111. $core.addMethod(
  3112. $core.method({
  3113. selector: "exporterClass",
  3114. protocol: "accessing",
  3115. fn: function (){
  3116. var self=this,$self=this;
  3117. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3118. return $core.withContext(function($ctx1) {
  3119. //>>excludeEnd("ctx");
  3120. $self._subclassResponsibility();
  3121. return self;
  3122. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3123. }, function($ctx1) {$ctx1.fill(self,"exporterClass",{},$globals.PackageHandler)});
  3124. //>>excludeEnd("ctx");
  3125. },
  3126. //>>excludeStart("ide", pragmas.excludeIdeData);
  3127. args: [],
  3128. source: "exporterClass\x0a\x09self subclassResponsibility",
  3129. referencedClasses: [],
  3130. //>>excludeEnd("ide");
  3131. messageSends: ["subclassResponsibility"]
  3132. }),
  3133. $globals.PackageHandler);
  3134. $core.addMethod(
  3135. $core.method({
  3136. selector: "load:",
  3137. protocol: "loading",
  3138. fn: function (aPackage){
  3139. var self=this,$self=this;
  3140. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3141. return $core.withContext(function($ctx1) {
  3142. //>>excludeEnd("ctx");
  3143. $self._subclassResponsibility();
  3144. return self;
  3145. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3146. }, function($ctx1) {$ctx1.fill(self,"load:",{aPackage:aPackage},$globals.PackageHandler)});
  3147. //>>excludeEnd("ctx");
  3148. },
  3149. //>>excludeStart("ide", pragmas.excludeIdeData);
  3150. args: ["aPackage"],
  3151. source: "load: aPackage\x0a\x09self subclassResponsibility",
  3152. referencedClasses: [],
  3153. //>>excludeEnd("ide");
  3154. messageSends: ["subclassResponsibility"]
  3155. }),
  3156. $globals.PackageHandler);
  3157. $core.addMethod(
  3158. $core.method({
  3159. selector: "onCommitError:",
  3160. protocol: "error handling",
  3161. fn: function (anError){
  3162. var self=this,$self=this;
  3163. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3164. return $core.withContext(function($ctx1) {
  3165. //>>excludeEnd("ctx");
  3166. var $1,$2;
  3167. $1=$recv($globals.PackageCommitError)._new();
  3168. $2=$recv("Commiting failed with reason: \x22".__comma($recv(anError)._responseText())).__comma("\x22");
  3169. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3170. $ctx1.sendIdx[","]=1;
  3171. //>>excludeEnd("ctx");
  3172. $recv($1)._messageText_($2);
  3173. $recv($1)._signal();
  3174. return self;
  3175. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3176. }, function($ctx1) {$ctx1.fill(self,"onCommitError:",{anError:anError},$globals.PackageHandler)});
  3177. //>>excludeEnd("ctx");
  3178. },
  3179. //>>excludeStart("ide", pragmas.excludeIdeData);
  3180. args: ["anError"],
  3181. source: "onCommitError: anError\x0a\x09PackageCommitError new\x0a\x09\x09messageText: 'Commiting failed with reason: \x22' , (anError responseText) , '\x22';\x0a\x09\x09signal",
  3182. referencedClasses: ["PackageCommitError"],
  3183. //>>excludeEnd("ide");
  3184. messageSends: ["messageText:", "new", ",", "responseText", "signal"]
  3185. }),
  3186. $globals.PackageHandler);
  3187. $core.addClass("AmdPackageHandler", $globals.PackageHandler, [], "Platform-ImportExport");
  3188. //>>excludeStart("ide", pragmas.excludeIdeData);
  3189. $globals.AmdPackageHandler.comment="I am responsible for handling package loading and committing.\x0a\x0aI should not be used directly. Instead, use the corresponding `Package` methods.";
  3190. //>>excludeEnd("ide");
  3191. $core.addMethod(
  3192. $core.method({
  3193. selector: "commitPathJsFor:",
  3194. protocol: "accessing",
  3195. fn: function (aPackage){
  3196. var self=this,$self=this;
  3197. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3198. return $core.withContext(function($ctx1) {
  3199. //>>excludeEnd("ctx");
  3200. return $self._toUrl_($self._namespaceFor_(aPackage));
  3201. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3202. }, function($ctx1) {$ctx1.fill(self,"commitPathJsFor:",{aPackage:aPackage},$globals.AmdPackageHandler)});
  3203. //>>excludeEnd("ctx");
  3204. },
  3205. //>>excludeStart("ide", pragmas.excludeIdeData);
  3206. args: ["aPackage"],
  3207. source: "commitPathJsFor: aPackage\x0a\x09^ self toUrl: (self namespaceFor: aPackage)",
  3208. referencedClasses: [],
  3209. //>>excludeEnd("ide");
  3210. messageSends: ["toUrl:", "namespaceFor:"]
  3211. }),
  3212. $globals.AmdPackageHandler);
  3213. $core.addMethod(
  3214. $core.method({
  3215. selector: "commitPathStFor:",
  3216. protocol: "accessing",
  3217. fn: function (aPackage){
  3218. var self=this,$self=this;
  3219. var path,pathWithout;
  3220. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3221. return $core.withContext(function($ctx1) {
  3222. //>>excludeEnd("ctx");
  3223. var $1,$2;
  3224. $1=$recv($self._namespaceFor_(aPackage)).__comma("/_source");
  3225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3226. $ctx1.sendIdx[","]=1;
  3227. //>>excludeEnd("ctx");
  3228. path=$self._toUrl_($1);
  3229. pathWithout=$self._commitPathJsFor_(aPackage);
  3230. $2=$recv(path).__eq($recv(pathWithout).__comma("/_source"));
  3231. if($core.assert($2)){
  3232. return pathWithout;
  3233. } else {
  3234. return path;
  3235. }
  3236. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3237. }, function($ctx1) {$ctx1.fill(self,"commitPathStFor:",{aPackage:aPackage,path:path,pathWithout:pathWithout},$globals.AmdPackageHandler)});
  3238. //>>excludeEnd("ctx");
  3239. },
  3240. //>>excludeStart("ide", pragmas.excludeIdeData);
  3241. args: ["aPackage"],
  3242. source: "commitPathStFor: aPackage\x0a\x09\x22If _source is not mapped, .st will be committed to .js path.\x0a\x09It is recommended not to use _source as it can be deprecated.\x22\x0a\x09\x0a\x09| path pathWithout |\x0a\x09path := self toUrl: (self namespaceFor: aPackage), '/_source'.\x0a\x09pathWithout := self commitPathJsFor: aPackage.\x0a\x09^ path = (pathWithout, '/_source') ifTrue: [ pathWithout ] ifFalse: [ path ]",
  3243. referencedClasses: [],
  3244. //>>excludeEnd("ide");
  3245. messageSends: ["toUrl:", ",", "namespaceFor:", "commitPathJsFor:", "ifTrue:ifFalse:", "="]
  3246. }),
  3247. $globals.AmdPackageHandler);
  3248. $core.addMethod(
  3249. $core.method({
  3250. selector: "exporterClass",
  3251. protocol: "accessing",
  3252. fn: function (){
  3253. var self=this,$self=this;
  3254. return $globals.AmdExporter;
  3255. },
  3256. //>>excludeStart("ide", pragmas.excludeIdeData);
  3257. args: [],
  3258. source: "exporterClass\x0a\x09^ AmdExporter",
  3259. referencedClasses: ["AmdExporter"],
  3260. //>>excludeEnd("ide");
  3261. messageSends: []
  3262. }),
  3263. $globals.AmdPackageHandler);
  3264. $core.addMethod(
  3265. $core.method({
  3266. selector: "load:",
  3267. protocol: "loading",
  3268. fn: function (aPackage){
  3269. var self=this,$self=this;
  3270. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3271. return $core.withContext(function($ctx1) {
  3272. //>>excludeEnd("ctx");
  3273. var $1,$3,$2,$receiver;
  3274. $1=$recv($globals.Smalltalk)._amdRequire();
  3275. if(($receiver = $1) == null || $receiver.a$nil){
  3276. $self._error_("AMD loader not present");
  3277. } else {
  3278. var require;
  3279. require=$receiver;
  3280. $3=$recv($recv($self._namespaceFor_(aPackage)).__comma("/")).__comma($recv(aPackage)._name());
  3281. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3282. $ctx1.sendIdx[","]=1;
  3283. //>>excludeEnd("ctx");
  3284. $2=$recv($globals.Array)._with_($3);
  3285. $recv(require)._value_($2);
  3286. }
  3287. return self;
  3288. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3289. }, function($ctx1) {$ctx1.fill(self,"load:",{aPackage:aPackage},$globals.AmdPackageHandler)});
  3290. //>>excludeEnd("ctx");
  3291. },
  3292. //>>excludeStart("ide", pragmas.excludeIdeData);
  3293. args: ["aPackage"],
  3294. source: "load: aPackage\x0a\x09Smalltalk amdRequire\x0a\x09\x09ifNil: [ self error: 'AMD loader not present' ]\x0a\x09\x09ifNotNil: [ :require |\x0a\x09\x09\x09require value: (Array with: (self namespaceFor: aPackage), '/', aPackage name ) ]",
  3295. referencedClasses: ["Smalltalk", "Array"],
  3296. //>>excludeEnd("ide");
  3297. messageSends: ["ifNil:ifNotNil:", "amdRequire", "error:", "value:", "with:", ",", "namespaceFor:", "name"]
  3298. }),
  3299. $globals.AmdPackageHandler);
  3300. $core.addMethod(
  3301. $core.method({
  3302. selector: "namespaceFor:",
  3303. protocol: "committing",
  3304. fn: function (aPackage){
  3305. var self=this,$self=this;
  3306. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3307. return $core.withContext(function($ctx1) {
  3308. //>>excludeEnd("ctx");
  3309. return $recv($recv(aPackage)._transport())._namespace();
  3310. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3311. }, function($ctx1) {$ctx1.fill(self,"namespaceFor:",{aPackage:aPackage},$globals.AmdPackageHandler)});
  3312. //>>excludeEnd("ctx");
  3313. },
  3314. //>>excludeStart("ide", pragmas.excludeIdeData);
  3315. args: ["aPackage"],
  3316. source: "namespaceFor: aPackage\x0a\x09^ aPackage transport namespace",
  3317. referencedClasses: [],
  3318. //>>excludeEnd("ide");
  3319. messageSends: ["namespace", "transport"]
  3320. }),
  3321. $globals.AmdPackageHandler);
  3322. $core.addMethod(
  3323. $core.method({
  3324. selector: "toUrl:",
  3325. protocol: "private",
  3326. fn: function (aString){
  3327. var self=this,$self=this;
  3328. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3329. return $core.withContext(function($ctx1) {
  3330. //>>excludeEnd("ctx");
  3331. var $1,$receiver;
  3332. $1=$recv($globals.Smalltalk)._amdRequire();
  3333. if(($receiver = $1) == null || $receiver.a$nil){
  3334. return $self._error_("AMD loader not present");
  3335. } else {
  3336. var require;
  3337. require=$receiver;
  3338. return $recv($recv(require)._basicAt_("toUrl"))._value_(aString);
  3339. }
  3340. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3341. }, function($ctx1) {$ctx1.fill(self,"toUrl:",{aString:aString},$globals.AmdPackageHandler)});
  3342. //>>excludeEnd("ctx");
  3343. },
  3344. //>>excludeStart("ide", pragmas.excludeIdeData);
  3345. args: ["aString"],
  3346. source: "toUrl: aString\x0a\x09^ Smalltalk amdRequire\x0a\x09\x09ifNil: [ self error: 'AMD loader not present' ]\x0a\x09\x09ifNotNil: [ :require | (require basicAt: 'toUrl') value: aString ]",
  3347. referencedClasses: ["Smalltalk"],
  3348. //>>excludeEnd("ide");
  3349. messageSends: ["ifNil:ifNotNil:", "amdRequire", "error:", "value:", "basicAt:"]
  3350. }),
  3351. $globals.AmdPackageHandler);
  3352. $core.addMethod(
  3353. $core.method({
  3354. selector: "defaultNamespace",
  3355. protocol: "commit paths",
  3356. fn: function (){
  3357. var self=this,$self=this;
  3358. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3359. return $core.withContext(function($ctx1) {
  3360. //>>excludeEnd("ctx");
  3361. return $recv($globals.Smalltalk)._defaultAmdNamespace();
  3362. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3363. }, function($ctx1) {$ctx1.fill(self,"defaultNamespace",{},$globals.AmdPackageHandler.a$cls)});
  3364. //>>excludeEnd("ctx");
  3365. },
  3366. //>>excludeStart("ide", pragmas.excludeIdeData);
  3367. args: [],
  3368. source: "defaultNamespace\x0a\x09^ Smalltalk defaultAmdNamespace",
  3369. referencedClasses: ["Smalltalk"],
  3370. //>>excludeEnd("ide");
  3371. messageSends: ["defaultAmdNamespace"]
  3372. }),
  3373. $globals.AmdPackageHandler.a$cls);
  3374. $core.addMethod(
  3375. $core.method({
  3376. selector: "defaultNamespace:",
  3377. protocol: "commit paths",
  3378. fn: function (aString){
  3379. var self=this,$self=this;
  3380. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3381. return $core.withContext(function($ctx1) {
  3382. //>>excludeEnd("ctx");
  3383. $recv($globals.Smalltalk)._defaultAmdNamespace_(aString);
  3384. return self;
  3385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3386. }, function($ctx1) {$ctx1.fill(self,"defaultNamespace:",{aString:aString},$globals.AmdPackageHandler.a$cls)});
  3387. //>>excludeEnd("ctx");
  3388. },
  3389. //>>excludeStart("ide", pragmas.excludeIdeData);
  3390. args: ["aString"],
  3391. source: "defaultNamespace: aString\x0a\x09Smalltalk defaultAmdNamespace: aString",
  3392. referencedClasses: ["Smalltalk"],
  3393. //>>excludeEnd("ide");
  3394. messageSends: ["defaultAmdNamespace:"]
  3395. }),
  3396. $globals.AmdPackageHandler.a$cls);
  3397. $core.addClass("PackageTransport", $globals.Object, ["package"], "Platform-ImportExport");
  3398. //>>excludeStart("ide", pragmas.excludeIdeData);
  3399. $globals.PackageTransport.comment="I represent the transport mechanism used to commit a package.\x0a\x0aMy concrete subclasses have a `#handler` to which committing is delegated.";
  3400. //>>excludeEnd("ide");
  3401. $core.addMethod(
  3402. $core.method({
  3403. selector: "asJavaScriptObject",
  3404. protocol: "converting",
  3405. fn: function (){
  3406. var self=this,$self=this;
  3407. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3408. return $core.withContext(function($ctx1) {
  3409. //>>excludeEnd("ctx");
  3410. return $globals.HashedCollection._newFromPairs_(["type",$self._type()]);
  3411. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3412. }, function($ctx1) {$ctx1.fill(self,"asJavaScriptObject",{},$globals.PackageTransport)});
  3413. //>>excludeEnd("ctx");
  3414. },
  3415. //>>excludeStart("ide", pragmas.excludeIdeData);
  3416. args: [],
  3417. source: "asJavaScriptObject\x0a\x09^ #{ 'type' -> self type }",
  3418. referencedClasses: [],
  3419. //>>excludeEnd("ide");
  3420. messageSends: ["type"]
  3421. }),
  3422. $globals.PackageTransport);
  3423. $core.addMethod(
  3424. $core.method({
  3425. selector: "commit",
  3426. protocol: "committing",
  3427. fn: function (){
  3428. var self=this,$self=this;
  3429. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3430. return $core.withContext(function($ctx1) {
  3431. //>>excludeEnd("ctx");
  3432. $recv($self._commitHandler())._commit_($self._package());
  3433. return self;
  3434. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3435. }, function($ctx1) {$ctx1.fill(self,"commit",{},$globals.PackageTransport)});
  3436. //>>excludeEnd("ctx");
  3437. },
  3438. //>>excludeStart("ide", pragmas.excludeIdeData);
  3439. args: [],
  3440. source: "commit\x0a\x09self commitHandler commit: self package",
  3441. referencedClasses: [],
  3442. //>>excludeEnd("ide");
  3443. messageSends: ["commit:", "commitHandler", "package"]
  3444. }),
  3445. $globals.PackageTransport);
  3446. $core.addMethod(
  3447. $core.method({
  3448. selector: "commitHandler",
  3449. protocol: "factory",
  3450. fn: function (){
  3451. var self=this,$self=this;
  3452. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3453. return $core.withContext(function($ctx1) {
  3454. //>>excludeEnd("ctx");
  3455. return $recv($self._commitHandlerClass())._new();
  3456. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3457. }, function($ctx1) {$ctx1.fill(self,"commitHandler",{},$globals.PackageTransport)});
  3458. //>>excludeEnd("ctx");
  3459. },
  3460. //>>excludeStart("ide", pragmas.excludeIdeData);
  3461. args: [],
  3462. source: "commitHandler\x0a\x09^ self commitHandlerClass new",
  3463. referencedClasses: [],
  3464. //>>excludeEnd("ide");
  3465. messageSends: ["new", "commitHandlerClass"]
  3466. }),
  3467. $globals.PackageTransport);
  3468. $core.addMethod(
  3469. $core.method({
  3470. selector: "commitHandlerClass",
  3471. protocol: "accessing",
  3472. fn: function (){
  3473. var self=this,$self=this;
  3474. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3475. return $core.withContext(function($ctx1) {
  3476. //>>excludeEnd("ctx");
  3477. $self._subclassResponsibility();
  3478. return self;
  3479. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3480. }, function($ctx1) {$ctx1.fill(self,"commitHandlerClass",{},$globals.PackageTransport)});
  3481. //>>excludeEnd("ctx");
  3482. },
  3483. //>>excludeStart("ide", pragmas.excludeIdeData);
  3484. args: [],
  3485. source: "commitHandlerClass\x0a\x09self subclassResponsibility",
  3486. referencedClasses: [],
  3487. //>>excludeEnd("ide");
  3488. messageSends: ["subclassResponsibility"]
  3489. }),
  3490. $globals.PackageTransport);
  3491. $core.addMethod(
  3492. $core.method({
  3493. selector: "commitOnSuccess:onError:",
  3494. protocol: "committing",
  3495. fn: function (aBlock,anotherBlock){
  3496. var self=this,$self=this;
  3497. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3498. return $core.withContext(function($ctx1) {
  3499. //>>excludeEnd("ctx");
  3500. $recv($self._commitHandler())._commit_onSuccess_onError_($self._package(),aBlock,anotherBlock);
  3501. return self;
  3502. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3503. }, function($ctx1) {$ctx1.fill(self,"commitOnSuccess:onError:",{aBlock:aBlock,anotherBlock:anotherBlock},$globals.PackageTransport)});
  3504. //>>excludeEnd("ctx");
  3505. },
  3506. //>>excludeStart("ide", pragmas.excludeIdeData);
  3507. args: ["aBlock", "anotherBlock"],
  3508. source: "commitOnSuccess: aBlock onError: anotherBlock\x0a\x09self commitHandler \x0a\x09\x09commit: self package\x0a\x09\x09onSuccess: aBlock\x0a\x09\x09onError: anotherBlock",
  3509. referencedClasses: [],
  3510. //>>excludeEnd("ide");
  3511. messageSends: ["commit:onSuccess:onError:", "commitHandler", "package"]
  3512. }),
  3513. $globals.PackageTransport);
  3514. $core.addMethod(
  3515. $core.method({
  3516. selector: "definition",
  3517. protocol: "accessing",
  3518. fn: function (){
  3519. var self=this,$self=this;
  3520. return "";
  3521. },
  3522. //>>excludeStart("ide", pragmas.excludeIdeData);
  3523. args: [],
  3524. source: "definition\x0a\x09^ ''",
  3525. referencedClasses: [],
  3526. //>>excludeEnd("ide");
  3527. messageSends: []
  3528. }),
  3529. $globals.PackageTransport);
  3530. $core.addMethod(
  3531. $core.method({
  3532. selector: "load",
  3533. protocol: "loading",
  3534. fn: function (){
  3535. var self=this,$self=this;
  3536. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3537. return $core.withContext(function($ctx1) {
  3538. //>>excludeEnd("ctx");
  3539. $recv($self._commitHandler())._load_($self._package());
  3540. return self;
  3541. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3542. }, function($ctx1) {$ctx1.fill(self,"load",{},$globals.PackageTransport)});
  3543. //>>excludeEnd("ctx");
  3544. },
  3545. //>>excludeStart("ide", pragmas.excludeIdeData);
  3546. args: [],
  3547. source: "load\x0a\x09self commitHandler load: self package",
  3548. referencedClasses: [],
  3549. //>>excludeEnd("ide");
  3550. messageSends: ["load:", "commitHandler", "package"]
  3551. }),
  3552. $globals.PackageTransport);
  3553. $core.addMethod(
  3554. $core.method({
  3555. selector: "package",
  3556. protocol: "accessing",
  3557. fn: function (){
  3558. var self=this,$self=this;
  3559. return $self["@package"];
  3560. },
  3561. //>>excludeStart("ide", pragmas.excludeIdeData);
  3562. args: [],
  3563. source: "package\x0a\x09^ package",
  3564. referencedClasses: [],
  3565. //>>excludeEnd("ide");
  3566. messageSends: []
  3567. }),
  3568. $globals.PackageTransport);
  3569. $core.addMethod(
  3570. $core.method({
  3571. selector: "package:",
  3572. protocol: "accessing",
  3573. fn: function (aPackage){
  3574. var self=this,$self=this;
  3575. $self["@package"]=aPackage;
  3576. return self;
  3577. },
  3578. //>>excludeStart("ide", pragmas.excludeIdeData);
  3579. args: ["aPackage"],
  3580. source: "package: aPackage\x0a\x09package := aPackage",
  3581. referencedClasses: [],
  3582. //>>excludeEnd("ide");
  3583. messageSends: []
  3584. }),
  3585. $globals.PackageTransport);
  3586. $core.addMethod(
  3587. $core.method({
  3588. selector: "setupFromJson:",
  3589. protocol: "initialization",
  3590. fn: function (anObject){
  3591. var self=this,$self=this;
  3592. return self;
  3593. },
  3594. //>>excludeStart("ide", pragmas.excludeIdeData);
  3595. args: ["anObject"],
  3596. source: "setupFromJson: anObject\x0a\x09\x22no op. override if needed in subclasses\x22",
  3597. referencedClasses: [],
  3598. //>>excludeEnd("ide");
  3599. messageSends: []
  3600. }),
  3601. $globals.PackageTransport);
  3602. $core.addMethod(
  3603. $core.method({
  3604. selector: "type",
  3605. protocol: "accessing",
  3606. fn: function (){
  3607. var self=this,$self=this;
  3608. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3609. return $core.withContext(function($ctx1) {
  3610. //>>excludeEnd("ctx");
  3611. return $recv($self._class())._type();
  3612. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3613. }, function($ctx1) {$ctx1.fill(self,"type",{},$globals.PackageTransport)});
  3614. //>>excludeEnd("ctx");
  3615. },
  3616. //>>excludeStart("ide", pragmas.excludeIdeData);
  3617. args: [],
  3618. source: "type\x0a\x09^ self class type",
  3619. referencedClasses: [],
  3620. //>>excludeEnd("ide");
  3621. messageSends: ["type", "class"]
  3622. }),
  3623. $globals.PackageTransport);
  3624. $globals.PackageTransport.a$cls.iVarNames = ["registry"];
  3625. $core.addMethod(
  3626. $core.method({
  3627. selector: "classRegisteredFor:",
  3628. protocol: "accessing",
  3629. fn: function (aString){
  3630. var self=this,$self=this;
  3631. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3632. return $core.withContext(function($ctx1) {
  3633. //>>excludeEnd("ctx");
  3634. return $recv($self["@registry"])._at_(aString);
  3635. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3636. }, function($ctx1) {$ctx1.fill(self,"classRegisteredFor:",{aString:aString},$globals.PackageTransport.a$cls)});
  3637. //>>excludeEnd("ctx");
  3638. },
  3639. //>>excludeStart("ide", pragmas.excludeIdeData);
  3640. args: ["aString"],
  3641. source: "classRegisteredFor: aString\x0a\x09^ registry at: aString",
  3642. referencedClasses: [],
  3643. //>>excludeEnd("ide");
  3644. messageSends: ["at:"]
  3645. }),
  3646. $globals.PackageTransport.a$cls);
  3647. $core.addMethod(
  3648. $core.method({
  3649. selector: "defaultType",
  3650. protocol: "accessing",
  3651. fn: function (){
  3652. var self=this,$self=this;
  3653. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3654. return $core.withContext(function($ctx1) {
  3655. //>>excludeEnd("ctx");
  3656. return $recv($globals.AmdPackageTransport)._type();
  3657. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3658. }, function($ctx1) {$ctx1.fill(self,"defaultType",{},$globals.PackageTransport.a$cls)});
  3659. //>>excludeEnd("ctx");
  3660. },
  3661. //>>excludeStart("ide", pragmas.excludeIdeData);
  3662. args: [],
  3663. source: "defaultType\x0a\x09^ AmdPackageTransport type",
  3664. referencedClasses: ["AmdPackageTransport"],
  3665. //>>excludeEnd("ide");
  3666. messageSends: ["type"]
  3667. }),
  3668. $globals.PackageTransport.a$cls);
  3669. $core.addMethod(
  3670. $core.method({
  3671. selector: "for:",
  3672. protocol: "instance creation",
  3673. fn: function (aString){
  3674. var self=this,$self=this;
  3675. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3676. return $core.withContext(function($ctx1) {
  3677. //>>excludeEnd("ctx");
  3678. return $recv($self._classRegisteredFor_(aString))._new();
  3679. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3680. }, function($ctx1) {$ctx1.fill(self,"for:",{aString:aString},$globals.PackageTransport.a$cls)});
  3681. //>>excludeEnd("ctx");
  3682. },
  3683. //>>excludeStart("ide", pragmas.excludeIdeData);
  3684. args: ["aString"],
  3685. source: "for: aString\x0a\x09^ (self classRegisteredFor: aString) new",
  3686. referencedClasses: [],
  3687. //>>excludeEnd("ide");
  3688. messageSends: ["new", "classRegisteredFor:"]
  3689. }),
  3690. $globals.PackageTransport.a$cls);
  3691. $core.addMethod(
  3692. $core.method({
  3693. selector: "fromJson:",
  3694. protocol: "instance creation",
  3695. fn: function (anObject){
  3696. var self=this,$self=this;
  3697. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3698. return $core.withContext(function($ctx1) {
  3699. //>>excludeEnd("ctx");
  3700. var $1,$2,$receiver;
  3701. if(($receiver = anObject) == null || $receiver.a$nil){
  3702. $1=$self._for_($self._defaultType());
  3703. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3704. $ctx1.sendIdx["for:"]=1;
  3705. //>>excludeEnd("ctx");
  3706. return $1;
  3707. } else {
  3708. anObject;
  3709. }
  3710. $2=$self._for_($recv(anObject)._type());
  3711. $recv($2)._setupFromJson_(anObject);
  3712. return $recv($2)._yourself();
  3713. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3714. }, function($ctx1) {$ctx1.fill(self,"fromJson:",{anObject:anObject},$globals.PackageTransport.a$cls)});
  3715. //>>excludeEnd("ctx");
  3716. },
  3717. //>>excludeStart("ide", pragmas.excludeIdeData);
  3718. args: ["anObject"],
  3719. source: "fromJson: anObject\x0a\x09anObject ifNil: [ ^ self for: self defaultType ].\x0a\x09\x0a\x09^ (self for: anObject type)\x0a\x09\x09setupFromJson: anObject;\x0a\x09\x09yourself",
  3720. referencedClasses: [],
  3721. //>>excludeEnd("ide");
  3722. messageSends: ["ifNil:", "for:", "defaultType", "setupFromJson:", "type", "yourself"]
  3723. }),
  3724. $globals.PackageTransport.a$cls);
  3725. $core.addMethod(
  3726. $core.method({
  3727. selector: "initialize",
  3728. protocol: "initialization",
  3729. fn: function (){
  3730. var self=this,$self=this;
  3731. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3732. return $core.withContext(function($ctx1) {
  3733. //>>excludeEnd("ctx");
  3734. var $1;
  3735. (
  3736. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3737. $ctx1.supercall = true,
  3738. //>>excludeEnd("ctx");
  3739. ($globals.PackageTransport.a$cls.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($self, []));
  3740. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3741. $ctx1.supercall = false;
  3742. //>>excludeEnd("ctx");;
  3743. $1=$self.__eq_eq($globals.PackageTransport);
  3744. if($core.assert($1)){
  3745. $self["@registry"]=$globals.HashedCollection._newFromPairs_([]);
  3746. $self["@registry"];
  3747. } else {
  3748. $self._register();
  3749. }
  3750. return self;
  3751. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3752. }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.PackageTransport.a$cls)});
  3753. //>>excludeEnd("ctx");
  3754. },
  3755. //>>excludeStart("ide", pragmas.excludeIdeData);
  3756. args: [],
  3757. source: "initialize\x0a\x09super initialize.\x0a\x09self == PackageTransport\x0a\x09\x09ifTrue: [ registry := #{} ]\x0a\x09\x09ifFalse: [ self register ]",
  3758. referencedClasses: ["PackageTransport"],
  3759. //>>excludeEnd("ide");
  3760. messageSends: ["initialize", "ifTrue:ifFalse:", "==", "register"]
  3761. }),
  3762. $globals.PackageTransport.a$cls);
  3763. $core.addMethod(
  3764. $core.method({
  3765. selector: "register",
  3766. protocol: "registration",
  3767. fn: function (){
  3768. var self=this,$self=this;
  3769. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3770. return $core.withContext(function($ctx1) {
  3771. //>>excludeEnd("ctx");
  3772. $recv($globals.PackageTransport)._register_(self);
  3773. return self;
  3774. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3775. }, function($ctx1) {$ctx1.fill(self,"register",{},$globals.PackageTransport.a$cls)});
  3776. //>>excludeEnd("ctx");
  3777. },
  3778. //>>excludeStart("ide", pragmas.excludeIdeData);
  3779. args: [],
  3780. source: "register\x0a\x09PackageTransport register: self",
  3781. referencedClasses: ["PackageTransport"],
  3782. //>>excludeEnd("ide");
  3783. messageSends: ["register:"]
  3784. }),
  3785. $globals.PackageTransport.a$cls);
  3786. $core.addMethod(
  3787. $core.method({
  3788. selector: "register:",
  3789. protocol: "registration",
  3790. fn: function (aClass){
  3791. var self=this,$self=this;
  3792. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3793. return $core.withContext(function($ctx1) {
  3794. //>>excludeEnd("ctx");
  3795. var $1,$receiver;
  3796. $1=$recv(aClass)._type();
  3797. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3798. $ctx1.sendIdx["type"]=1;
  3799. //>>excludeEnd("ctx");
  3800. if(($receiver = $1) == null || $receiver.a$nil){
  3801. $1;
  3802. } else {
  3803. $recv($self["@registry"])._at_put_($recv(aClass)._type(),aClass);
  3804. }
  3805. return self;
  3806. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3807. }, function($ctx1) {$ctx1.fill(self,"register:",{aClass:aClass},$globals.PackageTransport.a$cls)});
  3808. //>>excludeEnd("ctx");
  3809. },
  3810. //>>excludeStart("ide", pragmas.excludeIdeData);
  3811. args: ["aClass"],
  3812. source: "register: aClass\x0a\x09aClass type ifNotNil: [\x0a\x09\x09registry at: aClass type put: aClass ]",
  3813. referencedClasses: [],
  3814. //>>excludeEnd("ide");
  3815. messageSends: ["ifNotNil:", "type", "at:put:"]
  3816. }),
  3817. $globals.PackageTransport.a$cls);
  3818. $core.addMethod(
  3819. $core.method({
  3820. selector: "type",
  3821. protocol: "accessing",
  3822. fn: function (){
  3823. var self=this,$self=this;
  3824. return nil;
  3825. },
  3826. //>>excludeStart("ide", pragmas.excludeIdeData);
  3827. args: [],
  3828. source: "type\x0a\x09\x22Override in subclasses\x22\x0a\x09^ nil",
  3829. referencedClasses: [],
  3830. //>>excludeEnd("ide");
  3831. messageSends: []
  3832. }),
  3833. $globals.PackageTransport.a$cls);
  3834. $core.addClass("AmdPackageTransport", $globals.PackageTransport, ["namespace"], "Platform-ImportExport");
  3835. //>>excludeStart("ide", pragmas.excludeIdeData);
  3836. $globals.AmdPackageTransport.comment="I am the default transport for committing packages.\x0a\x0aSee `AmdExporter` and `AmdPackageHandler`.";
  3837. //>>excludeEnd("ide");
  3838. $core.addMethod(
  3839. $core.method({
  3840. selector: "asJavaScriptObject",
  3841. protocol: "converting",
  3842. fn: function (){
  3843. var self=this,$self=this;
  3844. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3845. return $core.withContext(function($ctx1) {
  3846. //>>excludeEnd("ctx");
  3847. var $1;
  3848. $1=(
  3849. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3850. $ctx1.supercall = true,
  3851. //>>excludeEnd("ctx");
  3852. ($globals.AmdPackageTransport.superclass||$boot.nilAsClass).fn.prototype._asJavaScriptObject.apply($self, []));
  3853. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3854. $ctx1.supercall = false;
  3855. //>>excludeEnd("ctx");;
  3856. $recv($1)._at_put_("amdNamespace",$self._namespace());
  3857. return $recv($1)._yourself();
  3858. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3859. }, function($ctx1) {$ctx1.fill(self,"asJavaScriptObject",{},$globals.AmdPackageTransport)});
  3860. //>>excludeEnd("ctx");
  3861. },
  3862. //>>excludeStart("ide", pragmas.excludeIdeData);
  3863. args: [],
  3864. source: "asJavaScriptObject\x0a\x09^ super asJavaScriptObject\x0a\x09\x09at: 'amdNamespace' put: self namespace;\x0a\x09\x09yourself",
  3865. referencedClasses: [],
  3866. //>>excludeEnd("ide");
  3867. messageSends: ["at:put:", "asJavaScriptObject", "namespace", "yourself"]
  3868. }),
  3869. $globals.AmdPackageTransport);
  3870. $core.addMethod(
  3871. $core.method({
  3872. selector: "commitHandlerClass",
  3873. protocol: "accessing",
  3874. fn: function (){
  3875. var self=this,$self=this;
  3876. return $globals.AmdPackageHandler;
  3877. },
  3878. //>>excludeStart("ide", pragmas.excludeIdeData);
  3879. args: [],
  3880. source: "commitHandlerClass\x0a\x09^ AmdPackageHandler",
  3881. referencedClasses: ["AmdPackageHandler"],
  3882. //>>excludeEnd("ide");
  3883. messageSends: []
  3884. }),
  3885. $globals.AmdPackageTransport);
  3886. $core.addMethod(
  3887. $core.method({
  3888. selector: "defaultNamespace",
  3889. protocol: "defaults",
  3890. fn: function (){
  3891. var self=this,$self=this;
  3892. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3893. return $core.withContext(function($ctx1) {
  3894. //>>excludeEnd("ctx");
  3895. return $recv($globals.Smalltalk)._defaultAmdNamespace();
  3896. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3897. }, function($ctx1) {$ctx1.fill(self,"defaultNamespace",{},$globals.AmdPackageTransport)});
  3898. //>>excludeEnd("ctx");
  3899. },
  3900. //>>excludeStart("ide", pragmas.excludeIdeData);
  3901. args: [],
  3902. source: "defaultNamespace\x0a\x09^ Smalltalk defaultAmdNamespace",
  3903. referencedClasses: ["Smalltalk"],
  3904. //>>excludeEnd("ide");
  3905. messageSends: ["defaultAmdNamespace"]
  3906. }),
  3907. $globals.AmdPackageTransport);
  3908. $core.addMethod(
  3909. $core.method({
  3910. selector: "definition",
  3911. protocol: "accessing",
  3912. fn: function (){
  3913. var self=this,$self=this;
  3914. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3915. return $core.withContext(function($ctx1) {
  3916. //>>excludeEnd("ctx");
  3917. return $recv($globals.String)._streamContents_((function(stream){
  3918. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3919. return $core.withContext(function($ctx2) {
  3920. //>>excludeEnd("ctx");
  3921. $recv(stream)._write_([$recv($self._class())._name()," namespace: "]);
  3922. return $recv(stream)._print_($self._namespace());
  3923. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3924. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)});
  3925. //>>excludeEnd("ctx");
  3926. }));
  3927. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3928. }, function($ctx1) {$ctx1.fill(self,"definition",{},$globals.AmdPackageTransport)});
  3929. //>>excludeEnd("ctx");
  3930. },
  3931. //>>excludeStart("ide", pragmas.excludeIdeData);
  3932. args: [],
  3933. source: "definition\x0a\x09^ String streamContents: [ :stream | stream \x0a\x09\x09write: { self class name. ' namespace: ' }; print: self namespace ]",
  3934. referencedClasses: ["String"],
  3935. //>>excludeEnd("ide");
  3936. messageSends: ["streamContents:", "write:", "name", "class", "print:", "namespace"]
  3937. }),
  3938. $globals.AmdPackageTransport);
  3939. $core.addMethod(
  3940. $core.method({
  3941. selector: "namespace",
  3942. protocol: "accessing",
  3943. fn: function (){
  3944. var self=this,$self=this;
  3945. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3946. return $core.withContext(function($ctx1) {
  3947. //>>excludeEnd("ctx");
  3948. var $1,$receiver;
  3949. $1=$self["@namespace"];
  3950. if(($receiver = $1) == null || $receiver.a$nil){
  3951. return $self._defaultNamespace();
  3952. } else {
  3953. return $1;
  3954. }
  3955. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3956. }, function($ctx1) {$ctx1.fill(self,"namespace",{},$globals.AmdPackageTransport)});
  3957. //>>excludeEnd("ctx");
  3958. },
  3959. //>>excludeStart("ide", pragmas.excludeIdeData);
  3960. args: [],
  3961. source: "namespace\x0a\x09^ namespace ifNil: [ self defaultNamespace ]",
  3962. referencedClasses: [],
  3963. //>>excludeEnd("ide");
  3964. messageSends: ["ifNil:", "defaultNamespace"]
  3965. }),
  3966. $globals.AmdPackageTransport);
  3967. $core.addMethod(
  3968. $core.method({
  3969. selector: "namespace:",
  3970. protocol: "accessing",
  3971. fn: function (aString){
  3972. var self=this,$self=this;
  3973. $self["@namespace"]=aString;
  3974. return self;
  3975. },
  3976. //>>excludeStart("ide", pragmas.excludeIdeData);
  3977. args: ["aString"],
  3978. source: "namespace: aString\x0a\x09namespace := aString",
  3979. referencedClasses: [],
  3980. //>>excludeEnd("ide");
  3981. messageSends: []
  3982. }),
  3983. $globals.AmdPackageTransport);
  3984. $core.addMethod(
  3985. $core.method({
  3986. selector: "printOn:",
  3987. protocol: "printing",
  3988. fn: function (aStream){
  3989. var self=this,$self=this;
  3990. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3991. return $core.withContext(function($ctx1) {
  3992. //>>excludeEnd("ctx");
  3993. (
  3994. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3995. $ctx1.supercall = true,
  3996. //>>excludeEnd("ctx");
  3997. ($globals.AmdPackageTransport.superclass||$boot.nilAsClass).fn.prototype._printOn_.apply($self, [aStream]));
  3998. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3999. $ctx1.supercall = false;
  4000. //>>excludeEnd("ctx");;
  4001. $recv(aStream)._nextPutAll_(" (AMD Namespace: ");
  4002. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4003. $ctx1.sendIdx["nextPutAll:"]=1;
  4004. //>>excludeEnd("ctx");
  4005. $recv(aStream)._nextPutAll_($self._namespace());
  4006. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4007. $ctx1.sendIdx["nextPutAll:"]=2;
  4008. //>>excludeEnd("ctx");
  4009. $recv(aStream)._nextPutAll_(")");
  4010. return self;
  4011. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4012. }, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},$globals.AmdPackageTransport)});
  4013. //>>excludeEnd("ctx");
  4014. },
  4015. //>>excludeStart("ide", pragmas.excludeIdeData);
  4016. args: ["aStream"],
  4017. source: "printOn: aStream\x0a\x09super printOn: aStream.\x0a\x09aStream\x0a\x09\x09nextPutAll: ' (AMD Namespace: ';\x0a\x09\x09nextPutAll: self namespace;\x0a\x09\x09nextPutAll: ')'",
  4018. referencedClasses: [],
  4019. //>>excludeEnd("ide");
  4020. messageSends: ["printOn:", "nextPutAll:", "namespace"]
  4021. }),
  4022. $globals.AmdPackageTransport);
  4023. $core.addMethod(
  4024. $core.method({
  4025. selector: "setPath:",
  4026. protocol: "actions",
  4027. fn: function (aString){
  4028. var self=this,$self=this;
  4029. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4030. return $core.withContext(function($ctx1) {
  4031. //>>excludeEnd("ctx");
  4032. $recv($recv(require)._basicAt_("config"))._value_($globals.HashedCollection._newFromPairs_(["paths",$globals.HashedCollection._newFromPairs_([$self._namespace(),aString])]));
  4033. return self;
  4034. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4035. }, function($ctx1) {$ctx1.fill(self,"setPath:",{aString:aString},$globals.AmdPackageTransport)});
  4036. //>>excludeEnd("ctx");
  4037. },
  4038. //>>excludeStart("ide", pragmas.excludeIdeData);
  4039. args: ["aString"],
  4040. source: "setPath: aString\x0a\x09\x22Set the path the the receiver's `namespace`\x22\x0a\x09\x0a\x09(require basicAt: 'config') value: #{\x0a\x09\x09'paths' -> #{\x0a\x09\x09\x09self namespace -> aString\x0a\x09\x09}\x0a\x09}.",
  4041. referencedClasses: [],
  4042. //>>excludeEnd("ide");
  4043. messageSends: ["value:", "basicAt:", "namespace"]
  4044. }),
  4045. $globals.AmdPackageTransport);
  4046. $core.addMethod(
  4047. $core.method({
  4048. selector: "setupFromJson:",
  4049. protocol: "initialization",
  4050. fn: function (anObject){
  4051. var self=this,$self=this;
  4052. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4053. return $core.withContext(function($ctx1) {
  4054. //>>excludeEnd("ctx");
  4055. $self._namespace_($recv(anObject)._at_("amdNamespace"));
  4056. return self;
  4057. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4058. }, function($ctx1) {$ctx1.fill(self,"setupFromJson:",{anObject:anObject},$globals.AmdPackageTransport)});
  4059. //>>excludeEnd("ctx");
  4060. },
  4061. //>>excludeStart("ide", pragmas.excludeIdeData);
  4062. args: ["anObject"],
  4063. source: "setupFromJson: anObject\x0a\x09self namespace: (anObject at: 'amdNamespace')",
  4064. referencedClasses: [],
  4065. //>>excludeEnd("ide");
  4066. messageSends: ["namespace:", "at:"]
  4067. }),
  4068. $globals.AmdPackageTransport);
  4069. $core.addMethod(
  4070. $core.method({
  4071. selector: "namespace:",
  4072. protocol: "instance creation",
  4073. fn: function (aString){
  4074. var self=this,$self=this;
  4075. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4076. return $core.withContext(function($ctx1) {
  4077. //>>excludeEnd("ctx");
  4078. var $1;
  4079. $1=$self._new();
  4080. $recv($1)._namespace_(aString);
  4081. return $recv($1)._yourself();
  4082. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4083. }, function($ctx1) {$ctx1.fill(self,"namespace:",{aString:aString},$globals.AmdPackageTransport.a$cls)});
  4084. //>>excludeEnd("ctx");
  4085. },
  4086. //>>excludeStart("ide", pragmas.excludeIdeData);
  4087. args: ["aString"],
  4088. source: "namespace: aString\x0a\x09^ self new\x0a\x09\x09namespace: aString;\x0a\x09\x09yourself",
  4089. referencedClasses: [],
  4090. //>>excludeEnd("ide");
  4091. messageSends: ["namespace:", "new", "yourself"]
  4092. }),
  4093. $globals.AmdPackageTransport.a$cls);
  4094. $core.addMethod(
  4095. $core.method({
  4096. selector: "type",
  4097. protocol: "accessing",
  4098. fn: function (){
  4099. var self=this,$self=this;
  4100. return "amd";
  4101. },
  4102. //>>excludeStart("ide", pragmas.excludeIdeData);
  4103. args: [],
  4104. source: "type\x0a\x09^ 'amd'",
  4105. referencedClasses: [],
  4106. //>>excludeEnd("ide");
  4107. messageSends: []
  4108. }),
  4109. $globals.AmdPackageTransport.a$cls);
  4110. $core.addMethod(
  4111. $core.method({
  4112. selector: "exportBehaviorDefinitionTo:using:",
  4113. protocol: "*Platform-ImportExport",
  4114. fn: function (aStream,anExporter){
  4115. var self=this,$self=this;
  4116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4117. return $core.withContext(function($ctx1) {
  4118. //>>excludeEnd("ctx");
  4119. $recv(anExporter)._exportDefinitionOf_on_(self,aStream);
  4120. return self;
  4121. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4122. }, function($ctx1) {$ctx1.fill(self,"exportBehaviorDefinitionTo:using:",{aStream:aStream,anExporter:anExporter},$globals.Class)});
  4123. //>>excludeEnd("ctx");
  4124. },
  4125. //>>excludeStart("ide", pragmas.excludeIdeData);
  4126. args: ["aStream", "anExporter"],
  4127. source: "exportBehaviorDefinitionTo: aStream using: anExporter\x0a\x09anExporter exportDefinitionOf: self on: aStream",
  4128. referencedClasses: [],
  4129. //>>excludeEnd("ide");
  4130. messageSends: ["exportDefinitionOf:on:"]
  4131. }),
  4132. $globals.Class);
  4133. $core.addMethod(
  4134. $core.method({
  4135. selector: "exportBehaviorDefinitionTo:using:",
  4136. protocol: "*Platform-ImportExport",
  4137. fn: function (aStream,anExporter){
  4138. var self=this,$self=this;
  4139. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4140. return $core.withContext(function($ctx1) {
  4141. //>>excludeEnd("ctx");
  4142. $recv(anExporter)._exportMetaDefinitionOf_on_($self._instanceClass(),aStream);
  4143. return self;
  4144. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4145. }, function($ctx1) {$ctx1.fill(self,"exportBehaviorDefinitionTo:using:",{aStream:aStream,anExporter:anExporter},$globals.Metaclass)});
  4146. //>>excludeEnd("ctx");
  4147. },
  4148. //>>excludeStart("ide", pragmas.excludeIdeData);
  4149. args: ["aStream", "anExporter"],
  4150. source: "exportBehaviorDefinitionTo: aStream using: anExporter\x0a\x09anExporter exportMetaDefinitionOf: self instanceClass on: aStream",
  4151. referencedClasses: [],
  4152. //>>excludeEnd("ide");
  4153. messageSends: ["exportMetaDefinitionOf:on:", "instanceClass"]
  4154. }),
  4155. $globals.Metaclass);
  4156. $core.addMethod(
  4157. $core.method({
  4158. selector: "commit",
  4159. protocol: "*Platform-ImportExport",
  4160. fn: function (){
  4161. var self=this,$self=this;
  4162. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4163. return $core.withContext(function($ctx1) {
  4164. //>>excludeEnd("ctx");
  4165. return $recv($self._transport())._commit();
  4166. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4167. }, function($ctx1) {$ctx1.fill(self,"commit",{},$globals.Package)});
  4168. //>>excludeEnd("ctx");
  4169. },
  4170. //>>excludeStart("ide", pragmas.excludeIdeData);
  4171. args: [],
  4172. source: "commit\x0a\x09^ self transport commit",
  4173. referencedClasses: [],
  4174. //>>excludeEnd("ide");
  4175. messageSends: ["commit", "transport"]
  4176. }),
  4177. $globals.Package);
  4178. $core.addMethod(
  4179. $core.method({
  4180. selector: "load",
  4181. protocol: "*Platform-ImportExport",
  4182. fn: function (){
  4183. var self=this,$self=this;
  4184. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4185. return $core.withContext(function($ctx1) {
  4186. //>>excludeEnd("ctx");
  4187. return $recv($self._transport())._load();
  4188. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4189. }, function($ctx1) {$ctx1.fill(self,"load",{},$globals.Package)});
  4190. //>>excludeEnd("ctx");
  4191. },
  4192. //>>excludeStart("ide", pragmas.excludeIdeData);
  4193. args: [],
  4194. source: "load\x0a\x09^ self transport load",
  4195. referencedClasses: [],
  4196. //>>excludeEnd("ide");
  4197. messageSends: ["load", "transport"]
  4198. }),
  4199. $globals.Package);
  4200. $core.addMethod(
  4201. $core.method({
  4202. selector: "loadFromNamespace:",
  4203. protocol: "*Platform-ImportExport",
  4204. fn: function (aString){
  4205. var self=this,$self=this;
  4206. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4207. return $core.withContext(function($ctx1) {
  4208. //>>excludeEnd("ctx");
  4209. var $1;
  4210. $1=$self._transport();
  4211. $recv($1)._namespace_(aString);
  4212. return $recv($1)._load();
  4213. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4214. }, function($ctx1) {$ctx1.fill(self,"loadFromNamespace:",{aString:aString},$globals.Package)});
  4215. //>>excludeEnd("ctx");
  4216. },
  4217. //>>excludeStart("ide", pragmas.excludeIdeData);
  4218. args: ["aString"],
  4219. source: "loadFromNamespace: aString\x0a\x09^ self transport\x0a\x09\x09namespace: aString;\x0a\x09\x09load",
  4220. referencedClasses: [],
  4221. //>>excludeEnd("ide");
  4222. messageSends: ["namespace:", "transport", "load"]
  4223. }),
  4224. $globals.Package);
  4225. $core.addMethod(
  4226. $core.method({
  4227. selector: "load:",
  4228. protocol: "*Platform-ImportExport",
  4229. fn: function (aPackageName){
  4230. var self=this,$self=this;
  4231. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4232. return $core.withContext(function($ctx1) {
  4233. //>>excludeEnd("ctx");
  4234. $recv($self._named_(aPackageName))._load();
  4235. return self;
  4236. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4237. }, function($ctx1) {$ctx1.fill(self,"load:",{aPackageName:aPackageName},$globals.Package.a$cls)});
  4238. //>>excludeEnd("ctx");
  4239. },
  4240. //>>excludeStart("ide", pragmas.excludeIdeData);
  4241. args: ["aPackageName"],
  4242. source: "load: aPackageName\x0a\x09(self named: aPackageName) load",
  4243. referencedClasses: [],
  4244. //>>excludeEnd("ide");
  4245. messageSends: ["load", "named:"]
  4246. }),
  4247. $globals.Package.a$cls);
  4248. $core.addMethod(
  4249. $core.method({
  4250. selector: "load:fromNamespace:",
  4251. protocol: "*Platform-ImportExport",
  4252. fn: function (aPackageName,aString){
  4253. var self=this,$self=this;
  4254. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4255. return $core.withContext(function($ctx1) {
  4256. //>>excludeEnd("ctx");
  4257. $recv($self._named_(aPackageName))._loadFromNamespace_(aString);
  4258. return self;
  4259. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4260. }, function($ctx1) {$ctx1.fill(self,"load:fromNamespace:",{aPackageName:aPackageName,aString:aString},$globals.Package.a$cls)});
  4261. //>>excludeEnd("ctx");
  4262. },
  4263. //>>excludeStart("ide", pragmas.excludeIdeData);
  4264. args: ["aPackageName", "aString"],
  4265. source: "load: aPackageName fromNamespace: aString\x0a\x09(self named: aPackageName) loadFromNamespace: aString",
  4266. referencedClasses: [],
  4267. //>>excludeEnd("ide");
  4268. messageSends: ["loadFromNamespace:", "named:"]
  4269. }),
  4270. $globals.Package.a$cls);
  4271. $core.addMethod(
  4272. $core.method({
  4273. selector: "methodsFor:",
  4274. protocol: "*Platform-ImportExport",
  4275. fn: function (aString){
  4276. var self=this,$self=this;
  4277. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4278. return $core.withContext(function($ctx1) {
  4279. //>>excludeEnd("ctx");
  4280. var $1;
  4281. $1=$recv($globals.ClassProtocolReader)._new();
  4282. $recv($1)._class_category_(self,aString);
  4283. return $recv($1)._yourself();
  4284. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4285. }, function($ctx1) {$ctx1.fill(self,"methodsFor:",{aString:aString},$globals.TBehaviorProvider)});
  4286. //>>excludeEnd("ctx");
  4287. },
  4288. //>>excludeStart("ide", pragmas.excludeIdeData);
  4289. args: ["aString"],
  4290. source: "methodsFor: aString\x0a\x09^ ClassProtocolReader new\x0a\x09\x09class: self category: aString;\x0a\x09\x09yourself",
  4291. referencedClasses: ["ClassProtocolReader"],
  4292. //>>excludeEnd("ide");
  4293. messageSends: ["class:category:", "new", "yourself"]
  4294. }),
  4295. $globals.TBehaviorProvider);
  4296. $core.addMethod(
  4297. $core.method({
  4298. selector: "methodsFor:stamp:",
  4299. protocol: "*Platform-ImportExport",
  4300. fn: function (aString,aStamp){
  4301. var self=this,$self=this;
  4302. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4303. return $core.withContext(function($ctx1) {
  4304. //>>excludeEnd("ctx");
  4305. return $self._methodsFor_(aString);
  4306. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4307. }, function($ctx1) {$ctx1.fill(self,"methodsFor:stamp:",{aString:aString,aStamp:aStamp},$globals.TBehaviorProvider)});
  4308. //>>excludeEnd("ctx");
  4309. },
  4310. //>>excludeStart("ide", pragmas.excludeIdeData);
  4311. args: ["aString", "aStamp"],
  4312. source: "methodsFor: aString stamp: aStamp\x0a\x09\x22Added for file-in compatibility, ignores stamp.\x22\x0a\x09^ self methodsFor: aString",
  4313. referencedClasses: [],
  4314. //>>excludeEnd("ide");
  4315. messageSends: ["methodsFor:"]
  4316. }),
  4317. $globals.TBehaviorProvider);
  4318. $core.addMethod(
  4319. $core.method({
  4320. selector: "commentStamp",
  4321. protocol: "*Platform-ImportExport",
  4322. fn: function (){
  4323. var self=this,$self=this;
  4324. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4325. return $core.withContext(function($ctx1) {
  4326. //>>excludeEnd("ctx");
  4327. var $1;
  4328. $1=$recv($globals.ClassCommentReader)._new();
  4329. $recv($1)._class_(self);
  4330. return $recv($1)._yourself();
  4331. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4332. }, function($ctx1) {$ctx1.fill(self,"commentStamp",{},$globals.TMasterBehavior)});
  4333. //>>excludeEnd("ctx");
  4334. },
  4335. //>>excludeStart("ide", pragmas.excludeIdeData);
  4336. args: [],
  4337. source: "commentStamp\x0a\x09^ ClassCommentReader new\x0a\x09class: self;\x0a\x09yourself",
  4338. referencedClasses: ["ClassCommentReader"],
  4339. //>>excludeEnd("ide");
  4340. messageSends: ["class:", "new", "yourself"]
  4341. }),
  4342. $globals.TMasterBehavior);
  4343. $core.addMethod(
  4344. $core.method({
  4345. selector: "commentStamp:prior:",
  4346. protocol: "*Platform-ImportExport",
  4347. fn: function (aStamp,prior){
  4348. var self=this,$self=this;
  4349. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4350. return $core.withContext(function($ctx1) {
  4351. //>>excludeEnd("ctx");
  4352. return $self._commentStamp();
  4353. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4354. }, function($ctx1) {$ctx1.fill(self,"commentStamp:prior:",{aStamp:aStamp,prior:prior},$globals.TMasterBehavior)});
  4355. //>>excludeEnd("ctx");
  4356. },
  4357. //>>excludeStart("ide", pragmas.excludeIdeData);
  4358. args: ["aStamp", "prior"],
  4359. source: "commentStamp: aStamp prior: prior\x0a\x09\x09^ self commentStamp",
  4360. referencedClasses: [],
  4361. //>>excludeEnd("ide");
  4362. messageSends: ["commentStamp"]
  4363. }),
  4364. $globals.TMasterBehavior);
  4365. $core.addMethod(
  4366. $core.method({
  4367. selector: "exportBehaviorDefinitionTo:using:",
  4368. protocol: "*Platform-ImportExport",
  4369. fn: function (aStream,anExporter){
  4370. var self=this,$self=this;
  4371. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4372. return $core.withContext(function($ctx1) {
  4373. //>>excludeEnd("ctx");
  4374. $recv(anExporter)._exportTraitDefinitionOf_on_(self,aStream);
  4375. return self;
  4376. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4377. }, function($ctx1) {$ctx1.fill(self,"exportBehaviorDefinitionTo:using:",{aStream:aStream,anExporter:anExporter},$globals.Trait)});
  4378. //>>excludeEnd("ctx");
  4379. },
  4380. //>>excludeStart("ide", pragmas.excludeIdeData);
  4381. args: ["aStream", "anExporter"],
  4382. source: "exportBehaviorDefinitionTo: aStream using: anExporter\x0a\x09anExporter exportTraitDefinitionOf: self on: aStream",
  4383. referencedClasses: [],
  4384. //>>excludeEnd("ide");
  4385. messageSends: ["exportTraitDefinitionOf:on:"]
  4386. }),
  4387. $globals.Trait);
  4388. });