Kernel-Collections.deploy.js 128 KB

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