1
0

Kernel-Collections.deploy.js 127 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176
  1. smalltalk.addPackage('Kernel-Collections');
  2. smalltalk.addClass('Association', smalltalk.Object, ['key', 'value'], 'Kernel-Collections');
  3. smalltalk.addMethod(
  4. smalltalk.method({
  5. selector: "=",
  6. fn: function (anAssociation){
  7. var self=this;
  8. return smalltalk.withContext(function($ctx1) {
  9. var $1;
  10. $1=_st(_st(_st(self)._class()).__eq(_st(anAssociation)._class()))._and_((function(){
  11. return smalltalk.withContext(function($ctx2) {
  12. return _st(_st(_st(self)._key()).__eq(_st(anAssociation)._key()))._and_((function(){
  13. return smalltalk.withContext(function($ctx3) {
  14. return _st(_st(self)._value()).__eq(_st(anAssociation)._value());
  15. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  16. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  17. return $1;
  18. }, function($ctx1) {$ctx1.fill(self,"=",{anAssociation:anAssociation},smalltalk.Association)})},
  19. messageSends: ["and:", "=", "value", "key", "class"]}),
  20. smalltalk.Association);
  21. smalltalk.addMethod(
  22. smalltalk.method({
  23. selector: "key",
  24. fn: function (){
  25. var self=this;
  26. return smalltalk.withContext(function($ctx1) {
  27. var $1;
  28. $1=self["@key"];
  29. return $1;
  30. }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.Association)})},
  31. messageSends: []}),
  32. smalltalk.Association);
  33. smalltalk.addMethod(
  34. smalltalk.method({
  35. selector: "key:",
  36. fn: function (aKey){
  37. var self=this;
  38. return smalltalk.withContext(function($ctx1) {
  39. self["@key"]=aKey;
  40. return self}, function($ctx1) {$ctx1.fill(self,"key:",{aKey:aKey},smalltalk.Association)})},
  41. messageSends: []}),
  42. smalltalk.Association);
  43. smalltalk.addMethod(
  44. smalltalk.method({
  45. selector: "printOn:",
  46. fn: function (aStream){
  47. var self=this;
  48. return smalltalk.withContext(function($ctx1) {
  49. _st(_st(self)._key())._printOn_(aStream);
  50. _st(aStream)._nextPutAll_(" -> ");
  51. _st(_st(self)._value())._printOn_(aStream);
  52. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Association)})},
  53. messageSends: ["printOn:", "key", "nextPutAll:", "value"]}),
  54. smalltalk.Association);
  55. smalltalk.addMethod(
  56. smalltalk.method({
  57. selector: "value",
  58. fn: function (){
  59. var self=this;
  60. return smalltalk.withContext(function($ctx1) {
  61. var $1;
  62. $1=self["@value"];
  63. return $1;
  64. }, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.Association)})},
  65. messageSends: []}),
  66. smalltalk.Association);
  67. smalltalk.addMethod(
  68. smalltalk.method({
  69. selector: "value:",
  70. fn: function (aValue){
  71. var self=this;
  72. return smalltalk.withContext(function($ctx1) {
  73. self["@value"]=aValue;
  74. return self}, function($ctx1) {$ctx1.fill(self,"value:",{aValue:aValue},smalltalk.Association)})},
  75. messageSends: []}),
  76. smalltalk.Association);
  77. smalltalk.addMethod(
  78. smalltalk.method({
  79. selector: "key:value:",
  80. fn: function (aKey,aValue){
  81. var self=this;
  82. return smalltalk.withContext(function($ctx1) {
  83. var $2,$3,$1;
  84. $2=_st(self)._new();
  85. _st($2)._key_(aKey);
  86. _st($2)._value_(aValue);
  87. $3=_st($2)._yourself();
  88. $1=$3;
  89. return $1;
  90. }, function($ctx1) {$ctx1.fill(self,"key:value:",{aKey:aKey,aValue:aValue},smalltalk.Association.klass)})},
  91. messageSends: ["key:", "new", "value:", "yourself"]}),
  92. smalltalk.Association.klass);
  93. smalltalk.addClass('Collection', smalltalk.Object, [], 'Kernel-Collections');
  94. smalltalk.addMethod(
  95. smalltalk.method({
  96. selector: ",",
  97. fn: function (aCollection){
  98. var self=this;
  99. return smalltalk.withContext(function($ctx1) {
  100. var $2,$3,$1;
  101. $2=_st(self)._copy();
  102. _st($2)._addAll_(aCollection);
  103. $3=_st($2)._yourself();
  104. $1=$3;
  105. return $1;
  106. }, function($ctx1) {$ctx1.fill(self,",",{aCollection:aCollection},smalltalk.Collection)})},
  107. messageSends: ["addAll:", "copy", "yourself"]}),
  108. smalltalk.Collection);
  109. smalltalk.addMethod(
  110. smalltalk.method({
  111. selector: "add:",
  112. fn: function (anObject){
  113. var self=this;
  114. return smalltalk.withContext(function($ctx1) {
  115. _st(self)._subclassResponsibility();
  116. return self}, function($ctx1) {$ctx1.fill(self,"add:",{anObject:anObject},smalltalk.Collection)})},
  117. messageSends: ["subclassResponsibility"]}),
  118. smalltalk.Collection);
  119. smalltalk.addMethod(
  120. smalltalk.method({
  121. selector: "addAll:",
  122. fn: function (aCollection){
  123. var self=this;
  124. return smalltalk.withContext(function($ctx1) {
  125. var $1;
  126. _st(aCollection)._do_((function(each){
  127. return smalltalk.withContext(function($ctx2) {
  128. return _st(self)._add_(each);
  129. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  130. $1=aCollection;
  131. return $1;
  132. }, function($ctx1) {$ctx1.fill(self,"addAll:",{aCollection:aCollection},smalltalk.Collection)})},
  133. messageSends: ["do:", "add:"]}),
  134. smalltalk.Collection);
  135. smalltalk.addMethod(
  136. smalltalk.method({
  137. selector: "asArray",
  138. fn: function (){
  139. var self=this;
  140. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  141. return smalltalk.withContext(function($ctx1) {
  142. var $1;
  143. $1=_st($Array())._withAll_(self);
  144. return $1;
  145. }, function($ctx1) {$ctx1.fill(self,"asArray",{},smalltalk.Collection)})},
  146. messageSends: ["withAll:"]}),
  147. smalltalk.Collection);
  148. smalltalk.addMethod(
  149. smalltalk.method({
  150. selector: "asJSON",
  151. fn: function (){
  152. var self=this;
  153. return smalltalk.withContext(function($ctx1) {
  154. var $1;
  155. $1=_st(_st(self)._asArray())._collect_((function(each){
  156. return smalltalk.withContext(function($ctx2) {
  157. return _st(each)._asJSON();
  158. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  159. return $1;
  160. }, function($ctx1) {$ctx1.fill(self,"asJSON",{},smalltalk.Collection)})},
  161. messageSends: ["collect:", "asJSON", "asArray"]}),
  162. smalltalk.Collection);
  163. smalltalk.addMethod(
  164. smalltalk.method({
  165. selector: "asOrderedCollection",
  166. fn: function (){
  167. var self=this;
  168. return smalltalk.withContext(function($ctx1) {
  169. var $1;
  170. $1=_st(self)._asArray();
  171. return $1;
  172. }, function($ctx1) {$ctx1.fill(self,"asOrderedCollection",{},smalltalk.Collection)})},
  173. messageSends: ["asArray"]}),
  174. smalltalk.Collection);
  175. smalltalk.addMethod(
  176. smalltalk.method({
  177. selector: "asSet",
  178. fn: function (){
  179. var self=this;
  180. function $Set(){return smalltalk.Set||(typeof Set=="undefined"?nil:Set)}
  181. return smalltalk.withContext(function($ctx1) {
  182. var $1;
  183. $1=_st($Set())._withAll_(self);
  184. return $1;
  185. }, function($ctx1) {$ctx1.fill(self,"asSet",{},smalltalk.Collection)})},
  186. messageSends: ["withAll:"]}),
  187. smalltalk.Collection);
  188. smalltalk.addMethod(
  189. smalltalk.method({
  190. selector: "collect:",
  191. fn: function (aBlock){
  192. var self=this;
  193. var stream;
  194. return smalltalk.withContext(function($ctx1) {
  195. var $1;
  196. stream=_st(_st(_st(self)._class())._new())._writeStream();
  197. _st(self)._do_((function(each){
  198. return smalltalk.withContext(function($ctx2) {
  199. return _st(stream)._nextPut_(_st(aBlock)._value_(each));
  200. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  201. $1=_st(stream)._contents();
  202. return $1;
  203. }, function($ctx1) {$ctx1.fill(self,"collect:",{aBlock:aBlock,stream:stream},smalltalk.Collection)})},
  204. messageSends: ["writeStream", "new", "class", "do:", "nextPut:", "value:", "contents"]}),
  205. smalltalk.Collection);
  206. smalltalk.addMethod(
  207. smalltalk.method({
  208. selector: "contains:",
  209. fn: function (aBlock){
  210. var self=this;
  211. return smalltalk.withContext(function($ctx1) {
  212. var $1;
  213. var $early={};
  214. try {
  215. _st(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=_st(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=_st(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=_st(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=_st(self)._detect_ifNone_(aBlock,(function(){
  281. return smalltalk.withContext(function($ctx2) {
  282. return _st(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. _st(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. _st(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. _st(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. _st(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=_st(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=_st(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(_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. _st(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=_st(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({},$ctx1)})}));
  424. if(smalltalk.assert($1)){
  425. return _st(outputSet)._add_(each);
  426. };
  427. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  428. $2=_st(_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(_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(_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. _st(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. _st(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=_st(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=_st(self)._remove_ifAbsent_(anObject,(function(){
  515. return smalltalk.withContext(function($ctx2) {
  516. return _st(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. _st(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(_st(self)._class())._new())._writeStream();
  541. _st(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. _st(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=_st(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=_st(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=_st(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=_st(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=_st(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=_st(self)._at_ifAbsent_(anIndex,(function(){
  657. return smalltalk.withContext(function($ctx2) {
  658. return _st(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. _st(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=_st(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. _st(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. _st(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=_st(self)._indexOf_ifAbsent_(anObject,(function(){
  717. return smalltalk.withContext(function($ctx2) {
  718. return _st(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. _st(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. _st(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. _st(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. _st(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(_st(self)._class()).__eq(_st(aHashedCollection)._class());
  776. if(! smalltalk.assert($1)){
  777. return false;
  778. };
  779. $2=_st(_st(self)._size()).__eq(_st(aHashedCollection)._size());
  780. if(! smalltalk.assert($2)){
  781. return false;
  782. };
  783. $3=_st(_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. _st(self)._at_put_(_st(anAssociation)._key(),_st(anAssociation)._value());
  795. return self}, function($ctx1) {$ctx1.fill(self,"add:",{anAssociation:anAssociation},smalltalk.HashedCollection)})},
  796. messageSends: ["at:put:", "key", "value"]}),
  797. smalltalk.HashedCollection);
  798. smalltalk.addMethod(
  799. smalltalk.method({
  800. selector: "addAll:",
  801. fn: function (aHashedCollection){
  802. var self=this;
  803. return smalltalk.withContext(function($ctx1) {
  804. var $1;
  805. smalltalk.IndexableCollection.fn.prototype._addAll_.apply(_st(self), [_st(aHashedCollection)._associations()]);
  806. $1=aHashedCollection;
  807. return $1;
  808. }, function($ctx1) {$ctx1.fill(self,"addAll:",{aHashedCollection:aHashedCollection},smalltalk.HashedCollection)})},
  809. messageSends: ["addAll:", "associations"]}),
  810. smalltalk.HashedCollection);
  811. smalltalk.addMethod(
  812. smalltalk.method({
  813. selector: "asDictionary",
  814. fn: function (){
  815. var self=this;
  816. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  817. return smalltalk.withContext(function($ctx1) {
  818. var $1;
  819. $1=_st($Dictionary())._fromPairs_(_st(self)._associations());
  820. return $1;
  821. }, function($ctx1) {$ctx1.fill(self,"asDictionary",{},smalltalk.HashedCollection)})},
  822. messageSends: ["fromPairs:", "associations"]}),
  823. smalltalk.HashedCollection);
  824. smalltalk.addMethod(
  825. smalltalk.method({
  826. selector: "asJSON",
  827. fn: function (){
  828. var self=this;
  829. var c;
  830. return smalltalk.withContext(function($ctx1) {
  831. var $1;
  832. c=_st(_st(self)._class())._new();
  833. _st(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. _st(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. _st(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=_st(self)._includesKey_(aKey);
  882. $1=_st($2)._ifTrue_ifFalse_((function(){
  883. return smalltalk.withContext(function($ctx2) {
  884. return _st(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=_st(self)._at_ifAbsent_(aKey,(function(){
  898. return smalltalk.withContext(function($ctx2) {
  899. return _st(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=_st(self)._includesKey_(aKey);
  913. $1=_st($2)._ifTrue_ifFalse_((function(){
  914. return smalltalk.withContext(function($ctx2) {
  915. return _st(aBlock)._value_(_st(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=_st(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(_st(self)._class())._new();
  942. _st(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(_st(self)._class())._new();
  960. _st(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(_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. _st(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(_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(_st(self)._keys())._detect_ifNone_((function(each){
  1021. return smalltalk.withContext(function($ctx2) {
  1022. return _st(_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. _st(self)._keysDo_((function(each){
  1053. return smalltalk.withContext(function($ctx2) {
  1054. return _st(aBlock)._value_value_(each,_st(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(_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(_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=_st(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=_st(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=_st(self)._includesKey_(aKey);
  1120. if(smalltalk.assert($2)){
  1121. $1=_st(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(_st(self)._class())._new();
  1138. _st(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(_st(self)._class())._new();
  1159. _st(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(_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(_st(self)._keys())._collect_((function(each){
  1188. return smalltalk.withContext(function($ctx2) {
  1189. return _st(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. _st(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. _st(self)._keysAndValuesDo_((function(key,value){
  1215. return smalltalk.withContext(function($ctx2) {
  1216. return _st(aBlock)._value_value_(value,key);
  1217. }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1)})}));
  1218. return self}, function($ctx1) {$ctx1.fill(self,"withIndexDo:",{aBlock:aBlock},smalltalk.HashedCollection)})},
  1219. messageSends: ["keysAndValuesDo:", "value:value:"]}),
  1220. smalltalk.HashedCollection);
  1221. smalltalk.addMethod(
  1222. smalltalk.method({
  1223. selector: "fromPairs:",
  1224. fn: function (aCollection){
  1225. var self=this;
  1226. var dict;
  1227. return smalltalk.withContext(function($ctx1) {
  1228. var $1;
  1229. dict=_st(self)._new();
  1230. _st(aCollection)._do_((function(each){
  1231. return smalltalk.withContext(function($ctx2) {
  1232. return _st(dict)._add_(each);
  1233. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1234. $1=dict;
  1235. return $1;
  1236. }, function($ctx1) {$ctx1.fill(self,"fromPairs:",{aCollection:aCollection,dict:dict},smalltalk.HashedCollection.klass)})},
  1237. messageSends: ["new", "do:", "add:"]}),
  1238. smalltalk.HashedCollection.klass);
  1239. smalltalk.addClass('Dictionary', smalltalk.HashedCollection, ['keys', 'values'], 'Kernel-Collections');
  1240. smalltalk.addMethod(
  1241. smalltalk.method({
  1242. selector: "asHashedCollection",
  1243. fn: function (){
  1244. var self=this;
  1245. function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  1246. return smalltalk.withContext(function($ctx1) {
  1247. var $1;
  1248. $1=_st($HashedCollection())._fromPairs_(_st(self)._associations());
  1249. return $1;
  1250. }, function($ctx1) {$ctx1.fill(self,"asHashedCollection",{},smalltalk.Dictionary)})},
  1251. messageSends: ["fromPairs:", "associations"]}),
  1252. smalltalk.Dictionary);
  1253. smalltalk.addMethod(
  1254. smalltalk.method({
  1255. selector: "asJSON",
  1256. fn: function (){
  1257. var self=this;
  1258. return smalltalk.withContext(function($ctx1) {
  1259. var $1;
  1260. $1=_st(_st(self)._asHashedCollection())._asJSON();
  1261. return $1;
  1262. }, function($ctx1) {$ctx1.fill(self,"asJSON",{},smalltalk.Dictionary)})},
  1263. messageSends: ["asJSON", "asHashedCollection"]}),
  1264. smalltalk.Dictionary);
  1265. smalltalk.addMethod(
  1266. smalltalk.method({
  1267. selector: "at:ifAbsent:",
  1268. fn: function (aKey,aBlock){
  1269. var self=this;
  1270. return smalltalk.withContext(function($ctx1) {
  1271. var index = self._positionOfKey_(aKey);
  1272. return index >=0 ? self['@values'][index] : aBlock();
  1273. ;
  1274. return self}, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{aKey:aKey,aBlock:aBlock},smalltalk.Dictionary)})},
  1275. messageSends: []}),
  1276. smalltalk.Dictionary);
  1277. smalltalk.addMethod(
  1278. smalltalk.method({
  1279. selector: "at:put:",
  1280. fn: function (aKey,aValue){
  1281. var self=this;
  1282. return smalltalk.withContext(function($ctx1) {
  1283. var index = self._positionOfKey_(aKey);
  1284. if(index === -1) {
  1285. var keys = self['@keys'];
  1286. index = keys.length;
  1287. keys.push(aKey);
  1288. }
  1289. return self['@values'][index] = aValue;
  1290. ;
  1291. return self}, function($ctx1) {$ctx1.fill(self,"at:put:",{aKey:aKey,aValue:aValue},smalltalk.Dictionary)})},
  1292. messageSends: []}),
  1293. smalltalk.Dictionary);
  1294. smalltalk.addMethod(
  1295. smalltalk.method({
  1296. selector: "includesKey:",
  1297. fn: function (aKey){
  1298. var self=this;
  1299. return smalltalk.withContext(function($ctx1) {
  1300. return self._positionOfKey_(aKey) >= 0; ;
  1301. return self}, function($ctx1) {$ctx1.fill(self,"includesKey:",{aKey:aKey},smalltalk.Dictionary)})},
  1302. messageSends: []}),
  1303. smalltalk.Dictionary);
  1304. smalltalk.addMethod(
  1305. smalltalk.method({
  1306. selector: "indexOf:ifAbsent:",
  1307. fn: function (anObject,aBlock){
  1308. var self=this;
  1309. var index;
  1310. return smalltalk.withContext(function($ctx1) {
  1311. var $2,$1;
  1312. index=_st(self["@values"])._indexOf_ifAbsent_(anObject,(function(){
  1313. return smalltalk.withContext(function($ctx2) {
  1314. return (0);
  1315. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1316. $2=_st(index).__eq((0));
  1317. if(smalltalk.assert($2)){
  1318. $1=_st(aBlock)._value();
  1319. } else {
  1320. $1=_st(self["@keys"])._at_(index);
  1321. };
  1322. return $1;
  1323. }, function($ctx1) {$ctx1.fill(self,"indexOf:ifAbsent:",{anObject:anObject,aBlock:aBlock,index:index},smalltalk.Dictionary)})},
  1324. messageSends: ["indexOf:ifAbsent:", "ifTrue:ifFalse:", "value", "at:", "="]}),
  1325. smalltalk.Dictionary);
  1326. smalltalk.addMethod(
  1327. smalltalk.method({
  1328. selector: "initialize",
  1329. fn: function (){
  1330. var self=this;
  1331. return smalltalk.withContext(function($ctx1) {
  1332. smalltalk.HashedCollection.fn.prototype._initialize.apply(_st(self), []);
  1333. self["@keys"]=[];
  1334. self["@values"]=[];
  1335. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Dictionary)})},
  1336. messageSends: ["initialize"]}),
  1337. smalltalk.Dictionary);
  1338. smalltalk.addMethod(
  1339. smalltalk.method({
  1340. selector: "keys",
  1341. fn: function (){
  1342. var self=this;
  1343. return smalltalk.withContext(function($ctx1) {
  1344. var $1;
  1345. $1=_st(self["@keys"])._copy();
  1346. return $1;
  1347. }, function($ctx1) {$ctx1.fill(self,"keys",{},smalltalk.Dictionary)})},
  1348. messageSends: ["copy"]}),
  1349. smalltalk.Dictionary);
  1350. smalltalk.addMethod(
  1351. smalltalk.method({
  1352. selector: "keysAndValuesDo:",
  1353. fn: function (aBlock){
  1354. var self=this;
  1355. return smalltalk.withContext(function($ctx1) {
  1356. var $1;
  1357. $1=_st(self["@keys"])._with_do_(self["@values"],aBlock);
  1358. return $1;
  1359. }, function($ctx1) {$ctx1.fill(self,"keysAndValuesDo:",{aBlock:aBlock},smalltalk.Dictionary)})},
  1360. messageSends: ["with:do:"]}),
  1361. smalltalk.Dictionary);
  1362. smalltalk.addMethod(
  1363. smalltalk.method({
  1364. selector: "keysDo:",
  1365. fn: function (aBlock){
  1366. var self=this;
  1367. return smalltalk.withContext(function($ctx1) {
  1368. var $1;
  1369. $1=_st(self["@keys"])._do_(aBlock);
  1370. return $1;
  1371. }, function($ctx1) {$ctx1.fill(self,"keysDo:",{aBlock:aBlock},smalltalk.Dictionary)})},
  1372. messageSends: ["do:"]}),
  1373. smalltalk.Dictionary);
  1374. smalltalk.addMethod(
  1375. smalltalk.method({
  1376. selector: "positionOfKey:",
  1377. fn: function (anObject){
  1378. var self=this;
  1379. return smalltalk.withContext(function($ctx1) {
  1380. var keys = self['@keys'];
  1381. for(var i=0;i<keys.length;i++){
  1382. if(keys[i].__eq(anObject)) { return i;}
  1383. }
  1384. return -1;
  1385. ;
  1386. return self}, function($ctx1) {$ctx1.fill(self,"positionOfKey:",{anObject:anObject},smalltalk.Dictionary)})},
  1387. messageSends: []}),
  1388. smalltalk.Dictionary);
  1389. smalltalk.addMethod(
  1390. smalltalk.method({
  1391. selector: "removeKey:ifAbsent:",
  1392. fn: function (aKey,aBlock){
  1393. var self=this;
  1394. return smalltalk.withContext(function($ctx1) {
  1395. var index = self._positionOfKey_(aKey);
  1396. if(index === -1) {
  1397. return aBlock()
  1398. } else {
  1399. var keys = self['@keys'], values = self['@values'];
  1400. var value = values[index], l = keys.length;
  1401. keys[index] = keys[l-1];
  1402. keys.pop();
  1403. values[index] = values[l-1];
  1404. values.pop();
  1405. return value;
  1406. }
  1407. ;
  1408. return self}, function($ctx1) {$ctx1.fill(self,"removeKey:ifAbsent:",{aKey:aKey,aBlock:aBlock},smalltalk.Dictionary)})},
  1409. messageSends: []}),
  1410. smalltalk.Dictionary);
  1411. smalltalk.addMethod(
  1412. smalltalk.method({
  1413. selector: "values",
  1414. fn: function (){
  1415. var self=this;
  1416. return smalltalk.withContext(function($ctx1) {
  1417. var $1;
  1418. $1=_st(self["@values"])._copy();
  1419. return $1;
  1420. }, function($ctx1) {$ctx1.fill(self,"values",{},smalltalk.Dictionary)})},
  1421. messageSends: ["copy"]}),
  1422. smalltalk.Dictionary);
  1423. smalltalk.addMethod(
  1424. smalltalk.method({
  1425. selector: "valuesDo:",
  1426. fn: function (aBlock){
  1427. var self=this;
  1428. return smalltalk.withContext(function($ctx1) {
  1429. var $1;
  1430. $1=_st(self["@values"])._do_(aBlock);
  1431. return $1;
  1432. }, function($ctx1) {$ctx1.fill(self,"valuesDo:",{aBlock:aBlock},smalltalk.Dictionary)})},
  1433. messageSends: ["do:"]}),
  1434. smalltalk.Dictionary);
  1435. smalltalk.addClass('SequenceableCollection', smalltalk.IndexableCollection, [], 'Kernel-Collections');
  1436. smalltalk.addMethod(
  1437. smalltalk.method({
  1438. selector: "=",
  1439. fn: function (aCollection){
  1440. var self=this;
  1441. return smalltalk.withContext(function($ctx1) {
  1442. var $1,$2;
  1443. var $early={};
  1444. try {
  1445. $1=_st(_st(_st(self)._class()).__eq(_st(aCollection)._class()))._and_((function(){
  1446. return smalltalk.withContext(function($ctx2) {
  1447. return _st(_st(self)._size()).__eq(_st(aCollection)._size());
  1448. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1449. if(! smalltalk.assert($1)){
  1450. return false;
  1451. };
  1452. _st(self)._withIndexDo_((function(each,i){
  1453. return smalltalk.withContext(function($ctx2) {
  1454. $2=_st(_st(aCollection)._at_(i)).__eq(each);
  1455. if(! smalltalk.assert($2)){
  1456. throw $early=[false];
  1457. };
  1458. }, function($ctx2) {$ctx2.fillBlock({each:each,i:i},$ctx1)})}));
  1459. return true;
  1460. }
  1461. catch(e) {if(e===$early)return e[0]; throw e}
  1462. }, function($ctx1) {$ctx1.fill(self,"=",{aCollection:aCollection},smalltalk.SequenceableCollection)})},
  1463. messageSends: ["ifFalse:", "and:", "=", "size", "class", "withIndexDo:", "at:"]}),
  1464. smalltalk.SequenceableCollection);
  1465. smalltalk.addMethod(
  1466. smalltalk.method({
  1467. selector: "addLast:",
  1468. fn: function (anObject){
  1469. var self=this;
  1470. return smalltalk.withContext(function($ctx1) {
  1471. _st(self)._add_(anObject);
  1472. return self}, function($ctx1) {$ctx1.fill(self,"addLast:",{anObject:anObject},smalltalk.SequenceableCollection)})},
  1473. messageSends: ["add:"]}),
  1474. smalltalk.SequenceableCollection);
  1475. smalltalk.addMethod(
  1476. smalltalk.method({
  1477. selector: "allButFirst",
  1478. fn: function (){
  1479. var self=this;
  1480. return smalltalk.withContext(function($ctx1) {
  1481. var $1;
  1482. $1=_st(self)._copyFrom_to_((2),_st(self)._size());
  1483. return $1;
  1484. }, function($ctx1) {$ctx1.fill(self,"allButFirst",{},smalltalk.SequenceableCollection)})},
  1485. messageSends: ["copyFrom:to:", "size"]}),
  1486. smalltalk.SequenceableCollection);
  1487. smalltalk.addMethod(
  1488. smalltalk.method({
  1489. selector: "allButLast",
  1490. fn: function (){
  1491. var self=this;
  1492. return smalltalk.withContext(function($ctx1) {
  1493. var $1;
  1494. $1=_st(self)._copyFrom_to_((1),_st(_st(self)._size()).__minus((1)));
  1495. return $1;
  1496. }, function($ctx1) {$ctx1.fill(self,"allButLast",{},smalltalk.SequenceableCollection)})},
  1497. messageSends: ["copyFrom:to:", "-", "size"]}),
  1498. smalltalk.SequenceableCollection);
  1499. smalltalk.addMethod(
  1500. smalltalk.method({
  1501. selector: "atRandom",
  1502. fn: function (){
  1503. var self=this;
  1504. return smalltalk.withContext(function($ctx1) {
  1505. var $1;
  1506. $1=_st(self)._at_(_st(_st(self)._size())._atRandom());
  1507. return $1;
  1508. }, function($ctx1) {$ctx1.fill(self,"atRandom",{},smalltalk.SequenceableCollection)})},
  1509. messageSends: ["at:", "atRandom", "size"]}),
  1510. smalltalk.SequenceableCollection);
  1511. smalltalk.addMethod(
  1512. smalltalk.method({
  1513. selector: "copyFrom:to:",
  1514. fn: function (anIndex,anotherIndex){
  1515. var self=this;
  1516. var range,newCollection;
  1517. return smalltalk.withContext(function($ctx1) {
  1518. var $1;
  1519. range=_st(anIndex)._to_(anotherIndex);
  1520. newCollection=_st(_st(self)._class())._new_(_st(range)._size());
  1521. _st(range)._withIndexDo_((function(each,i){
  1522. return smalltalk.withContext(function($ctx2) {
  1523. return _st(newCollection)._at_put_(i,_st(self)._at_(each));
  1524. }, function($ctx2) {$ctx2.fillBlock({each:each,i:i},$ctx1)})}));
  1525. $1=newCollection;
  1526. return $1;
  1527. }, function($ctx1) {$ctx1.fill(self,"copyFrom:to:",{anIndex:anIndex,anotherIndex:anotherIndex,range:range,newCollection:newCollection},smalltalk.SequenceableCollection)})},
  1528. messageSends: ["to:", "new:", "size", "class", "withIndexDo:", "at:put:", "at:"]}),
  1529. smalltalk.SequenceableCollection);
  1530. smalltalk.addMethod(
  1531. smalltalk.method({
  1532. selector: "deepCopy",
  1533. fn: function (){
  1534. var self=this;
  1535. var newCollection;
  1536. return smalltalk.withContext(function($ctx1) {
  1537. var $1;
  1538. newCollection=_st(_st(self)._class())._new_(_st(self)._size());
  1539. _st(self)._withIndexDo_((function(each,index){
  1540. return smalltalk.withContext(function($ctx2) {
  1541. return _st(newCollection)._at_put_(index,_st(each)._deepCopy());
  1542. }, function($ctx2) {$ctx2.fillBlock({each:each,index:index},$ctx1)})}));
  1543. $1=newCollection;
  1544. return $1;
  1545. }, function($ctx1) {$ctx1.fill(self,"deepCopy",{newCollection:newCollection},smalltalk.SequenceableCollection)})},
  1546. messageSends: ["new:", "size", "class", "withIndexDo:", "at:put:", "deepCopy"]}),
  1547. smalltalk.SequenceableCollection);
  1548. smalltalk.addMethod(
  1549. smalltalk.method({
  1550. selector: "detect:ifNone:",
  1551. fn: function (aBlock,anotherBlock){
  1552. var self=this;
  1553. return smalltalk.withContext(function($ctx1) {
  1554. for(var i = 0; i < self.length; i++)
  1555. if(aBlock(self[i]))
  1556. return self[i];
  1557. return anotherBlock();
  1558. ;
  1559. return self}, function($ctx1) {$ctx1.fill(self,"detect:ifNone:",{aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.SequenceableCollection)})},
  1560. messageSends: []}),
  1561. smalltalk.SequenceableCollection);
  1562. smalltalk.addMethod(
  1563. smalltalk.method({
  1564. selector: "do:",
  1565. fn: function (aBlock){
  1566. var self=this;
  1567. return smalltalk.withContext(function($ctx1) {
  1568. for(var i=0;i<self.length;i++){aBlock(self[i]);};
  1569. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.SequenceableCollection)})},
  1570. messageSends: []}),
  1571. smalltalk.SequenceableCollection);
  1572. smalltalk.addMethod(
  1573. smalltalk.method({
  1574. selector: "first",
  1575. fn: function (){
  1576. var self=this;
  1577. return smalltalk.withContext(function($ctx1) {
  1578. var $1;
  1579. $1=_st(self)._at_((1));
  1580. return $1;
  1581. }, function($ctx1) {$ctx1.fill(self,"first",{},smalltalk.SequenceableCollection)})},
  1582. messageSends: ["at:"]}),
  1583. smalltalk.SequenceableCollection);
  1584. smalltalk.addMethod(
  1585. smalltalk.method({
  1586. selector: "first:",
  1587. fn: function (n){
  1588. var self=this;
  1589. return smalltalk.withContext(function($ctx1) {
  1590. var $1;
  1591. $1=_st(self)._copyFrom_to_((1),n);
  1592. return $1;
  1593. }, function($ctx1) {$ctx1.fill(self,"first:",{n:n},smalltalk.SequenceableCollection)})},
  1594. messageSends: ["copyFrom:to:"]}),
  1595. smalltalk.SequenceableCollection);
  1596. smalltalk.addMethod(
  1597. smalltalk.method({
  1598. selector: "fourth",
  1599. fn: function (){
  1600. var self=this;
  1601. return smalltalk.withContext(function($ctx1) {
  1602. var $1;
  1603. $1=_st(self)._at_((4));
  1604. return $1;
  1605. }, function($ctx1) {$ctx1.fill(self,"fourth",{},smalltalk.SequenceableCollection)})},
  1606. messageSends: ["at:"]}),
  1607. smalltalk.SequenceableCollection);
  1608. smalltalk.addMethod(
  1609. smalltalk.method({
  1610. selector: "includes:",
  1611. fn: function (anObject){
  1612. var self=this;
  1613. return smalltalk.withContext(function($ctx1) {
  1614. var $1;
  1615. $1=_st(_st(self)._indexOf_ifAbsent_(anObject,(function(){
  1616. return smalltalk.withContext(function($ctx2) {
  1617. return nil;
  1618. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._notNil();
  1619. return $1;
  1620. }, function($ctx1) {$ctx1.fill(self,"includes:",{anObject:anObject},smalltalk.SequenceableCollection)})},
  1621. messageSends: ["notNil", "indexOf:ifAbsent:"]}),
  1622. smalltalk.SequenceableCollection);
  1623. smalltalk.addMethod(
  1624. smalltalk.method({
  1625. selector: "indexOf:ifAbsent:",
  1626. fn: function (anObject,aBlock){
  1627. var self=this;
  1628. return smalltalk.withContext(function($ctx1) {
  1629. for(var i=0;i<self.length;i++) {
  1630. if(self[i].__eq(anObject)) {return i+1}
  1631. };
  1632. return aBlock();
  1633. ;
  1634. return self}, function($ctx1) {$ctx1.fill(self,"indexOf:ifAbsent:",{anObject:anObject,aBlock:aBlock},smalltalk.SequenceableCollection)})},
  1635. messageSends: []}),
  1636. smalltalk.SequenceableCollection);
  1637. smalltalk.addMethod(
  1638. smalltalk.method({
  1639. selector: "indexOf:startingAt:",
  1640. fn: function (anObject,start){
  1641. var self=this;
  1642. return smalltalk.withContext(function($ctx1) {
  1643. var $1;
  1644. $1=_st(self)._indexOf_startingAt_ifAbsent_(anObject,start,(function(){
  1645. return smalltalk.withContext(function($ctx2) {
  1646. return (0);
  1647. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1648. return $1;
  1649. }, function($ctx1) {$ctx1.fill(self,"indexOf:startingAt:",{anObject:anObject,start:start},smalltalk.SequenceableCollection)})},
  1650. messageSends: ["indexOf:startingAt:ifAbsent:"]}),
  1651. smalltalk.SequenceableCollection);
  1652. smalltalk.addMethod(
  1653. smalltalk.method({
  1654. selector: "indexOf:startingAt:ifAbsent:",
  1655. fn: function (anObject,start,aBlock){
  1656. var self=this;
  1657. return smalltalk.withContext(function($ctx1) {
  1658. for(var i=start-1;i<self.length;i++){
  1659. if(self[i].__eq(anObject)) {return i+1}
  1660. }
  1661. return aBlock();
  1662. ;
  1663. return self}, function($ctx1) {$ctx1.fill(self,"indexOf:startingAt:ifAbsent:",{anObject:anObject,start:start,aBlock:aBlock},smalltalk.SequenceableCollection)})},
  1664. messageSends: []}),
  1665. smalltalk.SequenceableCollection);
  1666. smalltalk.addMethod(
  1667. smalltalk.method({
  1668. selector: "last",
  1669. fn: function (){
  1670. var self=this;
  1671. return smalltalk.withContext(function($ctx1) {
  1672. var $1;
  1673. $1=_st(self)._at_(_st(self)._size());
  1674. return $1;
  1675. }, function($ctx1) {$ctx1.fill(self,"last",{},smalltalk.SequenceableCollection)})},
  1676. messageSends: ["at:", "size"]}),
  1677. smalltalk.SequenceableCollection);
  1678. smalltalk.addMethod(
  1679. smalltalk.method({
  1680. selector: "newStream",
  1681. fn: function (){
  1682. var self=this;
  1683. return smalltalk.withContext(function($ctx1) {
  1684. var $1;
  1685. $1=_st(_st(self)._streamClass())._on_(self);
  1686. return $1;
  1687. }, function($ctx1) {$ctx1.fill(self,"newStream",{},smalltalk.SequenceableCollection)})},
  1688. messageSends: ["on:", "streamClass"]}),
  1689. smalltalk.SequenceableCollection);
  1690. smalltalk.addMethod(
  1691. smalltalk.method({
  1692. selector: "readStream",
  1693. fn: function (){
  1694. var self=this;
  1695. return smalltalk.withContext(function($ctx1) {
  1696. var $1;
  1697. $1=_st(self)._stream();
  1698. return $1;
  1699. }, function($ctx1) {$ctx1.fill(self,"readStream",{},smalltalk.SequenceableCollection)})},
  1700. messageSends: ["stream"]}),
  1701. smalltalk.SequenceableCollection);
  1702. smalltalk.addMethod(
  1703. smalltalk.method({
  1704. selector: "removeLast",
  1705. fn: function (){
  1706. var self=this;
  1707. return smalltalk.withContext(function($ctx1) {
  1708. _st(self)._remove_(_st(self)._last());
  1709. return self}, function($ctx1) {$ctx1.fill(self,"removeLast",{},smalltalk.SequenceableCollection)})},
  1710. messageSends: ["remove:", "last"]}),
  1711. smalltalk.SequenceableCollection);
  1712. smalltalk.addMethod(
  1713. smalltalk.method({
  1714. selector: "reversed",
  1715. fn: function (){
  1716. var self=this;
  1717. return smalltalk.withContext(function($ctx1) {
  1718. _st(self)._subclassResponsibility();
  1719. return self}, function($ctx1) {$ctx1.fill(self,"reversed",{},smalltalk.SequenceableCollection)})},
  1720. messageSends: ["subclassResponsibility"]}),
  1721. smalltalk.SequenceableCollection);
  1722. smalltalk.addMethod(
  1723. smalltalk.method({
  1724. selector: "second",
  1725. fn: function (){
  1726. var self=this;
  1727. return smalltalk.withContext(function($ctx1) {
  1728. var $1;
  1729. $1=_st(self)._at_((2));
  1730. return $1;
  1731. }, function($ctx1) {$ctx1.fill(self,"second",{},smalltalk.SequenceableCollection)})},
  1732. messageSends: ["at:"]}),
  1733. smalltalk.SequenceableCollection);
  1734. smalltalk.addMethod(
  1735. smalltalk.method({
  1736. selector: "shallowCopy",
  1737. fn: function (){
  1738. var self=this;
  1739. var newCollection;
  1740. return smalltalk.withContext(function($ctx1) {
  1741. var $1;
  1742. newCollection=_st(_st(self)._class())._new_(_st(self)._size());
  1743. _st(self)._withIndexDo_((function(each,index){
  1744. return smalltalk.withContext(function($ctx2) {
  1745. return _st(newCollection)._at_put_(index,each);
  1746. }, function($ctx2) {$ctx2.fillBlock({each:each,index:index},$ctx1)})}));
  1747. $1=newCollection;
  1748. return $1;
  1749. }, function($ctx1) {$ctx1.fill(self,"shallowCopy",{newCollection:newCollection},smalltalk.SequenceableCollection)})},
  1750. messageSends: ["new:", "size", "class", "withIndexDo:", "at:put:"]}),
  1751. smalltalk.SequenceableCollection);
  1752. smalltalk.addMethod(
  1753. smalltalk.method({
  1754. selector: "stream",
  1755. fn: function (){
  1756. var self=this;
  1757. return smalltalk.withContext(function($ctx1) {
  1758. var $1;
  1759. $1=_st(self)._newStream();
  1760. return $1;
  1761. }, function($ctx1) {$ctx1.fill(self,"stream",{},smalltalk.SequenceableCollection)})},
  1762. messageSends: ["newStream"]}),
  1763. smalltalk.SequenceableCollection);
  1764. smalltalk.addMethod(
  1765. smalltalk.method({
  1766. selector: "streamClass",
  1767. fn: function (){
  1768. var self=this;
  1769. return smalltalk.withContext(function($ctx1) {
  1770. var $1;
  1771. $1=_st(_st(self)._class())._streamClass();
  1772. return $1;
  1773. }, function($ctx1) {$ctx1.fill(self,"streamClass",{},smalltalk.SequenceableCollection)})},
  1774. messageSends: ["streamClass", "class"]}),
  1775. smalltalk.SequenceableCollection);
  1776. smalltalk.addMethod(
  1777. smalltalk.method({
  1778. selector: "third",
  1779. fn: function (){
  1780. var self=this;
  1781. return smalltalk.withContext(function($ctx1) {
  1782. var $1;
  1783. $1=_st(self)._at_((3));
  1784. return $1;
  1785. }, function($ctx1) {$ctx1.fill(self,"third",{},smalltalk.SequenceableCollection)})},
  1786. messageSends: ["at:"]}),
  1787. smalltalk.SequenceableCollection);
  1788. smalltalk.addMethod(
  1789. smalltalk.method({
  1790. selector: "with:do:",
  1791. fn: function (anotherCollection,aBlock){
  1792. var self=this;
  1793. return smalltalk.withContext(function($ctx1) {
  1794. for(var i=0;i<self.length;i++){aBlock(self[i], anotherCollection[i]);};
  1795. return self}, function($ctx1) {$ctx1.fill(self,"with:do:",{anotherCollection:anotherCollection,aBlock:aBlock},smalltalk.SequenceableCollection)})},
  1796. messageSends: []}),
  1797. smalltalk.SequenceableCollection);
  1798. smalltalk.addMethod(
  1799. smalltalk.method({
  1800. selector: "withIndexDo:",
  1801. fn: function (aBlock){
  1802. var self=this;
  1803. return smalltalk.withContext(function($ctx1) {
  1804. for(var i=0;i<self.length;i++){aBlock(self[i], i+1);};
  1805. return self}, function($ctx1) {$ctx1.fill(self,"withIndexDo:",{aBlock:aBlock},smalltalk.SequenceableCollection)})},
  1806. messageSends: []}),
  1807. smalltalk.SequenceableCollection);
  1808. smalltalk.addMethod(
  1809. smalltalk.method({
  1810. selector: "writeStream",
  1811. fn: function (){
  1812. var self=this;
  1813. return smalltalk.withContext(function($ctx1) {
  1814. var $1;
  1815. $1=_st(self)._stream();
  1816. return $1;
  1817. }, function($ctx1) {$ctx1.fill(self,"writeStream",{},smalltalk.SequenceableCollection)})},
  1818. messageSends: ["stream"]}),
  1819. smalltalk.SequenceableCollection);
  1820. smalltalk.addMethod(
  1821. smalltalk.method({
  1822. selector: "streamClass",
  1823. fn: function (){
  1824. var self=this;
  1825. function $Stream(){return smalltalk.Stream||(typeof Stream=="undefined"?nil:Stream)}
  1826. return smalltalk.withContext(function($ctx1) {
  1827. var $1;
  1828. $1=$Stream();
  1829. return $1;
  1830. }, function($ctx1) {$ctx1.fill(self,"streamClass",{},smalltalk.SequenceableCollection.klass)})},
  1831. messageSends: []}),
  1832. smalltalk.SequenceableCollection.klass);
  1833. smalltalk.addMethod(
  1834. smalltalk.method({
  1835. selector: "streamContents:",
  1836. fn: function (aBlock){
  1837. var self=this;
  1838. var stream;
  1839. return smalltalk.withContext(function($ctx1) {
  1840. var $1;
  1841. stream=_st(_st(self)._streamClass())._on_(_st(self)._new());
  1842. _st(aBlock)._value_(stream);
  1843. $1=_st(stream)._contents();
  1844. return $1;
  1845. }, function($ctx1) {$ctx1.fill(self,"streamContents:",{aBlock:aBlock,stream:stream},smalltalk.SequenceableCollection.klass)})},
  1846. messageSends: ["on:", "new", "streamClass", "value:", "contents"]}),
  1847. smalltalk.SequenceableCollection.klass);
  1848. smalltalk.addClass('Array', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
  1849. smalltalk.addMethod(
  1850. smalltalk.method({
  1851. selector: "add:",
  1852. fn: function (anObject){
  1853. var self=this;
  1854. return smalltalk.withContext(function($ctx1) {
  1855. self.push(anObject); return anObject;;
  1856. return self}, function($ctx1) {$ctx1.fill(self,"add:",{anObject:anObject},smalltalk.Array)})},
  1857. messageSends: []}),
  1858. smalltalk.Array);
  1859. smalltalk.addMethod(
  1860. smalltalk.method({
  1861. selector: "asJavascript",
  1862. fn: function (){
  1863. var self=this;
  1864. return smalltalk.withContext(function($ctx1) {
  1865. var $1;
  1866. $1=_st(_st("[").__comma(_st(_st(self)._collect_((function(each){
  1867. return smalltalk.withContext(function($ctx2) {
  1868. return _st(each)._asJavascript();
  1869. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._join_(", "))).__comma("]");
  1870. return $1;
  1871. }, function($ctx1) {$ctx1.fill(self,"asJavascript",{},smalltalk.Array)})},
  1872. messageSends: [",", "join:", "collect:", "asJavascript"]}),
  1873. smalltalk.Array);
  1874. smalltalk.addMethod(
  1875. smalltalk.method({
  1876. selector: "at:ifAbsent:",
  1877. fn: function (anIndex,aBlock){
  1878. var self=this;
  1879. return smalltalk.withContext(function($ctx1) {
  1880. if((anIndex < 1) || (self.length < anIndex)) {return aBlock()};
  1881. return self[anIndex - 1];
  1882. ;
  1883. return self}, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{anIndex:anIndex,aBlock:aBlock},smalltalk.Array)})},
  1884. messageSends: []}),
  1885. smalltalk.Array);
  1886. smalltalk.addMethod(
  1887. smalltalk.method({
  1888. selector: "at:ifPresent:ifAbsent:",
  1889. fn: function (anIndex,aBlock,anotherBlock){
  1890. var self=this;
  1891. return smalltalk.withContext(function($ctx1) {
  1892. return anIndex < 1 || self.length < anIndex ? anotherBlock._value() : aBlock._value_(self[anIndex - 1]);;
  1893. return self}, function($ctx1) {$ctx1.fill(self,"at:ifPresent:ifAbsent:",{anIndex:anIndex,aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.Array)})},
  1894. messageSends: []}),
  1895. smalltalk.Array);
  1896. smalltalk.addMethod(
  1897. smalltalk.method({
  1898. selector: "at:put:",
  1899. fn: function (anIndex,anObject){
  1900. var self=this;
  1901. return smalltalk.withContext(function($ctx1) {
  1902. return self[anIndex - 1] = anObject;
  1903. return self}, function($ctx1) {$ctx1.fill(self,"at:put:",{anIndex:anIndex,anObject:anObject},smalltalk.Array)})},
  1904. messageSends: []}),
  1905. smalltalk.Array);
  1906. smalltalk.addMethod(
  1907. smalltalk.method({
  1908. selector: "join:",
  1909. fn: function (aString){
  1910. var self=this;
  1911. return smalltalk.withContext(function($ctx1) {
  1912. return self.join(aString);
  1913. return self}, function($ctx1) {$ctx1.fill(self,"join:",{aString:aString},smalltalk.Array)})},
  1914. messageSends: []}),
  1915. smalltalk.Array);
  1916. smalltalk.addMethod(
  1917. smalltalk.method({
  1918. selector: "printOn:",
  1919. fn: function (aStream){
  1920. var self=this;
  1921. return smalltalk.withContext(function($ctx1) {
  1922. smalltalk.SequenceableCollection.fn.prototype._printOn_.apply(_st(self), [aStream]);
  1923. _st(aStream)._nextPutAll_(" (");
  1924. _st(self)._do_separatedBy_((function(each){
  1925. return smalltalk.withContext(function($ctx2) {
  1926. return _st(each)._printOn_(aStream);
  1927. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  1928. return smalltalk.withContext(function($ctx2) {
  1929. return _st(aStream)._nextPutAll_(" ");
  1930. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1931. _st(aStream)._nextPutAll_(")");
  1932. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Array)})},
  1933. messageSends: ["printOn:", "nextPutAll:", "do:separatedBy:"]}),
  1934. smalltalk.Array);
  1935. smalltalk.addMethod(
  1936. smalltalk.method({
  1937. selector: "remove:ifAbsent:",
  1938. fn: function (anObject,aBlock){
  1939. var self=this;
  1940. return smalltalk.withContext(function($ctx1) {
  1941. for(var i=0;i<self.length;i++) {
  1942. if(self[i] == anObject) {
  1943. self.splice(i,1);
  1944. return self;
  1945. }
  1946. };
  1947. aBlock._value();
  1948. ;
  1949. return self}, function($ctx1) {$ctx1.fill(self,"remove:ifAbsent:",{anObject:anObject,aBlock:aBlock},smalltalk.Array)})},
  1950. messageSends: []}),
  1951. smalltalk.Array);
  1952. smalltalk.addMethod(
  1953. smalltalk.method({
  1954. selector: "removeFrom:to:",
  1955. fn: function (aNumber,anotherNumber){
  1956. var self=this;
  1957. return smalltalk.withContext(function($ctx1) {
  1958. self.splice(aNumber - 1,anotherNumber - 1);
  1959. return self}, function($ctx1) {$ctx1.fill(self,"removeFrom:to:",{aNumber:aNumber,anotherNumber:anotherNumber},smalltalk.Array)})},
  1960. messageSends: []}),
  1961. smalltalk.Array);
  1962. smalltalk.addMethod(
  1963. smalltalk.method({
  1964. selector: "reversed",
  1965. fn: function (){
  1966. var self=this;
  1967. return smalltalk.withContext(function($ctx1) {
  1968. return self._copy().reverse();
  1969. return self}, function($ctx1) {$ctx1.fill(self,"reversed",{},smalltalk.Array)})},
  1970. messageSends: []}),
  1971. smalltalk.Array);
  1972. smalltalk.addMethod(
  1973. smalltalk.method({
  1974. selector: "size",
  1975. fn: function (){
  1976. var self=this;
  1977. return smalltalk.withContext(function($ctx1) {
  1978. return self.length;
  1979. return self}, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.Array)})},
  1980. messageSends: []}),
  1981. smalltalk.Array);
  1982. smalltalk.addMethod(
  1983. smalltalk.method({
  1984. selector: "sort",
  1985. fn: function (){
  1986. var self=this;
  1987. return smalltalk.withContext(function($ctx1) {
  1988. var $1;
  1989. $1=_st(self)._basicPerform_("sort");
  1990. return $1;
  1991. }, function($ctx1) {$ctx1.fill(self,"sort",{},smalltalk.Array)})},
  1992. messageSends: ["basicPerform:"]}),
  1993. smalltalk.Array);
  1994. smalltalk.addMethod(
  1995. smalltalk.method({
  1996. selector: "sort:",
  1997. fn: function (aBlock){
  1998. var self=this;
  1999. return smalltalk.withContext(function($ctx1) {
  2000. return self.sort(function(a, b) {
  2001. if(aBlock(a,b)) {return -1} else {return 1}
  2002. })
  2003. ;
  2004. return self}, function($ctx1) {$ctx1.fill(self,"sort:",{aBlock:aBlock},smalltalk.Array)})},
  2005. messageSends: []}),
  2006. smalltalk.Array);
  2007. smalltalk.addMethod(
  2008. smalltalk.method({
  2009. selector: "sorted",
  2010. fn: function (){
  2011. var self=this;
  2012. return smalltalk.withContext(function($ctx1) {
  2013. var $1;
  2014. $1=_st(_st(self)._copy())._sort();
  2015. return $1;
  2016. }, function($ctx1) {$ctx1.fill(self,"sorted",{},smalltalk.Array)})},
  2017. messageSends: ["sort", "copy"]}),
  2018. smalltalk.Array);
  2019. smalltalk.addMethod(
  2020. smalltalk.method({
  2021. selector: "sorted:",
  2022. fn: function (aBlock){
  2023. var self=this;
  2024. return smalltalk.withContext(function($ctx1) {
  2025. var $1;
  2026. $1=_st(_st(self)._copy())._sort_(aBlock);
  2027. return $1;
  2028. }, function($ctx1) {$ctx1.fill(self,"sorted:",{aBlock:aBlock},smalltalk.Array)})},
  2029. messageSends: ["sort:", "copy"]}),
  2030. smalltalk.Array);
  2031. smalltalk.addMethod(
  2032. smalltalk.method({
  2033. selector: "new:",
  2034. fn: function (anInteger){
  2035. var self=this;
  2036. return smalltalk.withContext(function($ctx1) {
  2037. return new Array(anInteger);
  2038. return self}, function($ctx1) {$ctx1.fill(self,"new:",{anInteger:anInteger},smalltalk.Array.klass)})},
  2039. messageSends: []}),
  2040. smalltalk.Array.klass);
  2041. smalltalk.addMethod(
  2042. smalltalk.method({
  2043. selector: "with:",
  2044. fn: function (anObject){
  2045. var self=this;
  2046. return smalltalk.withContext(function($ctx1) {
  2047. var $2,$3,$1;
  2048. $2=_st(self)._new_((1));
  2049. _st($2)._at_put_((1),anObject);
  2050. $3=_st($2)._yourself();
  2051. $1=$3;
  2052. return $1;
  2053. }, function($ctx1) {$ctx1.fill(self,"with:",{anObject:anObject},smalltalk.Array.klass)})},
  2054. messageSends: ["at:put:", "new:", "yourself"]}),
  2055. smalltalk.Array.klass);
  2056. smalltalk.addMethod(
  2057. smalltalk.method({
  2058. selector: "with:with:",
  2059. fn: function (anObject,anObject2){
  2060. var self=this;
  2061. return smalltalk.withContext(function($ctx1) {
  2062. var $2,$3,$1;
  2063. $2=_st(self)._new_((2));
  2064. _st($2)._at_put_((1),anObject);
  2065. _st($2)._at_put_((2),anObject2);
  2066. $3=_st($2)._yourself();
  2067. $1=$3;
  2068. return $1;
  2069. }, function($ctx1) {$ctx1.fill(self,"with:with:",{anObject:anObject,anObject2:anObject2},smalltalk.Array.klass)})},
  2070. messageSends: ["at:put:", "new:", "yourself"]}),
  2071. smalltalk.Array.klass);
  2072. smalltalk.addMethod(
  2073. smalltalk.method({
  2074. selector: "with:with:with:",
  2075. fn: function (anObject,anObject2,anObject3){
  2076. var self=this;
  2077. return smalltalk.withContext(function($ctx1) {
  2078. var $2,$3,$1;
  2079. $2=_st(self)._new_((3));
  2080. _st($2)._at_put_((1),anObject);
  2081. _st($2)._at_put_((2),anObject2);
  2082. _st($2)._at_put_((3),anObject3);
  2083. $3=_st($2)._yourself();
  2084. $1=$3;
  2085. return $1;
  2086. }, function($ctx1) {$ctx1.fill(self,"with:with:with:",{anObject:anObject,anObject2:anObject2,anObject3:anObject3},smalltalk.Array.klass)})},
  2087. messageSends: ["at:put:", "new:", "yourself"]}),
  2088. smalltalk.Array.klass);
  2089. smalltalk.addMethod(
  2090. smalltalk.method({
  2091. selector: "withAll:",
  2092. fn: function (aCollection){
  2093. var self=this;
  2094. var instance,index;
  2095. return smalltalk.withContext(function($ctx1) {
  2096. var $1;
  2097. index=(1);
  2098. instance=_st(self)._new_(_st(aCollection)._size());
  2099. _st(aCollection)._do_((function(each){
  2100. return smalltalk.withContext(function($ctx2) {
  2101. _st(instance)._at_put_(index,each);
  2102. index=_st(index).__plus((1));
  2103. return index;
  2104. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  2105. $1=instance;
  2106. return $1;
  2107. }, function($ctx1) {$ctx1.fill(self,"withAll:",{aCollection:aCollection,instance:instance,index:index},smalltalk.Array.klass)})},
  2108. messageSends: ["new:", "size", "do:", "at:put:", "+"]}),
  2109. smalltalk.Array.klass);
  2110. smalltalk.addClass('CharacterArray', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
  2111. smalltalk.addMethod(
  2112. smalltalk.method({
  2113. selector: ",",
  2114. fn: function (aString){
  2115. var self=this;
  2116. return smalltalk.withContext(function($ctx1) {
  2117. var $1;
  2118. $1=_st(_st(self)._asString()).__comma(_st(aString)._asString());
  2119. return $1;
  2120. }, function($ctx1) {$ctx1.fill(self,",",{aString:aString},smalltalk.CharacterArray)})},
  2121. messageSends: [",", "asString"]}),
  2122. smalltalk.CharacterArray);
  2123. smalltalk.addMethod(
  2124. smalltalk.method({
  2125. selector: "add:",
  2126. fn: function (anObject){
  2127. var self=this;
  2128. return smalltalk.withContext(function($ctx1) {
  2129. _st(self)._errorReadOnly();
  2130. return self}, function($ctx1) {$ctx1.fill(self,"add:",{anObject:anObject},smalltalk.CharacterArray)})},
  2131. messageSends: ["errorReadOnly"]}),
  2132. smalltalk.CharacterArray);
  2133. smalltalk.addMethod(
  2134. smalltalk.method({
  2135. selector: "asLowercase",
  2136. fn: function (){
  2137. var self=this;
  2138. return smalltalk.withContext(function($ctx1) {
  2139. var $1;
  2140. $1=_st(_st(self)._class())._fromString_(_st(_st(self)._asString())._asLowercase());
  2141. return $1;
  2142. }, function($ctx1) {$ctx1.fill(self,"asLowercase",{},smalltalk.CharacterArray)})},
  2143. messageSends: ["fromString:", "asLowercase", "asString", "class"]}),
  2144. smalltalk.CharacterArray);
  2145. smalltalk.addMethod(
  2146. smalltalk.method({
  2147. selector: "asNumber",
  2148. fn: function (){
  2149. var self=this;
  2150. return smalltalk.withContext(function($ctx1) {
  2151. var $1;
  2152. $1=_st(_st(self)._asString())._asNumber();
  2153. return $1;
  2154. }, function($ctx1) {$ctx1.fill(self,"asNumber",{},smalltalk.CharacterArray)})},
  2155. messageSends: ["asNumber", "asString"]}),
  2156. smalltalk.CharacterArray);
  2157. smalltalk.addMethod(
  2158. smalltalk.method({
  2159. selector: "asString",
  2160. fn: function (){
  2161. var self=this;
  2162. return smalltalk.withContext(function($ctx1) {
  2163. var $1;
  2164. $1=_st(self)._subclassResponsibility();
  2165. return $1;
  2166. }, function($ctx1) {$ctx1.fill(self,"asString",{},smalltalk.CharacterArray)})},
  2167. messageSends: ["subclassResponsibility"]}),
  2168. smalltalk.CharacterArray);
  2169. smalltalk.addMethod(
  2170. smalltalk.method({
  2171. selector: "asSymbol",
  2172. fn: function (){
  2173. var self=this;
  2174. return smalltalk.withContext(function($ctx1) {
  2175. var $1;
  2176. $1=_st(self)._asString();
  2177. return $1;
  2178. }, function($ctx1) {$ctx1.fill(self,"asSymbol",{},smalltalk.CharacterArray)})},
  2179. messageSends: ["asString"]}),
  2180. smalltalk.CharacterArray);
  2181. smalltalk.addMethod(
  2182. smalltalk.method({
  2183. selector: "asUppercase",
  2184. fn: function (){
  2185. var self=this;
  2186. return smalltalk.withContext(function($ctx1) {
  2187. var $1;
  2188. $1=_st(_st(self)._class())._fromString_(_st(_st(self)._asString())._asUppercase());
  2189. return $1;
  2190. }, function($ctx1) {$ctx1.fill(self,"asUppercase",{},smalltalk.CharacterArray)})},
  2191. messageSends: ["fromString:", "asUppercase", "asString", "class"]}),
  2192. smalltalk.CharacterArray);
  2193. smalltalk.addMethod(
  2194. smalltalk.method({
  2195. selector: "at:put:",
  2196. fn: function (anIndex,anObject){
  2197. var self=this;
  2198. return smalltalk.withContext(function($ctx1) {
  2199. _st(self)._errorReadOnly();
  2200. return self}, function($ctx1) {$ctx1.fill(self,"at:put:",{anIndex:anIndex,anObject:anObject},smalltalk.CharacterArray)})},
  2201. messageSends: ["errorReadOnly"]}),
  2202. smalltalk.CharacterArray);
  2203. smalltalk.addMethod(
  2204. smalltalk.method({
  2205. selector: "errorReadOnly",
  2206. fn: function (){
  2207. var self=this;
  2208. return smalltalk.withContext(function($ctx1) {
  2209. _st(self)._error_("Object is read-only");
  2210. return self}, function($ctx1) {$ctx1.fill(self,"errorReadOnly",{},smalltalk.CharacterArray)})},
  2211. messageSends: ["error:"]}),
  2212. smalltalk.CharacterArray);
  2213. smalltalk.addMethod(
  2214. smalltalk.method({
  2215. selector: "printOn:",
  2216. fn: function (aStream){
  2217. var self=this;
  2218. return smalltalk.withContext(function($ctx1) {
  2219. _st(_st(self)._asString())._printOn_(aStream);
  2220. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.CharacterArray)})},
  2221. messageSends: ["printOn:", "asString"]}),
  2222. smalltalk.CharacterArray);
  2223. smalltalk.addMethod(
  2224. smalltalk.method({
  2225. selector: "putOn:",
  2226. fn: function (aStream){
  2227. var self=this;
  2228. return smalltalk.withContext(function($ctx1) {
  2229. _st(aStream)._nextPutString_(self);
  2230. return self}, function($ctx1) {$ctx1.fill(self,"putOn:",{aStream:aStream},smalltalk.CharacterArray)})},
  2231. messageSends: ["nextPutString:"]}),
  2232. smalltalk.CharacterArray);
  2233. smalltalk.addMethod(
  2234. smalltalk.method({
  2235. selector: "remove:",
  2236. fn: function (anObject){
  2237. var self=this;
  2238. return smalltalk.withContext(function($ctx1) {
  2239. _st(self)._errorReadOnly();
  2240. return self}, function($ctx1) {$ctx1.fill(self,"remove:",{anObject:anObject},smalltalk.CharacterArray)})},
  2241. messageSends: ["errorReadOnly"]}),
  2242. smalltalk.CharacterArray);
  2243. smalltalk.addMethod(
  2244. smalltalk.method({
  2245. selector: "fromString:",
  2246. fn: function (aString){
  2247. var self=this;
  2248. return smalltalk.withContext(function($ctx1) {
  2249. _st(self)._subclassResponsibility();
  2250. return self}, function($ctx1) {$ctx1.fill(self,"fromString:",{aString:aString},smalltalk.CharacterArray.klass)})},
  2251. messageSends: ["subclassResponsibility"]}),
  2252. smalltalk.CharacterArray.klass);
  2253. smalltalk.addClass('String', smalltalk.CharacterArray, [], 'Kernel-Collections');
  2254. smalltalk.addMethod(
  2255. smalltalk.method({
  2256. selector: ",",
  2257. fn: function (aString){
  2258. var self=this;
  2259. return smalltalk.withContext(function($ctx1) {
  2260. return self + aString;
  2261. return self}, function($ctx1) {$ctx1.fill(self,",",{aString:aString},smalltalk.String)})},
  2262. messageSends: []}),
  2263. smalltalk.String);
  2264. smalltalk.addMethod(
  2265. smalltalk.method({
  2266. selector: "<",
  2267. fn: function (aString){
  2268. var self=this;
  2269. return smalltalk.withContext(function($ctx1) {
  2270. return String(self) < aString._asString();
  2271. return self}, function($ctx1) {$ctx1.fill(self,"<",{aString:aString},smalltalk.String)})},
  2272. messageSends: []}),
  2273. smalltalk.String);
  2274. smalltalk.addMethod(
  2275. smalltalk.method({
  2276. selector: "<=",
  2277. fn: function (aString){
  2278. var self=this;
  2279. return smalltalk.withContext(function($ctx1) {
  2280. return String(self) <= aString._asString();
  2281. return self}, function($ctx1) {$ctx1.fill(self,"<=",{aString:aString},smalltalk.String)})},
  2282. messageSends: []}),
  2283. smalltalk.String);
  2284. smalltalk.addMethod(
  2285. smalltalk.method({
  2286. selector: "=",
  2287. fn: function (aString){
  2288. var self=this;
  2289. return smalltalk.withContext(function($ctx1) {
  2290. if(typeof aString === 'undefined') { return false }
  2291. if(!aString._isString || ! aString._isString()) {
  2292. return false;
  2293. }
  2294. return String(self) === String(aString)
  2295. ;
  2296. return self}, function($ctx1) {$ctx1.fill(self,"=",{aString:aString},smalltalk.String)})},
  2297. messageSends: []}),
  2298. smalltalk.String);
  2299. smalltalk.addMethod(
  2300. smalltalk.method({
  2301. selector: "==",
  2302. fn: function (aString){
  2303. var self=this;
  2304. return smalltalk.withContext(function($ctx1) {
  2305. var $1;
  2306. $1=_st(self).__eq(aString);
  2307. return $1;
  2308. }, function($ctx1) {$ctx1.fill(self,"==",{aString:aString},smalltalk.String)})},
  2309. messageSends: ["="]}),
  2310. smalltalk.String);
  2311. smalltalk.addMethod(
  2312. smalltalk.method({
  2313. selector: ">",
  2314. fn: function (aString){
  2315. var self=this;
  2316. return smalltalk.withContext(function($ctx1) {
  2317. return String(self) > aString._asString();
  2318. return self}, function($ctx1) {$ctx1.fill(self,">",{aString:aString},smalltalk.String)})},
  2319. messageSends: []}),
  2320. smalltalk.String);
  2321. smalltalk.addMethod(
  2322. smalltalk.method({
  2323. selector: ">=",
  2324. fn: function (aString){
  2325. var self=this;
  2326. return smalltalk.withContext(function($ctx1) {
  2327. return String(self) >= aString._asString();
  2328. return self}, function($ctx1) {$ctx1.fill(self,">=",{aString:aString},smalltalk.String)})},
  2329. messageSends: []}),
  2330. smalltalk.String);
  2331. smalltalk.addMethod(
  2332. smalltalk.method({
  2333. selector: "asJSON",
  2334. fn: function (){
  2335. var self=this;
  2336. return smalltalk.withContext(function($ctx1) {
  2337. var $1;
  2338. $1=self;
  2339. return $1;
  2340. }, function($ctx1) {$ctx1.fill(self,"asJSON",{},smalltalk.String)})},
  2341. messageSends: []}),
  2342. smalltalk.String);
  2343. smalltalk.addMethod(
  2344. smalltalk.method({
  2345. selector: "asJavascript",
  2346. fn: function (){
  2347. var self=this;
  2348. return smalltalk.withContext(function($ctx1) {
  2349. if(self.search(/^[a-zA-Z0-9_:.$ ]*$/) == -1)
  2350. return "\"" + self.replace(/[\x00-\x1f"\\\x7f-\x9f]/g, function(ch){var c=ch.charCodeAt(0);return "\\x"+("0"+c.toString(16)).slice(-2)}) + "\"";
  2351. else
  2352. return "\"" + self + "\"";
  2353. ;
  2354. return self}, function($ctx1) {$ctx1.fill(self,"asJavascript",{},smalltalk.String)})},
  2355. messageSends: []}),
  2356. smalltalk.String);
  2357. smalltalk.addMethod(
  2358. smalltalk.method({
  2359. selector: "asLowercase",
  2360. fn: function (){
  2361. var self=this;
  2362. return smalltalk.withContext(function($ctx1) {
  2363. return self.toLowerCase();
  2364. return self}, function($ctx1) {$ctx1.fill(self,"asLowercase",{},smalltalk.String)})},
  2365. messageSends: []}),
  2366. smalltalk.String);
  2367. smalltalk.addMethod(
  2368. smalltalk.method({
  2369. selector: "asNumber",
  2370. fn: function (){
  2371. var self=this;
  2372. return smalltalk.withContext(function($ctx1) {
  2373. return Number(self);
  2374. return self}, function($ctx1) {$ctx1.fill(self,"asNumber",{},smalltalk.String)})},
  2375. messageSends: []}),
  2376. smalltalk.String);
  2377. smalltalk.addMethod(
  2378. smalltalk.method({
  2379. selector: "asRegexp",
  2380. fn: function (){
  2381. var self=this;
  2382. function $RegularExpression(){return smalltalk.RegularExpression||(typeof RegularExpression=="undefined"?nil:RegularExpression)}
  2383. return smalltalk.withContext(function($ctx1) {
  2384. var $1;
  2385. $1=_st($RegularExpression())._fromString_(self);
  2386. return $1;
  2387. }, function($ctx1) {$ctx1.fill(self,"asRegexp",{},smalltalk.String)})},
  2388. messageSends: ["fromString:"]}),
  2389. smalltalk.String);
  2390. smalltalk.addMethod(
  2391. smalltalk.method({
  2392. selector: "asSelector",
  2393. fn: function (){
  2394. var self=this;
  2395. return smalltalk.withContext(function($ctx1) {
  2396. return smalltalk.selector(self);
  2397. return self}, function($ctx1) {$ctx1.fill(self,"asSelector",{},smalltalk.String)})},
  2398. messageSends: []}),
  2399. smalltalk.String);
  2400. smalltalk.addMethod(
  2401. smalltalk.method({
  2402. selector: "asString",
  2403. fn: function (){
  2404. var self=this;
  2405. return smalltalk.withContext(function($ctx1) {
  2406. var $1;
  2407. $1=self;
  2408. return $1;
  2409. }, function($ctx1) {$ctx1.fill(self,"asString",{},smalltalk.String)})},
  2410. messageSends: []}),
  2411. smalltalk.String);
  2412. smalltalk.addMethod(
  2413. smalltalk.method({
  2414. selector: "asSymbol",
  2415. fn: function (){
  2416. var self=this;
  2417. return smalltalk.withContext(function($ctx1) {
  2418. var $1;
  2419. $1=self;
  2420. return $1;
  2421. }, function($ctx1) {$ctx1.fill(self,"asSymbol",{},smalltalk.String)})},
  2422. messageSends: []}),
  2423. smalltalk.String);
  2424. smalltalk.addMethod(
  2425. smalltalk.method({
  2426. selector: "asUppercase",
  2427. fn: function (){
  2428. var self=this;
  2429. return smalltalk.withContext(function($ctx1) {
  2430. return self.toUpperCase();
  2431. return self}, function($ctx1) {$ctx1.fill(self,"asUppercase",{},smalltalk.String)})},
  2432. messageSends: []}),
  2433. smalltalk.String);
  2434. smalltalk.addMethod(
  2435. smalltalk.method({
  2436. selector: "asciiValue",
  2437. fn: function (){
  2438. var self=this;
  2439. return smalltalk.withContext(function($ctx1) {
  2440. return self.charCodeAt(0);;
  2441. return self}, function($ctx1) {$ctx1.fill(self,"asciiValue",{},smalltalk.String)})},
  2442. messageSends: []}),
  2443. smalltalk.String);
  2444. smalltalk.addMethod(
  2445. smalltalk.method({
  2446. selector: "at:ifAbsent:",
  2447. fn: function (anIndex,aBlock){
  2448. var self=this;
  2449. return smalltalk.withContext(function($ctx1) {
  2450. return String(self).charAt(anIndex - 1) || aBlock();
  2451. return self}, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{anIndex:anIndex,aBlock:aBlock},smalltalk.String)})},
  2452. messageSends: []}),
  2453. smalltalk.String);
  2454. smalltalk.addMethod(
  2455. smalltalk.method({
  2456. selector: "at:ifPresent:ifAbsent:",
  2457. fn: function (anIndex,aBlock,anotherBlock){
  2458. var self=this;
  2459. return smalltalk.withContext(function($ctx1) {
  2460. var result = String(self).charAt(anIndex - 1);
  2461. return result ? aBlock._value_(result) : anotherBlock._value();
  2462. ;
  2463. return self}, function($ctx1) {$ctx1.fill(self,"at:ifPresent:ifAbsent:",{anIndex:anIndex,aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.String)})},
  2464. messageSends: []}),
  2465. smalltalk.String);
  2466. smalltalk.addMethod(
  2467. smalltalk.method({
  2468. selector: "charCodeAt:",
  2469. fn: function (anInteger){
  2470. var self=this;
  2471. return smalltalk.withContext(function($ctx1) {
  2472. return self.charCodeAt(anInteger - 1) ;
  2473. return self}, function($ctx1) {$ctx1.fill(self,"charCodeAt:",{anInteger:anInteger},smalltalk.String)})},
  2474. messageSends: []}),
  2475. smalltalk.String);
  2476. smalltalk.addMethod(
  2477. smalltalk.method({
  2478. selector: "copyFrom:to:",
  2479. fn: function (anIndex,anotherIndex){
  2480. var self=this;
  2481. return smalltalk.withContext(function($ctx1) {
  2482. return self.substring(anIndex - 1, anotherIndex);
  2483. return self}, function($ctx1) {$ctx1.fill(self,"copyFrom:to:",{anIndex:anIndex,anotherIndex:anotherIndex},smalltalk.String)})},
  2484. messageSends: []}),
  2485. smalltalk.String);
  2486. smalltalk.addMethod(
  2487. smalltalk.method({
  2488. selector: "crlfSanitized",
  2489. fn: function (){
  2490. var self=this;
  2491. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  2492. return smalltalk.withContext(function($ctx1) {
  2493. var $1;
  2494. $1=_st(_st(self)._lines())._join_(_st($String())._lf());
  2495. return $1;
  2496. }, function($ctx1) {$ctx1.fill(self,"crlfSanitized",{},smalltalk.String)})},
  2497. messageSends: ["join:", "lf", "lines"]}),
  2498. smalltalk.String);
  2499. smalltalk.addMethod(
  2500. smalltalk.method({
  2501. selector: "deepCopy",
  2502. fn: function (){
  2503. var self=this;
  2504. return smalltalk.withContext(function($ctx1) {
  2505. var $1;
  2506. $1=_st(self)._shallowCopy();
  2507. return $1;
  2508. }, function($ctx1) {$ctx1.fill(self,"deepCopy",{},smalltalk.String)})},
  2509. messageSends: ["shallowCopy"]}),
  2510. smalltalk.String);
  2511. smalltalk.addMethod(
  2512. smalltalk.method({
  2513. selector: "do:",
  2514. fn: function (aBlock){
  2515. var self=this;
  2516. return smalltalk.withContext(function($ctx1) {
  2517. for(var i=0;i<self.length;i++){aBlock(self.charAt(i));};
  2518. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.String)})},
  2519. messageSends: []}),
  2520. smalltalk.String);
  2521. smalltalk.addMethod(
  2522. smalltalk.method({
  2523. selector: "escaped",
  2524. fn: function (){
  2525. var self=this;
  2526. return smalltalk.withContext(function($ctx1) {
  2527. return escape(self);
  2528. return self}, function($ctx1) {$ctx1.fill(self,"escaped",{},smalltalk.String)})},
  2529. messageSends: []}),
  2530. smalltalk.String);
  2531. smalltalk.addMethod(
  2532. smalltalk.method({
  2533. selector: "includesSubString:",
  2534. fn: function (subString){
  2535. var self=this;
  2536. return smalltalk.withContext(function($ctx1) {
  2537. return self.indexOf(subString) != -1 ;
  2538. return self}, function($ctx1) {$ctx1.fill(self,"includesSubString:",{subString:subString},smalltalk.String)})},
  2539. messageSends: []}),
  2540. smalltalk.String);
  2541. smalltalk.addMethod(
  2542. smalltalk.method({
  2543. selector: "isImmutable",
  2544. fn: function (){
  2545. var self=this;
  2546. return smalltalk.withContext(function($ctx1) {
  2547. return true;
  2548. }, function($ctx1) {$ctx1.fill(self,"isImmutable",{},smalltalk.String)})},
  2549. messageSends: []}),
  2550. smalltalk.String);
  2551. smalltalk.addMethod(
  2552. smalltalk.method({
  2553. selector: "isString",
  2554. fn: function (){
  2555. var self=this;
  2556. return smalltalk.withContext(function($ctx1) {
  2557. return true;
  2558. }, function($ctx1) {$ctx1.fill(self,"isString",{},smalltalk.String)})},
  2559. messageSends: []}),
  2560. smalltalk.String);
  2561. smalltalk.addMethod(
  2562. smalltalk.method({
  2563. selector: "isVowel",
  2564. fn: function (){
  2565. var self=this;
  2566. return smalltalk.withContext(function($ctx1) {
  2567. var $1;
  2568. $1=_st(_st(_st(self)._size()).__eq((1)))._and_((function(){
  2569. return smalltalk.withContext(function($ctx2) {
  2570. return _st("aeiou")._includes_(_st(self)._asLowercase());
  2571. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2572. return $1;
  2573. }, function($ctx1) {$ctx1.fill(self,"isVowel",{},smalltalk.String)})},
  2574. messageSends: ["and:", "includes:", "asLowercase", "=", "size"]}),
  2575. smalltalk.String);
  2576. smalltalk.addMethod(
  2577. smalltalk.method({
  2578. selector: "join:",
  2579. fn: function (aCollection){
  2580. var self=this;
  2581. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  2582. return smalltalk.withContext(function($ctx1) {
  2583. var $1;
  2584. $1=_st($String())._streamContents_((function(stream){
  2585. return smalltalk.withContext(function($ctx2) {
  2586. return _st(aCollection)._do_separatedBy_((function(each){
  2587. return smalltalk.withContext(function($ctx3) {
  2588. return _st(stream)._nextPutAll_(_st(each)._asString());
  2589. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}),(function(){
  2590. return smalltalk.withContext(function($ctx3) {
  2591. return _st(stream)._nextPutAll_(self);
  2592. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2593. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
  2594. return $1;
  2595. }, function($ctx1) {$ctx1.fill(self,"join:",{aCollection:aCollection},smalltalk.String)})},
  2596. messageSends: ["streamContents:", "do:separatedBy:", "nextPutAll:", "asString"]}),
  2597. smalltalk.String);
  2598. smalltalk.addMethod(
  2599. smalltalk.method({
  2600. selector: "lineIndicesDo:",
  2601. fn: function (aBlock){
  2602. var self=this;
  2603. var cr,lf,start,sz,nextLF,nextCR;
  2604. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  2605. return smalltalk.withContext(function($ctx1) {
  2606. var $1,$2,$3,$4;
  2607. var $early={};
  2608. try {
  2609. start=(1);
  2610. sz=_st(self)._size();
  2611. cr=_st($String())._cr();
  2612. nextCR=_st(self)._indexOf_startingAt_(cr,(1));
  2613. lf=_st($String())._lf();
  2614. nextLF=_st(self)._indexOf_startingAt_(lf,(1));
  2615. _st((function(){
  2616. return smalltalk.withContext(function($ctx2) {
  2617. return _st(start).__lt_eq(sz);
  2618. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  2619. return smalltalk.withContext(function($ctx2) {
  2620. $1=_st(_st(nextLF).__eq((0)))._and_((function(){
  2621. return smalltalk.withContext(function($ctx3) {
  2622. return _st(nextCR).__eq((0));
  2623. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2624. if(smalltalk.assert($1)){
  2625. _st(aBlock)._value_value_value_(start,sz,sz);
  2626. $2=self;
  2627. throw $early=[$2];
  2628. };
  2629. $3=_st(_st(nextCR).__eq((0)))._or_((function(){
  2630. return smalltalk.withContext(function($ctx3) {
  2631. return _st(_st((0)).__lt(nextLF))._and_((function(){
  2632. return smalltalk.withContext(function($ctx4) {
  2633. return _st(nextLF).__lt(nextCR);
  2634. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  2635. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2636. if(smalltalk.assert($3)){
  2637. _st(aBlock)._value_value_value_(start,_st(nextLF).__minus((1)),nextLF);
  2638. start=_st((1)).__plus(nextLF);
  2639. start;
  2640. nextLF=_st(self)._indexOf_startingAt_(lf,start);
  2641. return nextLF;
  2642. } else {
  2643. $4=_st(_st((1)).__plus(nextCR)).__eq(nextLF);
  2644. if(smalltalk.assert($4)){
  2645. _st(aBlock)._value_value_value_(start,_st(nextCR).__minus((1)),nextLF);
  2646. start=_st((1)).__plus(nextLF);
  2647. start;
  2648. nextCR=_st(self)._indexOf_startingAt_(cr,start);
  2649. nextCR;
  2650. nextLF=_st(self)._indexOf_startingAt_(lf,start);
  2651. return nextLF;
  2652. } else {
  2653. _st(aBlock)._value_value_value_(start,_st(nextCR).__minus((1)),nextCR);
  2654. start=_st((1)).__plus(nextCR);
  2655. start;
  2656. nextCR=_st(self)._indexOf_startingAt_(cr,start);
  2657. return nextCR;
  2658. };
  2659. };
  2660. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2661. return self}
  2662. catch(e) {if(e===$early)return e[0]; throw e}
  2663. }, function($ctx1) {$ctx1.fill(self,"lineIndicesDo:",{aBlock:aBlock,cr:cr,lf:lf,start:start,sz:sz,nextLF:nextLF,nextCR:nextCR},smalltalk.String)})},
  2664. messageSends: ["size", "cr", "indexOf:startingAt:", "lf", "whileTrue:", "ifTrue:", "value:value:value:", "and:", "=", "ifTrue:ifFalse:", "-", "+", "or:", "<", "<="]}),
  2665. smalltalk.String);
  2666. smalltalk.addMethod(
  2667. smalltalk.method({
  2668. selector: "lineNumber:",
  2669. fn: function (anIndex){
  2670. var self=this;
  2671. var lineCount;
  2672. return smalltalk.withContext(function($ctx1) {
  2673. var $1,$2;
  2674. var $early={};
  2675. try {
  2676. lineCount=(0);
  2677. _st(self)._lineIndicesDo_((function(start,endWithoutDelimiters,end){
  2678. return smalltalk.withContext(function($ctx2) {
  2679. lineCount=_st(lineCount).__plus((1));
  2680. $1=_st(lineCount).__eq(anIndex);
  2681. if(smalltalk.assert($1)){
  2682. $2=_st(self)._copyFrom_to_(start,endWithoutDelimiters);
  2683. throw $early=[$2];
  2684. };
  2685. }, function($ctx2) {$ctx2.fillBlock({start:start,endWithoutDelimiters:endWithoutDelimiters,end:end},$ctx1)})}));
  2686. return nil;
  2687. }
  2688. catch(e) {if(e===$early)return e[0]; throw e}
  2689. }, function($ctx1) {$ctx1.fill(self,"lineNumber:",{anIndex:anIndex,lineCount:lineCount},smalltalk.String)})},
  2690. messageSends: ["lineIndicesDo:", "ifTrue:", "copyFrom:to:", "=", "+"]}),
  2691. smalltalk.String);
  2692. smalltalk.addMethod(
  2693. smalltalk.method({
  2694. selector: "lines",
  2695. fn: function (){
  2696. var self=this;
  2697. var lines;
  2698. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  2699. return smalltalk.withContext(function($ctx1) {
  2700. var $1;
  2701. lines=_st($Array())._new();
  2702. _st(self)._linesDo_((function(aLine){
  2703. return smalltalk.withContext(function($ctx2) {
  2704. return _st(lines)._add_(aLine);
  2705. }, function($ctx2) {$ctx2.fillBlock({aLine:aLine},$ctx1)})}));
  2706. $1=lines;
  2707. return $1;
  2708. }, function($ctx1) {$ctx1.fill(self,"lines",{lines:lines},smalltalk.String)})},
  2709. messageSends: ["new", "linesDo:", "add:"]}),
  2710. smalltalk.String);
  2711. smalltalk.addMethod(
  2712. smalltalk.method({
  2713. selector: "linesDo:",
  2714. fn: function (aBlock){
  2715. var self=this;
  2716. return smalltalk.withContext(function($ctx1) {
  2717. _st(self)._lineIndicesDo_((function(start,endWithoutDelimiters,end){
  2718. return smalltalk.withContext(function($ctx2) {
  2719. return _st(aBlock)._value_(_st(self)._copyFrom_to_(start,endWithoutDelimiters));
  2720. }, function($ctx2) {$ctx2.fillBlock({start:start,endWithoutDelimiters:endWithoutDelimiters,end:end},$ctx1)})}));
  2721. return self}, function($ctx1) {$ctx1.fill(self,"linesDo:",{aBlock:aBlock},smalltalk.String)})},
  2722. messageSends: ["lineIndicesDo:", "value:", "copyFrom:to:"]}),
  2723. smalltalk.String);
  2724. smalltalk.addMethod(
  2725. smalltalk.method({
  2726. selector: "match:",
  2727. fn: function (aRegexp){
  2728. var self=this;
  2729. return smalltalk.withContext(function($ctx1) {
  2730. return self.search(aRegexp) != -1;
  2731. return self}, function($ctx1) {$ctx1.fill(self,"match:",{aRegexp:aRegexp},smalltalk.String)})},
  2732. messageSends: []}),
  2733. smalltalk.String);
  2734. smalltalk.addMethod(
  2735. smalltalk.method({
  2736. selector: "matchesOf:",
  2737. fn: function (aRegularExpression){
  2738. var self=this;
  2739. return smalltalk.withContext(function($ctx1) {
  2740. return self.match(aRegularExpression);
  2741. return self}, function($ctx1) {$ctx1.fill(self,"matchesOf:",{aRegularExpression:aRegularExpression},smalltalk.String)})},
  2742. messageSends: []}),
  2743. smalltalk.String);
  2744. smalltalk.addMethod(
  2745. smalltalk.method({
  2746. selector: "printNl",
  2747. fn: function (){
  2748. var self=this;
  2749. return smalltalk.withContext(function($ctx1) {
  2750. console.log(self);
  2751. return self}, function($ctx1) {$ctx1.fill(self,"printNl",{},smalltalk.String)})},
  2752. messageSends: []}),
  2753. smalltalk.String);
  2754. smalltalk.addMethod(
  2755. smalltalk.method({
  2756. selector: "printOn:",
  2757. fn: function (aStream){
  2758. var self=this;
  2759. return smalltalk.withContext(function($ctx1) {
  2760. var $1,$2;
  2761. $1=aStream;
  2762. _st($1)._nextPutAll_("'");
  2763. _st($1)._nextPutAll_(self);
  2764. $2=_st($1)._nextPutAll_("'");
  2765. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.String)})},
  2766. messageSends: ["nextPutAll:"]}),
  2767. smalltalk.String);
  2768. smalltalk.addMethod(
  2769. smalltalk.method({
  2770. selector: "replace:with:",
  2771. fn: function (aString,anotherString){
  2772. var self=this;
  2773. function $RegularExpression(){return smalltalk.RegularExpression||(typeof RegularExpression=="undefined"?nil:RegularExpression)}
  2774. return smalltalk.withContext(function($ctx1) {
  2775. var $1;
  2776. $1=_st(self)._replaceRegexp_with_(_st($RegularExpression())._fromString_flag_(aString,"g"),anotherString);
  2777. return $1;
  2778. }, function($ctx1) {$ctx1.fill(self,"replace:with:",{aString:aString,anotherString:anotherString},smalltalk.String)})},
  2779. messageSends: ["replaceRegexp:with:", "fromString:flag:"]}),
  2780. smalltalk.String);
  2781. smalltalk.addMethod(
  2782. smalltalk.method({
  2783. selector: "replaceRegexp:with:",
  2784. fn: function (aRegexp,aString){
  2785. var self=this;
  2786. return smalltalk.withContext(function($ctx1) {
  2787. return self.replace(aRegexp, aString);
  2788. return self}, function($ctx1) {$ctx1.fill(self,"replaceRegexp:with:",{aRegexp:aRegexp,aString:aString},smalltalk.String)})},
  2789. messageSends: []}),
  2790. smalltalk.String);
  2791. smalltalk.addMethod(
  2792. smalltalk.method({
  2793. selector: "reversed",
  2794. fn: function (){
  2795. var self=this;
  2796. return smalltalk.withContext(function($ctx1) {
  2797. return self.split("").reverse().join("");
  2798. return self}, function($ctx1) {$ctx1.fill(self,"reversed",{},smalltalk.String)})},
  2799. messageSends: []}),
  2800. smalltalk.String);
  2801. smalltalk.addMethod(
  2802. smalltalk.method({
  2803. selector: "shallowCopy",
  2804. fn: function (){
  2805. var self=this;
  2806. return smalltalk.withContext(function($ctx1) {
  2807. var $1;
  2808. $1=_st(_st(self)._class())._fromString_(self);
  2809. return $1;
  2810. }, function($ctx1) {$ctx1.fill(self,"shallowCopy",{},smalltalk.String)})},
  2811. messageSends: ["fromString:", "class"]}),
  2812. smalltalk.String);
  2813. smalltalk.addMethod(
  2814. smalltalk.method({
  2815. selector: "size",
  2816. fn: function (){
  2817. var self=this;
  2818. return smalltalk.withContext(function($ctx1) {
  2819. return self.length;
  2820. return self}, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.String)})},
  2821. messageSends: []}),
  2822. smalltalk.String);
  2823. smalltalk.addMethod(
  2824. smalltalk.method({
  2825. selector: "subStrings:",
  2826. fn: function (aString){
  2827. var self=this;
  2828. return smalltalk.withContext(function($ctx1) {
  2829. var $1;
  2830. $1=_st(self)._tokenize_(aString);
  2831. return $1;
  2832. }, function($ctx1) {$ctx1.fill(self,"subStrings:",{aString:aString},smalltalk.String)})},
  2833. messageSends: ["tokenize:"]}),
  2834. smalltalk.String);
  2835. smalltalk.addMethod(
  2836. smalltalk.method({
  2837. selector: "tokenize:",
  2838. fn: function (aString){
  2839. var self=this;
  2840. return smalltalk.withContext(function($ctx1) {
  2841. return self.split(aString);
  2842. return self}, function($ctx1) {$ctx1.fill(self,"tokenize:",{aString:aString},smalltalk.String)})},
  2843. messageSends: []}),
  2844. smalltalk.String);
  2845. smalltalk.addMethod(
  2846. smalltalk.method({
  2847. selector: "trimBoth",
  2848. fn: function (){
  2849. var self=this;
  2850. return smalltalk.withContext(function($ctx1) {
  2851. var $1;
  2852. $1=_st(self)._trimBoth_("\x5cs");
  2853. return $1;
  2854. }, function($ctx1) {$ctx1.fill(self,"trimBoth",{},smalltalk.String)})},
  2855. messageSends: ["trimBoth:"]}),
  2856. smalltalk.String);
  2857. smalltalk.addMethod(
  2858. smalltalk.method({
  2859. selector: "trimBoth:",
  2860. fn: function (separators){
  2861. var self=this;
  2862. return smalltalk.withContext(function($ctx1) {
  2863. var $1;
  2864. $1=_st(_st(self)._trimLeft_(separators))._trimRight_(separators);
  2865. return $1;
  2866. }, function($ctx1) {$ctx1.fill(self,"trimBoth:",{separators:separators},smalltalk.String)})},
  2867. messageSends: ["trimRight:", "trimLeft:"]}),
  2868. smalltalk.String);
  2869. smalltalk.addMethod(
  2870. smalltalk.method({
  2871. selector: "trimLeft",
  2872. fn: function (){
  2873. var self=this;
  2874. return smalltalk.withContext(function($ctx1) {
  2875. var $1;
  2876. $1=_st(self)._trimLeft_("\x5cs");
  2877. return $1;
  2878. }, function($ctx1) {$ctx1.fill(self,"trimLeft",{},smalltalk.String)})},
  2879. messageSends: ["trimLeft:"]}),
  2880. smalltalk.String);
  2881. smalltalk.addMethod(
  2882. smalltalk.method({
  2883. selector: "trimLeft:",
  2884. fn: function (separators){
  2885. var self=this;
  2886. function $RegularExpression(){return smalltalk.RegularExpression||(typeof RegularExpression=="undefined"?nil:RegularExpression)}
  2887. return smalltalk.withContext(function($ctx1) {
  2888. var $1;
  2889. $1=_st(self)._replaceRegexp_with_(_st($RegularExpression())._fromString_flag_(_st(_st("^[").__comma(separators)).__comma("]+"),"g"),"");
  2890. return $1;
  2891. }, function($ctx1) {$ctx1.fill(self,"trimLeft:",{separators:separators},smalltalk.String)})},
  2892. messageSends: ["replaceRegexp:with:", "fromString:flag:", ","]}),
  2893. smalltalk.String);
  2894. smalltalk.addMethod(
  2895. smalltalk.method({
  2896. selector: "trimRight",
  2897. fn: function (){
  2898. var self=this;
  2899. return smalltalk.withContext(function($ctx1) {
  2900. var $1;
  2901. $1=_st(self)._trimRight_("\x5cs");
  2902. return $1;
  2903. }, function($ctx1) {$ctx1.fill(self,"trimRight",{},smalltalk.String)})},
  2904. messageSends: ["trimRight:"]}),
  2905. smalltalk.String);
  2906. smalltalk.addMethod(
  2907. smalltalk.method({
  2908. selector: "trimRight:",
  2909. fn: function (separators){
  2910. var self=this;
  2911. function $RegularExpression(){return smalltalk.RegularExpression||(typeof RegularExpression=="undefined"?nil:RegularExpression)}
  2912. return smalltalk.withContext(function($ctx1) {
  2913. var $1;
  2914. $1=_st(self)._replaceRegexp_with_(_st($RegularExpression())._fromString_flag_(_st(_st("[").__comma(separators)).__comma("]+$"),"g"),"");
  2915. return $1;
  2916. }, function($ctx1) {$ctx1.fill(self,"trimRight:",{separators:separators},smalltalk.String)})},
  2917. messageSends: ["replaceRegexp:with:", "fromString:flag:", ","]}),
  2918. smalltalk.String);
  2919. smalltalk.addMethod(
  2920. smalltalk.method({
  2921. selector: "unescaped",
  2922. fn: function (){
  2923. var self=this;
  2924. return smalltalk.withContext(function($ctx1) {
  2925. return unescape(self);
  2926. return self}, function($ctx1) {$ctx1.fill(self,"unescaped",{},smalltalk.String)})},
  2927. messageSends: []}),
  2928. smalltalk.String);
  2929. smalltalk.addMethod(
  2930. smalltalk.method({
  2931. selector: "withIndexDo:",
  2932. fn: function (aBlock){
  2933. var self=this;
  2934. return smalltalk.withContext(function($ctx1) {
  2935. for(var i=0;i<self.length;i++){aBlock(self.charAt(i), i+1);};
  2936. return self}, function($ctx1) {$ctx1.fill(self,"withIndexDo:",{aBlock:aBlock},smalltalk.String)})},
  2937. messageSends: []}),
  2938. smalltalk.String);
  2939. smalltalk.addMethod(
  2940. smalltalk.method({
  2941. selector: "cr",
  2942. fn: function (){
  2943. var self=this;
  2944. return smalltalk.withContext(function($ctx1) {
  2945. return '\r';
  2946. return self}, function($ctx1) {$ctx1.fill(self,"cr",{},smalltalk.String.klass)})},
  2947. messageSends: []}),
  2948. smalltalk.String.klass);
  2949. smalltalk.addMethod(
  2950. smalltalk.method({
  2951. selector: "crlf",
  2952. fn: function (){
  2953. var self=this;
  2954. return smalltalk.withContext(function($ctx1) {
  2955. return '\r\n';
  2956. return self}, function($ctx1) {$ctx1.fill(self,"crlf",{},smalltalk.String.klass)})},
  2957. messageSends: []}),
  2958. smalltalk.String.klass);
  2959. smalltalk.addMethod(
  2960. smalltalk.method({
  2961. selector: "fromCharCode:",
  2962. fn: function (anInteger){
  2963. var self=this;
  2964. return smalltalk.withContext(function($ctx1) {
  2965. return String.fromCharCode(anInteger);
  2966. return self}, function($ctx1) {$ctx1.fill(self,"fromCharCode:",{anInteger:anInteger},smalltalk.String.klass)})},
  2967. messageSends: []}),
  2968. smalltalk.String.klass);
  2969. smalltalk.addMethod(
  2970. smalltalk.method({
  2971. selector: "fromString:",
  2972. fn: function (aString){
  2973. var self=this;
  2974. return smalltalk.withContext(function($ctx1) {
  2975. return String(aString);
  2976. return self}, function($ctx1) {$ctx1.fill(self,"fromString:",{aString:aString},smalltalk.String.klass)})},
  2977. messageSends: []}),
  2978. smalltalk.String.klass);
  2979. smalltalk.addMethod(
  2980. smalltalk.method({
  2981. selector: "lf",
  2982. fn: function (){
  2983. var self=this;
  2984. return smalltalk.withContext(function($ctx1) {
  2985. return '\n';
  2986. return self}, function($ctx1) {$ctx1.fill(self,"lf",{},smalltalk.String.klass)})},
  2987. messageSends: []}),
  2988. smalltalk.String.klass);
  2989. smalltalk.addMethod(
  2990. smalltalk.method({
  2991. selector: "random",
  2992. fn: function (){
  2993. var self=this;
  2994. return smalltalk.withContext(function($ctx1) {
  2995. return (Math.random()*(22/32)+(10/32)).toString(32).slice(2);;
  2996. return self}, function($ctx1) {$ctx1.fill(self,"random",{},smalltalk.String.klass)})},
  2997. messageSends: []}),
  2998. smalltalk.String.klass);
  2999. smalltalk.addMethod(
  3000. smalltalk.method({
  3001. selector: "randomNotIn:",
  3002. fn: function (aString){
  3003. var self=this;
  3004. var result;
  3005. return smalltalk.withContext(function($ctx1) {
  3006. var $1;
  3007. _st((function(){
  3008. return smalltalk.withContext(function($ctx2) {
  3009. result=_st(self)._random();
  3010. result;
  3011. return _st(aString)._includesSubString_(result);
  3012. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue();
  3013. $1=result;
  3014. return $1;
  3015. }, function($ctx1) {$ctx1.fill(self,"randomNotIn:",{aString:aString,result:result},smalltalk.String.klass)})},
  3016. messageSends: ["whileTrue", "random", "includesSubString:"]}),
  3017. smalltalk.String.klass);
  3018. smalltalk.addMethod(
  3019. smalltalk.method({
  3020. selector: "space",
  3021. fn: function (){
  3022. var self=this;
  3023. return smalltalk.withContext(function($ctx1) {
  3024. return ' ';
  3025. return self}, function($ctx1) {$ctx1.fill(self,"space",{},smalltalk.String.klass)})},
  3026. messageSends: []}),
  3027. smalltalk.String.klass);
  3028. smalltalk.addMethod(
  3029. smalltalk.method({
  3030. selector: "streamClass",
  3031. fn: function (){
  3032. var self=this;
  3033. function $StringStream(){return smalltalk.StringStream||(typeof StringStream=="undefined"?nil:StringStream)}
  3034. return smalltalk.withContext(function($ctx1) {
  3035. var $1;
  3036. $1=$StringStream();
  3037. return $1;
  3038. }, function($ctx1) {$ctx1.fill(self,"streamClass",{},smalltalk.String.klass)})},
  3039. messageSends: []}),
  3040. smalltalk.String.klass);
  3041. smalltalk.addMethod(
  3042. smalltalk.method({
  3043. selector: "tab",
  3044. fn: function (){
  3045. var self=this;
  3046. return smalltalk.withContext(function($ctx1) {
  3047. return '\t';
  3048. return self}, function($ctx1) {$ctx1.fill(self,"tab",{},smalltalk.String.klass)})},
  3049. messageSends: []}),
  3050. smalltalk.String.klass);
  3051. smalltalk.addMethod(
  3052. smalltalk.method({
  3053. selector: "value:",
  3054. fn: function (aUTFCharCode){
  3055. var self=this;
  3056. return smalltalk.withContext(function($ctx1) {
  3057. return String.fromCharCode(aUTFCharCode);;
  3058. return self}, function($ctx1) {$ctx1.fill(self,"value:",{aUTFCharCode:aUTFCharCode},smalltalk.String.klass)})},
  3059. messageSends: []}),
  3060. smalltalk.String.klass);
  3061. smalltalk.addClass('Set', smalltalk.Collection, ['elements'], 'Kernel-Collections');
  3062. smalltalk.addMethod(
  3063. smalltalk.method({
  3064. selector: "=",
  3065. fn: function (aCollection){
  3066. var self=this;
  3067. return smalltalk.withContext(function($ctx1) {
  3068. var $1,$2,$3;
  3069. var $early={};
  3070. try {
  3071. $1=_st(_st(self)._class()).__eq(_st(aCollection)._class());
  3072. if(! smalltalk.assert($1)){
  3073. return false;
  3074. };
  3075. $2=_st(_st(self)._size()).__eq(_st(aCollection)._size());
  3076. if(! smalltalk.assert($2)){
  3077. return false;
  3078. };
  3079. _st(self)._do_((function(each){
  3080. return smalltalk.withContext(function($ctx2) {
  3081. $3=_st(aCollection)._includes_(each);
  3082. if(! smalltalk.assert($3)){
  3083. throw $early=[false];
  3084. };
  3085. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3086. return true;
  3087. }
  3088. catch(e) {if(e===$early)return e[0]; throw e}
  3089. }, function($ctx1) {$ctx1.fill(self,"=",{aCollection:aCollection},smalltalk.Set)})},
  3090. messageSends: ["ifFalse:", "=", "class", "size", "do:", "includes:"]}),
  3091. smalltalk.Set);
  3092. smalltalk.addMethod(
  3093. smalltalk.method({
  3094. selector: "add:",
  3095. fn: function (anObject){
  3096. var self=this;
  3097. return smalltalk.withContext(function($ctx1) {
  3098. var found;
  3099. for(var i=0; i < self['@elements'].length; i++) {
  3100. if(anObject == self['@elements'][i]) {
  3101. found = true;
  3102. break;
  3103. }
  3104. }
  3105. if(!found) {self['@elements'].push(anObject)}
  3106. ;
  3107. return self}, function($ctx1) {$ctx1.fill(self,"add:",{anObject:anObject},smalltalk.Set)})},
  3108. messageSends: []}),
  3109. smalltalk.Set);
  3110. smalltalk.addMethod(
  3111. smalltalk.method({
  3112. selector: "asArray",
  3113. fn: function (){
  3114. var self=this;
  3115. return smalltalk.withContext(function($ctx1) {
  3116. var $1;
  3117. $1=_st(self["@elements"])._copy();
  3118. return $1;
  3119. }, function($ctx1) {$ctx1.fill(self,"asArray",{},smalltalk.Set)})},
  3120. messageSends: ["copy"]}),
  3121. smalltalk.Set);
  3122. smalltalk.addMethod(
  3123. smalltalk.method({
  3124. selector: "collect:",
  3125. fn: function (aBlock){
  3126. var self=this;
  3127. return smalltalk.withContext(function($ctx1) {
  3128. var $1;
  3129. $1=_st(_st(self)._class())._withAll_(_st(self["@elements"])._collect_(aBlock));
  3130. return $1;
  3131. }, function($ctx1) {$ctx1.fill(self,"collect:",{aBlock:aBlock},smalltalk.Set)})},
  3132. messageSends: ["withAll:", "collect:", "class"]}),
  3133. smalltalk.Set);
  3134. smalltalk.addMethod(
  3135. smalltalk.method({
  3136. selector: "detect:ifNone:",
  3137. fn: function (aBlock,anotherBlock){
  3138. var self=this;
  3139. return smalltalk.withContext(function($ctx1) {
  3140. var $1;
  3141. $1=_st(self["@elements"])._detect_ifNone_(aBlock,anotherBlock);
  3142. return $1;
  3143. }, function($ctx1) {$ctx1.fill(self,"detect:ifNone:",{aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.Set)})},
  3144. messageSends: ["detect:ifNone:"]}),
  3145. smalltalk.Set);
  3146. smalltalk.addMethod(
  3147. smalltalk.method({
  3148. selector: "do:",
  3149. fn: function (aBlock){
  3150. var self=this;
  3151. return smalltalk.withContext(function($ctx1) {
  3152. _st(self["@elements"])._do_(aBlock);
  3153. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.Set)})},
  3154. messageSends: ["do:"]}),
  3155. smalltalk.Set);
  3156. smalltalk.addMethod(
  3157. smalltalk.method({
  3158. selector: "includes:",
  3159. fn: function (anObject){
  3160. var self=this;
  3161. return smalltalk.withContext(function($ctx1) {
  3162. var $1;
  3163. $1=_st(self["@elements"])._includes_(anObject);
  3164. return $1;
  3165. }, function($ctx1) {$ctx1.fill(self,"includes:",{anObject:anObject},smalltalk.Set)})},
  3166. messageSends: ["includes:"]}),
  3167. smalltalk.Set);
  3168. smalltalk.addMethod(
  3169. smalltalk.method({
  3170. selector: "initialize",
  3171. fn: function (){
  3172. var self=this;
  3173. return smalltalk.withContext(function($ctx1) {
  3174. smalltalk.Collection.fn.prototype._initialize.apply(_st(self), []);
  3175. self["@elements"]=[];
  3176. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Set)})},
  3177. messageSends: ["initialize"]}),
  3178. smalltalk.Set);
  3179. smalltalk.addMethod(
  3180. smalltalk.method({
  3181. selector: "printOn:",
  3182. fn: function (aStream){
  3183. var self=this;
  3184. return smalltalk.withContext(function($ctx1) {
  3185. smalltalk.Collection.fn.prototype._printOn_.apply(_st(self), [aStream]);
  3186. _st(aStream)._nextPutAll_(" (");
  3187. _st(self)._do_separatedBy_((function(each){
  3188. return smalltalk.withContext(function($ctx2) {
  3189. return _st(each)._printOn_(aStream);
  3190. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  3191. return smalltalk.withContext(function($ctx2) {
  3192. return _st(aStream)._nextPutAll_(" ");
  3193. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3194. _st(aStream)._nextPutAll_(")");
  3195. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Set)})},
  3196. messageSends: ["printOn:", "nextPutAll:", "do:separatedBy:"]}),
  3197. smalltalk.Set);
  3198. smalltalk.addMethod(
  3199. smalltalk.method({
  3200. selector: "remove:",
  3201. fn: function (anObject){
  3202. var self=this;
  3203. return smalltalk.withContext(function($ctx1) {
  3204. _st(self["@elements"])._remove_(anObject);
  3205. return self}, function($ctx1) {$ctx1.fill(self,"remove:",{anObject:anObject},smalltalk.Set)})},
  3206. messageSends: ["remove:"]}),
  3207. smalltalk.Set);
  3208. smalltalk.addMethod(
  3209. smalltalk.method({
  3210. selector: "remove:ifAbsent:",
  3211. fn: function (anObject,aBlock){
  3212. var self=this;
  3213. return smalltalk.withContext(function($ctx1) {
  3214. _st(self["@elements"])._remove_ifAbsent_(anObject,aBlock);
  3215. return self}, function($ctx1) {$ctx1.fill(self,"remove:ifAbsent:",{anObject:anObject,aBlock:aBlock},smalltalk.Set)})},
  3216. messageSends: ["remove:ifAbsent:"]}),
  3217. smalltalk.Set);
  3218. smalltalk.addMethod(
  3219. smalltalk.method({
  3220. selector: "select:",
  3221. fn: function (aBlock){
  3222. var self=this;
  3223. var collection;
  3224. return smalltalk.withContext(function($ctx1) {
  3225. var $1,$2;
  3226. collection=_st(_st(self)._class())._new();
  3227. _st(self)._do_((function(each){
  3228. return smalltalk.withContext(function($ctx2) {
  3229. $1=_st(aBlock)._value_(each);
  3230. if(smalltalk.assert($1)){
  3231. return _st(collection)._add_(each);
  3232. };
  3233. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3234. $2=collection;
  3235. return $2;
  3236. }, function($ctx1) {$ctx1.fill(self,"select:",{aBlock:aBlock,collection:collection},smalltalk.Set)})},
  3237. messageSends: ["new", "class", "do:", "ifTrue:", "add:", "value:"]}),
  3238. smalltalk.Set);
  3239. smalltalk.addMethod(
  3240. smalltalk.method({
  3241. selector: "size",
  3242. fn: function (){
  3243. var self=this;
  3244. return smalltalk.withContext(function($ctx1) {
  3245. var $1;
  3246. $1=_st(self["@elements"])._size();
  3247. return $1;
  3248. }, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.Set)})},
  3249. messageSends: ["size"]}),
  3250. smalltalk.Set);
  3251. smalltalk.addClass('Queue', smalltalk.Object, ['read', 'readIndex', 'write'], 'Kernel-Collections');
  3252. smalltalk.addMethod(
  3253. smalltalk.method({
  3254. selector: "initialize",
  3255. fn: function (){
  3256. var self=this;
  3257. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  3258. return smalltalk.withContext(function($ctx1) {
  3259. smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  3260. self["@read"]=_st($OrderedCollection())._new();
  3261. self["@write"]=_st($OrderedCollection())._new();
  3262. self["@readIndex"]=(1);
  3263. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Queue)})},
  3264. messageSends: ["initialize", "new"]}),
  3265. smalltalk.Queue);
  3266. smalltalk.addMethod(
  3267. smalltalk.method({
  3268. selector: "next",
  3269. fn: function (){
  3270. var self=this;
  3271. return smalltalk.withContext(function($ctx1) {
  3272. var $1;
  3273. $1=_st(self)._nextIfAbsent_((function(){
  3274. return smalltalk.withContext(function($ctx2) {
  3275. return _st(self)._error_("Cannot read from empty Queue.");
  3276. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3277. return $1;
  3278. }, function($ctx1) {$ctx1.fill(self,"next",{},smalltalk.Queue)})},
  3279. messageSends: ["nextIfAbsent:", "error:"]}),
  3280. smalltalk.Queue);
  3281. smalltalk.addMethod(
  3282. smalltalk.method({
  3283. selector: "nextIfAbsent:",
  3284. fn: function (aBlock){
  3285. var self=this;
  3286. var result;
  3287. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  3288. return smalltalk.withContext(function($ctx1) {
  3289. var $1,$2,$3,$4;
  3290. var $early={};
  3291. try {
  3292. result=_st(self["@read"])._at_ifAbsent_(self["@readIndex"],(function(){
  3293. return smalltalk.withContext(function($ctx2) {
  3294. $1=_st(self["@write"])._isEmpty();
  3295. if(smalltalk.assert($1)){
  3296. $2=_st(self["@readIndex"]).__gt((1));
  3297. if(smalltalk.assert($2)){
  3298. self["@read"]=[];
  3299. self["@read"];
  3300. self["@readIndex"]=(1);
  3301. self["@readIndex"];
  3302. };
  3303. $3=_st(aBlock)._value();
  3304. throw $early=[$3];
  3305. };
  3306. self["@read"]=self["@write"];
  3307. self["@read"];
  3308. self["@readIndex"]=(1);
  3309. self["@readIndex"];
  3310. self["@write"]=_st($OrderedCollection())._new();
  3311. self["@write"];
  3312. return _st(self["@read"])._first();
  3313. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3314. _st(self["@read"])._at_put_(self["@readIndex"],nil);
  3315. self["@readIndex"]=_st(self["@readIndex"]).__plus((1));
  3316. $4=result;
  3317. return $4;
  3318. }
  3319. catch(e) {if(e===$early)return e[0]; throw e}
  3320. }, function($ctx1) {$ctx1.fill(self,"nextIfAbsent:",{aBlock:aBlock,result:result},smalltalk.Queue)})},
  3321. messageSends: ["at:ifAbsent:", "ifTrue:", ">", "value", "isEmpty", "new", "first", "at:put:", "+"]}),
  3322. smalltalk.Queue);
  3323. smalltalk.addMethod(
  3324. smalltalk.method({
  3325. selector: "nextPut:",
  3326. fn: function (anObject){
  3327. var self=this;
  3328. return smalltalk.withContext(function($ctx1) {
  3329. _st(self["@write"])._add_(anObject);
  3330. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{anObject:anObject},smalltalk.Queue)})},
  3331. messageSends: ["add:"]}),
  3332. smalltalk.Queue);
  3333. smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel-Collections');
  3334. smalltalk.addMethod(
  3335. smalltalk.method({
  3336. selector: "compile:",
  3337. fn: function (aString){
  3338. var self=this;
  3339. return smalltalk.withContext(function($ctx1) {
  3340. return self.compile(aString);
  3341. return self}, function($ctx1) {$ctx1.fill(self,"compile:",{aString:aString},smalltalk.RegularExpression)})},
  3342. messageSends: []}),
  3343. smalltalk.RegularExpression);
  3344. smalltalk.addMethod(
  3345. smalltalk.method({
  3346. selector: "exec:",
  3347. fn: function (aString){
  3348. var self=this;
  3349. return smalltalk.withContext(function($ctx1) {
  3350. return self.exec(aString) || nil;
  3351. return self}, function($ctx1) {$ctx1.fill(self,"exec:",{aString:aString},smalltalk.RegularExpression)})},
  3352. messageSends: []}),
  3353. smalltalk.RegularExpression);
  3354. smalltalk.addMethod(
  3355. smalltalk.method({
  3356. selector: "test:",
  3357. fn: function (aString){
  3358. var self=this;
  3359. return smalltalk.withContext(function($ctx1) {
  3360. return self.test(aString);
  3361. return self}, function($ctx1) {$ctx1.fill(self,"test:",{aString:aString},smalltalk.RegularExpression)})},
  3362. messageSends: []}),
  3363. smalltalk.RegularExpression);
  3364. smalltalk.addMethod(
  3365. smalltalk.method({
  3366. selector: "fromString:",
  3367. fn: function (aString){
  3368. var self=this;
  3369. return smalltalk.withContext(function($ctx1) {
  3370. var $1;
  3371. $1=_st(self)._fromString_flag_(aString,"");
  3372. return $1;
  3373. }, function($ctx1) {$ctx1.fill(self,"fromString:",{aString:aString},smalltalk.RegularExpression.klass)})},
  3374. messageSends: ["fromString:flag:"]}),
  3375. smalltalk.RegularExpression.klass);
  3376. smalltalk.addMethod(
  3377. smalltalk.method({
  3378. selector: "fromString:flag:",
  3379. fn: function (aString,anotherString){
  3380. var self=this;
  3381. return smalltalk.withContext(function($ctx1) {
  3382. return new RegExp(aString, anotherString);
  3383. return self}, function($ctx1) {$ctx1.fill(self,"fromString:flag:",{aString:aString,anotherString:anotherString},smalltalk.RegularExpression.klass)})},
  3384. messageSends: []}),
  3385. smalltalk.RegularExpression.klass);
  3386. smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel-Collections');
  3387. smalltalk.addMethod(
  3388. smalltalk.method({
  3389. selector: "<<",
  3390. fn: function (anObject){
  3391. var self=this;
  3392. return smalltalk.withContext(function($ctx1) {
  3393. _st(self)._write_(anObject);
  3394. return self}, function($ctx1) {$ctx1.fill(self,"<<",{anObject:anObject},smalltalk.Stream)})},
  3395. messageSends: ["write:"]}),
  3396. smalltalk.Stream);
  3397. smalltalk.addMethod(
  3398. smalltalk.method({
  3399. selector: "atEnd",
  3400. fn: function (){
  3401. var self=this;
  3402. return smalltalk.withContext(function($ctx1) {
  3403. var $1;
  3404. $1=_st(_st(self)._position()).__eq(_st(self)._size());
  3405. return $1;
  3406. }, function($ctx1) {$ctx1.fill(self,"atEnd",{},smalltalk.Stream)})},
  3407. messageSends: ["=", "size", "position"]}),
  3408. smalltalk.Stream);
  3409. smalltalk.addMethod(
  3410. smalltalk.method({
  3411. selector: "atStart",
  3412. fn: function (){
  3413. var self=this;
  3414. return smalltalk.withContext(function($ctx1) {
  3415. var $1;
  3416. $1=_st(_st(self)._position()).__eq((0));
  3417. return $1;
  3418. }, function($ctx1) {$ctx1.fill(self,"atStart",{},smalltalk.Stream)})},
  3419. messageSends: ["=", "position"]}),
  3420. smalltalk.Stream);
  3421. smalltalk.addMethod(
  3422. smalltalk.method({
  3423. selector: "close",
  3424. fn: function (){
  3425. var self=this;
  3426. return smalltalk.withContext(function($ctx1) {
  3427. return self}, function($ctx1) {$ctx1.fill(self,"close",{},smalltalk.Stream)})},
  3428. messageSends: []}),
  3429. smalltalk.Stream);
  3430. smalltalk.addMethod(
  3431. smalltalk.method({
  3432. selector: "collection",
  3433. fn: function (){
  3434. var self=this;
  3435. return smalltalk.withContext(function($ctx1) {
  3436. var $1;
  3437. $1=self["@collection"];
  3438. return $1;
  3439. }, function($ctx1) {$ctx1.fill(self,"collection",{},smalltalk.Stream)})},
  3440. messageSends: []}),
  3441. smalltalk.Stream);
  3442. smalltalk.addMethod(
  3443. smalltalk.method({
  3444. selector: "contents",
  3445. fn: function (){
  3446. var self=this;
  3447. return smalltalk.withContext(function($ctx1) {
  3448. var $1;
  3449. $1=_st(_st(self)._collection())._copyFrom_to_((1),_st(self)._streamSize());
  3450. return $1;
  3451. }, function($ctx1) {$ctx1.fill(self,"contents",{},smalltalk.Stream)})},
  3452. messageSends: ["copyFrom:to:", "streamSize", "collection"]}),
  3453. smalltalk.Stream);
  3454. smalltalk.addMethod(
  3455. smalltalk.method({
  3456. selector: "do:",
  3457. fn: function (aBlock){
  3458. var self=this;
  3459. return smalltalk.withContext(function($ctx1) {
  3460. _st((function(){
  3461. return smalltalk.withContext(function($ctx2) {
  3462. return _st(self)._atEnd();
  3463. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  3464. return smalltalk.withContext(function($ctx2) {
  3465. return _st(aBlock)._value_(_st(self)._next());
  3466. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3467. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.Stream)})},
  3468. messageSends: ["whileFalse:", "value:", "next", "atEnd"]}),
  3469. smalltalk.Stream);
  3470. smalltalk.addMethod(
  3471. smalltalk.method({
  3472. selector: "flush",
  3473. fn: function (){
  3474. var self=this;
  3475. return smalltalk.withContext(function($ctx1) {
  3476. return self}, function($ctx1) {$ctx1.fill(self,"flush",{},smalltalk.Stream)})},
  3477. messageSends: []}),
  3478. smalltalk.Stream);
  3479. smalltalk.addMethod(
  3480. smalltalk.method({
  3481. selector: "isEmpty",
  3482. fn: function (){
  3483. var self=this;
  3484. return smalltalk.withContext(function($ctx1) {
  3485. var $1;
  3486. $1=_st(_st(self)._size()).__eq((0));
  3487. return $1;
  3488. }, function($ctx1) {$ctx1.fill(self,"isEmpty",{},smalltalk.Stream)})},
  3489. messageSends: ["=", "size"]}),
  3490. smalltalk.Stream);
  3491. smalltalk.addMethod(
  3492. smalltalk.method({
  3493. selector: "next",
  3494. fn: function (){
  3495. var self=this;
  3496. return smalltalk.withContext(function($ctx1) {
  3497. var $2,$1;
  3498. $2=_st(self)._atEnd();
  3499. if(smalltalk.assert($2)){
  3500. $1=nil;
  3501. } else {
  3502. _st(self)._position_(_st(_st(self)._position()).__plus((1)));
  3503. $1=_st(self["@collection"])._at_(_st(self)._position());
  3504. };
  3505. return $1;
  3506. }, function($ctx1) {$ctx1.fill(self,"next",{},smalltalk.Stream)})},
  3507. messageSends: ["ifTrue:ifFalse:", "position:", "+", "position", "at:", "atEnd"]}),
  3508. smalltalk.Stream);
  3509. smalltalk.addMethod(
  3510. smalltalk.method({
  3511. selector: "next:",
  3512. fn: function (anInteger){
  3513. var self=this;
  3514. var tempCollection;
  3515. return smalltalk.withContext(function($ctx1) {
  3516. var $1,$2;
  3517. tempCollection=_st(_st(_st(self)._collection())._class())._new();
  3518. _st(anInteger)._timesRepeat_((function(){
  3519. return smalltalk.withContext(function($ctx2) {
  3520. $1=_st(self)._atEnd();
  3521. if(! smalltalk.assert($1)){
  3522. return _st(tempCollection)._add_(_st(self)._next());
  3523. };
  3524. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3525. $2=tempCollection;
  3526. return $2;
  3527. }, function($ctx1) {$ctx1.fill(self,"next:",{anInteger:anInteger,tempCollection:tempCollection},smalltalk.Stream)})},
  3528. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", "add:", "next", "atEnd"]}),
  3529. smalltalk.Stream);
  3530. smalltalk.addMethod(
  3531. smalltalk.method({
  3532. selector: "nextPut:",
  3533. fn: function (anObject){
  3534. var self=this;
  3535. return smalltalk.withContext(function($ctx1) {
  3536. _st(self)._position_(_st(_st(self)._position()).__plus((1)));
  3537. _st(_st(self)._collection())._at_put_(_st(self)._position(),anObject);
  3538. _st(self)._setStreamSize_(_st(_st(self)._streamSize())._max_(_st(self)._position()));
  3539. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{anObject:anObject},smalltalk.Stream)})},
  3540. messageSends: ["position:", "+", "position", "at:put:", "collection", "setStreamSize:", "max:", "streamSize"]}),
  3541. smalltalk.Stream);
  3542. smalltalk.addMethod(
  3543. smalltalk.method({
  3544. selector: "nextPutAll:",
  3545. fn: function (aCollection){
  3546. var self=this;
  3547. return smalltalk.withContext(function($ctx1) {
  3548. _st(aCollection)._do_((function(each){
  3549. return smalltalk.withContext(function($ctx2) {
  3550. return _st(self)._nextPut_(each);
  3551. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3552. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAll:",{aCollection:aCollection},smalltalk.Stream)})},
  3553. messageSends: ["do:", "nextPut:"]}),
  3554. smalltalk.Stream);
  3555. smalltalk.addMethod(
  3556. smalltalk.method({
  3557. selector: "nextPutString:",
  3558. fn: function (aString){
  3559. var self=this;
  3560. return smalltalk.withContext(function($ctx1) {
  3561. _st(self)._nextPut_(aString);
  3562. return self}, function($ctx1) {$ctx1.fill(self,"nextPutString:",{aString:aString},smalltalk.Stream)})},
  3563. messageSends: ["nextPut:"]}),
  3564. smalltalk.Stream);
  3565. smalltalk.addMethod(
  3566. smalltalk.method({
  3567. selector: "peek",
  3568. fn: function (){
  3569. var self=this;
  3570. return smalltalk.withContext(function($ctx1) {
  3571. var $2,$1;
  3572. $2=_st(self)._atEnd();
  3573. if(! smalltalk.assert($2)){
  3574. $1=_st(_st(self)._collection())._at_(_st(_st(self)._position()).__plus((1)));
  3575. };
  3576. return $1;
  3577. }, function($ctx1) {$ctx1.fill(self,"peek",{},smalltalk.Stream)})},
  3578. messageSends: ["ifFalse:", "at:", "+", "position", "collection", "atEnd"]}),
  3579. smalltalk.Stream);
  3580. smalltalk.addMethod(
  3581. smalltalk.method({
  3582. selector: "position",
  3583. fn: function (){
  3584. var self=this;
  3585. return smalltalk.withContext(function($ctx1) {
  3586. var $2,$1;
  3587. $2=self["@position"];
  3588. if(($receiver = $2) == nil || $receiver == undefined){
  3589. self["@position"]=(0);
  3590. $1=self["@position"];
  3591. } else {
  3592. $1=$2;
  3593. };
  3594. return $1;
  3595. }, function($ctx1) {$ctx1.fill(self,"position",{},smalltalk.Stream)})},
  3596. messageSends: ["ifNil:"]}),
  3597. smalltalk.Stream);
  3598. smalltalk.addMethod(
  3599. smalltalk.method({
  3600. selector: "position:",
  3601. fn: function (anInteger){
  3602. var self=this;
  3603. return smalltalk.withContext(function($ctx1) {
  3604. self["@position"]=anInteger;
  3605. return self}, function($ctx1) {$ctx1.fill(self,"position:",{anInteger:anInteger},smalltalk.Stream)})},
  3606. messageSends: []}),
  3607. smalltalk.Stream);
  3608. smalltalk.addMethod(
  3609. smalltalk.method({
  3610. selector: "reset",
  3611. fn: function (){
  3612. var self=this;
  3613. return smalltalk.withContext(function($ctx1) {
  3614. _st(self)._position_((0));
  3615. return self}, function($ctx1) {$ctx1.fill(self,"reset",{},smalltalk.Stream)})},
  3616. messageSends: ["position:"]}),
  3617. smalltalk.Stream);
  3618. smalltalk.addMethod(
  3619. smalltalk.method({
  3620. selector: "resetContents",
  3621. fn: function (){
  3622. var self=this;
  3623. return smalltalk.withContext(function($ctx1) {
  3624. _st(self)._reset();
  3625. _st(self)._setStreamSize_((0));
  3626. return self}, function($ctx1) {$ctx1.fill(self,"resetContents",{},smalltalk.Stream)})},
  3627. messageSends: ["reset", "setStreamSize:"]}),
  3628. smalltalk.Stream);
  3629. smalltalk.addMethod(
  3630. smalltalk.method({
  3631. selector: "setCollection:",
  3632. fn: function (aCollection){
  3633. var self=this;
  3634. return smalltalk.withContext(function($ctx1) {
  3635. self["@collection"]=aCollection;
  3636. return self}, function($ctx1) {$ctx1.fill(self,"setCollection:",{aCollection:aCollection},smalltalk.Stream)})},
  3637. messageSends: []}),
  3638. smalltalk.Stream);
  3639. smalltalk.addMethod(
  3640. smalltalk.method({
  3641. selector: "setStreamSize:",
  3642. fn: function (anInteger){
  3643. var self=this;
  3644. return smalltalk.withContext(function($ctx1) {
  3645. self["@streamSize"]=anInteger;
  3646. return self}, function($ctx1) {$ctx1.fill(self,"setStreamSize:",{anInteger:anInteger},smalltalk.Stream)})},
  3647. messageSends: []}),
  3648. smalltalk.Stream);
  3649. smalltalk.addMethod(
  3650. smalltalk.method({
  3651. selector: "setToEnd",
  3652. fn: function (){
  3653. var self=this;
  3654. return smalltalk.withContext(function($ctx1) {
  3655. _st(self)._position_(_st(self)._size());
  3656. return self}, function($ctx1) {$ctx1.fill(self,"setToEnd",{},smalltalk.Stream)})},
  3657. messageSends: ["position:", "size"]}),
  3658. smalltalk.Stream);
  3659. smalltalk.addMethod(
  3660. smalltalk.method({
  3661. selector: "size",
  3662. fn: function (){
  3663. var self=this;
  3664. return smalltalk.withContext(function($ctx1) {
  3665. var $1;
  3666. $1=_st(self)._streamSize();
  3667. return $1;
  3668. }, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.Stream)})},
  3669. messageSends: ["streamSize"]}),
  3670. smalltalk.Stream);
  3671. smalltalk.addMethod(
  3672. smalltalk.method({
  3673. selector: "skip:",
  3674. fn: function (anInteger){
  3675. var self=this;
  3676. return smalltalk.withContext(function($ctx1) {
  3677. _st(self)._position_(_st(_st(_st(self)._position()).__plus(anInteger))._min_max_(_st(self)._size(),(0)));
  3678. return self}, function($ctx1) {$ctx1.fill(self,"skip:",{anInteger:anInteger},smalltalk.Stream)})},
  3679. messageSends: ["position:", "min:max:", "size", "+", "position"]}),
  3680. smalltalk.Stream);
  3681. smalltalk.addMethod(
  3682. smalltalk.method({
  3683. selector: "streamSize",
  3684. fn: function (){
  3685. var self=this;
  3686. return smalltalk.withContext(function($ctx1) {
  3687. var $1;
  3688. $1=self["@streamSize"];
  3689. return $1;
  3690. }, function($ctx1) {$ctx1.fill(self,"streamSize",{},smalltalk.Stream)})},
  3691. messageSends: []}),
  3692. smalltalk.Stream);
  3693. smalltalk.addMethod(
  3694. smalltalk.method({
  3695. selector: "write:",
  3696. fn: function (anObject){
  3697. var self=this;
  3698. return smalltalk.withContext(function($ctx1) {
  3699. _st(anObject)._putOn_(self);
  3700. return self}, function($ctx1) {$ctx1.fill(self,"write:",{anObject:anObject},smalltalk.Stream)})},
  3701. messageSends: ["putOn:"]}),
  3702. smalltalk.Stream);
  3703. smalltalk.addMethod(
  3704. smalltalk.method({
  3705. selector: "on:",
  3706. fn: function (aCollection){
  3707. var self=this;
  3708. return smalltalk.withContext(function($ctx1) {
  3709. var $2,$3,$1;
  3710. $2=_st(self)._new();
  3711. _st($2)._setCollection_(aCollection);
  3712. _st($2)._setStreamSize_(_st(aCollection)._size());
  3713. $3=_st($2)._yourself();
  3714. $1=$3;
  3715. return $1;
  3716. }, function($ctx1) {$ctx1.fill(self,"on:",{aCollection:aCollection},smalltalk.Stream.klass)})},
  3717. messageSends: ["setCollection:", "new", "setStreamSize:", "size", "yourself"]}),
  3718. smalltalk.Stream.klass);
  3719. smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel-Collections');
  3720. smalltalk.addMethod(
  3721. smalltalk.method({
  3722. selector: "cr",
  3723. fn: function (){
  3724. var self=this;
  3725. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  3726. return smalltalk.withContext(function($ctx1) {
  3727. var $1;
  3728. $1=_st(self)._nextPutAll_(_st($String())._cr());
  3729. return $1;
  3730. }, function($ctx1) {$ctx1.fill(self,"cr",{},smalltalk.StringStream)})},
  3731. messageSends: ["nextPutAll:", "cr"]}),
  3732. smalltalk.StringStream);
  3733. smalltalk.addMethod(
  3734. smalltalk.method({
  3735. selector: "crlf",
  3736. fn: function (){
  3737. var self=this;
  3738. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  3739. return smalltalk.withContext(function($ctx1) {
  3740. var $1;
  3741. $1=_st(self)._nextPutAll_(_st($String())._crlf());
  3742. return $1;
  3743. }, function($ctx1) {$ctx1.fill(self,"crlf",{},smalltalk.StringStream)})},
  3744. messageSends: ["nextPutAll:", "crlf"]}),
  3745. smalltalk.StringStream);
  3746. smalltalk.addMethod(
  3747. smalltalk.method({
  3748. selector: "lf",
  3749. fn: function (){
  3750. var self=this;
  3751. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  3752. return smalltalk.withContext(function($ctx1) {
  3753. var $1;
  3754. $1=_st(self)._nextPutAll_(_st($String())._lf());
  3755. return $1;
  3756. }, function($ctx1) {$ctx1.fill(self,"lf",{},smalltalk.StringStream)})},
  3757. messageSends: ["nextPutAll:", "lf"]}),
  3758. smalltalk.StringStream);
  3759. smalltalk.addMethod(
  3760. smalltalk.method({
  3761. selector: "next:",
  3762. fn: function (anInteger){
  3763. var self=this;
  3764. var tempCollection;
  3765. return smalltalk.withContext(function($ctx1) {
  3766. var $1,$2;
  3767. tempCollection=_st(_st(_st(self)._collection())._class())._new();
  3768. _st(anInteger)._timesRepeat_((function(){
  3769. return smalltalk.withContext(function($ctx2) {
  3770. $1=_st(self)._atEnd();
  3771. if(! smalltalk.assert($1)){
  3772. tempCollection=_st(tempCollection).__comma(_st(self)._next());
  3773. return tempCollection;
  3774. };
  3775. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3776. $2=tempCollection;
  3777. return $2;
  3778. }, function($ctx1) {$ctx1.fill(self,"next:",{anInteger:anInteger,tempCollection:tempCollection},smalltalk.StringStream)})},
  3779. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", ",", "next", "atEnd"]}),
  3780. smalltalk.StringStream);
  3781. smalltalk.addMethod(
  3782. smalltalk.method({
  3783. selector: "nextPut:",
  3784. fn: function (aString){
  3785. var self=this;
  3786. return smalltalk.withContext(function($ctx1) {
  3787. _st(self)._nextPutAll_(aString);
  3788. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{aString:aString},smalltalk.StringStream)})},
  3789. messageSends: ["nextPutAll:"]}),
  3790. smalltalk.StringStream);
  3791. smalltalk.addMethod(
  3792. smalltalk.method({
  3793. selector: "nextPutAll:",
  3794. fn: function (aString){
  3795. var self=this;
  3796. var pre,post;
  3797. return smalltalk.withContext(function($ctx1) {
  3798. var $1;
  3799. $1=_st(self)._atEnd();
  3800. if(smalltalk.assert($1)){
  3801. _st(self)._setCollection_(_st(_st(self)._collection()).__comma(aString));
  3802. } else {
  3803. pre=_st(_st(self)._collection())._copyFrom_to_((1),_st(self)._position());
  3804. pre;
  3805. post=_st(_st(self)._collection())._copyFrom_to_(_st(_st(_st(self)._position()).__plus((1))).__plus(_st(aString)._size()),_st(_st(self)._collection())._size());
  3806. post;
  3807. _st(self)._setCollection_(_st(_st(pre).__comma(aString)).__comma(post));
  3808. };
  3809. _st(self)._position_(_st(_st(self)._position()).__plus(_st(aString)._size()));
  3810. _st(self)._setStreamSize_(_st(_st(self)._streamSize())._max_(_st(self)._position()));
  3811. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAll:",{aString:aString,pre:pre,post:post},smalltalk.StringStream)})},
  3812. messageSends: ["ifTrue:ifFalse:", "setCollection:", ",", "collection", "copyFrom:to:", "position", "+", "size", "atEnd", "position:", "setStreamSize:", "max:", "streamSize"]}),
  3813. smalltalk.StringStream);
  3814. smalltalk.addMethod(
  3815. smalltalk.method({
  3816. selector: "nextPutString:",
  3817. fn: function (aString){
  3818. var self=this;
  3819. return smalltalk.withContext(function($ctx1) {
  3820. _st(self)._nextPutAll_(aString);
  3821. return self}, function($ctx1) {$ctx1.fill(self,"nextPutString:",{aString:aString},smalltalk.StringStream)})},
  3822. messageSends: ["nextPutAll:"]}),
  3823. smalltalk.StringStream);
  3824. smalltalk.addMethod(
  3825. smalltalk.method({
  3826. selector: "space",
  3827. fn: function (){
  3828. var self=this;
  3829. return smalltalk.withContext(function($ctx1) {
  3830. _st(self)._nextPut_(" ");
  3831. return self}, function($ctx1) {$ctx1.fill(self,"space",{},smalltalk.StringStream)})},
  3832. messageSends: ["nextPut:"]}),
  3833. smalltalk.StringStream);
  3834. smalltalk.addMethod(
  3835. smalltalk.method({
  3836. selector: "tab",
  3837. fn: function (){
  3838. var self=this;
  3839. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  3840. return smalltalk.withContext(function($ctx1) {
  3841. var $1;
  3842. $1=_st(self)._nextPutAll_(_st($String())._tab());
  3843. return $1;
  3844. }, function($ctx1) {$ctx1.fill(self,"tab",{},smalltalk.StringStream)})},
  3845. messageSends: ["nextPutAll:", "tab"]}),
  3846. smalltalk.StringStream);