Kernel-Collections.deploy.js 133 KB

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