Kernel-Collections.deploy.js 126 KB

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