Kernel-Collections.deploy.js 129 KB

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