Kernel-Collections.deploy.js 131 KB

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