Kernel-Collections.deploy.js 135 KB

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