12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457 |
- define("amber_core/Platform-ImportExport", ["amber/boot", "amber_core/Kernel-Objects", "amber_core/Kernel-Exceptions", "amber_core/Platform-Services", "amber_core/Kernel-Infrastructure", "amber_core/Kernel-Classes"], function($boot){"use strict";
- var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
- $core.addPackage('Platform-ImportExport');
- $core.packages["Platform-ImportExport"].innerEval = function (expr) { return eval(expr); };
- $core.packages["Platform-ImportExport"].transport = {"type":"amd","amdNamespace":"amber_core"};
- $core.addClass('AbstractExporter', $globals.Object, [], 'Platform-ImportExport');
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $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.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "classNameFor:",
- protocol: 'convenience',
- fn: function (aClass){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $2,$3,$4,$1;
- $2=$recv(aClass)._isMetaclass();
- if($core.assert($2)){
- $3=$recv($recv(aClass)._instanceClass())._name();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["name"]=1;
- //>>excludeEnd("ctx");
- $1=$recv($3).__comma(" class");
- } else {
- $4=$recv(aClass)._isNil();
- if($core.assert($4)){
- $1="nil";
- } else {
- $1=$recv(aClass)._name();
- };
- };
- return $1;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"classNameFor:",{aClass:aClass},$globals.AbstractExporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass"],
- source: "classNameFor: aClass\x0a\x09^ aClass isMetaclass\x0a\x09\x09ifTrue: [ aClass instanceClass name, ' class' ]\x0a\x09\x09ifFalse: [\x0a\x09\x09\x09aClass isNil\x0a\x09\x09\x09\x09ifTrue: [ 'nil' ]\x0a\x09\x09\x09\x09ifFalse: [ aClass name ] ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifTrue:ifFalse:", "isMetaclass", ",", "name", "instanceClass", "isNil"]
- }),
- $globals.AbstractExporter);
- $core.addMethod(
- $core.method({
- selector: "exportPackage:on:",
- protocol: 'output',
- fn: function (aPackage,aStream){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- self._subclassResponsibility();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"exportPackage:on:",{aPackage:aPackage,aStream:aStream},$globals.AbstractExporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage", "aStream"],
- source: "exportPackage: aPackage on: aStream\x0a\x09self subclassResponsibility",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["subclassResponsibility"]
- }),
- $globals.AbstractExporter);
- $core.addMethod(
- $core.method({
- selector: "extensionMethodsOfPackage:",
- protocol: 'accessing',
- fn: function (aPackage){
- var self=this;
- var result;
- function $OrderedCollection(){return $globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- result=$recv($OrderedCollection())._new();
- $recv(self._extensionProtocolsOfPackage_(aPackage))._do_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(result)._addAll_($recv(each)._methods());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- return result;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"extensionMethodsOfPackage:",{aPackage:aPackage,result:result},$globals.AbstractExporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage"],
- 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 methods ].\x0a\x09\x09\x0a\x09^ result",
- referencedClasses: ["OrderedCollection"],
- //>>excludeEnd("ide");
- messageSends: ["new", "do:", "extensionProtocolsOfPackage:", "addAll:", "methods"]
- }),
- $globals.AbstractExporter);
- $core.addMethod(
- $core.method({
- selector: "extensionProtocolsOfPackage:",
- protocol: 'accessing',
- fn: function (aPackage){
- var self=this;
- var extensionName,result;
- function $OrderedCollection(){return $globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
- function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
- function $ExportMethodProtocol(){return $globals.ExportMethodProtocol||(typeof ExportMethodProtocol=="undefined"?nil:ExportMethodProtocol)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2,$3;
- $1=$recv(aPackage)._name();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["name"]=1;
- //>>excludeEnd("ctx");
- extensionName="*".__comma($1);
- result=$recv($OrderedCollection())._new();
- $recv($recv($recv($recv($Smalltalk())._classes())._asArray())._sorted_((function(a,b){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $2=$recv(a)._name();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["name"]=2;
- //>>excludeEnd("ctx");
- return $recv($2).__lt($recv(b)._name());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,1)});
- //>>excludeEnd("ctx");
- })))._do_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv([each,$recv(each)._class()])._do_((function(behavior){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- $3=$recv($recv(behavior)._protocols())._includes_(extensionName);
- if($core.assert($3)){
- return $recv(result)._add_($recv($ExportMethodProtocol())._name_theClass_(extensionName,behavior));
- };
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({behavior:behavior},$ctx2,3)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["do:"]=1;
- //>>excludeEnd("ctx");
- return result;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"extensionProtocolsOfPackage:",{aPackage:aPackage,extensionName:extensionName,result:result},$globals.AbstractExporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage"],
- 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 class} 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",
- referencedClasses: ["OrderedCollection", "Smalltalk", "ExportMethodProtocol"],
- //>>excludeEnd("ide");
- messageSends: [",", "name", "new", "do:", "sorted:", "asArray", "classes", "<", "class", "ifTrue:", "includes:", "protocols", "add:", "name:theClass:"]
- }),
- $globals.AbstractExporter);
- $core.addClass('ChunkExporter', $globals.AbstractExporter, [], 'Platform-ImportExport');
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $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.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "chunkEscape:",
- protocol: 'convenience',
- fn: function (aString){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($recv(aString)._replace_with_("!","!!"))._trimBoth();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"chunkEscape:",{aString:aString},$globals.ChunkExporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "chunkEscape: aString\x0a\x09\x22Replace all occurrences of ! with !! and trim at both ends.\x22\x0a\x0a\x09^ (aString replace: '!' with: '!!') trimBoth",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["trimBoth", "replace:with:"]
- }),
- $globals.ChunkExporter);
- $core.addMethod(
- $core.method({
- selector: "exportCategoryEpilogueOf:on:",
- protocol: 'output',
- fn: function (aCategory,aStream){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_(" !");
- $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=1;
- //>>excludeEnd("ctx");
- $recv(aStream)._lf();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"exportCategoryEpilogueOf:on:",{aCategory:aCategory,aStream:aStream},$globals.ChunkExporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aCategory", "aStream"],
- source: "exportCategoryEpilogueOf: aCategory on: aStream\x0a\x09aStream nextPutAll: ' !'; lf; lf",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["nextPutAll:", "lf"]
- }),
- $globals.ChunkExporter);
- $core.addMethod(
- $core.method({
- selector: "exportCategoryPrologueOf:on:",
- protocol: 'output',
- fn: function (aCategory,aStream){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2;
- $1="!".__comma(self._classNameFor_($recv(aCategory)._theClass()));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=1;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($1);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=1;
- //>>excludeEnd("ctx");
- $2=$recv(" methodsFor: '".__comma($recv(aCategory)._name())).__comma("'!");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=2;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($2);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"exportCategoryPrologueOf:on:",{aCategory:aCategory,aStream:aStream},$globals.ChunkExporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aCategory", "aStream"],
- source: "exportCategoryPrologueOf: aCategory on: aStream\x0a\x09aStream\x0a\x09\x09nextPutAll: '!', (self classNameFor: aCategory theClass);\x0a\x09\x09nextPutAll: ' methodsFor: ''', aCategory name, '''!'",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["nextPutAll:", ",", "classNameFor:", "theClass", "name"]
- }),
- $globals.ChunkExporter);
- $core.addMethod(
- $core.method({
- selector: "exportDefinitionOf:on:",
- protocol: 'output',
- fn: function (aClass,aStream){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$3,$2,$4,$6,$5,$7,$9,$8,$11,$10,$12;
- $1=self._classNameFor_($recv(aClass)._superclass());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["classNameFor:"]=1;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($1);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=1;
- //>>excludeEnd("ctx");
- $3=self._classNameFor_(aClass);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["classNameFor:"]=2;
- //>>excludeEnd("ctx");
- $2=" subclass: #".__comma($3);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=1;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($2);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=2;
- //>>excludeEnd("ctx");
- $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=1;
- //>>excludeEnd("ctx");
- $recv(aStream)._tab();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["tab"]=1;
- //>>excludeEnd("ctx");
- $4=$recv(aStream)._nextPutAll_("instanceVariableNames: '");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=3;
- //>>excludeEnd("ctx");
- $recv($recv(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(aStream)._nextPutAll_(each);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["nextPutAll:"]=4;
- //>>excludeEnd("ctx");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- }),(function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(aStream)._nextPutAll_(" ");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["nextPutAll:"]=5;
- //>>excludeEnd("ctx");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
- //>>excludeEnd("ctx");
- }));
- $recv(aStream)._nextPutAll_("'");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=6;
- //>>excludeEnd("ctx");
- $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=2;
- //>>excludeEnd("ctx");
- $recv(aStream)._tab();
- $6="package: '".__comma($recv(aClass)._category());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=3;
- //>>excludeEnd("ctx");
- $5=$recv($6).__comma("'!");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=2;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($5);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=7;
- //>>excludeEnd("ctx");
- $7=$recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=3;
- //>>excludeEnd("ctx");
- $9=$recv(aClass)._comment();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["comment"]=1;
- //>>excludeEnd("ctx");
- $8=$recv($9)._notEmpty();
- if($core.assert($8)){
- $11="!".__comma(self._classNameFor_(aClass));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=5;
- //>>excludeEnd("ctx");
- $10=$recv($11).__comma(" commentStamp!");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=4;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($10);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=8;
- //>>excludeEnd("ctx");
- $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=4;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($recv(self._chunkEscape_($recv(aClass)._comment())).__comma("!"));
- $12=$recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=5;
- //>>excludeEnd("ctx");
- $12;
- };
- $recv(aStream)._lf();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"exportDefinitionOf:on:",{aClass:aClass,aStream:aStream},$globals.ChunkExporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass", "aStream"],
- source: "exportDefinitionOf: aClass on: aStream\x0a\x09\x22Chunk format.\x22\x0a\x0a\x09aStream\x0a\x09\x09nextPutAll: (self classNameFor: aClass superclass);\x0a\x09\x09nextPutAll: ' subclass: #', (self classNameFor: aClass); lf;\x0a\x09\x09tab; nextPutAll: 'instanceVariableNames: '''.\x0a\x09aClass instanceVariableNames\x0a\x09\x09do: [ :each | aStream nextPutAll: each ]\x0a\x09\x09separatedBy: [ aStream nextPutAll: ' ' ].\x0a\x09aStream\x0a\x09\x09nextPutAll: ''''; lf;\x0a\x09\x09tab; nextPutAll: 'package: ''', aClass category, '''!'; lf.\x0a\x09aClass comment notEmpty ifTrue: [\x0a\x09\x09aStream\x0a\x09\x09nextPutAll: '!', (self classNameFor: aClass), ' commentStamp!';lf;\x0a\x09\x09nextPutAll: (self chunkEscape: aClass comment), '!';lf ].\x0a\x09aStream lf",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["nextPutAll:", "classNameFor:", "superclass", ",", "lf", "tab", "do:separatedBy:", "instanceVariableNames", "category", "ifTrue:", "notEmpty", "comment", "chunkEscape:"]
- }),
- $globals.ChunkExporter);
- $core.addMethod(
- $core.method({
- selector: "exportMetaDefinitionOf:on:",
- protocol: 'output',
- fn: function (aClass,aStream){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $3,$2,$1,$5,$4,$6;
- $3=$recv(aClass)._class();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["class"]=1;
- //>>excludeEnd("ctx");
- $2=$recv($3)._instanceVariableNames();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["instanceVariableNames"]=1;
- //>>excludeEnd("ctx");
- $1=$recv($2)._isEmpty();
- if(!$core.assert($1)){
- $5=$recv(aClass)._class();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["class"]=2;
- //>>excludeEnd("ctx");
- $4=self._classNameFor_($5);
- $recv(aStream)._nextPutAll_($4);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=1;
- //>>excludeEnd("ctx");
- $6=$recv(aStream)._nextPutAll_(" instanceVariableNames: '");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=2;
- //>>excludeEnd("ctx");
- $6;
- $recv($recv($recv(aClass)._class())._instanceVariableNames())._do_separatedBy_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(aStream)._nextPutAll_(each);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["nextPutAll:"]=3;
- //>>excludeEnd("ctx");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
- //>>excludeEnd("ctx");
- }),(function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(aStream)._nextPutAll_(" ");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["nextPutAll:"]=4;
- //>>excludeEnd("ctx");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
- //>>excludeEnd("ctx");
- }));
- $recv(aStream)._nextPutAll_("'!");
- $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=1;
- //>>excludeEnd("ctx");
- $recv(aStream)._lf();
- };
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"exportMetaDefinitionOf:on:",{aClass:aClass,aStream:aStream},$globals.ChunkExporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass", "aStream"],
- source: "exportMetaDefinitionOf: aClass on: aStream\x0a\x0a\x09aClass class instanceVariableNames isEmpty ifFalse: [\x0a\x09\x09aStream\x0a\x09\x09\x09nextPutAll: (self classNameFor: aClass class);\x0a\x09\x09\x09nextPutAll: ' instanceVariableNames: '''.\x0a\x09\x09aClass class instanceVariableNames\x0a\x09\x09\x09do: [ :each | aStream nextPutAll: each ]\x0a\x09\x09\x09separatedBy: [ aStream nextPutAll: ' ' ].\x0a\x09\x09aStream\x0a\x09\x09\x09nextPutAll: '''!'; lf; lf ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifFalse:", "isEmpty", "instanceVariableNames", "class", "nextPutAll:", "classNameFor:", "do:separatedBy:", "lf"]
- }),
- $globals.ChunkExporter);
- $core.addMethod(
- $core.method({
- selector: "exportMethod:on:",
- protocol: 'output',
- fn: function (aMethod,aStream){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=1;
- //>>excludeEnd("ctx");
- $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=2;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_(self._chunkEscape_($recv(aMethod)._source()));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=1;
- //>>excludeEnd("ctx");
- $recv(aStream)._lf();
- $recv(aStream)._nextPutAll_("!");
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"exportMethod:on:",{aMethod:aMethod,aStream:aStream},$globals.ChunkExporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aMethod", "aStream"],
- source: "exportMethod: aMethod on: aStream\x0a\x09aStream\x0a\x09\x09lf; lf; nextPutAll: (self chunkEscape: aMethod source); lf;\x0a\x09\x09nextPutAll: '!'",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["lf", "nextPutAll:", "chunkEscape:", "source"]
- }),
- $globals.ChunkExporter);
- $core.addMethod(
- $core.method({
- selector: "exportPackage:on:",
- protocol: 'output',
- fn: function (aPackage,aStream){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- self._exportPackageDefinitionOf_on_(aPackage,aStream);
- self._exportPackageImportsOf_on_(aPackage,aStream);
- $recv($recv(aPackage)._sortedClasses())._do_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- self._exportDefinitionOf_on_(each,aStream);
- $1=self._ownMethodProtocolsOfClass_(each);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["ownMethodProtocolsOfClass:"]=1;
- //>>excludeEnd("ctx");
- self._exportProtocols_on_($1,aStream);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["exportProtocols:on:"]=1;
- //>>excludeEnd("ctx");
- self._exportMetaDefinitionOf_on_(each,aStream);
- return self._exportProtocols_on_(self._ownMethodProtocolsOfClass_($recv(each)._class()),aStream);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["exportProtocols:on:"]=2;
- //>>excludeEnd("ctx");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- self._exportProtocols_on_(self._extensionProtocolsOfPackage_(aPackage),aStream);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"exportPackage:on:",{aPackage:aPackage,aStream:aStream},$globals.ChunkExporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage", "aStream"],
- 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 exportDefinitionOf: each on: aStream.\x0a\x09\x09\x0a\x09\x09self \x0a\x09\x09\x09exportProtocols: (self ownMethodProtocolsOfClass: each)\x0a\x09\x09\x09on: aStream.\x0a\x09\x09\x09\x0a\x09\x09self exportMetaDefinitionOf: each on: aStream.\x0a\x09\x09\x0a\x09\x09self \x0a\x09\x09\x09exportProtocols: (self ownMethodProtocolsOfClass: each class)\x0a\x09\x09\x09on: aStream ].\x0a\x09\x09\x09\x0a\x09self \x0a\x09\x09exportProtocols: (self extensionProtocolsOfPackage: aPackage)\x0a\x09\x09on: aStream",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["exportPackageDefinitionOf:on:", "exportPackageImportsOf:on:", "do:", "sortedClasses", "exportDefinitionOf:on:", "exportProtocols:on:", "ownMethodProtocolsOfClass:", "exportMetaDefinitionOf:on:", "class", "extensionProtocolsOfPackage:"]
- }),
- $globals.ChunkExporter);
- $core.addMethod(
- $core.method({
- selector: "exportPackageDefinitionOf:on:",
- protocol: 'output',
- fn: function (aPackage,aStream){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$recv("Smalltalk createPackage: '".__comma($recv(aPackage)._name())).__comma("'!");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=1;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($1);
- $recv(aStream)._lf();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"exportPackageDefinitionOf:on:",{aPackage:aPackage,aStream:aStream},$globals.ChunkExporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage", "aStream"],
- source: "exportPackageDefinitionOf: aPackage on: aStream\x0a\x09aStream\x0a\x09\x09nextPutAll: 'Smalltalk createPackage: ''', aPackage name, '''!';\x0a\x09\x09lf",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["nextPutAll:", ",", "name", "lf"]
- }),
- $globals.ChunkExporter);
- $core.addMethod(
- $core.method({
- selector: "exportPackageImportsOf:on:",
- protocol: 'output',
- fn: function (aPackage,aStream){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv($recv(aPackage)._imports())._ifNotEmpty_((function(imports){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_("(Smalltalk packageAt: '");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["nextPutAll:"]=1;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($recv(aPackage)._name());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["nextPutAll:"]=2;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_("') imports: ");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["nextPutAll:"]=3;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_(self._chunkEscape_($recv(aPackage)._importsDefinition()));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["nextPutAll:"]=4;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_("!");
- return $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({imports:imports},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"exportPackageImportsOf:on:",{aPackage:aPackage,aStream:aStream},$globals.ChunkExporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage", "aStream"],
- source: "exportPackageImportsOf: aPackage on: aStream\x0a\x09aPackage imports ifNotEmpty: [ :imports |\x0a\x09\x09aStream\x0a\x09\x09\x09nextPutAll: '(Smalltalk packageAt: ''';\x0a\x09\x09\x09nextPutAll: aPackage name;\x0a\x09\x09\x09nextPutAll: ''') imports: ';\x0a\x09\x09\x09nextPutAll: (self chunkEscape: aPackage importsDefinition);\x0a\x09\x09\x09nextPutAll: '!';\x0a\x09\x09\x09lf ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifNotEmpty:", "imports", "nextPutAll:", "name", "chunkEscape:", "importsDefinition", "lf"]
- }),
- $globals.ChunkExporter);
- $core.addMethod(
- $core.method({
- selector: "exportProtocol:on:",
- protocol: 'output',
- fn: function (aProtocol,aStream){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- self._exportProtocolPrologueOf_on_(aProtocol,aStream);
- $recv($recv(aProtocol)._methods())._do_((function(method){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return self._exportMethod_on_(method,aStream);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({method:method},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- self._exportProtocolEpilogueOf_on_(aProtocol,aStream);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"exportProtocol:on:",{aProtocol:aProtocol,aStream:aStream},$globals.ChunkExporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aProtocol", "aStream"],
- source: "exportProtocol: aProtocol on: aStream\x0a\x09self exportProtocolPrologueOf: aProtocol on: aStream.\x0a\x09aProtocol methods do: [ :method | \x0a\x09\x09self exportMethod: method on: aStream ].\x0a\x09self exportProtocolEpilogueOf: aProtocol on: aStream",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["exportProtocolPrologueOf:on:", "do:", "methods", "exportMethod:on:", "exportProtocolEpilogueOf:on:"]
- }),
- $globals.ChunkExporter);
- $core.addMethod(
- $core.method({
- selector: "exportProtocolEpilogueOf:on:",
- protocol: 'output',
- fn: function (aProtocol,aStream){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_(" !");
- $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=1;
- //>>excludeEnd("ctx");
- $recv(aStream)._lf();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"exportProtocolEpilogueOf:on:",{aProtocol:aProtocol,aStream:aStream},$globals.ChunkExporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aProtocol", "aStream"],
- source: "exportProtocolEpilogueOf: aProtocol on: aStream\x0a\x09aStream nextPutAll: ' !'; lf; lf",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["nextPutAll:", "lf"]
- }),
- $globals.ChunkExporter);
- $core.addMethod(
- $core.method({
- selector: "exportProtocolPrologueOf:on:",
- protocol: 'output',
- fn: function (aProtocol,aStream){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2;
- $1="!".__comma(self._classNameFor_($recv(aProtocol)._theClass()));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=1;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($1);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=1;
- //>>excludeEnd("ctx");
- $2=$recv(" methodsFor: '".__comma($recv(aProtocol)._name())).__comma("'!");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=2;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($2);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"exportProtocolPrologueOf:on:",{aProtocol:aProtocol,aStream:aStream},$globals.ChunkExporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aProtocol", "aStream"],
- source: "exportProtocolPrologueOf: aProtocol on: aStream\x0a\x09aStream\x0a\x09\x09nextPutAll: '!', (self classNameFor: aProtocol theClass);\x0a\x09\x09nextPutAll: ' methodsFor: ''', aProtocol name, '''!'",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["nextPutAll:", ",", "classNameFor:", "theClass", "name"]
- }),
- $globals.ChunkExporter);
- $core.addMethod(
- $core.method({
- selector: "exportProtocols:on:",
- protocol: 'output',
- fn: function (aCollection,aStream){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv(aCollection)._do_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return self._exportProtocol_on_(each,aStream);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"exportProtocols:on:",{aCollection:aCollection,aStream:aStream},$globals.ChunkExporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aCollection", "aStream"],
- source: "exportProtocols: aCollection on: aStream\x0a\x09aCollection do: [ :each |\x0a\x09\x09self exportProtocol: each on: aStream ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["do:", "exportProtocol:on:"]
- }),
- $globals.ChunkExporter);
- $core.addMethod(
- $core.method({
- selector: "extensionCategoriesOfPackage:",
- protocol: 'accessing',
- fn: function (aPackage){
- var self=this;
- var name,map,result;
- function $OrderedCollection(){return $globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
- function $Package(){return $globals.Package||(typeof Package=="undefined"?nil:Package)}
- function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
- function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
- function $MethodCategory(){return $globals.MethodCategory||(typeof MethodCategory=="undefined"?nil:MethodCategory)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- name=$recv(aPackage)._name();
- result=$recv($OrderedCollection())._new();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["new"]=1;
- //>>excludeEnd("ctx");
- $recv($recv($Package())._sortedClasses_($recv($Smalltalk())._classes()))._do_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv([each,$recv(each)._class()])._do_((function(aClass){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- map=$recv($Dictionary())._new();
- map;
- $recv(aClass)._protocolsDo_((function(category,methods){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx4) {
- //>>excludeEnd("ctx");
- $1=$recv(category).__eq("*".__comma(name));
- if($core.assert($1)){
- return $recv(map)._at_put_(category,methods);
- };
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx4) {$ctx4.fillBlock({category:category,methods:methods},$ctx3,3)});
- //>>excludeEnd("ctx");
- }));
- return $recv(result)._addAll_($recv($recv($recv(map)._keys())._sorted_((function(a,b){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx4) {
- //>>excludeEnd("ctx");
- return $recv(a).__lt_eq(b);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx3,5)});
- //>>excludeEnd("ctx");
- })))._collect_((function(category){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx4) {
- //>>excludeEnd("ctx");
- return $recv($MethodCategory())._name_theClass_methods_(category,aClass,$recv(map)._at_(category));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx4) {$ctx4.fillBlock({category:category},$ctx3,6)});
- //>>excludeEnd("ctx");
- })));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({aClass:aClass},$ctx2,2)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["do:"]=1;
- //>>excludeEnd("ctx");
- return result;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"extensionCategoriesOfPackage:",{aPackage:aPackage,name:name,map:map,result:result},$globals.ChunkExporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage"],
- 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 class} 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",
- referencedClasses: ["OrderedCollection", "Package", "Smalltalk", "Dictionary", "MethodCategory"],
- //>>excludeEnd("ide");
- messageSends: ["name", "new", "do:", "sortedClasses:", "classes", "class", "protocolsDo:", "ifTrue:", "=", ",", "at:put:", "addAll:", "collect:", "sorted:", "keys", "<=", "name:theClass:methods:", "at:"]
- }),
- $globals.ChunkExporter);
- $core.addMethod(
- $core.method({
- selector: "ownCategoriesOfClass:",
- protocol: 'accessing',
- fn: function (aClass){
- var self=this;
- var map;
- function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
- function $MethodCategory(){return $globals.MethodCategory||(typeof MethodCategory=="undefined"?nil:MethodCategory)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- map=$recv($Dictionary())._new();
- $recv(aClass)._protocolsDo_((function(each,methods){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $1=$recv(each)._match_("^\x5c*");
- if(!$core.assert($1)){
- return $recv(map)._at_put_(each,methods);
- };
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each,methods:methods},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- return $recv($recv($recv(map)._keys())._sorted_((function(a,b){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(a).__lt_eq(b);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,3)});
- //>>excludeEnd("ctx");
- })))._collect_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv($MethodCategory())._name_theClass_methods_(each,aClass,$recv(map)._at_(each));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"ownCategoriesOfClass:",{aClass:aClass,map:map},$globals.ChunkExporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass"],
- 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) ]",
- referencedClasses: ["Dictionary", "MethodCategory"],
- //>>excludeEnd("ide");
- messageSends: ["new", "protocolsDo:", "ifFalse:", "match:", "at:put:", "collect:", "sorted:", "keys", "<=", "name:theClass:methods:", "at:"]
- }),
- $globals.ChunkExporter);
- $core.addMethod(
- $core.method({
- selector: "ownCategoriesOfMetaClass:",
- protocol: 'accessing',
- fn: function (aClass){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return self._ownCategoriesOfClass_($recv(aClass)._class());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"ownCategoriesOfMetaClass:",{aClass:aClass},$globals.ChunkExporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass"],
- source: "ownCategoriesOfMetaClass: aClass\x0a\x09\x22Issue #143: sort protocol alphabetically\x22\x0a\x0a\x09^ self ownCategoriesOfClass: aClass class",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ownCategoriesOfClass:", "class"]
- }),
- $globals.ChunkExporter);
- $core.addMethod(
- $core.method({
- selector: "ownMethodProtocolsOfClass:",
- protocol: 'accessing',
- fn: function (aClass){
- var self=this;
- function $ExportMethodProtocol(){return $globals.ExportMethodProtocol||(typeof ExportMethodProtocol=="undefined"?nil:ExportMethodProtocol)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($recv(aClass)._ownProtocols())._collect_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv($ExportMethodProtocol())._name_theClass_(each,aClass);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"ownMethodProtocolsOfClass:",{aClass:aClass},$globals.ChunkExporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass"],
- 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 ]",
- referencedClasses: ["ExportMethodProtocol"],
- //>>excludeEnd("ide");
- messageSends: ["collect:", "ownProtocols", "name:theClass:"]
- }),
- $globals.ChunkExporter);
- $core.addClass('Exporter', $globals.AbstractExporter, [], 'Platform-ImportExport');
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $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.).";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "exportDefinitionOf:on:",
- protocol: 'output',
- fn: function (aClass,aStream){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $2,$1,$3,$4,$6,$5,$7,$9,$8;
- $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=1;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_("$core.addClass(");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=1;
- //>>excludeEnd("ctx");
- $2="'".__comma(self._classNameFor_(aClass));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=2;
- //>>excludeEnd("ctx");
- $1=$recv($2).__comma("', ");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=1;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($1);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=2;
- //>>excludeEnd("ctx");
- $3=self._jsClassNameFor_($recv(aClass)._superclass());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["jsClassNameFor:"]=1;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($3);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=3;
- //>>excludeEnd("ctx");
- $4=$recv(aStream)._nextPutAll_(", [");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=4;
- //>>excludeEnd("ctx");
- $recv($recv(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $6="'".__comma(each);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx[","]=4;
- //>>excludeEnd("ctx");
- $5=$recv($6).__comma("'");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx[","]=3;
- //>>excludeEnd("ctx");
- return $recv(aStream)._nextPutAll_($5);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["nextPutAll:"]=5;
- //>>excludeEnd("ctx");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- }),(function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(aStream)._nextPutAll_(", ");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["nextPutAll:"]=6;
- //>>excludeEnd("ctx");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
- //>>excludeEnd("ctx");
- }));
- $recv(aStream)._nextPutAll_("], '");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=7;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($recv($recv(aClass)._category()).__comma("'"));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=8;
- //>>excludeEnd("ctx");
- $7=$recv(aStream)._nextPutAll_(");");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=9;
- //>>excludeEnd("ctx");
- $9=$recv(aClass)._comment();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["comment"]=1;
- //>>excludeEnd("ctx");
- $8=$recv($9)._notEmpty();
- if($core.assert($8)){
- $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=2;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_("//>>excludeStart(\x22ide\x22, pragmas.excludeIdeData);");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=10;
- //>>excludeEnd("ctx");
- $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=3;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_(self._jsClassNameFor_(aClass));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=11;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_(".comment=");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=12;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($recv($recv($recv(aClass)._comment())._crlfSanitized())._asJavascript());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=13;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_(";");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=14;
- //>>excludeEnd("ctx");
- $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=4;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_("//>>excludeEnd(\x22ide\x22);");
- };
- $recv(aStream)._lf();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"exportDefinitionOf:on:",{aClass:aClass,aStream:aStream},$globals.Exporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass", "aStream"],
- source: "exportDefinitionOf: aClass on: aStream\x0a\x09aStream\x0a\x09\x09lf;\x0a\x09\x09nextPutAll: '$core.addClass(';\x0a\x09\x09nextPutAll: '''', (self classNameFor: aClass), ''', ';\x0a\x09\x09nextPutAll: (self jsClassNameFor: aClass superclass);\x0a\x09\x09nextPutAll: ', ['.\x0a\x09aClass instanceVariableNames\x0a\x09\x09do: [ :each | aStream nextPutAll: '''', each, '''' ]\x0a\x09\x09separatedBy: [ aStream nextPutAll: ', ' ].\x0a\x09aStream\x0a\x09\x09nextPutAll: '], ''';\x0a\x09\x09nextPutAll: aClass category, '''';\x0a\x09\x09nextPutAll: ');'.\x0a\x09aClass comment notEmpty ifTrue: [\x0a\x09\x09aStream\x0a\x09\x09\x09lf;\x0a\x09\x09\x09nextPutAll: '//>>excludeStart(\x22ide\x22, pragmas.excludeIdeData);';\x0a\x09\x09\x09lf;\x0a\x09\x09\x09nextPutAll: (self jsClassNameFor: aClass);\x0a\x09\x09\x09nextPutAll: '.comment=';\x0a\x09\x09\x09nextPutAll: aClass comment crlfSanitized asJavascript;\x0a\x09\x09\x09nextPutAll: ';';\x0a\x09\x09\x09lf;\x0a\x09\x09\x09nextPutAll: '//>>excludeEnd(\x22ide\x22);' ].\x0a\x09aStream lf",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["lf", "nextPutAll:", ",", "classNameFor:", "jsClassNameFor:", "superclass", "do:separatedBy:", "instanceVariableNames", "category", "ifTrue:", "notEmpty", "comment", "asJavascript", "crlfSanitized"]
- }),
- $globals.Exporter);
- $core.addMethod(
- $core.method({
- selector: "exportMetaDefinitionOf:on:",
- protocol: 'output',
- fn: function (aClass,aStream){
- var self=this;
- function $String(){return $globals.String||(typeof String=="undefined"?nil:String)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $3,$2,$1,$5,$4,$6,$8,$7;
- $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=1;
- //>>excludeEnd("ctx");
- $3=$recv(aClass)._class();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["class"]=1;
- //>>excludeEnd("ctx");
- $2=$recv($3)._instanceVariableNames();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["instanceVariableNames"]=1;
- //>>excludeEnd("ctx");
- $1=$recv($2)._isEmpty();
- if(!$core.assert($1)){
- $5=$recv(aClass)._class();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["class"]=2;
- //>>excludeEnd("ctx");
- $4=self._jsClassNameFor_($5);
- $recv(aStream)._nextPutAll_($4);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=1;
- //>>excludeEnd("ctx");
- $6=$recv(aStream)._nextPutAll_(".iVarNames = [");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=2;
- //>>excludeEnd("ctx");
- $6;
- $recv($recv($recv(aClass)._class())._instanceVariableNames())._do_separatedBy_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $8="'".__comma(each);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx[","]=2;
- //>>excludeEnd("ctx");
- $7=$recv($8).__comma("'");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx[","]=1;
- //>>excludeEnd("ctx");
- return $recv(aStream)._nextPutAll_($7);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["nextPutAll:"]=3;
- //>>excludeEnd("ctx");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
- //>>excludeEnd("ctx");
- }),(function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(aStream)._nextPutAll_(",");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["nextPutAll:"]=4;
- //>>excludeEnd("ctx");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
- //>>excludeEnd("ctx");
- }));
- $recv(aStream)._nextPutAll_("];".__comma($recv($String())._lf()));
- };
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"exportMetaDefinitionOf:on:",{aClass:aClass,aStream:aStream},$globals.Exporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass", "aStream"],
- source: "exportMetaDefinitionOf: aClass on: aStream\x0a\x09aStream lf.\x0a\x09aClass class instanceVariableNames isEmpty ifFalse: [\x0a\x09\x09aStream\x0a\x09\x09nextPutAll: (self jsClassNameFor: aClass class);\x0a\x09\x09nextPutAll: '.iVarNames = ['.\x0a\x09\x09aClass class instanceVariableNames\x0a\x09\x09do: [ :each | aStream nextPutAll: '''', each, '''' ]\x0a\x09\x09separatedBy: [ aStream nextPutAll: ',' ].\x0a\x09\x09aStream nextPutAll: '];', String lf ]",
- referencedClasses: ["String"],
- //>>excludeEnd("ide");
- messageSends: ["lf", "ifFalse:", "isEmpty", "instanceVariableNames", "class", "nextPutAll:", "jsClassNameFor:", "do:separatedBy:", ","]
- }),
- $globals.Exporter);
- $core.addMethod(
- $core.method({
- selector: "exportMethod:on:",
- protocol: 'output',
- fn: function (aMethod,aStream){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $3,$2,$1,$5,$4,$7,$6,$10,$9,$8,$13,$12,$11,$16,$15,$14;
- $recv(aStream)._nextPutAll_("$core.addMethod(");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=1;
- //>>excludeEnd("ctx");
- $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=1;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_("$core.method({");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=2;
- //>>excludeEnd("ctx");
- $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=2;
- //>>excludeEnd("ctx");
- $3=$recv($recv(aMethod)._selector())._asJavascript();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["asJavascript"]=1;
- //>>excludeEnd("ctx");
- $2="selector: ".__comma($3);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=2;
- //>>excludeEnd("ctx");
- $1=$recv($2).__comma(",");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=1;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($1);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=3;
- //>>excludeEnd("ctx");
- $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=3;
- //>>excludeEnd("ctx");
- $5="protocol: '".__comma($recv(aMethod)._protocol());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=4;
- //>>excludeEnd("ctx");
- $4=$recv($5).__comma("',");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=3;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($4);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=4;
- //>>excludeEnd("ctx");
- $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=4;
- //>>excludeEnd("ctx");
- $7="fn: ".__comma($recv($recv(aMethod)._fn())._compiledSource());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=6;
- //>>excludeEnd("ctx");
- $6=$recv($7).__comma(",");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=5;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($6);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=5;
- //>>excludeEnd("ctx");
- $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=5;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_("//>>excludeStart(\x22ide\x22, pragmas.excludeIdeData);");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=6;
- //>>excludeEnd("ctx");
- $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=6;
- //>>excludeEnd("ctx");
- $10=$recv($recv(aMethod)._arguments())._asJavascript();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["asJavascript"]=2;
- //>>excludeEnd("ctx");
- $9="args: ".__comma($10);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=8;
- //>>excludeEnd("ctx");
- $8=$recv($9).__comma(",");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=7;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($8);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=7;
- //>>excludeEnd("ctx");
- $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=7;
- //>>excludeEnd("ctx");
- $13=$recv($recv(aMethod)._source())._asJavascript();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["asJavascript"]=3;
- //>>excludeEnd("ctx");
- $12="source: ".__comma($13);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=10;
- //>>excludeEnd("ctx");
- $11=$recv($12).__comma(",");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=9;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($11);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=8;
- //>>excludeEnd("ctx");
- $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=8;
- //>>excludeEnd("ctx");
- $16=$recv($recv(aMethod)._referencedClasses())._asJavascript();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["asJavascript"]=4;
- //>>excludeEnd("ctx");
- $15="referencedClasses: ".__comma($16);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=12;
- //>>excludeEnd("ctx");
- $14=$recv($15).__comma(",");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=11;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($14);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=9;
- //>>excludeEnd("ctx");
- $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=9;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_("//>>excludeEnd(\x22ide\x22);");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=10;
- //>>excludeEnd("ctx");
- $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=10;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_("messageSends: ".__comma($recv($recv(aMethod)._messageSends())._asJavascript()));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=11;
- //>>excludeEnd("ctx");
- $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=11;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_("}),");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=12;
- //>>excludeEnd("ctx");
- $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=12;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_(self._jsClassNameFor_($recv(aMethod)._methodClass()));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=13;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_(");");
- $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=13;
- //>>excludeEnd("ctx");
- $recv(aStream)._lf();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"exportMethod:on:",{aMethod:aMethod,aStream:aStream},$globals.Exporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aMethod", "aStream"],
- source: "exportMethod: aMethod on: aStream\x0a\x09aStream\x0a\x09\x09nextPutAll: '$core.addMethod(';lf;\x0a\x09\x09nextPutAll: '$core.method({';lf;\x0a\x09\x09nextPutAll: 'selector: ', aMethod selector asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'protocol: ''', aMethod protocol, ''',';lf;\x0a\x09\x09nextPutAll: 'fn: ', aMethod fn compiledSource, ',';lf;\x0a\x09\x09nextPutAll: '//>>excludeStart(\x22ide\x22, pragmas.excludeIdeData);';lf;\x0a\x09\x09nextPutAll: 'args: ', aMethod arguments asJavascript, ','; lf;\x0a\x09\x09nextPutAll: 'source: ', aMethod source asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'referencedClasses: ', aMethod referencedClasses asJavascript, ',';lf;\x0a\x09\x09nextPutAll: '//>>excludeEnd(\x22ide\x22);';lf;\x0a\x09\x09nextPutAll: 'messageSends: ', aMethod messageSends asJavascript;lf;\x0a\x09\x09nextPutAll: '}),';lf;\x0a\x09\x09nextPutAll: (self jsClassNameFor: aMethod methodClass);\x0a\x09\x09nextPutAll: ');';lf;lf",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "selector", "protocol", "compiledSource", "fn", "arguments", "source", "referencedClasses", "messageSends", "jsClassNameFor:", "methodClass"]
- }),
- $globals.Exporter);
- $core.addMethod(
- $core.method({
- selector: "exportPackage:on:",
- protocol: 'output',
- fn: function (aPackage,aStream){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- self._exportPackagePrologueOf_on_(aPackage,aStream);
- self._exportPackageDefinitionOf_on_(aPackage,aStream);
- self._exportPackageContextOf_on_(aPackage,aStream);
- self._exportPackageImportsOf_on_(aPackage,aStream);
- self._exportPackageTransportOf_on_(aPackage,aStream);
- $recv($recv(aPackage)._sortedClasses())._do_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- self._exportDefinitionOf_on_(each,aStream);
- $1=$recv(each)._ownMethods();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["ownMethods"]=1;
- //>>excludeEnd("ctx");
- $recv($1)._do_((function(method){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- return self._exportMethod_on_(method,aStream);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx3.sendIdx["exportMethod:on:"]=1;
- //>>excludeEnd("ctx");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({method:method},$ctx2,2)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["do:"]=2;
- //>>excludeEnd("ctx");
- self._exportMetaDefinitionOf_on_(each,aStream);
- return $recv($recv($recv(each)._class())._ownMethods())._do_((function(method){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- return self._exportMethod_on_(method,aStream);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx3.sendIdx["exportMethod:on:"]=2;
- //>>excludeEnd("ctx");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({method:method},$ctx2,3)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["do:"]=3;
- //>>excludeEnd("ctx");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["do:"]=1;
- //>>excludeEnd("ctx");
- $recv(self._extensionMethodsOfPackage_(aPackage))._do_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return self._exportMethod_on_(each,aStream);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)});
- //>>excludeEnd("ctx");
- }));
- self._exportPackageEpilogueOf_on_(aPackage,aStream);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"exportPackage:on:",{aPackage:aPackage,aStream:aStream},$globals.Exporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage", "aStream"],
- 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 exportDefinitionOf: each on: aStream.\x0a\x09\x09each ownMethods do: [ :method |\x0a\x09\x09\x09self exportMethod: method on: aStream ].\x0a\x09\x09\x09\x0a\x09\x09self exportMetaDefinitionOf: each on: aStream.\x0a\x09\x09each class ownMethods do: [ :method |\x0a\x09\x09\x09self exportMethod: method on: aStream ] ].\x0a\x09\x09\x09\x0a\x09(self extensionMethodsOfPackage: aPackage) do: [ :each |\x0a\x09\x09self exportMethod: each on: aStream ].\x0a\x09\x09\x0a\x09self exportPackageEpilogueOf: aPackage on: aStream",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["exportPackagePrologueOf:on:", "exportPackageDefinitionOf:on:", "exportPackageContextOf:on:", "exportPackageImportsOf:on:", "exportPackageTransportOf:on:", "do:", "sortedClasses", "exportDefinitionOf:on:", "ownMethods", "exportMethod:on:", "exportMetaDefinitionOf:on:", "class", "extensionMethodsOfPackage:", "exportPackageEpilogueOf:on:"]
- }),
- $globals.Exporter);
- $core.addMethod(
- $core.method({
- selector: "exportPackageContextOf:on:",
- protocol: 'output',
- fn: function (aPackage,aStream){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_("$core.packages[");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=1;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($recv($recv(aPackage)._name())._asJavascript());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=2;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_("].innerEval = ");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=3;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_("function (expr) { return eval(expr); }");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=4;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_(";");
- $recv(aStream)._lf();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"exportPackageContextOf:on:",{aPackage:aPackage,aStream:aStream},$globals.Exporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage", "aStream"],
- source: "exportPackageContextOf: aPackage on: aStream\x0a\x09aStream\x0a\x09\x09nextPutAll: '$core.packages[';\x0a\x09\x09nextPutAll: aPackage name asJavascript;\x0a\x09\x09nextPutAll: '].innerEval = ';\x0a\x09\x09nextPutAll: 'function (expr) { return eval(expr); }';\x0a\x09\x09nextPutAll: ';';\x0a\x09\x09lf",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["nextPutAll:", "asJavascript", "name", "lf"]
- }),
- $globals.Exporter);
- $core.addMethod(
- $core.method({
- selector: "exportPackageDefinitionOf:on:",
- protocol: 'output',
- fn: function (aPackage,aStream){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $recv(aStream)._nextPutAll_("$core.addPackage(");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=1;
- //>>excludeEnd("ctx");
- $1=$recv("'".__comma($recv(aPackage)._name())).__comma("');");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=1;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($1);
- $recv(aStream)._lf();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"exportPackageDefinitionOf:on:",{aPackage:aPackage,aStream:aStream},$globals.Exporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage", "aStream"],
- source: "exportPackageDefinitionOf: aPackage on: aStream\x0a\x09aStream\x0a\x09\x09nextPutAll: '$core.addPackage(';\x0a\x09\x09nextPutAll: '''', aPackage name, ''');';\x0a\x09\x09lf",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["nextPutAll:", ",", "name", "lf"]
- }),
- $globals.Exporter);
- $core.addMethod(
- $core.method({
- selector: "exportPackageEpilogueOf:on:",
- protocol: 'output',
- fn: function (aPackage,aStream){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- self._subclassResponsibility();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"exportPackageEpilogueOf:on:",{aPackage:aPackage,aStream:aStream},$globals.Exporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage", "aStream"],
- source: "exportPackageEpilogueOf: aPackage on: aStream\x0a\x09self subclassResponsibility",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["subclassResponsibility"]
- }),
- $globals.Exporter);
- $core.addMethod(
- $core.method({
- selector: "exportPackageImportsOf:on:",
- protocol: 'output',
- fn: function (aPackage,aStream){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $recv($recv(aPackage)._importsAsJson())._ifNotEmpty_((function(imports){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_("$core.packages[");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["nextPutAll:"]=1;
- //>>excludeEnd("ctx");
- $1=$recv($recv(aPackage)._name())._asJavascript();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["asJavascript"]=1;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($1);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["nextPutAll:"]=2;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_("].imports = ");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["nextPutAll:"]=3;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($recv(imports)._asJavascript());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["nextPutAll:"]=4;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_(";");
- return $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({imports:imports},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"exportPackageImportsOf:on:",{aPackage:aPackage,aStream:aStream},$globals.Exporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage", "aStream"],
- source: "exportPackageImportsOf: aPackage on: aStream\x0a\x09aPackage importsAsJson ifNotEmpty: [ :imports |\x0a\x09\x09aStream\x0a\x09\x09\x09nextPutAll: '$core.packages[';\x0a\x09\x09\x09nextPutAll: aPackage name asJavascript;\x0a\x09\x09\x09nextPutAll: '].imports = ';\x0a\x09\x09\x09nextPutAll: imports asJavascript;\x0a\x09\x09\x09nextPutAll: ';';\x0a\x09\x09\x09lf ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifNotEmpty:", "importsAsJson", "nextPutAll:", "asJavascript", "name", "lf"]
- }),
- $globals.Exporter);
- $core.addMethod(
- $core.method({
- selector: "exportPackagePrologueOf:on:",
- protocol: 'output',
- fn: function (aPackage,aStream){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- self._subclassResponsibility();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"exportPackagePrologueOf:on:",{aPackage:aPackage,aStream:aStream},$globals.Exporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage", "aStream"],
- source: "exportPackagePrologueOf: aPackage on: aStream\x0a\x09self subclassResponsibility",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["subclassResponsibility"]
- }),
- $globals.Exporter);
- $core.addMethod(
- $core.method({
- selector: "exportPackageTransportOf:on:",
- protocol: 'output',
- fn: function (aPackage,aStream){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_("$core.packages[");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=1;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($recv($recv(aPackage)._name())._asJavascript());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=2;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_("].transport = ");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=3;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($recv($recv(aPackage)._transport())._asJSONString());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=4;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_(";");
- $recv(aStream)._lf();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"exportPackageTransportOf:on:",{aPackage:aPackage,aStream:aStream},$globals.Exporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage", "aStream"],
- source: "exportPackageTransportOf: aPackage on: aStream\x0a\x09aStream\x0a\x09\x09nextPutAll: '$core.packages[';\x0a\x09\x09nextPutAll: aPackage name asJavascript;\x0a\x09\x09nextPutAll: '].transport = ';\x0a\x09\x09nextPutAll: aPackage transport asJSONString;\x0a\x09\x09nextPutAll: ';';\x0a\x09\x09lf",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["nextPutAll:", "asJavascript", "name", "asJSONString", "transport", "lf"]
- }),
- $globals.Exporter);
- $core.addMethod(
- $core.method({
- selector: "jsClassNameFor:",
- protocol: 'convenience',
- fn: function (aClass){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$receiver;
- $1=$recv(aClass)._isMetaclass();
- if($core.assert($1)){
- return $recv(self._jsClassNameFor_($recv(aClass)._instanceClass())).__comma(".klass");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=1;
- //>>excludeEnd("ctx");
- } else {
- if(($receiver = aClass) == null || $receiver.isNil){
- return "null";
- } else {
- return "$globals.".__comma($recv(aClass)._name());
- };
- };
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"jsClassNameFor:",{aClass:aClass},$globals.Exporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass"],
- source: "jsClassNameFor: aClass\x0a\x09^ aClass isMetaclass\x0a\x09\x09ifTrue: [ (self jsClassNameFor: aClass instanceClass), '.klass' ]\x0a\x09\x09ifFalse: [\x0a\x09\x09\x09aClass\x0a\x09\x09\x09\x09ifNil: [ 'null' ]\x0a\x09\x09\x09\x09ifNotNil: [ '$globals.', aClass name ] ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifTrue:ifFalse:", "isMetaclass", ",", "jsClassNameFor:", "instanceClass", "ifNil:ifNotNil:", "name"]
- }),
- $globals.Exporter);
- $core.addMethod(
- $core.method({
- selector: "ownMethodsOfClass:",
- protocol: 'accessing',
- fn: function (aClass){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- return $recv($recv($recv($recv(aClass)._methodDictionary())._values())._sorted_((function(a,b){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $1=$recv(a)._selector();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["selector"]=1;
- //>>excludeEnd("ctx");
- return $recv($1).__lt_eq($recv(b)._selector());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,1)});
- //>>excludeEnd("ctx");
- })))._reject_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv($recv(each)._protocol())._match_("^\x5c*");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"ownMethodsOfClass:",{aClass:aClass},$globals.Exporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass"],
- 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*') ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["reject:", "sorted:", "values", "methodDictionary", "<=", "selector", "match:", "protocol"]
- }),
- $globals.Exporter);
- $core.addMethod(
- $core.method({
- selector: "ownMethodsOfMetaClass:",
- protocol: 'accessing',
- fn: function (aClass){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return self._ownMethodsOfClass_($recv(aClass)._class());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"ownMethodsOfMetaClass:",{aClass:aClass},$globals.Exporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass"],
- source: "ownMethodsOfMetaClass: aClass\x0a\x09\x22Issue #143: sort methods alphabetically\x22\x0a\x0a\x09^ self ownMethodsOfClass: aClass class",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ownMethodsOfClass:", "class"]
- }),
- $globals.Exporter);
- $core.addClass('AmdExporter', $globals.Exporter, ['namespace'], 'Platform-ImportExport');
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $globals.AmdExporter.comment="I am used to export Packages in an AMD (Asynchronous Module Definition) JavaScript format.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "amdNamesOfPackages:",
- protocol: 'private',
- fn: function (anArray){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- return $recv($recv(anArray)._select_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $1=self._amdNamespaceOfPackage_(each);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["amdNamespaceOfPackage:"]=1;
- //>>excludeEnd("ctx");
- return $recv($1)._notNil();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- })))._collect_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv($recv(self._amdNamespaceOfPackage_(each)).__comma("/")).__comma($recv(each)._name());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx[","]=1;
- //>>excludeEnd("ctx");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"amdNamesOfPackages:",{anArray:anArray},$globals.AmdExporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anArray"],
- source: "amdNamesOfPackages: anArray\x0a\x09^ (anArray\x0a\x09\x09select: [ :each | (self amdNamespaceOfPackage: each) notNil ])\x0a\x09\x09collect: [ :each | (self amdNamespaceOfPackage: each), '/', each name ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["collect:", "select:", "notNil", "amdNamespaceOfPackage:", ",", "name"]
- }),
- $globals.AmdExporter);
- $core.addMethod(
- $core.method({
- selector: "amdNamespaceOfPackage:",
- protocol: 'private',
- fn: function (aPackage){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $3,$2,$1;
- $3=$recv(aPackage)._transport();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["transport"]=1;
- //>>excludeEnd("ctx");
- $2=$recv($3)._type();
- $1=$recv($2).__eq("amd");
- if($core.assert($1)){
- return $recv($recv(aPackage)._transport())._namespace();
- } else {
- return nil;
- };
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"amdNamespaceOfPackage:",{aPackage:aPackage},$globals.AmdExporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage"],
- source: "amdNamespaceOfPackage: aPackage\x0a\x09^ (aPackage transport type = 'amd')\x0a\x09\x09ifTrue: [ aPackage transport namespace ]\x0a\x09\x09ifFalse: [ nil ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifTrue:ifFalse:", "=", "type", "transport", "namespace"]
- }),
- $globals.AmdExporter);
- $core.addMethod(
- $core.method({
- selector: "exportPackageEpilogueOf:on:",
- protocol: 'output',
- fn: function (aPackage,aStream){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_("});");
- $recv(aStream)._lf();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"exportPackageEpilogueOf:on:",{aPackage:aPackage,aStream:aStream},$globals.AmdExporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage", "aStream"],
- source: "exportPackageEpilogueOf: aPackage on: aStream\x0a\x09aStream\x0a\x09\x09nextPutAll: '});';\x0a\x09\x09lf",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["nextPutAll:", "lf"]
- }),
- $globals.AmdExporter);
- $core.addMethod(
- $core.method({
- selector: "exportPackagePrologueOf:on:",
- protocol: 'output',
- fn: function (aPackage,aStream){
- var self=this;
- var importsForOutput,loadDependencies,pragmaStart,pragmaEnd;
- function $String(){return $globals.String||(typeof String=="undefined"?nil:String)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$3,$2,$4,$6,$5,$7,$13,$12,$11,$10,$9,$8,$17,$16,$15,$14;
- pragmaStart="";
- pragmaEnd="";
- importsForOutput=self._importsForOutput_(aPackage);
- loadDependencies=self._amdNamesOfPackages_($recv(aPackage)._loadDependencies());
- $1=$recv(importsForOutput)._value();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["value"]=1;
- //>>excludeEnd("ctx");
- $recv($1)._ifNotEmpty_((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $3=$recv($String())._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["lf"]=1;
- //>>excludeEnd("ctx");
- $2=$recv($3).__comma("//>>excludeStart(\x22imports\x22, pragmas.excludeImports);");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx[","]=2;
- //>>excludeEnd("ctx");
- $4=$recv($String())._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["lf"]=2;
- //>>excludeEnd("ctx");
- pragmaStart=$recv($2).__comma($4);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx[","]=1;
- //>>excludeEnd("ctx");
- pragmaStart;
- $6=$recv($String())._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["lf"]=3;
- //>>excludeEnd("ctx");
- $5=$recv($6).__comma("//>>excludeEnd(\x22imports\x22);");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx[","]=4;
- //>>excludeEnd("ctx");
- $7=$recv($String())._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["lf"]=4;
- //>>excludeEnd("ctx");
- pragmaEnd=$recv($5).__comma($7);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx[","]=3;
- //>>excludeEnd("ctx");
- return pragmaEnd;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- $recv(aStream)._nextPutAll_("define(\x22");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=1;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_(self._amdNamespaceOfPackage_(aPackage));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=2;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_("/");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=3;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($recv(aPackage)._name());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=4;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_("\x22, ");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=5;
- //>>excludeEnd("ctx");
- $13=["amber/boot", ":1:"].__comma($recv(importsForOutput)._value());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=7;
- //>>excludeEnd("ctx");
- $12=$recv($13).__comma([":2:"]);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=6;
- //>>excludeEnd("ctx");
- $11=$recv($12).__comma(loadDependencies);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=5;
- //>>excludeEnd("ctx");
- $10=$recv($11)._asJavascript();
- $9=$recv($10)._replace_with_(",\x5cs*[\x22']:1:[\x22']",pragmaStart);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["replace:with:"]=2;
- //>>excludeEnd("ctx");
- $8=$recv($9)._replace_with_(",\x5cs*[\x22']:2:[\x22']",pragmaEnd);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["replace:with:"]=1;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($8);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=6;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_(", function(");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=7;
- //>>excludeEnd("ctx");
- $17=$recv(["$boot", ":1:"].__comma($recv(importsForOutput)._key())).__comma([":2:"]);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=8;
- //>>excludeEnd("ctx");
- $16=$recv($17)._join_(",");
- $15=$recv($16)._replace_with_(",\x5cs*:1:",pragmaStart);
- $14=$recv($15)._replace_with_(",\x5cs*:2:",pragmaEnd);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["replace:with:"]=3;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_($14);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=8;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_("){\x22use strict\x22;");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=9;
- //>>excludeEnd("ctx");
- $recv(aStream)._lf();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["lf"]=5;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_("var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;");
- $recv(aStream)._lf();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"exportPackagePrologueOf:on:",{aPackage:aPackage,aStream:aStream,importsForOutput:importsForOutput,loadDependencies:loadDependencies,pragmaStart:pragmaStart,pragmaEnd:pragmaEnd},$globals.AmdExporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage", "aStream"],
- 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\x09nextPutAll: 'define(\x22';\x0a\x09\x09nextPutAll: (self amdNamespaceOfPackage: aPackage);\x0a\x09\x09nextPutAll: '/'; \x0a\x09\x09nextPutAll: aPackage name;\x0a\x09\x09nextPutAll: '\x22, ';\x0a\x09\x09nextPutAll: (((\x0a\x09\x09\x09(#('amber/boot' ':1:'), importsForOutput value, #(':2:'), loadDependencies) asJavascript)\x0a\x09\x09\x09replace: ',\x5cs*[\x22'']:1:[\x22'']' with: pragmaStart) replace: ',\x5cs*[\x22'']:2:[\x22'']' with: pragmaEnd);\x0a\x09\x09nextPutAll: ', function(';\x0a\x09\x09nextPutAll: (((\x0a\x09\x09\x09(#('$boot' ':1:'), importsForOutput key, #(':2:')) join: ',')\x0a\x09\x09\x09replace: ',\x5cs*:1:' with: pragmaStart) replace: ',\x5cs*:2:' with: pragmaEnd);\x0a\x09\x09nextPutAll: '){\x22use strict\x22;';\x0a\x09\x09lf;\x0a\x09\x09nextPutAll: 'var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;';\x0a\x09\x09lf",
- referencedClasses: ["String"],
- //>>excludeEnd("ide");
- messageSends: ["importsForOutput:", "amdNamesOfPackages:", "loadDependencies", "ifNotEmpty:", "value", ",", "lf", "nextPutAll:", "amdNamespaceOfPackage:", "name", "replace:with:", "asJavascript", "join:", "key"]
- }),
- $globals.AmdExporter);
- $core.addMethod(
- $core.method({
- selector: "importsForOutput:",
- protocol: 'private',
- fn: function (aPackage){
- var self=this;
- var namedImports,anonImports,importVarNames;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- namedImports=[];
- anonImports=[];
- importVarNames=[];
- $recv($recv(aPackage)._imports())._do_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $1=$recv(each)._isString();
- if($core.assert($1)){
- return $recv(anonImports)._add_(each);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["add:"]=1;
- //>>excludeEnd("ctx");
- } else {
- $recv(namedImports)._add_($recv(each)._value());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["add:"]=2;
- //>>excludeEnd("ctx");
- return $recv(importVarNames)._add_($recv(each)._key());
- };
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- return $recv(importVarNames).__minus_gt($recv(namedImports).__comma(anonImports));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"importsForOutput:",{aPackage:aPackage,namedImports:namedImports,anonImports:anonImports,importVarNames:importVarNames},$globals.AmdExporter)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage"],
- 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)",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["do:", "imports", "ifTrue:ifFalse:", "isString", "add:", "value", "key", "->", ","]
- }),
- $globals.AmdExporter);
- $core.addClass('ChunkParser', $globals.Object, ['stream', 'last'], 'Platform-ImportExport');
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $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";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "last",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return self["@last"];
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "last\x0a\x09^ last",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.ChunkParser);
- $core.addMethod(
- $core.method({
- selector: "nextChunk",
- protocol: 'reading',
- fn: function (){
- var self=this;
- var char,result,chunk;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2,$3,$4;
- var $early={};
- try {
- result=""._writeStream();
- $recv((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- char=$recv(self["@stream"])._next();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["next"]=1;
- //>>excludeEnd("ctx");
- char;
- return $recv(char)._notNil();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
- //>>excludeEnd("ctx");
- }))._whileTrue_((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $1=$recv(char).__eq("!");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["="]=1;
- //>>excludeEnd("ctx");
- if($core.assert($1)){
- $2=$recv($recv(self["@stream"])._peek()).__eq("!");
- if($core.assert($2)){
- $recv(self["@stream"])._next();
- } else {
- self["@last"]=$recv($recv(result)._contents())._trimBoth();
- $3=self["@last"];
- throw $early=[$3];
- };
- };
- return $recv(result)._nextPut_(char);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
- //>>excludeEnd("ctx");
- }));
- self["@last"]=nil;
- $4=self["@last"];
- return $4;
- }
- catch(e) {if(e===$early)return e[0]; throw e}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"nextChunk",{char:char,result:result,chunk:chunk},$globals.ChunkParser)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- 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",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["writeStream", "whileTrue:", "next", "notNil", "ifTrue:", "=", "ifTrue:ifFalse:", "peek", "trimBoth", "contents", "nextPut:"]
- }),
- $globals.ChunkParser);
- $core.addMethod(
- $core.method({
- selector: "stream:",
- protocol: 'accessing',
- fn: function (aStream){
- var self=this;
- self["@stream"]=aStream;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aStream"],
- source: "stream: aStream\x0a\x09stream := aStream",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.ChunkParser);
- $core.addMethod(
- $core.method({
- selector: "on:",
- protocol: 'instance creation',
- fn: function (aStream){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv(self._new())._stream_(aStream);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"on:",{aStream:aStream},$globals.ChunkParser.klass)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aStream"],
- source: "on: aStream\x0a\x09^ self new stream: aStream",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["stream:", "new"]
- }),
- $globals.ChunkParser.klass);
- $core.addClass('ClassCommentReader', $globals.Object, ['class'], 'Platform-ImportExport');
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $globals.ClassCommentReader.comment="I provide a mechanism for retrieving class comments stored on a file.\x0a\x0aSee also `ClassCategoryReader`.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "class:",
- protocol: 'accessing',
- fn: function (aClass){
- var self=this;
- self["@class"]=aClass;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass"],
- source: "class: aClass\x0a\x09class := aClass",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.ClassCommentReader);
- $core.addMethod(
- $core.method({
- selector: "initialize",
- protocol: 'initialization',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- (
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- ($globals.ClassCommentReader.superclass||$boot.dnu).fn.prototype._initialize.apply($recv(self), []));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = false;
- //>>excludeEnd("ctx");;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.ClassCommentReader)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "initialize\x0a\x09super initialize.",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["initialize"]
- }),
- $globals.ClassCommentReader);
- $core.addMethod(
- $core.method({
- selector: "scanFrom:",
- protocol: 'fileIn',
- fn: function (aChunkParser){
- var self=this;
- var chunk;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- chunk=$recv(aChunkParser)._nextChunk();
- $1=$recv(chunk)._isEmpty();
- if(!$core.assert($1)){
- self._setComment_(chunk);
- };
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"scanFrom:",{aChunkParser:aChunkParser,chunk:chunk},$globals.ClassCommentReader)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aChunkParser"],
- source: "scanFrom: aChunkParser\x0a\x09| chunk |\x0a\x09chunk := aChunkParser nextChunk.\x0a\x09chunk isEmpty ifFalse: [\x0a\x09\x09self setComment: chunk ].",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["nextChunk", "ifFalse:", "isEmpty", "setComment:"]
- }),
- $globals.ClassCommentReader);
- $core.addMethod(
- $core.method({
- selector: "setComment:",
- protocol: 'private',
- fn: function (aString){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv(self["@class"])._comment_(aString);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"setComment:",{aString:aString},$globals.ClassCommentReader)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "setComment: aString\x0a\x09class comment: aString",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["comment:"]
- }),
- $globals.ClassCommentReader);
- $core.addClass('ClassProtocolReader', $globals.Object, ['class', 'category'], 'Platform-ImportExport');
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $globals.ClassProtocolReader.comment="I provide a mechanism for retrieving class descriptions stored on a file in the Smalltalk chunk format.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "class:category:",
- protocol: 'accessing',
- fn: function (aClass,aString){
- var self=this;
- self["@class"]=aClass;
- self["@category"]=aString;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass", "aString"],
- source: "class: aClass category: aString\x0a\x09class := aClass.\x0a\x09category := aString",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.ClassProtocolReader);
- $core.addMethod(
- $core.method({
- selector: "compileMethod:",
- protocol: 'private',
- fn: function (aString){
- var self=this;
- function $Compiler(){return $globals.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv($recv($Compiler())._new())._install_forClass_protocol_(aString,self["@class"],self["@category"]);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"compileMethod:",{aString:aString},$globals.ClassProtocolReader)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "compileMethod: aString\x0a\x09Compiler new install: aString forClass: class protocol: category",
- referencedClasses: ["Compiler"],
- //>>excludeEnd("ide");
- messageSends: ["install:forClass:protocol:", "new"]
- }),
- $globals.ClassProtocolReader);
- $core.addMethod(
- $core.method({
- selector: "initialize",
- protocol: 'initialization',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- (
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- ($globals.ClassProtocolReader.superclass||$boot.dnu).fn.prototype._initialize.apply($recv(self), []));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = false;
- //>>excludeEnd("ctx");;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.ClassProtocolReader)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "initialize\x0a\x09super initialize.",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["initialize"]
- }),
- $globals.ClassProtocolReader);
- $core.addMethod(
- $core.method({
- selector: "scanFrom:",
- protocol: 'fileIn',
- fn: function (aChunkParser){
- var self=this;
- var chunk;
- function $ClassBuilder(){return $globals.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- chunk=$recv(aChunkParser)._nextChunk();
- chunk;
- return $recv(chunk)._isEmpty();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
- //>>excludeEnd("ctx");
- }))._whileFalse_((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return self._compileMethod_(chunk);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
- //>>excludeEnd("ctx");
- }));
- $recv($recv($ClassBuilder())._new())._setupClass_(self["@class"]);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"scanFrom:",{aChunkParser:aChunkParser,chunk:chunk},$globals.ClassProtocolReader)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aChunkParser"],
- source: "scanFrom: aChunkParser\x0a\x09| chunk |\x0a\x09[ chunk := aChunkParser nextChunk.\x0a\x09chunk isEmpty ] whileFalse: [\x0a\x09\x09self compileMethod: chunk ].\x0a\x09ClassBuilder new setupClass: class",
- referencedClasses: ["ClassBuilder"],
- //>>excludeEnd("ide");
- messageSends: ["whileFalse:", "nextChunk", "isEmpty", "compileMethod:", "setupClass:", "new"]
- }),
- $globals.ClassProtocolReader);
- $core.addClass('ExportMethodProtocol', $globals.Object, ['name', 'theClass'], 'Platform-ImportExport');
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $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.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "methods",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- return $recv($recv(self._theClass())._methodsInProtocol_(self._name()))._sorted_((function(a,b){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $1=$recv(a)._selector();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["selector"]=1;
- //>>excludeEnd("ctx");
- return $recv($1).__lt_eq($recv(b)._selector());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"methods",{},$globals.ExportMethodProtocol)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "methods\x0a\x09^ (self theClass methodsInProtocol: self name)\x0a\x09\x09sorted: [ :a :b | a selector <= b selector ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["sorted:", "methodsInProtocol:", "theClass", "name", "<=", "selector"]
- }),
- $globals.ExportMethodProtocol);
- $core.addMethod(
- $core.method({
- selector: "name",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return self["@name"];
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "name\x0a\x09^ name",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.ExportMethodProtocol);
- $core.addMethod(
- $core.method({
- selector: "name:",
- protocol: 'accessing',
- fn: function (aString){
- var self=this;
- self["@name"]=aString;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "name: aString\x0a\x09name := aString",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.ExportMethodProtocol);
- $core.addMethod(
- $core.method({
- selector: "theClass",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return self["@theClass"];
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "theClass\x0a\x09^ theClass",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.ExportMethodProtocol);
- $core.addMethod(
- $core.method({
- selector: "theClass:",
- protocol: 'accessing',
- fn: function (aClass){
- var self=this;
- self["@theClass"]=aClass;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass"],
- source: "theClass: aClass\x0a\x09theClass := aClass",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.ExportMethodProtocol);
- $core.addMethod(
- $core.method({
- selector: "name:theClass:",
- protocol: 'instance creation',
- fn: function (aString,aClass){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=self._new();
- $recv($1)._name_(aString);
- $recv($1)._theClass_(aClass);
- return $recv($1)._yourself();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"name:theClass:",{aString:aString,aClass:aClass},$globals.ExportMethodProtocol.klass)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString", "aClass"],
- source: "name: aString theClass: aClass\x0a\x09^ self new\x0a\x09\x09name: aString;\x0a\x09\x09theClass: aClass;\x0a\x09\x09yourself",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["name:", "new", "theClass:", "yourself"]
- }),
- $globals.ExportMethodProtocol.klass);
- $core.addClass('Importer', $globals.Object, ['lastSection', 'lastChunk'], 'Platform-ImportExport');
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $globals.Importer.comment="I can import Amber code from a string in the chunk format.\x0a\x0a## API\x0a\x0a Importer new import: aString";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "import:",
- protocol: 'fileIn',
- fn: function (aStream){
- var self=this;
- var chunk,result,parser,lastEmpty;
- function $ChunkParser(){return $globals.ChunkParser||(typeof ChunkParser=="undefined"?nil:ChunkParser)}
- function $Compiler(){return $globals.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
- function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2;
- parser=$recv($ChunkParser())._on_(aStream);
- lastEmpty=false;
- self["@lastSection"]="n/a, not started";
- self["@lastChunk"]=nil;
- $recv((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $recv((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- chunk=$recv(parser)._nextChunk();
- chunk;
- return $recv(chunk)._isNil();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
- //>>excludeEnd("ctx");
- }))._whileFalse_((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- $1=$recv(chunk)._isEmpty();
- if($core.assert($1)){
- lastEmpty=true;
- return lastEmpty;
- } else {
- self["@lastSection"]=chunk;
- self["@lastSection"];
- result=$recv($recv($Compiler())._new())._evaluateExpression_(chunk);
- result;
- $2=lastEmpty;
- if($core.assert($2)){
- lastEmpty=false;
- lastEmpty;
- return $recv(result)._scanFrom_(parser);
- };
- };
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)});
- //>>excludeEnd("ctx");
- }));
- self["@lastSection"]="n/a, finished";
- return self["@lastSection"];
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
- //>>excludeEnd("ctx");
- }))._on_do_($Error(),(function(e){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- self["@lastChunk"]=$recv(parser)._last();
- self["@lastChunk"];
- return $recv(e)._resignal();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1,7)});
- //>>excludeEnd("ctx");
- }));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"import:",{aStream:aStream,chunk:chunk,result:result,parser:parser,lastEmpty:lastEmpty},$globals.Importer)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aStream"],
- 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 isEmpty\x0a\x09\x09\x09ifTrue: [ lastEmpty := true ]\x0a\x09\x09\x09ifFalse: [\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 ].",
- referencedClasses: ["ChunkParser", "Compiler", "Error"],
- //>>excludeEnd("ide");
- messageSends: ["on:", "on:do:", "whileFalse:", "nextChunk", "isNil", "ifTrue:ifFalse:", "isEmpty", "evaluateExpression:", "new", "ifTrue:", "scanFrom:", "last", "resignal"]
- }),
- $globals.Importer);
- $core.addMethod(
- $core.method({
- selector: "lastChunk",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return self["@lastChunk"];
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "lastChunk\x0a\x09^ lastChunk",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.Importer);
- $core.addMethod(
- $core.method({
- selector: "lastSection",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return self["@lastSection"];
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "lastSection\x0a\x09^ lastSection",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.Importer);
- $core.addClass('PackageCommitError', $globals.Error, [], 'Platform-ImportExport');
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $globals.PackageCommitError.comment="I get signaled when an attempt to commit a package has failed.";
- //>>excludeEnd("ide");
- $core.addClass('PackageHandler', $globals.InterfacingObject, [], 'Platform-ImportExport');
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $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.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "ajaxPutAt:data:onSuccess:onError:",
- protocol: 'private',
- fn: function (aURL,aString,aBlock,anotherBlock){
- var self=this;
- var xhr;
- function $Platform(){return $globals.Platform||(typeof Platform=="undefined"?nil:Platform)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$4,$3,$2;
- xhr=$recv($Platform())._newXhr();
- $recv(xhr)._open_url_async_("PUT",aURL,true);
- $recv(xhr)._onreadystatechange_((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $1=$recv($recv(xhr)._readyState()).__eq((4));
- if($core.assert($1)){
- $4=$recv(xhr)._status();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["status"]=1;
- //>>excludeEnd("ctx");
- $3=$recv($4).__gt_eq((200));
- $2=$recv($3)._and_((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- return $recv($recv(xhr)._status()).__lt((300));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)});
- //>>excludeEnd("ctx");
- }));
- return $recv($2)._ifTrue_ifFalse_(aBlock,anotherBlock);
- };
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- $recv(xhr)._send_(aString);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"ajaxPutAt:data:onSuccess:onError:",{aURL:aURL,aString:aString,aBlock:aBlock,anotherBlock:anotherBlock,xhr:xhr},$globals.PackageHandler)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aURL", "aString", "aBlock", "anotherBlock"],
- 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",
- referencedClasses: ["Platform"],
- //>>excludeEnd("ide");
- messageSends: ["newXhr", "open:url:async:", "onreadystatechange:", "ifTrue:", "=", "readyState", "ifTrue:ifFalse:", "and:", ">=", "status", "<", "send:"]
- }),
- $globals.PackageHandler);
- $core.addMethod(
- $core.method({
- selector: "chunkContentsFor:",
- protocol: 'accessing',
- fn: function (aPackage){
- var self=this;
- function $String(){return $globals.String||(typeof String=="undefined"?nil:String)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($String())._streamContents_((function(str){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(self._chunkExporter())._exportPackage_on_(aPackage,str);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"chunkContentsFor:",{aPackage:aPackage},$globals.PackageHandler)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage"],
- source: "chunkContentsFor: aPackage\x0a\x09^ String streamContents: [ :str |\x0a\x09\x09self chunkExporter exportPackage: aPackage on: str ]",
- referencedClasses: ["String"],
- //>>excludeEnd("ide");
- messageSends: ["streamContents:", "exportPackage:on:", "chunkExporter"]
- }),
- $globals.PackageHandler);
- $core.addMethod(
- $core.method({
- selector: "chunkExporter",
- protocol: 'factory',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv(self._chunkExporterClass())._new();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"chunkExporter",{},$globals.PackageHandler)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "chunkExporter\x0a\x09^ self chunkExporterClass new",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["new", "chunkExporterClass"]
- }),
- $globals.PackageHandler);
- $core.addMethod(
- $core.method({
- selector: "chunkExporterClass",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- function $ChunkExporter(){return $globals.ChunkExporter||(typeof ChunkExporter=="undefined"?nil:ChunkExporter)}
- return $ChunkExporter();
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "chunkExporterClass\x0a\x09^ ChunkExporter",
- referencedClasses: ["ChunkExporter"],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.PackageHandler);
- $core.addMethod(
- $core.method({
- selector: "commit:",
- protocol: 'committing',
- fn: function (aPackage){
- var self=this;
- function $PackageCommitError(){return $globals.PackageCommitError||(typeof PackageCommitError=="undefined"?nil:PackageCommitError)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2;
- self._commit_onSuccess_onError_(aPackage,(function(){
- }),(function(error){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $1=$recv($PackageCommitError())._new();
- $2=$recv("Commiting failed with reason: \x22".__comma($recv(error)._responseText())).__comma("\x22");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx[","]=1;
- //>>excludeEnd("ctx");
- $recv($1)._messageText_($2);
- return $recv($1)._signal();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1,2)});
- //>>excludeEnd("ctx");
- }));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"commit:",{aPackage:aPackage},$globals.PackageHandler)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage"],
- 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 ]",
- referencedClasses: ["PackageCommitError"],
- //>>excludeEnd("ide");
- messageSends: ["commit:onSuccess:onError:", "messageText:", "new", ",", "responseText", "signal"]
- }),
- $globals.PackageHandler);
- $core.addMethod(
- $core.method({
- selector: "commit:onSuccess:onError:",
- protocol: 'committing',
- fn: function (aPackage,aBlock,anotherBlock){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- self._commitJsFileFor_onSuccess_onError_(aPackage,(function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return self._commitStFileFor_onSuccess_onError_(aPackage,(function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- $recv(aPackage)._beClean();
- return $recv(aBlock)._value();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
- //>>excludeEnd("ctx");
- }),anotherBlock);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
- //>>excludeEnd("ctx");
- }),anotherBlock);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"commit:onSuccess:onError:",{aPackage:aPackage,aBlock:aBlock,anotherBlock:anotherBlock},$globals.PackageHandler)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage", "aBlock", "anotherBlock"],
- 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",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["commitJsFileFor:onSuccess:onError:", "commitStFileFor:onSuccess:onError:", "beClean", "value"]
- }),
- $globals.PackageHandler);
- $core.addMethod(
- $core.method({
- selector: "commitJsFileFor:onSuccess:onError:",
- protocol: 'committing',
- fn: function (aPackage,aBlock,anotherBlock){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $2,$1;
- $2=$recv($recv(self._commitPathJsFor_(aPackage)).__comma("/")).__comma($recv(aPackage)._name());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=2;
- //>>excludeEnd("ctx");
- $1=$recv($2).__comma(".js");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=1;
- //>>excludeEnd("ctx");
- self._ajaxPutAt_data_onSuccess_onError_($1,self._contentsFor_(aPackage),aBlock,anotherBlock);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"commitJsFileFor:onSuccess:onError:",{aPackage:aPackage,aBlock:aBlock,anotherBlock:anotherBlock},$globals.PackageHandler)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage", "aBlock", "anotherBlock"],
- 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",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ajaxPutAt:data:onSuccess:onError:", ",", "commitPathJsFor:", "name", "contentsFor:"]
- }),
- $globals.PackageHandler);
- $core.addMethod(
- $core.method({
- selector: "commitPathJsFor:",
- protocol: 'accessing',
- fn: function (aPackage){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- self._subclassResponsibility();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"commitPathJsFor:",{aPackage:aPackage},$globals.PackageHandler)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage"],
- source: "commitPathJsFor: aPackage\x0a\x09self subclassResponsibility",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["subclassResponsibility"]
- }),
- $globals.PackageHandler);
- $core.addMethod(
- $core.method({
- selector: "commitPathStFor:",
- protocol: 'accessing',
- fn: function (aPackage){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- self._subclassResponsibility();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"commitPathStFor:",{aPackage:aPackage},$globals.PackageHandler)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage"],
- source: "commitPathStFor: aPackage\x0a\x09self subclassResponsibility",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["subclassResponsibility"]
- }),
- $globals.PackageHandler);
- $core.addMethod(
- $core.method({
- selector: "commitStFileFor:onSuccess:onError:",
- protocol: 'committing',
- fn: function (aPackage,aBlock,anotherBlock){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $2,$1;
- $2=$recv($recv(self._commitPathStFor_(aPackage)).__comma("/")).__comma($recv(aPackage)._name());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=2;
- //>>excludeEnd("ctx");
- $1=$recv($2).__comma(".st");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=1;
- //>>excludeEnd("ctx");
- self._ajaxPutAt_data_onSuccess_onError_($1,self._chunkContentsFor_(aPackage),aBlock,anotherBlock);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"commitStFileFor:onSuccess:onError:",{aPackage:aPackage,aBlock:aBlock,anotherBlock:anotherBlock},$globals.PackageHandler)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage", "aBlock", "anotherBlock"],
- 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",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ajaxPutAt:data:onSuccess:onError:", ",", "commitPathStFor:", "name", "chunkContentsFor:"]
- }),
- $globals.PackageHandler);
- $core.addMethod(
- $core.method({
- selector: "contentsFor:",
- protocol: 'accessing',
- fn: function (aPackage){
- var self=this;
- function $String(){return $globals.String||(typeof String=="undefined"?nil:String)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($String())._streamContents_((function(str){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(self._exporter())._exportPackage_on_(aPackage,str);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"contentsFor:",{aPackage:aPackage},$globals.PackageHandler)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage"],
- source: "contentsFor: aPackage\x0a\x09^ String streamContents: [ :str |\x0a\x09\x09self exporter exportPackage: aPackage on: str ]",
- referencedClasses: ["String"],
- //>>excludeEnd("ide");
- messageSends: ["streamContents:", "exportPackage:on:", "exporter"]
- }),
- $globals.PackageHandler);
- $core.addMethod(
- $core.method({
- selector: "exporter",
- protocol: 'factory',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv(self._exporterClass())._new();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"exporter",{},$globals.PackageHandler)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "exporter\x0a\x09^ self exporterClass new",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["new", "exporterClass"]
- }),
- $globals.PackageHandler);
- $core.addMethod(
- $core.method({
- selector: "exporterClass",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- self._subclassResponsibility();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"exporterClass",{},$globals.PackageHandler)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "exporterClass\x0a\x09self subclassResponsibility",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["subclassResponsibility"]
- }),
- $globals.PackageHandler);
- $core.addMethod(
- $core.method({
- selector: "load:",
- protocol: 'loading',
- fn: function (aPackage){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- self._subclassResponsibility();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"load:",{aPackage:aPackage},$globals.PackageHandler)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage"],
- source: "load: aPackage\x0a\x09self subclassResponsibility",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["subclassResponsibility"]
- }),
- $globals.PackageHandler);
- $core.addMethod(
- $core.method({
- selector: "onCommitError:",
- protocol: 'error handling',
- fn: function (anError){
- var self=this;
- function $PackageCommitError(){return $globals.PackageCommitError||(typeof PackageCommitError=="undefined"?nil:PackageCommitError)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2;
- $1=$recv($PackageCommitError())._new();
- $2=$recv("Commiting failed with reason: \x22".__comma($recv(anError)._responseText())).__comma("\x22");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=1;
- //>>excludeEnd("ctx");
- $recv($1)._messageText_($2);
- $recv($1)._signal();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"onCommitError:",{anError:anError},$globals.PackageHandler)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anError"],
- source: "onCommitError: anError\x0a\x09PackageCommitError new\x0a\x09\x09messageText: 'Commiting failed with reason: \x22' , (anError responseText) , '\x22';\x0a\x09\x09signal",
- referencedClasses: ["PackageCommitError"],
- //>>excludeEnd("ide");
- messageSends: ["messageText:", "new", ",", "responseText", "signal"]
- }),
- $globals.PackageHandler);
- $core.addClass('AmdPackageHandler', $globals.PackageHandler, [], 'Platform-ImportExport');
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $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.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "commitPathJsFor:",
- protocol: 'accessing',
- fn: function (aPackage){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return self._toUrl_(self._namespaceFor_(aPackage));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"commitPathJsFor:",{aPackage:aPackage},$globals.AmdPackageHandler)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage"],
- source: "commitPathJsFor: aPackage\x0a\x09^ self toUrl: (self namespaceFor: aPackage)",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["toUrl:", "namespaceFor:"]
- }),
- $globals.AmdPackageHandler);
- $core.addMethod(
- $core.method({
- selector: "commitPathStFor:",
- protocol: 'accessing',
- fn: function (aPackage){
- var self=this;
- var path,pathWithout;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2;
- $1=$recv(self._namespaceFor_(aPackage)).__comma("/_source");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=1;
- //>>excludeEnd("ctx");
- path=self._toUrl_($1);
- pathWithout=self._commitPathJsFor_(aPackage);
- $2=$recv(path).__eq($recv(pathWithout).__comma("/_source"));
- if($core.assert($2)){
- return pathWithout;
- } else {
- return path;
- };
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"commitPathStFor:",{aPackage:aPackage,path:path,pathWithout:pathWithout},$globals.AmdPackageHandler)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage"],
- 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 ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["toUrl:", ",", "namespaceFor:", "commitPathJsFor:", "ifTrue:ifFalse:", "="]
- }),
- $globals.AmdPackageHandler);
- $core.addMethod(
- $core.method({
- selector: "exporterClass",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- function $AmdExporter(){return $globals.AmdExporter||(typeof AmdExporter=="undefined"?nil:AmdExporter)}
- return $AmdExporter();
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "exporterClass\x0a\x09^ AmdExporter",
- referencedClasses: ["AmdExporter"],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.AmdPackageHandler);
- $core.addMethod(
- $core.method({
- selector: "load:",
- protocol: 'loading',
- fn: function (aPackage){
- var self=this;
- function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
- function $Array(){return $globals.Array||(typeof Array=="undefined"?nil:Array)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$3,$2,$receiver;
- $1=$recv($Smalltalk())._amdRequire();
- if(($receiver = $1) == null || $receiver.isNil){
- self._error_("AMD loader not present");
- } else {
- var require;
- require=$receiver;
- $3=$recv($recv(self._namespaceFor_(aPackage)).__comma("/")).__comma($recv(aPackage)._name());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=1;
- //>>excludeEnd("ctx");
- $2=$recv($Array())._with_($3);
- $recv(require)._value_($2);
- };
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"load:",{aPackage:aPackage},$globals.AmdPackageHandler)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage"],
- 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 ) ]",
- referencedClasses: ["Smalltalk", "Array"],
- //>>excludeEnd("ide");
- messageSends: ["ifNil:ifNotNil:", "amdRequire", "error:", "value:", "with:", ",", "namespaceFor:", "name"]
- }),
- $globals.AmdPackageHandler);
- $core.addMethod(
- $core.method({
- selector: "namespaceFor:",
- protocol: 'committing',
- fn: function (aPackage){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($recv(aPackage)._transport())._namespace();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"namespaceFor:",{aPackage:aPackage},$globals.AmdPackageHandler)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage"],
- source: "namespaceFor: aPackage\x0a\x09^ aPackage transport namespace",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["namespace", "transport"]
- }),
- $globals.AmdPackageHandler);
- $core.addMethod(
- $core.method({
- selector: "toUrl:",
- protocol: 'private',
- fn: function (aString){
- var self=this;
- function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$receiver;
- $1=$recv($Smalltalk())._amdRequire();
- if(($receiver = $1) == null || $receiver.isNil){
- return self._error_("AMD loader not present");
- } else {
- var require;
- require=$receiver;
- return $recv($recv(require)._basicAt_("toUrl"))._value_(aString);
- };
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"toUrl:",{aString:aString},$globals.AmdPackageHandler)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- 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 ]",
- referencedClasses: ["Smalltalk"],
- //>>excludeEnd("ide");
- messageSends: ["ifNil:ifNotNil:", "amdRequire", "error:", "value:", "basicAt:"]
- }),
- $globals.AmdPackageHandler);
- $core.addMethod(
- $core.method({
- selector: "defaultNamespace",
- protocol: 'commit paths',
- fn: function (){
- var self=this;
- function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($Smalltalk())._defaultAmdNamespace();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"defaultNamespace",{},$globals.AmdPackageHandler.klass)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "defaultNamespace\x0a\x09^ Smalltalk defaultAmdNamespace",
- referencedClasses: ["Smalltalk"],
- //>>excludeEnd("ide");
- messageSends: ["defaultAmdNamespace"]
- }),
- $globals.AmdPackageHandler.klass);
- $core.addMethod(
- $core.method({
- selector: "defaultNamespace:",
- protocol: 'commit paths',
- fn: function (aString){
- var self=this;
- function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv($Smalltalk())._defaultAmdNamespace_(aString);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"defaultNamespace:",{aString:aString},$globals.AmdPackageHandler.klass)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "defaultNamespace: aString\x0a\x09Smalltalk defaultAmdNamespace: aString",
- referencedClasses: ["Smalltalk"],
- //>>excludeEnd("ide");
- messageSends: ["defaultAmdNamespace:"]
- }),
- $globals.AmdPackageHandler.klass);
- $core.addClass('PackageTransport', $globals.Object, ['package'], 'Platform-ImportExport');
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $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.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "asJSON",
- protocol: 'converting',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $globals.HashedCollection._newFromPairs_(["type",self._type()]);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"asJSON",{},$globals.PackageTransport)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "asJSON\x0a\x09^ #{ 'type' -> self type }",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["type"]
- }),
- $globals.PackageTransport);
- $core.addMethod(
- $core.method({
- selector: "commit",
- protocol: 'committing',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv(self._commitHandler())._commit_(self._package());
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"commit",{},$globals.PackageTransport)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "commit\x0a\x09self commitHandler commit: self package",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["commit:", "commitHandler", "package"]
- }),
- $globals.PackageTransport);
- $core.addMethod(
- $core.method({
- selector: "commitHandler",
- protocol: 'factory',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv(self._commitHandlerClass())._new();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"commitHandler",{},$globals.PackageTransport)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "commitHandler\x0a\x09^ self commitHandlerClass new",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["new", "commitHandlerClass"]
- }),
- $globals.PackageTransport);
- $core.addMethod(
- $core.method({
- selector: "commitHandlerClass",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- self._subclassResponsibility();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"commitHandlerClass",{},$globals.PackageTransport)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "commitHandlerClass\x0a\x09self subclassResponsibility",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["subclassResponsibility"]
- }),
- $globals.PackageTransport);
- $core.addMethod(
- $core.method({
- selector: "commitOnSuccess:onError:",
- protocol: 'committing',
- fn: function (aBlock,anotherBlock){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv(self._commitHandler())._commit_onSuccess_onError_(self._package(),aBlock,anotherBlock);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"commitOnSuccess:onError:",{aBlock:aBlock,anotherBlock:anotherBlock},$globals.PackageTransport)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aBlock", "anotherBlock"],
- source: "commitOnSuccess: aBlock onError: anotherBlock\x0a\x09self commitHandler \x0a\x09\x09commit: self package\x0a\x09\x09onSuccess: aBlock\x0a\x09\x09onError: anotherBlock",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["commit:onSuccess:onError:", "commitHandler", "package"]
- }),
- $globals.PackageTransport);
- $core.addMethod(
- $core.method({
- selector: "definition",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return "";
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "definition\x0a\x09^ ''",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.PackageTransport);
- $core.addMethod(
- $core.method({
- selector: "load",
- protocol: 'loading',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv(self._commitHandler())._load_(self._package());
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"load",{},$globals.PackageTransport)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "load\x0a\x09self commitHandler load: self package",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["load:", "commitHandler", "package"]
- }),
- $globals.PackageTransport);
- $core.addMethod(
- $core.method({
- selector: "package",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return self["@package"];
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "package\x0a\x09^ package",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.PackageTransport);
- $core.addMethod(
- $core.method({
- selector: "package:",
- protocol: 'accessing',
- fn: function (aPackage){
- var self=this;
- self["@package"]=aPackage;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackage"],
- source: "package: aPackage\x0a\x09package := aPackage",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.PackageTransport);
- $core.addMethod(
- $core.method({
- selector: "setupFromJson:",
- protocol: 'initialization',
- fn: function (anObject){
- var self=this;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anObject"],
- source: "setupFromJson: anObject\x0a\x09\x22no op. override if needed in subclasses\x22",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.PackageTransport);
- $core.addMethod(
- $core.method({
- selector: "type",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv(self._class())._type();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"type",{},$globals.PackageTransport)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "type\x0a\x09^ self class type",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["type", "class"]
- }),
- $globals.PackageTransport);
- $globals.PackageTransport.klass.iVarNames = ['registry'];
- $core.addMethod(
- $core.method({
- selector: "classRegisteredFor:",
- protocol: 'accessing',
- fn: function (aString){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv(self["@registry"])._at_(aString);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"classRegisteredFor:",{aString:aString},$globals.PackageTransport.klass)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "classRegisteredFor: aString\x0a\x09^ registry at: aString",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["at:"]
- }),
- $globals.PackageTransport.klass);
- $core.addMethod(
- $core.method({
- selector: "defaultType",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- function $AmdPackageTransport(){return $globals.AmdPackageTransport||(typeof AmdPackageTransport=="undefined"?nil:AmdPackageTransport)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($AmdPackageTransport())._type();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"defaultType",{},$globals.PackageTransport.klass)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "defaultType\x0a\x09^ AmdPackageTransport type",
- referencedClasses: ["AmdPackageTransport"],
- //>>excludeEnd("ide");
- messageSends: ["type"]
- }),
- $globals.PackageTransport.klass);
- $core.addMethod(
- $core.method({
- selector: "for:",
- protocol: 'instance creation',
- fn: function (aString){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv(self._classRegisteredFor_(aString))._new();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"for:",{aString:aString},$globals.PackageTransport.klass)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "for: aString\x0a\x09^ (self classRegisteredFor: aString) new",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["new", "classRegisteredFor:"]
- }),
- $globals.PackageTransport.klass);
- $core.addMethod(
- $core.method({
- selector: "fromJson:",
- protocol: 'instance creation',
- fn: function (anObject){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2,$receiver;
- if(($receiver = anObject) == null || $receiver.isNil){
- $1=self._for_(self._defaultType());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["for:"]=1;
- //>>excludeEnd("ctx");
- return $1;
- } else {
- anObject;
- };
- $2=self._for_($recv(anObject)._type());
- $recv($2)._setupFromJson_(anObject);
- return $recv($2)._yourself();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"fromJson:",{anObject:anObject},$globals.PackageTransport.klass)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anObject"],
- 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",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifNil:", "for:", "defaultType", "setupFromJson:", "type", "yourself"]
- }),
- $globals.PackageTransport.klass);
- $core.addMethod(
- $core.method({
- selector: "initialize",
- protocol: 'initialization',
- fn: function (){
- var self=this;
- function $PackageTransport(){return $globals.PackageTransport||(typeof PackageTransport=="undefined"?nil:PackageTransport)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- (
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- ($globals.PackageTransport.klass.superclass||$boot.dnu).fn.prototype._initialize.apply($recv(self), []));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = false;
- //>>excludeEnd("ctx");;
- $1=self.__eq_eq($PackageTransport());
- if($core.assert($1)){
- self["@registry"]=$globals.HashedCollection._newFromPairs_([]);
- self["@registry"];
- } else {
- self._register();
- };
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.PackageTransport.klass)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "initialize\x0a\x09super initialize.\x0a\x09self == PackageTransport\x0a\x09\x09ifTrue: [ registry := #{} ]\x0a\x09\x09ifFalse: [ self register ]",
- referencedClasses: ["PackageTransport"],
- //>>excludeEnd("ide");
- messageSends: ["initialize", "ifTrue:ifFalse:", "==", "register"]
- }),
- $globals.PackageTransport.klass);
- $core.addMethod(
- $core.method({
- selector: "register",
- protocol: 'registration',
- fn: function (){
- var self=this;
- function $PackageTransport(){return $globals.PackageTransport||(typeof PackageTransport=="undefined"?nil:PackageTransport)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv($PackageTransport())._register_(self);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"register",{},$globals.PackageTransport.klass)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "register\x0a\x09PackageTransport register: self",
- referencedClasses: ["PackageTransport"],
- //>>excludeEnd("ide");
- messageSends: ["register:"]
- }),
- $globals.PackageTransport.klass);
- $core.addMethod(
- $core.method({
- selector: "register:",
- protocol: 'registration',
- fn: function (aClass){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$receiver;
- $1=$recv(aClass)._type();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["type"]=1;
- //>>excludeEnd("ctx");
- if(($receiver = $1) == null || $receiver.isNil){
- $1;
- } else {
- $recv(self["@registry"])._at_put_($recv(aClass)._type(),aClass);
- };
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"register:",{aClass:aClass},$globals.PackageTransport.klass)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass"],
- source: "register: aClass\x0a\x09aClass type ifNotNil: [\x0a\x09\x09registry at: aClass type put: aClass ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifNotNil:", "type", "at:put:"]
- }),
- $globals.PackageTransport.klass);
- $core.addMethod(
- $core.method({
- selector: "type",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return nil;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "type\x0a\x09\x22Override in subclasses\x22\x0a\x09^ nil",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.PackageTransport.klass);
- $core.addClass('AmdPackageTransport', $globals.PackageTransport, ['namespace'], 'Platform-ImportExport');
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $globals.AmdPackageTransport.comment="I am the default transport for committing packages.\x0a\x0aSee `AmdExporter` and `AmdPackageHandler`.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "asJSON",
- protocol: 'converting',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=(
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- ($globals.AmdPackageTransport.superclass||$boot.dnu).fn.prototype._asJSON.apply($recv(self), []));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = false;
- //>>excludeEnd("ctx");;
- $recv($1)._at_put_("amdNamespace",self._namespace());
- return $recv($1)._yourself();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"asJSON",{},$globals.AmdPackageTransport)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "asJSON\x0a\x09^ super asJSON\x0a\x09\x09at: 'amdNamespace' put: self namespace;\x0a\x09\x09yourself",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["at:put:", "asJSON", "namespace", "yourself"]
- }),
- $globals.AmdPackageTransport);
- $core.addMethod(
- $core.method({
- selector: "commitHandlerClass",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- function $AmdPackageHandler(){return $globals.AmdPackageHandler||(typeof AmdPackageHandler=="undefined"?nil:AmdPackageHandler)}
- return $AmdPackageHandler();
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "commitHandlerClass\x0a\x09^ AmdPackageHandler",
- referencedClasses: ["AmdPackageHandler"],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.AmdPackageTransport);
- $core.addMethod(
- $core.method({
- selector: "defaultNamespace",
- protocol: 'defaults',
- fn: function (){
- var self=this;
- function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($Smalltalk())._defaultAmdNamespace();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"defaultNamespace",{},$globals.AmdPackageTransport)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "defaultNamespace\x0a\x09^ Smalltalk defaultAmdNamespace",
- referencedClasses: ["Smalltalk"],
- //>>excludeEnd("ide");
- messageSends: ["defaultAmdNamespace"]
- }),
- $globals.AmdPackageTransport);
- $core.addMethod(
- $core.method({
- selector: "definition",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- function $String(){return $globals.String||(typeof String=="undefined"?nil:String)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- return $recv($String())._streamContents_((function(stream){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $recv(stream)._nextPutAll_($recv(self._class())._name());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["nextPutAll:"]=1;
- //>>excludeEnd("ctx");
- $recv(stream)._nextPutAll_(" namespace: ");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["nextPutAll:"]=2;
- //>>excludeEnd("ctx");
- $1=$recv("'".__comma(self._namespace())).__comma("'");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx[","]=1;
- //>>excludeEnd("ctx");
- return $recv(stream)._nextPutAll_($1);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"definition",{},$globals.AmdPackageTransport)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "definition\x0a\x09^ String streamContents: [ :stream |\x0a\x09\x09stream \x0a\x09\x09\x09nextPutAll: self class name;\x0a\x09\x09\x09nextPutAll: ' namespace: ';\x0a\x09\x09\x09nextPutAll: '''', self namespace, '''' ]",
- referencedClasses: ["String"],
- //>>excludeEnd("ide");
- messageSends: ["streamContents:", "nextPutAll:", "name", "class", ",", "namespace"]
- }),
- $globals.AmdPackageTransport);
- $core.addMethod(
- $core.method({
- selector: "namespace",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$receiver;
- $1=self["@namespace"];
- if(($receiver = $1) == null || $receiver.isNil){
- return self._defaultNamespace();
- } else {
- return $1;
- };
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"namespace",{},$globals.AmdPackageTransport)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "namespace\x0a\x09^ namespace ifNil: [ self defaultNamespace ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifNil:", "defaultNamespace"]
- }),
- $globals.AmdPackageTransport);
- $core.addMethod(
- $core.method({
- selector: "namespace:",
- protocol: 'accessing',
- fn: function (aString){
- var self=this;
- self["@namespace"]=aString;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "namespace: aString\x0a\x09namespace := aString",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.AmdPackageTransport);
- $core.addMethod(
- $core.method({
- selector: "printOn:",
- protocol: 'printing',
- fn: function (aStream){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- (
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- ($globals.AmdPackageTransport.superclass||$boot.dnu).fn.prototype._printOn_.apply($recv(self), [aStream]));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = false;
- //>>excludeEnd("ctx");;
- $recv(aStream)._nextPutAll_(" (AMD Namespace: ");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=1;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_(self._namespace());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["nextPutAll:"]=2;
- //>>excludeEnd("ctx");
- $recv(aStream)._nextPutAll_(")");
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},$globals.AmdPackageTransport)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aStream"],
- source: "printOn: aStream\x0a\x09super printOn: aStream.\x0a\x09aStream\x0a\x09\x09nextPutAll: ' (AMD Namespace: ';\x0a\x09\x09nextPutAll: self namespace;\x0a\x09\x09nextPutAll: ')'",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["printOn:", "nextPutAll:", "namespace"]
- }),
- $globals.AmdPackageTransport);
- $core.addMethod(
- $core.method({
- selector: "setPath:",
- protocol: 'actions',
- fn: function (aString){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv($recv(require)._basicAt_("config"))._value_($globals.HashedCollection._newFromPairs_(["paths",$globals.HashedCollection._newFromPairs_([self._namespace(),aString])]));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"setPath:",{aString:aString},$globals.AmdPackageTransport)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- 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}.",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["value:", "basicAt:", "namespace"]
- }),
- $globals.AmdPackageTransport);
- $core.addMethod(
- $core.method({
- selector: "setupFromJson:",
- protocol: 'initialization',
- fn: function (anObject){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- self._namespace_($recv(anObject)._at_("amdNamespace"));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"setupFromJson:",{anObject:anObject},$globals.AmdPackageTransport)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anObject"],
- source: "setupFromJson: anObject\x0a\x09self namespace: (anObject at: 'amdNamespace')",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["namespace:", "at:"]
- }),
- $globals.AmdPackageTransport);
- $core.addMethod(
- $core.method({
- selector: "namespace:",
- protocol: 'instance creation',
- fn: function (aString){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=self._new();
- $recv($1)._namespace_(aString);
- return $recv($1)._yourself();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"namespace:",{aString:aString},$globals.AmdPackageTransport.klass)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "namespace: aString\x0a\x09^ self new\x0a\x09\x09namespace: aString;\x0a\x09\x09yourself",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["namespace:", "new", "yourself"]
- }),
- $globals.AmdPackageTransport.klass);
- $core.addMethod(
- $core.method({
- selector: "type",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return "amd";
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "type\x0a\x09^ 'amd'",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.AmdPackageTransport.klass);
- $core.addMethod(
- $core.method({
- selector: "commentStamp",
- protocol: '*Platform-ImportExport',
- fn: function (){
- var self=this;
- function $ClassCommentReader(){return $globals.ClassCommentReader||(typeof ClassCommentReader=="undefined"?nil:ClassCommentReader)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$recv($ClassCommentReader())._new();
- $recv($1)._class_(self);
- return $recv($1)._yourself();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"commentStamp",{},$globals.Behavior)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "commentStamp\x0a\x09^ ClassCommentReader new\x0a\x09class: self;\x0a\x09yourself",
- referencedClasses: ["ClassCommentReader"],
- //>>excludeEnd("ide");
- messageSends: ["class:", "new", "yourself"]
- }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "commentStamp:prior:",
- protocol: '*Platform-ImportExport',
- fn: function (aStamp,prior){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return self._commentStamp();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"commentStamp:prior:",{aStamp:aStamp,prior:prior},$globals.Behavior)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aStamp", "prior"],
- source: "commentStamp: aStamp prior: prior\x0a\x09\x09^ self commentStamp",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["commentStamp"]
- }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "methodsFor:",
- protocol: '*Platform-ImportExport',
- fn: function (aString){
- var self=this;
- function $ClassProtocolReader(){return $globals.ClassProtocolReader||(typeof ClassProtocolReader=="undefined"?nil:ClassProtocolReader)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$recv($ClassProtocolReader())._new();
- $recv($1)._class_category_(self,aString);
- return $recv($1)._yourself();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"methodsFor:",{aString:aString},$globals.Behavior)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "methodsFor: aString\x0a\x09^ ClassProtocolReader new\x0a\x09\x09class: self category: aString;\x0a\x09\x09yourself",
- referencedClasses: ["ClassProtocolReader"],
- //>>excludeEnd("ide");
- messageSends: ["class:category:", "new", "yourself"]
- }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "methodsFor:stamp:",
- protocol: '*Platform-ImportExport',
- fn: function (aString,aStamp){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return self._methodsFor_(aString);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"methodsFor:stamp:",{aString:aString,aStamp:aStamp},$globals.Behavior)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString", "aStamp"],
- source: "methodsFor: aString stamp: aStamp\x0a\x09\x22Added for file-in compatibility, ignores stamp.\x22\x0a\x09^ self methodsFor: aString",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["methodsFor:"]
- }),
- $globals.Behavior);
- $core.addMethod(
- $core.method({
- selector: "commit",
- protocol: '*Platform-ImportExport',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv(self._transport())._commit();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"commit",{},$globals.Package)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "commit\x0a\x09^ self transport commit",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["commit", "transport"]
- }),
- $globals.Package);
- $core.addMethod(
- $core.method({
- selector: "load",
- protocol: '*Platform-ImportExport',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv(self._transport())._load();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"load",{},$globals.Package)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "load\x0a\x09^ self transport load",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["load", "transport"]
- }),
- $globals.Package);
- $core.addMethod(
- $core.method({
- selector: "loadFromNamespace:",
- protocol: '*Platform-ImportExport',
- fn: function (aString){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=self._transport();
- $recv($1)._namespace_(aString);
- return $recv($1)._load();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"loadFromNamespace:",{aString:aString},$globals.Package)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "loadFromNamespace: aString\x0a\x09^ self transport\x0a\x09\x09namespace: aString;\x0a\x09\x09load",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["namespace:", "transport", "load"]
- }),
- $globals.Package);
- $core.addMethod(
- $core.method({
- selector: "load:",
- protocol: '*Platform-ImportExport',
- fn: function (aPackageName){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv(self._named_(aPackageName))._load();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"load:",{aPackageName:aPackageName},$globals.Package.klass)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackageName"],
- source: "load: aPackageName\x0a\x09(self named: aPackageName) load",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["load", "named:"]
- }),
- $globals.Package.klass);
- $core.addMethod(
- $core.method({
- selector: "load:fromNamespace:",
- protocol: '*Platform-ImportExport',
- fn: function (aPackageName,aString){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv(self._named_(aPackageName))._loadFromNamespace_(aString);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"load:fromNamespace:",{aPackageName:aPackageName,aString:aString},$globals.Package.klass)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPackageName", "aString"],
- source: "load: aPackageName fromNamespace: aString\x0a\x09(self named: aPackageName) loadFromNamespace: aString",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["loadFromNamespace:", "named:"]
- }),
- $globals.Package.klass);
- });
|