2
0

Kernel-Collections.deploy.js 128 KB

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