Kernel-Collections.deploy.js 133 KB

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