Kernel-Collections.deploy.js 130 KB

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