Kernel-Collections.deploy.js 126 KB

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