Kernel-Collections.deploy.js 131 KB

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