Kernel-Collections.deploy.js 129 KB

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