Kernel-Collections.deploy.js 133 KB

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