1
0

Kernel-Collections.deploy.js 133 KB

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