2
0

Kernel-Collections.deploy.js 124 KB

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