1
0

Kernel-Collections.deploy.js 132 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497
  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. "_space",
  3029. smalltalk.method({
  3030. selector: "space",
  3031. fn: function (){
  3032. var self=this;
  3033. return smalltalk.withContext(function($ctx1) {
  3034. return ' ';
  3035. return self}, function($ctx1) {$ctx1.fill(self,"space",{}, smalltalk.String.klass)})},
  3036. messageSends: []}),
  3037. smalltalk.String.klass);
  3038. smalltalk.addMethod(
  3039. "_streamClass",
  3040. smalltalk.method({
  3041. selector: "streamClass",
  3042. fn: function (){
  3043. var self=this;
  3044. return smalltalk.withContext(function($ctx1) {
  3045. var $1;
  3046. $1=(smalltalk.StringStream || StringStream);
  3047. return $1;
  3048. }, function($ctx1) {$ctx1.fill(self,"streamClass",{}, smalltalk.String.klass)})},
  3049. messageSends: []}),
  3050. smalltalk.String.klass);
  3051. smalltalk.addMethod(
  3052. "_streamContents_",
  3053. smalltalk.method({
  3054. selector: "streamContents:",
  3055. fn: function (blockWithArg){
  3056. var self=this;
  3057. var stream;
  3058. return smalltalk.withContext(function($ctx1) {
  3059. var $1;
  3060. stream=_st(_st(self)._streamClass())._on_(_st((smalltalk.String || String))._new());
  3061. _st(blockWithArg)._value_(stream);
  3062. $1=_st(stream)._contents();
  3063. return $1;
  3064. }, function($ctx1) {$ctx1.fill(self,"streamContents:",{blockWithArg:blockWithArg,stream:stream}, smalltalk.String.klass)})},
  3065. messageSends: ["on:", "new", "streamClass", "value:", "contents"]}),
  3066. smalltalk.String.klass);
  3067. smalltalk.addMethod(
  3068. "_tab",
  3069. smalltalk.method({
  3070. selector: "tab",
  3071. fn: function (){
  3072. var self=this;
  3073. return smalltalk.withContext(function($ctx1) {
  3074. return '\t';
  3075. return self}, function($ctx1) {$ctx1.fill(self,"tab",{}, smalltalk.String.klass)})},
  3076. messageSends: []}),
  3077. smalltalk.String.klass);
  3078. smalltalk.addMethod(
  3079. "_value_",
  3080. smalltalk.method({
  3081. selector: "value:",
  3082. fn: function (aUTFCharCode){
  3083. var self=this;
  3084. return smalltalk.withContext(function($ctx1) {
  3085. return String.fromCharCode(aUTFCharCode);;
  3086. return self}, function($ctx1) {$ctx1.fill(self,"value:",{aUTFCharCode:aUTFCharCode}, smalltalk.String.klass)})},
  3087. messageSends: []}),
  3088. smalltalk.String.klass);
  3089. smalltalk.addClass('Symbol', smalltalk.CharacterArray, [], 'Kernel-Collections');
  3090. smalltalk.addMethod(
  3091. "__lt",
  3092. smalltalk.method({
  3093. selector: "<",
  3094. fn: function (aSymbol){
  3095. var self=this;
  3096. return smalltalk.withContext(function($ctx1) {
  3097. var $1;
  3098. $1=_st(_st(self)._asString()).__lt(_st(aSymbol)._asString());
  3099. return $1;
  3100. }, function($ctx1) {$ctx1.fill(self,"<",{aSymbol:aSymbol}, smalltalk.Symbol)})},
  3101. messageSends: ["<", "asString"]}),
  3102. smalltalk.Symbol);
  3103. smalltalk.addMethod(
  3104. "__lt_eq",
  3105. smalltalk.method({
  3106. selector: "<=",
  3107. fn: function (aSymbol){
  3108. var self=this;
  3109. return smalltalk.withContext(function($ctx1) {
  3110. var $1;
  3111. $1=_st(_st(self)._asString()).__lt_eq(_st(aSymbol)._asString());
  3112. return $1;
  3113. }, function($ctx1) {$ctx1.fill(self,"<=",{aSymbol:aSymbol}, smalltalk.Symbol)})},
  3114. messageSends: ["<=", "asString"]}),
  3115. smalltalk.Symbol);
  3116. smalltalk.addMethod(
  3117. "__eq",
  3118. smalltalk.method({
  3119. selector: "=",
  3120. fn: function (aSymbol){
  3121. var self=this;
  3122. return smalltalk.withContext(function($ctx1) {
  3123. var $1,$2;
  3124. $1=_st(_st(aSymbol)._class()).__eq(_st(self)._class());
  3125. if(! smalltalk.assert($1)){
  3126. return false;
  3127. };
  3128. $2=_st(_st(self)._asString()).__eq(_st(aSymbol)._asString());
  3129. return $2;
  3130. }, function($ctx1) {$ctx1.fill(self,"=",{aSymbol:aSymbol}, smalltalk.Symbol)})},
  3131. messageSends: ["ifFalse:", "=", "class", "asString"]}),
  3132. smalltalk.Symbol);
  3133. smalltalk.addMethod(
  3134. "__gt",
  3135. smalltalk.method({
  3136. selector: ">",
  3137. fn: function (aSymbol){
  3138. var self=this;
  3139. return smalltalk.withContext(function($ctx1) {
  3140. var $1;
  3141. $1=_st(_st(self)._asString()).__gt(_st(aSymbol)._asString());
  3142. return $1;
  3143. }, function($ctx1) {$ctx1.fill(self,">",{aSymbol:aSymbol}, smalltalk.Symbol)})},
  3144. messageSends: [">", "asString"]}),
  3145. smalltalk.Symbol);
  3146. smalltalk.addMethod(
  3147. "__gt_eq",
  3148. smalltalk.method({
  3149. selector: ">=",
  3150. fn: function (aSymbol){
  3151. var self=this;
  3152. return smalltalk.withContext(function($ctx1) {
  3153. var $1;
  3154. $1=_st(_st(self)._asString()).__gt_eq(_st(aSymbol)._asString());
  3155. return $1;
  3156. }, function($ctx1) {$ctx1.fill(self,">=",{aSymbol:aSymbol}, smalltalk.Symbol)})},
  3157. messageSends: [">=", "asString"]}),
  3158. smalltalk.Symbol);
  3159. smalltalk.addMethod(
  3160. "_asJSON",
  3161. smalltalk.method({
  3162. selector: "asJSON",
  3163. fn: function (){
  3164. var self=this;
  3165. return smalltalk.withContext(function($ctx1) {
  3166. var $1;
  3167. $1=_st(_st(self)._asString())._asJSON();
  3168. return $1;
  3169. }, function($ctx1) {$ctx1.fill(self,"asJSON",{}, smalltalk.Symbol)})},
  3170. messageSends: ["asJSON", "asString"]}),
  3171. smalltalk.Symbol);
  3172. smalltalk.addMethod(
  3173. "_asJavascript",
  3174. smalltalk.method({
  3175. selector: "asJavascript",
  3176. fn: function (){
  3177. var self=this;
  3178. return smalltalk.withContext(function($ctx1) {
  3179. var $1;
  3180. $1=_st(_st("smalltalk.symbolFor(").__comma(_st(_st(self)._asString())._asJavascript())).__comma(")");
  3181. return $1;
  3182. }, function($ctx1) {$ctx1.fill(self,"asJavascript",{}, smalltalk.Symbol)})},
  3183. messageSends: [",", "asJavascript", "asString"]}),
  3184. smalltalk.Symbol);
  3185. smalltalk.addMethod(
  3186. "_asSelector",
  3187. smalltalk.method({
  3188. selector: "asSelector",
  3189. fn: function (){
  3190. var self=this;
  3191. return smalltalk.withContext(function($ctx1) {
  3192. var $1;
  3193. $1=_st(_st(self)._asString())._asSelector();
  3194. return $1;
  3195. }, function($ctx1) {$ctx1.fill(self,"asSelector",{}, smalltalk.Symbol)})},
  3196. messageSends: ["asSelector", "asString"]}),
  3197. smalltalk.Symbol);
  3198. smalltalk.addMethod(
  3199. "_asString",
  3200. smalltalk.method({
  3201. selector: "asString",
  3202. fn: function (){
  3203. var self=this;
  3204. return smalltalk.withContext(function($ctx1) {
  3205. return self.value;
  3206. return self}, function($ctx1) {$ctx1.fill(self,"asString",{}, smalltalk.Symbol)})},
  3207. messageSends: []}),
  3208. smalltalk.Symbol);
  3209. smalltalk.addMethod(
  3210. "_asSuperSelector",
  3211. smalltalk.method({
  3212. selector: "asSuperSelector",
  3213. fn: function (){
  3214. var self=this;
  3215. return smalltalk.withContext(function($ctx1) {
  3216. var $1;
  3217. $1=_st(_st(self)._asString())._asSuperSelector();
  3218. return $1;
  3219. }, function($ctx1) {$ctx1.fill(self,"asSuperSelector",{}, smalltalk.Symbol)})},
  3220. messageSends: ["asSuperSelector", "asString"]}),
  3221. smalltalk.Symbol);
  3222. smalltalk.addMethod(
  3223. "_asSymbol",
  3224. smalltalk.method({
  3225. selector: "asSymbol",
  3226. fn: function (){
  3227. var self=this;
  3228. return smalltalk.withContext(function($ctx1) {
  3229. var $1;
  3230. $1=self;
  3231. return $1;
  3232. }, function($ctx1) {$ctx1.fill(self,"asSymbol",{}, smalltalk.Symbol)})},
  3233. messageSends: []}),
  3234. smalltalk.Symbol);
  3235. smalltalk.addMethod(
  3236. "_at_ifAbsent_",
  3237. smalltalk.method({
  3238. selector: "at:ifAbsent:",
  3239. fn: function (anIndex,aBlock){
  3240. var self=this;
  3241. return smalltalk.withContext(function($ctx1) {
  3242. var $1;
  3243. $1=_st(_st(self)._asString())._at_ifAbsent_(anIndex,aBlock);
  3244. return $1;
  3245. }, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{anIndex:anIndex,aBlock:aBlock}, smalltalk.Symbol)})},
  3246. messageSends: ["at:ifAbsent:", "asString"]}),
  3247. smalltalk.Symbol);
  3248. smalltalk.addMethod(
  3249. "_collect_",
  3250. smalltalk.method({
  3251. selector: "collect:",
  3252. fn: function (aBlock){
  3253. var self=this;
  3254. return smalltalk.withContext(function($ctx1) {
  3255. var $1;
  3256. $1=_st(_st(_st(self)._asString())._collect_(aBlock))._asSymbol();
  3257. return $1;
  3258. }, function($ctx1) {$ctx1.fill(self,"collect:",{aBlock:aBlock}, smalltalk.Symbol)})},
  3259. messageSends: ["asSymbol", "collect:", "asString"]}),
  3260. smalltalk.Symbol);
  3261. smalltalk.addMethod(
  3262. "_copyFrom_to_",
  3263. smalltalk.method({
  3264. selector: "copyFrom:to:",
  3265. fn: function (anIndex,anotherIndex){
  3266. var self=this;
  3267. return smalltalk.withContext(function($ctx1) {
  3268. var $1;
  3269. $1=_st(_st(self)._class())._fromString_(_st(_st(self)._asString())._copyFrom_to_(anIndex,anotherIndex));
  3270. return $1;
  3271. }, function($ctx1) {$ctx1.fill(self,"copyFrom:to:",{anIndex:anIndex,anotherIndex:anotherIndex}, smalltalk.Symbol)})},
  3272. messageSends: ["fromString:", "copyFrom:to:", "asString", "class"]}),
  3273. smalltalk.Symbol);
  3274. smalltalk.addMethod(
  3275. "_deepCopy",
  3276. smalltalk.method({
  3277. selector: "deepCopy",
  3278. fn: function (){
  3279. var self=this;
  3280. return smalltalk.withContext(function($ctx1) {
  3281. var $1;
  3282. $1=self;
  3283. return $1;
  3284. }, function($ctx1) {$ctx1.fill(self,"deepCopy",{}, smalltalk.Symbol)})},
  3285. messageSends: []}),
  3286. smalltalk.Symbol);
  3287. smalltalk.addMethod(
  3288. "_detect_",
  3289. smalltalk.method({
  3290. selector: "detect:",
  3291. fn: function (aBlock){
  3292. var self=this;
  3293. return smalltalk.withContext(function($ctx1) {
  3294. var $1;
  3295. $1=_st(_st(self)._asString())._detect_(aBlock);
  3296. return $1;
  3297. }, function($ctx1) {$ctx1.fill(self,"detect:",{aBlock:aBlock}, smalltalk.Symbol)})},
  3298. messageSends: ["detect:", "asString"]}),
  3299. smalltalk.Symbol);
  3300. smalltalk.addMethod(
  3301. "_do_",
  3302. smalltalk.method({
  3303. selector: "do:",
  3304. fn: function (aBlock){
  3305. var self=this;
  3306. return smalltalk.withContext(function($ctx1) {
  3307. _st(_st(self)._asString())._do_(aBlock);
  3308. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock}, smalltalk.Symbol)})},
  3309. messageSends: ["do:", "asString"]}),
  3310. smalltalk.Symbol);
  3311. smalltalk.addMethod(
  3312. "_isSymbol",
  3313. smalltalk.method({
  3314. selector: "isSymbol",
  3315. fn: function (){
  3316. var self=this;
  3317. return smalltalk.withContext(function($ctx1) {
  3318. return true;
  3319. }, function($ctx1) {$ctx1.fill(self,"isSymbol",{}, smalltalk.Symbol)})},
  3320. messageSends: []}),
  3321. smalltalk.Symbol);
  3322. smalltalk.addMethod(
  3323. "_printString",
  3324. smalltalk.method({
  3325. selector: "printString",
  3326. fn: function (){
  3327. var self=this;
  3328. return smalltalk.withContext(function($ctx1) {
  3329. var $1;
  3330. $1=_st("#").__comma(_st(self)._asString());
  3331. return $1;
  3332. }, function($ctx1) {$ctx1.fill(self,"printString",{}, smalltalk.Symbol)})},
  3333. messageSends: [",", "asString"]}),
  3334. smalltalk.Symbol);
  3335. smalltalk.addMethod(
  3336. "_select_",
  3337. smalltalk.method({
  3338. selector: "select:",
  3339. fn: function (aBlock){
  3340. var self=this;
  3341. return smalltalk.withContext(function($ctx1) {
  3342. var $1;
  3343. $1=_st(_st(_st(self)._asString())._select_(aBlock))._asSymbol();
  3344. return $1;
  3345. }, function($ctx1) {$ctx1.fill(self,"select:",{aBlock:aBlock}, smalltalk.Symbol)})},
  3346. messageSends: ["asSymbol", "select:", "asString"]}),
  3347. smalltalk.Symbol);
  3348. smalltalk.addMethod(
  3349. "_shallowCopy",
  3350. smalltalk.method({
  3351. selector: "shallowCopy",
  3352. fn: function (){
  3353. var self=this;
  3354. return smalltalk.withContext(function($ctx1) {
  3355. var $1;
  3356. $1=self;
  3357. return $1;
  3358. }, function($ctx1) {$ctx1.fill(self,"shallowCopy",{}, smalltalk.Symbol)})},
  3359. messageSends: []}),
  3360. smalltalk.Symbol);
  3361. smalltalk.addMethod(
  3362. "_size",
  3363. smalltalk.method({
  3364. selector: "size",
  3365. fn: function (){
  3366. var self=this;
  3367. return smalltalk.withContext(function($ctx1) {
  3368. var $1;
  3369. $1=_st(_st(self)._asString())._size();
  3370. return $1;
  3371. }, function($ctx1) {$ctx1.fill(self,"size",{}, smalltalk.Symbol)})},
  3372. messageSends: ["size", "asString"]}),
  3373. smalltalk.Symbol);
  3374. smalltalk.addMethod(
  3375. "_value_",
  3376. smalltalk.method({
  3377. selector: "value:",
  3378. fn: function (anObject){
  3379. var self=this;
  3380. return smalltalk.withContext(function($ctx1) {
  3381. var $1;
  3382. $1=_st(anObject)._perform_(self);
  3383. return $1;
  3384. }, function($ctx1) {$ctx1.fill(self,"value:",{anObject:anObject}, smalltalk.Symbol)})},
  3385. messageSends: ["perform:"]}),
  3386. smalltalk.Symbol);
  3387. smalltalk.addMethod(
  3388. "_withIndexDo_",
  3389. smalltalk.method({
  3390. selector: "withIndexDo:",
  3391. fn: function (aBlock){
  3392. var self=this;
  3393. return smalltalk.withContext(function($ctx1) {
  3394. _st(_st(self)._asString())._withIndexDo_(aBlock);
  3395. return self}, function($ctx1) {$ctx1.fill(self,"withIndexDo:",{aBlock:aBlock}, smalltalk.Symbol)})},
  3396. messageSends: ["withIndexDo:", "asString"]}),
  3397. smalltalk.Symbol);
  3398. smalltalk.addMethod(
  3399. "_basicNew",
  3400. smalltalk.method({
  3401. selector: "basicNew",
  3402. fn: function (){
  3403. var self=this;
  3404. return smalltalk.withContext(function($ctx1) {
  3405. _st(self)._shouldNotImplement();
  3406. return self}, function($ctx1) {$ctx1.fill(self,"basicNew",{}, smalltalk.Symbol.klass)})},
  3407. messageSends: ["shouldNotImplement"]}),
  3408. smalltalk.Symbol.klass);
  3409. smalltalk.addMethod(
  3410. "_fromString_",
  3411. smalltalk.method({
  3412. selector: "fromString:",
  3413. fn: function (aString){
  3414. var self=this;
  3415. return smalltalk.withContext(function($ctx1) {
  3416. var $1;
  3417. $1=_st(self)._lookup_(aString);
  3418. return $1;
  3419. }, function($ctx1) {$ctx1.fill(self,"fromString:",{aString:aString}, smalltalk.Symbol.klass)})},
  3420. messageSends: ["lookup:"]}),
  3421. smalltalk.Symbol.klass);
  3422. smalltalk.addMethod(
  3423. "_lookup_",
  3424. smalltalk.method({
  3425. selector: "lookup:",
  3426. fn: function (aString){
  3427. var self=this;
  3428. return smalltalk.withContext(function($ctx1) {
  3429. return smalltalk.symbolFor(aString);;
  3430. return self}, function($ctx1) {$ctx1.fill(self,"lookup:",{aString:aString}, smalltalk.Symbol.klass)})},
  3431. messageSends: []}),
  3432. smalltalk.Symbol.klass);
  3433. smalltalk.addClass('Set', smalltalk.Collection, ['elements'], 'Kernel-Collections');
  3434. smalltalk.addMethod(
  3435. "__eq",
  3436. smalltalk.method({
  3437. selector: "=",
  3438. fn: function (aCollection){
  3439. var self=this;
  3440. return smalltalk.withContext(function($ctx1) {
  3441. var $1,$2,$3;
  3442. var $early={};
  3443. try {
  3444. $1=_st(_st(self)._class()).__eq(_st(aCollection)._class());
  3445. if(! smalltalk.assert($1)){
  3446. return false;
  3447. };
  3448. $2=_st(_st(self)._size()).__eq(_st(aCollection)._size());
  3449. if(! smalltalk.assert($2)){
  3450. return false;
  3451. };
  3452. _st(self)._do_((function(each){
  3453. return smalltalk.withContext(function($ctx2) {
  3454. $3=_st(aCollection)._includes_(each);
  3455. if(! smalltalk.assert($3)){
  3456. throw $early=[false];
  3457. };
  3458. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3459. return true;
  3460. }
  3461. catch(e) {if(e===$early)return e[0]; throw e}
  3462. }, function($ctx1) {$ctx1.fill(self,"=",{aCollection:aCollection}, smalltalk.Set)})},
  3463. messageSends: ["ifFalse:", "=", "class", "size", "do:", "includes:"]}),
  3464. smalltalk.Set);
  3465. smalltalk.addMethod(
  3466. "_add_",
  3467. smalltalk.method({
  3468. selector: "add:",
  3469. fn: function (anObject){
  3470. var self=this;
  3471. return smalltalk.withContext(function($ctx1) {
  3472. var found;
  3473. for(var i=0; i < self['@elements'].length; i++) {
  3474. if(anObject == self['@elements'][i]) {
  3475. found = true;
  3476. break;
  3477. }
  3478. }
  3479. if(!found) {self['@elements'].push(anObject)}
  3480. ;
  3481. return self}, function($ctx1) {$ctx1.fill(self,"add:",{anObject:anObject}, smalltalk.Set)})},
  3482. messageSends: []}),
  3483. smalltalk.Set);
  3484. smalltalk.addMethod(
  3485. "_asArray",
  3486. smalltalk.method({
  3487. selector: "asArray",
  3488. fn: function (){
  3489. var self=this;
  3490. return smalltalk.withContext(function($ctx1) {
  3491. var $1;
  3492. $1=_st(self["@elements"])._copy();
  3493. return $1;
  3494. }, function($ctx1) {$ctx1.fill(self,"asArray",{}, smalltalk.Set)})},
  3495. messageSends: ["copy"]}),
  3496. smalltalk.Set);
  3497. smalltalk.addMethod(
  3498. "_collect_",
  3499. smalltalk.method({
  3500. selector: "collect:",
  3501. fn: function (aBlock){
  3502. var self=this;
  3503. return smalltalk.withContext(function($ctx1) {
  3504. var $1;
  3505. $1=_st(_st(self)._class())._withAll_(_st(self["@elements"])._collect_(aBlock));
  3506. return $1;
  3507. }, function($ctx1) {$ctx1.fill(self,"collect:",{aBlock:aBlock}, smalltalk.Set)})},
  3508. messageSends: ["withAll:", "collect:", "class"]}),
  3509. smalltalk.Set);
  3510. smalltalk.addMethod(
  3511. "_detect_ifNone_",
  3512. smalltalk.method({
  3513. selector: "detect:ifNone:",
  3514. fn: function (aBlock,anotherBlock){
  3515. var self=this;
  3516. return smalltalk.withContext(function($ctx1) {
  3517. var $1;
  3518. $1=_st(self["@elements"])._detect_ifNone_(aBlock,anotherBlock);
  3519. return $1;
  3520. }, function($ctx1) {$ctx1.fill(self,"detect:ifNone:",{aBlock:aBlock,anotherBlock:anotherBlock}, smalltalk.Set)})},
  3521. messageSends: ["detect:ifNone:"]}),
  3522. smalltalk.Set);
  3523. smalltalk.addMethod(
  3524. "_do_",
  3525. smalltalk.method({
  3526. selector: "do:",
  3527. fn: function (aBlock){
  3528. var self=this;
  3529. return smalltalk.withContext(function($ctx1) {
  3530. _st(self["@elements"])._do_(aBlock);
  3531. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock}, smalltalk.Set)})},
  3532. messageSends: ["do:"]}),
  3533. smalltalk.Set);
  3534. smalltalk.addMethod(
  3535. "_includes_",
  3536. smalltalk.method({
  3537. selector: "includes:",
  3538. fn: function (anObject){
  3539. var self=this;
  3540. return smalltalk.withContext(function($ctx1) {
  3541. var $1;
  3542. $1=_st(self["@elements"])._includes_(anObject);
  3543. return $1;
  3544. }, function($ctx1) {$ctx1.fill(self,"includes:",{anObject:anObject}, smalltalk.Set)})},
  3545. messageSends: ["includes:"]}),
  3546. smalltalk.Set);
  3547. smalltalk.addMethod(
  3548. "_initialize",
  3549. smalltalk.method({
  3550. selector: "initialize",
  3551. fn: function (){
  3552. var self=this;
  3553. return smalltalk.withContext(function($ctx1) {
  3554. smalltalk.Collection.fn.prototype._initialize.apply(_st(self), []);
  3555. self["@elements"]=[];
  3556. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.Set)})},
  3557. messageSends: ["initialize"]}),
  3558. smalltalk.Set);
  3559. smalltalk.addMethod(
  3560. "_remove_",
  3561. smalltalk.method({
  3562. selector: "remove:",
  3563. fn: function (anObject){
  3564. var self=this;
  3565. return smalltalk.withContext(function($ctx1) {
  3566. _st(self["@elements"])._remove_(anObject);
  3567. return self}, function($ctx1) {$ctx1.fill(self,"remove:",{anObject:anObject}, smalltalk.Set)})},
  3568. messageSends: ["remove:"]}),
  3569. smalltalk.Set);
  3570. smalltalk.addMethod(
  3571. "_select_",
  3572. smalltalk.method({
  3573. selector: "select:",
  3574. fn: function (aBlock){
  3575. var self=this;
  3576. var collection;
  3577. return smalltalk.withContext(function($ctx1) {
  3578. var $1,$2;
  3579. collection=_st(_st(self)._class())._new();
  3580. _st(self)._do_((function(each){
  3581. return smalltalk.withContext(function($ctx2) {
  3582. $1=_st(aBlock)._value_(each);
  3583. if(smalltalk.assert($1)){
  3584. return _st(collection)._add_(each);
  3585. };
  3586. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3587. $2=collection;
  3588. return $2;
  3589. }, function($ctx1) {$ctx1.fill(self,"select:",{aBlock:aBlock,collection:collection}, smalltalk.Set)})},
  3590. messageSends: ["new", "class", "do:", "ifTrue:", "add:", "value:"]}),
  3591. smalltalk.Set);
  3592. smalltalk.addMethod(
  3593. "_size",
  3594. smalltalk.method({
  3595. selector: "size",
  3596. fn: function (){
  3597. var self=this;
  3598. return smalltalk.withContext(function($ctx1) {
  3599. var $1;
  3600. $1=_st(self["@elements"])._size();
  3601. return $1;
  3602. }, function($ctx1) {$ctx1.fill(self,"size",{}, smalltalk.Set)})},
  3603. messageSends: ["size"]}),
  3604. smalltalk.Set);
  3605. smalltalk.addClass('Queue', smalltalk.Object, ['read', 'readIndex', 'write'], 'Kernel-Collections');
  3606. smalltalk.addMethod(
  3607. "_back_",
  3608. smalltalk.method({
  3609. selector: "back:",
  3610. fn: function (anObject){
  3611. var self=this;
  3612. return smalltalk.withContext(function($ctx1) {
  3613. _st(self["@write"])._add_(anObject);
  3614. return self}, function($ctx1) {$ctx1.fill(self,"back:",{anObject:anObject}, smalltalk.Queue)})},
  3615. messageSends: ["add:"]}),
  3616. smalltalk.Queue);
  3617. smalltalk.addMethod(
  3618. "_front",
  3619. smalltalk.method({
  3620. selector: "front",
  3621. fn: function (){
  3622. var self=this;
  3623. return smalltalk.withContext(function($ctx1) {
  3624. var $1;
  3625. $1=_st(self)._frontIfAbsent_((function(){
  3626. return smalltalk.withContext(function($ctx2) {
  3627. return _st(self)._error_("Cannot read from empty Queue.");
  3628. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3629. return $1;
  3630. }, function($ctx1) {$ctx1.fill(self,"front",{}, smalltalk.Queue)})},
  3631. messageSends: ["frontIfAbsent:", "error:"]}),
  3632. smalltalk.Queue);
  3633. smalltalk.addMethod(
  3634. "_frontIfAbsent_",
  3635. smalltalk.method({
  3636. selector: "frontIfAbsent:",
  3637. fn: function (aBlock){
  3638. var self=this;
  3639. var result;
  3640. return smalltalk.withContext(function($ctx1) {
  3641. var $1,$2,$3,$4;
  3642. var $early={};
  3643. try {
  3644. result=_st(self["@read"])._at_ifAbsent_(self["@readIndex"],(function(){
  3645. return smalltalk.withContext(function($ctx2) {
  3646. $1=_st(self["@write"])._isEmpty();
  3647. if(smalltalk.assert($1)){
  3648. $2=_st(self["@readIndex"]).__gt((1));
  3649. if(smalltalk.assert($2)){
  3650. self["@read"]=[];
  3651. self["@read"];
  3652. self["@readIndex"]=(1);
  3653. self["@readIndex"];
  3654. };
  3655. $3=_st(aBlock)._value();
  3656. throw $early=[$3];
  3657. };
  3658. self["@read"]=self["@write"];
  3659. self["@read"];
  3660. self["@readIndex"]=(1);
  3661. self["@readIndex"];
  3662. self["@write"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  3663. self["@write"];
  3664. return _st(self["@read"])._first();
  3665. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3666. _st(self["@read"])._at_put_(self["@readIndex"],nil);
  3667. self["@readIndex"]=_st(self["@readIndex"]).__plus((1));
  3668. $4=result;
  3669. return $4;
  3670. }
  3671. catch(e) {if(e===$early)return e[0]; throw e}
  3672. }, function($ctx1) {$ctx1.fill(self,"frontIfAbsent:",{aBlock:aBlock,result:result}, smalltalk.Queue)})},
  3673. messageSends: ["at:ifAbsent:", "ifTrue:", ">", "value", "isEmpty", "new", "first", "at:put:", "+"]}),
  3674. smalltalk.Queue);
  3675. smalltalk.addMethod(
  3676. "_initialize",
  3677. smalltalk.method({
  3678. selector: "initialize",
  3679. fn: function (){
  3680. var self=this;
  3681. return smalltalk.withContext(function($ctx1) {
  3682. smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  3683. self["@read"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  3684. self["@write"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  3685. self["@readIndex"]=(1);
  3686. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.Queue)})},
  3687. messageSends: ["initialize", "new"]}),
  3688. smalltalk.Queue);
  3689. smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel-Collections');
  3690. smalltalk.addMethod(
  3691. "_compile_",
  3692. smalltalk.method({
  3693. selector: "compile:",
  3694. fn: function (aString){
  3695. var self=this;
  3696. return smalltalk.withContext(function($ctx1) {
  3697. return self.compile(aString);
  3698. return self}, function($ctx1) {$ctx1.fill(self,"compile:",{aString:aString}, smalltalk.RegularExpression)})},
  3699. messageSends: []}),
  3700. smalltalk.RegularExpression);
  3701. smalltalk.addMethod(
  3702. "_exec_",
  3703. smalltalk.method({
  3704. selector: "exec:",
  3705. fn: function (aString){
  3706. var self=this;
  3707. return smalltalk.withContext(function($ctx1) {
  3708. return self.exec(aString) || nil;
  3709. return self}, function($ctx1) {$ctx1.fill(self,"exec:",{aString:aString}, smalltalk.RegularExpression)})},
  3710. messageSends: []}),
  3711. smalltalk.RegularExpression);
  3712. smalltalk.addMethod(
  3713. "_test_",
  3714. smalltalk.method({
  3715. selector: "test:",
  3716. fn: function (aString){
  3717. var self=this;
  3718. return smalltalk.withContext(function($ctx1) {
  3719. return self.test(aString);
  3720. return self}, function($ctx1) {$ctx1.fill(self,"test:",{aString:aString}, smalltalk.RegularExpression)})},
  3721. messageSends: []}),
  3722. smalltalk.RegularExpression);
  3723. smalltalk.addMethod(
  3724. "_fromString_",
  3725. smalltalk.method({
  3726. selector: "fromString:",
  3727. fn: function (aString){
  3728. var self=this;
  3729. return smalltalk.withContext(function($ctx1) {
  3730. var $1;
  3731. $1=_st(self)._fromString_flag_(aString,"");
  3732. return $1;
  3733. }, function($ctx1) {$ctx1.fill(self,"fromString:",{aString:aString}, smalltalk.RegularExpression.klass)})},
  3734. messageSends: ["fromString:flag:"]}),
  3735. smalltalk.RegularExpression.klass);
  3736. smalltalk.addMethod(
  3737. "_fromString_flag_",
  3738. smalltalk.method({
  3739. selector: "fromString:flag:",
  3740. fn: function (aString,anotherString){
  3741. var self=this;
  3742. return smalltalk.withContext(function($ctx1) {
  3743. return new RegExp(aString, anotherString);
  3744. return self}, function($ctx1) {$ctx1.fill(self,"fromString:flag:",{aString:aString,anotherString:anotherString}, smalltalk.RegularExpression.klass)})},
  3745. messageSends: []}),
  3746. smalltalk.RegularExpression.klass);
  3747. smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel-Collections');
  3748. smalltalk.addMethod(
  3749. "_atEnd",
  3750. smalltalk.method({
  3751. selector: "atEnd",
  3752. fn: function (){
  3753. var self=this;
  3754. return smalltalk.withContext(function($ctx1) {
  3755. var $1;
  3756. $1=_st(_st(self)._position()).__eq(_st(self)._size());
  3757. return $1;
  3758. }, function($ctx1) {$ctx1.fill(self,"atEnd",{}, smalltalk.Stream)})},
  3759. messageSends: ["=", "size", "position"]}),
  3760. smalltalk.Stream);
  3761. smalltalk.addMethod(
  3762. "_atStart",
  3763. smalltalk.method({
  3764. selector: "atStart",
  3765. fn: function (){
  3766. var self=this;
  3767. return smalltalk.withContext(function($ctx1) {
  3768. var $1;
  3769. $1=_st(_st(self)._position()).__eq((0));
  3770. return $1;
  3771. }, function($ctx1) {$ctx1.fill(self,"atStart",{}, smalltalk.Stream)})},
  3772. messageSends: ["=", "position"]}),
  3773. smalltalk.Stream);
  3774. smalltalk.addMethod(
  3775. "_close",
  3776. smalltalk.method({
  3777. selector: "close",
  3778. fn: function (){
  3779. var self=this;
  3780. return smalltalk.withContext(function($ctx1) {
  3781. return self}, function($ctx1) {$ctx1.fill(self,"close",{}, smalltalk.Stream)})},
  3782. messageSends: []}),
  3783. smalltalk.Stream);
  3784. smalltalk.addMethod(
  3785. "_collection",
  3786. smalltalk.method({
  3787. selector: "collection",
  3788. fn: function (){
  3789. var self=this;
  3790. return smalltalk.withContext(function($ctx1) {
  3791. var $1;
  3792. $1=self["@collection"];
  3793. return $1;
  3794. }, function($ctx1) {$ctx1.fill(self,"collection",{}, smalltalk.Stream)})},
  3795. messageSends: []}),
  3796. smalltalk.Stream);
  3797. smalltalk.addMethod(
  3798. "_contents",
  3799. smalltalk.method({
  3800. selector: "contents",
  3801. fn: function (){
  3802. var self=this;
  3803. return smalltalk.withContext(function($ctx1) {
  3804. var $1;
  3805. $1=_st(_st(self)._collection())._copyFrom_to_((1),_st(self)._streamSize());
  3806. return $1;
  3807. }, function($ctx1) {$ctx1.fill(self,"contents",{}, smalltalk.Stream)})},
  3808. messageSends: ["copyFrom:to:", "streamSize", "collection"]}),
  3809. smalltalk.Stream);
  3810. smalltalk.addMethod(
  3811. "_do_",
  3812. smalltalk.method({
  3813. selector: "do:",
  3814. fn: function (aBlock){
  3815. var self=this;
  3816. return smalltalk.withContext(function($ctx1) {
  3817. _st((function(){
  3818. return smalltalk.withContext(function($ctx2) {
  3819. return _st(self)._atEnd();
  3820. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  3821. return smalltalk.withContext(function($ctx2) {
  3822. return _st(aBlock)._value_(_st(self)._next());
  3823. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3824. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock}, smalltalk.Stream)})},
  3825. messageSends: ["whileFalse:", "value:", "next", "atEnd"]}),
  3826. smalltalk.Stream);
  3827. smalltalk.addMethod(
  3828. "_flush",
  3829. smalltalk.method({
  3830. selector: "flush",
  3831. fn: function (){
  3832. var self=this;
  3833. return smalltalk.withContext(function($ctx1) {
  3834. return self}, function($ctx1) {$ctx1.fill(self,"flush",{}, smalltalk.Stream)})},
  3835. messageSends: []}),
  3836. smalltalk.Stream);
  3837. smalltalk.addMethod(
  3838. "_isEmpty",
  3839. smalltalk.method({
  3840. selector: "isEmpty",
  3841. fn: function (){
  3842. var self=this;
  3843. return smalltalk.withContext(function($ctx1) {
  3844. var $1;
  3845. $1=_st(_st(self)._size()).__eq((0));
  3846. return $1;
  3847. }, function($ctx1) {$ctx1.fill(self,"isEmpty",{}, smalltalk.Stream)})},
  3848. messageSends: ["=", "size"]}),
  3849. smalltalk.Stream);
  3850. smalltalk.addMethod(
  3851. "_next",
  3852. smalltalk.method({
  3853. selector: "next",
  3854. fn: function (){
  3855. var self=this;
  3856. return smalltalk.withContext(function($ctx1) {
  3857. var $2,$1;
  3858. $2=_st(self)._atEnd();
  3859. if(smalltalk.assert($2)){
  3860. $1=nil;
  3861. } else {
  3862. _st(self)._position_(_st(_st(self)._position()).__plus((1)));
  3863. $1=_st(self["@collection"])._at_(_st(self)._position());
  3864. };
  3865. return $1;
  3866. }, function($ctx1) {$ctx1.fill(self,"next",{}, smalltalk.Stream)})},
  3867. messageSends: ["ifTrue:ifFalse:", "position:", "+", "position", "at:", "atEnd"]}),
  3868. smalltalk.Stream);
  3869. smalltalk.addMethod(
  3870. "_next_",
  3871. smalltalk.method({
  3872. selector: "next:",
  3873. fn: function (anInteger){
  3874. var self=this;
  3875. var tempCollection;
  3876. return smalltalk.withContext(function($ctx1) {
  3877. var $1,$2;
  3878. tempCollection=_st(_st(_st(self)._collection())._class())._new();
  3879. _st(anInteger)._timesRepeat_((function(){
  3880. return smalltalk.withContext(function($ctx2) {
  3881. $1=_st(self)._atEnd();
  3882. if(! smalltalk.assert($1)){
  3883. return _st(tempCollection)._add_(_st(self)._next());
  3884. };
  3885. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3886. $2=tempCollection;
  3887. return $2;
  3888. }, function($ctx1) {$ctx1.fill(self,"next:",{anInteger:anInteger,tempCollection:tempCollection}, smalltalk.Stream)})},
  3889. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", "add:", "next", "atEnd"]}),
  3890. smalltalk.Stream);
  3891. smalltalk.addMethod(
  3892. "_nextPut_",
  3893. smalltalk.method({
  3894. selector: "nextPut:",
  3895. fn: function (anObject){
  3896. var self=this;
  3897. return smalltalk.withContext(function($ctx1) {
  3898. _st(self)._position_(_st(_st(self)._position()).__plus((1)));
  3899. _st(_st(self)._collection())._at_put_(_st(self)._position(),anObject);
  3900. _st(self)._setStreamSize_(_st(_st(self)._streamSize())._max_(_st(self)._position()));
  3901. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{anObject:anObject}, smalltalk.Stream)})},
  3902. messageSends: ["position:", "+", "position", "at:put:", "collection", "setStreamSize:", "max:", "streamSize"]}),
  3903. smalltalk.Stream);
  3904. smalltalk.addMethod(
  3905. "_nextPutAll_",
  3906. smalltalk.method({
  3907. selector: "nextPutAll:",
  3908. fn: function (aCollection){
  3909. var self=this;
  3910. return smalltalk.withContext(function($ctx1) {
  3911. _st(aCollection)._do_((function(each){
  3912. return smalltalk.withContext(function($ctx2) {
  3913. return _st(self)._nextPut_(each);
  3914. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3915. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAll:",{aCollection:aCollection}, smalltalk.Stream)})},
  3916. messageSends: ["do:", "nextPut:"]}),
  3917. smalltalk.Stream);
  3918. smalltalk.addMethod(
  3919. "_peek",
  3920. smalltalk.method({
  3921. selector: "peek",
  3922. fn: function (){
  3923. var self=this;
  3924. return smalltalk.withContext(function($ctx1) {
  3925. var $2,$1;
  3926. $2=_st(self)._atEnd();
  3927. if(! smalltalk.assert($2)){
  3928. $1=_st(_st(self)._collection())._at_(_st(_st(self)._position()).__plus((1)));
  3929. };
  3930. return $1;
  3931. }, function($ctx1) {$ctx1.fill(self,"peek",{}, smalltalk.Stream)})},
  3932. messageSends: ["ifFalse:", "at:", "+", "position", "collection", "atEnd"]}),
  3933. smalltalk.Stream);
  3934. smalltalk.addMethod(
  3935. "_position",
  3936. smalltalk.method({
  3937. selector: "position",
  3938. fn: function (){
  3939. var self=this;
  3940. return smalltalk.withContext(function($ctx1) {
  3941. var $2,$1;
  3942. $2=self["@position"];
  3943. if(($receiver = $2) == nil || $receiver == undefined){
  3944. self["@position"]=(0);
  3945. $1=self["@position"];
  3946. } else {
  3947. $1=$2;
  3948. };
  3949. return $1;
  3950. }, function($ctx1) {$ctx1.fill(self,"position",{}, smalltalk.Stream)})},
  3951. messageSends: ["ifNil:"]}),
  3952. smalltalk.Stream);
  3953. smalltalk.addMethod(
  3954. "_position_",
  3955. smalltalk.method({
  3956. selector: "position:",
  3957. fn: function (anInteger){
  3958. var self=this;
  3959. return smalltalk.withContext(function($ctx1) {
  3960. self["@position"]=anInteger;
  3961. return self}, function($ctx1) {$ctx1.fill(self,"position:",{anInteger:anInteger}, smalltalk.Stream)})},
  3962. messageSends: []}),
  3963. smalltalk.Stream);
  3964. smalltalk.addMethod(
  3965. "_reset",
  3966. smalltalk.method({
  3967. selector: "reset",
  3968. fn: function (){
  3969. var self=this;
  3970. return smalltalk.withContext(function($ctx1) {
  3971. _st(self)._position_((0));
  3972. return self}, function($ctx1) {$ctx1.fill(self,"reset",{}, smalltalk.Stream)})},
  3973. messageSends: ["position:"]}),
  3974. smalltalk.Stream);
  3975. smalltalk.addMethod(
  3976. "_resetContents",
  3977. smalltalk.method({
  3978. selector: "resetContents",
  3979. fn: function (){
  3980. var self=this;
  3981. return smalltalk.withContext(function($ctx1) {
  3982. _st(self)._reset();
  3983. _st(self)._setStreamSize_((0));
  3984. return self}, function($ctx1) {$ctx1.fill(self,"resetContents",{}, smalltalk.Stream)})},
  3985. messageSends: ["reset", "setStreamSize:"]}),
  3986. smalltalk.Stream);
  3987. smalltalk.addMethod(
  3988. "_setCollection_",
  3989. smalltalk.method({
  3990. selector: "setCollection:",
  3991. fn: function (aCollection){
  3992. var self=this;
  3993. return smalltalk.withContext(function($ctx1) {
  3994. self["@collection"]=aCollection;
  3995. return self}, function($ctx1) {$ctx1.fill(self,"setCollection:",{aCollection:aCollection}, smalltalk.Stream)})},
  3996. messageSends: []}),
  3997. smalltalk.Stream);
  3998. smalltalk.addMethod(
  3999. "_setStreamSize_",
  4000. smalltalk.method({
  4001. selector: "setStreamSize:",
  4002. fn: function (anInteger){
  4003. var self=this;
  4004. return smalltalk.withContext(function($ctx1) {
  4005. self["@streamSize"]=anInteger;
  4006. return self}, function($ctx1) {$ctx1.fill(self,"setStreamSize:",{anInteger:anInteger}, smalltalk.Stream)})},
  4007. messageSends: []}),
  4008. smalltalk.Stream);
  4009. smalltalk.addMethod(
  4010. "_setToEnd",
  4011. smalltalk.method({
  4012. selector: "setToEnd",
  4013. fn: function (){
  4014. var self=this;
  4015. return smalltalk.withContext(function($ctx1) {
  4016. _st(self)._position_(_st(self)._size());
  4017. return self}, function($ctx1) {$ctx1.fill(self,"setToEnd",{}, smalltalk.Stream)})},
  4018. messageSends: ["position:", "size"]}),
  4019. smalltalk.Stream);
  4020. smalltalk.addMethod(
  4021. "_size",
  4022. smalltalk.method({
  4023. selector: "size",
  4024. fn: function (){
  4025. var self=this;
  4026. return smalltalk.withContext(function($ctx1) {
  4027. var $1;
  4028. $1=_st(self)._streamSize();
  4029. return $1;
  4030. }, function($ctx1) {$ctx1.fill(self,"size",{}, smalltalk.Stream)})},
  4031. messageSends: ["streamSize"]}),
  4032. smalltalk.Stream);
  4033. smalltalk.addMethod(
  4034. "_skip_",
  4035. smalltalk.method({
  4036. selector: "skip:",
  4037. fn: function (anInteger){
  4038. var self=this;
  4039. return smalltalk.withContext(function($ctx1) {
  4040. _st(self)._position_(_st(_st(_st(self)._position()).__plus(anInteger))._min_max_(_st(self)._size(),(0)));
  4041. return self}, function($ctx1) {$ctx1.fill(self,"skip:",{anInteger:anInteger}, smalltalk.Stream)})},
  4042. messageSends: ["position:", "min:max:", "size", "+", "position"]}),
  4043. smalltalk.Stream);
  4044. smalltalk.addMethod(
  4045. "_streamSize",
  4046. smalltalk.method({
  4047. selector: "streamSize",
  4048. fn: function (){
  4049. var self=this;
  4050. return smalltalk.withContext(function($ctx1) {
  4051. var $1;
  4052. $1=self["@streamSize"];
  4053. return $1;
  4054. }, function($ctx1) {$ctx1.fill(self,"streamSize",{}, smalltalk.Stream)})},
  4055. messageSends: []}),
  4056. smalltalk.Stream);
  4057. smalltalk.addMethod(
  4058. "_on_",
  4059. smalltalk.method({
  4060. selector: "on:",
  4061. fn: function (aCollection){
  4062. var self=this;
  4063. return smalltalk.withContext(function($ctx1) {
  4064. var $2,$3,$1;
  4065. $2=_st(self)._new();
  4066. _st($2)._setCollection_(aCollection);
  4067. _st($2)._setStreamSize_(_st(aCollection)._size());
  4068. $3=_st($2)._yourself();
  4069. $1=$3;
  4070. return $1;
  4071. }, function($ctx1) {$ctx1.fill(self,"on:",{aCollection:aCollection}, smalltalk.Stream.klass)})},
  4072. messageSends: ["setCollection:", "new", "setStreamSize:", "size", "yourself"]}),
  4073. smalltalk.Stream.klass);
  4074. smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel-Collections');
  4075. smalltalk.addMethod(
  4076. "_cr",
  4077. smalltalk.method({
  4078. selector: "cr",
  4079. fn: function (){
  4080. var self=this;
  4081. return smalltalk.withContext(function($ctx1) {
  4082. var $1;
  4083. $1=_st(self)._nextPutAll_(_st((smalltalk.String || String))._cr());
  4084. return $1;
  4085. }, function($ctx1) {$ctx1.fill(self,"cr",{}, smalltalk.StringStream)})},
  4086. messageSends: ["nextPutAll:", "cr"]}),
  4087. smalltalk.StringStream);
  4088. smalltalk.addMethod(
  4089. "_crlf",
  4090. smalltalk.method({
  4091. selector: "crlf",
  4092. fn: function (){
  4093. var self=this;
  4094. return smalltalk.withContext(function($ctx1) {
  4095. var $1;
  4096. $1=_st(self)._nextPutAll_(_st((smalltalk.String || String))._crlf());
  4097. return $1;
  4098. }, function($ctx1) {$ctx1.fill(self,"crlf",{}, smalltalk.StringStream)})},
  4099. messageSends: ["nextPutAll:", "crlf"]}),
  4100. smalltalk.StringStream);
  4101. smalltalk.addMethod(
  4102. "_lf",
  4103. smalltalk.method({
  4104. selector: "lf",
  4105. fn: function (){
  4106. var self=this;
  4107. return smalltalk.withContext(function($ctx1) {
  4108. var $1;
  4109. $1=_st(self)._nextPutAll_(_st((smalltalk.String || String))._lf());
  4110. return $1;
  4111. }, function($ctx1) {$ctx1.fill(self,"lf",{}, smalltalk.StringStream)})},
  4112. messageSends: ["nextPutAll:", "lf"]}),
  4113. smalltalk.StringStream);
  4114. smalltalk.addMethod(
  4115. "_next_",
  4116. smalltalk.method({
  4117. selector: "next:",
  4118. fn: function (anInteger){
  4119. var self=this;
  4120. var tempCollection;
  4121. return smalltalk.withContext(function($ctx1) {
  4122. var $1,$2;
  4123. tempCollection=_st(_st(_st(self)._collection())._class())._new();
  4124. _st(anInteger)._timesRepeat_((function(){
  4125. return smalltalk.withContext(function($ctx2) {
  4126. $1=_st(self)._atEnd();
  4127. if(! smalltalk.assert($1)){
  4128. tempCollection=_st(tempCollection).__comma(_st(self)._next());
  4129. return tempCollection;
  4130. };
  4131. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  4132. $2=tempCollection;
  4133. return $2;
  4134. }, function($ctx1) {$ctx1.fill(self,"next:",{anInteger:anInteger,tempCollection:tempCollection}, smalltalk.StringStream)})},
  4135. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", ",", "next", "atEnd"]}),
  4136. smalltalk.StringStream);
  4137. smalltalk.addMethod(
  4138. "_nextPut_",
  4139. smalltalk.method({
  4140. selector: "nextPut:",
  4141. fn: function (aString){
  4142. var self=this;
  4143. return smalltalk.withContext(function($ctx1) {
  4144. _st(self)._nextPutAll_(aString);
  4145. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{aString:aString}, smalltalk.StringStream)})},
  4146. messageSends: ["nextPutAll:"]}),
  4147. smalltalk.StringStream);
  4148. smalltalk.addMethod(
  4149. "_nextPutAll_",
  4150. smalltalk.method({
  4151. selector: "nextPutAll:",
  4152. fn: function (aString){
  4153. var self=this;
  4154. return smalltalk.withContext(function($ctx1) {
  4155. _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())));
  4156. _st(self)._position_(_st(_st(self)._position()).__plus(_st(aString)._size()));
  4157. _st(self)._setStreamSize_(_st(_st(self)._streamSize())._max_(_st(self)._position()));
  4158. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAll:",{aString:aString}, smalltalk.StringStream)})},
  4159. messageSends: ["setCollection:", ",", "copyFrom:to:", "+", "size", "position", "collection", "position:", "setStreamSize:", "max:", "streamSize"]}),
  4160. smalltalk.StringStream);
  4161. smalltalk.addMethod(
  4162. "_space",
  4163. smalltalk.method({
  4164. selector: "space",
  4165. fn: function (){
  4166. var self=this;
  4167. return smalltalk.withContext(function($ctx1) {
  4168. _st(self)._nextPut_(" ");
  4169. return self}, function($ctx1) {$ctx1.fill(self,"space",{}, smalltalk.StringStream)})},
  4170. messageSends: ["nextPut:"]}),
  4171. smalltalk.StringStream);