Kernel-Collections.deploy.js 130 KB

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