Kernel-Collections.deploy.js 129 KB

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