Kernel-Collections.deploy.js 131 KB

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