2
0

Kernel-Collections.deploy.js 131 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331
  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: "do:displayingProgress:",
  1657. fn: function (aBlock,aString){
  1658. var self=this;
  1659. function $ProgressHandler(){return smalltalk.ProgressHandler||(typeof ProgressHandler=="undefined"?nil:ProgressHandler)}
  1660. return smalltalk.withContext(function($ctx1) {
  1661. _st(_st($ProgressHandler())._current())._do_on_displaying_(aBlock,self,aString);
  1662. return self}, function($ctx1) {$ctx1.fill(self,"do:displayingProgress:",{aBlock:aBlock,aString:aString},smalltalk.SequenceableCollection)})},
  1663. messageSends: ["do:on:displaying:", "current"]}),
  1664. smalltalk.SequenceableCollection);
  1665. smalltalk.addMethod(
  1666. smalltalk.method({
  1667. selector: "first",
  1668. fn: function (){
  1669. var self=this;
  1670. return smalltalk.withContext(function($ctx1) {
  1671. var $1;
  1672. $1=self._at_((1));
  1673. return $1;
  1674. }, function($ctx1) {$ctx1.fill(self,"first",{},smalltalk.SequenceableCollection)})},
  1675. messageSends: ["at:"]}),
  1676. smalltalk.SequenceableCollection);
  1677. smalltalk.addMethod(
  1678. smalltalk.method({
  1679. selector: "first:",
  1680. fn: function (n){
  1681. var self=this;
  1682. return smalltalk.withContext(function($ctx1) {
  1683. var $1;
  1684. $1=self._copyFrom_to_((1),n);
  1685. return $1;
  1686. }, function($ctx1) {$ctx1.fill(self,"first:",{n:n},smalltalk.SequenceableCollection)})},
  1687. messageSends: ["copyFrom:to:"]}),
  1688. smalltalk.SequenceableCollection);
  1689. smalltalk.addMethod(
  1690. smalltalk.method({
  1691. selector: "fourth",
  1692. fn: function (){
  1693. var self=this;
  1694. return smalltalk.withContext(function($ctx1) {
  1695. var $1;
  1696. $1=self._at_((4));
  1697. return $1;
  1698. }, function($ctx1) {$ctx1.fill(self,"fourth",{},smalltalk.SequenceableCollection)})},
  1699. messageSends: ["at:"]}),
  1700. smalltalk.SequenceableCollection);
  1701. smalltalk.addMethod(
  1702. smalltalk.method({
  1703. selector: "includes:",
  1704. fn: function (anObject){
  1705. var self=this;
  1706. return smalltalk.withContext(function($ctx1) {
  1707. var $1;
  1708. $1=_st(self._indexOf_ifAbsent_(anObject,(function(){
  1709. return smalltalk.withContext(function($ctx2) {
  1710. return nil;
  1711. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._notNil();
  1712. return $1;
  1713. }, function($ctx1) {$ctx1.fill(self,"includes:",{anObject:anObject},smalltalk.SequenceableCollection)})},
  1714. messageSends: ["notNil", "indexOf:ifAbsent:"]}),
  1715. smalltalk.SequenceableCollection);
  1716. smalltalk.addMethod(
  1717. smalltalk.method({
  1718. selector: "indexOf:ifAbsent:",
  1719. fn: function (anObject,aBlock){
  1720. var self=this;
  1721. return smalltalk.withContext(function($ctx1) {
  1722. for(var i=0;i<self.length;i++) {
  1723. if(self[i].__eq(anObject)) {return i+1}
  1724. };
  1725. return aBlock._value();
  1726. ;
  1727. return self}, function($ctx1) {$ctx1.fill(self,"indexOf:ifAbsent:",{anObject:anObject,aBlock:aBlock},smalltalk.SequenceableCollection)})},
  1728. messageSends: []}),
  1729. smalltalk.SequenceableCollection);
  1730. smalltalk.addMethod(
  1731. smalltalk.method({
  1732. selector: "indexOf:startingAt:",
  1733. fn: function (anObject,start){
  1734. var self=this;
  1735. return smalltalk.withContext(function($ctx1) {
  1736. var $1;
  1737. $1=self._indexOf_startingAt_ifAbsent_(anObject,start,(function(){
  1738. return smalltalk.withContext(function($ctx2) {
  1739. return (0);
  1740. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1741. return $1;
  1742. }, function($ctx1) {$ctx1.fill(self,"indexOf:startingAt:",{anObject:anObject,start:start},smalltalk.SequenceableCollection)})},
  1743. messageSends: ["indexOf:startingAt:ifAbsent:"]}),
  1744. smalltalk.SequenceableCollection);
  1745. smalltalk.addMethod(
  1746. smalltalk.method({
  1747. selector: "indexOf:startingAt:ifAbsent:",
  1748. fn: function (anObject,start,aBlock){
  1749. var self=this;
  1750. return smalltalk.withContext(function($ctx1) {
  1751. for(var i=start-1;i<self.length;i++){
  1752. if(self[i].__eq(anObject)) {return i+1}
  1753. }
  1754. return aBlock._value();
  1755. ;
  1756. return self}, function($ctx1) {$ctx1.fill(self,"indexOf:startingAt:ifAbsent:",{anObject:anObject,start:start,aBlock:aBlock},smalltalk.SequenceableCollection)})},
  1757. messageSends: []}),
  1758. smalltalk.SequenceableCollection);
  1759. smalltalk.addMethod(
  1760. smalltalk.method({
  1761. selector: "last",
  1762. fn: function (){
  1763. var self=this;
  1764. return smalltalk.withContext(function($ctx1) {
  1765. var $1;
  1766. $1=self._at_(self._size());
  1767. return $1;
  1768. }, function($ctx1) {$ctx1.fill(self,"last",{},smalltalk.SequenceableCollection)})},
  1769. messageSends: ["at:", "size"]}),
  1770. smalltalk.SequenceableCollection);
  1771. smalltalk.addMethod(
  1772. smalltalk.method({
  1773. selector: "newStream",
  1774. fn: function (){
  1775. var self=this;
  1776. return smalltalk.withContext(function($ctx1) {
  1777. var $1;
  1778. $1=_st(self._streamClass())._on_(self);
  1779. return $1;
  1780. }, function($ctx1) {$ctx1.fill(self,"newStream",{},smalltalk.SequenceableCollection)})},
  1781. messageSends: ["on:", "streamClass"]}),
  1782. smalltalk.SequenceableCollection);
  1783. smalltalk.addMethod(
  1784. smalltalk.method({
  1785. selector: "readStream",
  1786. fn: function (){
  1787. var self=this;
  1788. return smalltalk.withContext(function($ctx1) {
  1789. var $1;
  1790. $1=self._stream();
  1791. return $1;
  1792. }, function($ctx1) {$ctx1.fill(self,"readStream",{},smalltalk.SequenceableCollection)})},
  1793. messageSends: ["stream"]}),
  1794. smalltalk.SequenceableCollection);
  1795. smalltalk.addMethod(
  1796. smalltalk.method({
  1797. selector: "removeLast",
  1798. fn: function (){
  1799. var self=this;
  1800. return smalltalk.withContext(function($ctx1) {
  1801. self._remove_(self._last());
  1802. return self}, function($ctx1) {$ctx1.fill(self,"removeLast",{},smalltalk.SequenceableCollection)})},
  1803. messageSends: ["remove:", "last"]}),
  1804. smalltalk.SequenceableCollection);
  1805. smalltalk.addMethod(
  1806. smalltalk.method({
  1807. selector: "reversed",
  1808. fn: function (){
  1809. var self=this;
  1810. return smalltalk.withContext(function($ctx1) {
  1811. self._subclassResponsibility();
  1812. return self}, function($ctx1) {$ctx1.fill(self,"reversed",{},smalltalk.SequenceableCollection)})},
  1813. messageSends: ["subclassResponsibility"]}),
  1814. smalltalk.SequenceableCollection);
  1815. smalltalk.addMethod(
  1816. smalltalk.method({
  1817. selector: "second",
  1818. fn: function (){
  1819. var self=this;
  1820. return smalltalk.withContext(function($ctx1) {
  1821. var $1;
  1822. $1=self._at_((2));
  1823. return $1;
  1824. }, function($ctx1) {$ctx1.fill(self,"second",{},smalltalk.SequenceableCollection)})},
  1825. messageSends: ["at:"]}),
  1826. smalltalk.SequenceableCollection);
  1827. smalltalk.addMethod(
  1828. smalltalk.method({
  1829. selector: "shallowCopy",
  1830. fn: function (){
  1831. var self=this;
  1832. var newCollection;
  1833. return smalltalk.withContext(function($ctx1) {
  1834. var $1;
  1835. newCollection=_st(self._class())._new_(self._size());
  1836. self._withIndexDo_((function(each,index){
  1837. return smalltalk.withContext(function($ctx2) {
  1838. return _st(newCollection)._at_put_(index,each);
  1839. }, function($ctx2) {$ctx2.fillBlock({each:each,index:index},$ctx1)})}));
  1840. $1=newCollection;
  1841. return $1;
  1842. }, function($ctx1) {$ctx1.fill(self,"shallowCopy",{newCollection:newCollection},smalltalk.SequenceableCollection)})},
  1843. messageSends: ["new:", "size", "class", "withIndexDo:", "at:put:"]}),
  1844. smalltalk.SequenceableCollection);
  1845. smalltalk.addMethod(
  1846. smalltalk.method({
  1847. selector: "stream",
  1848. fn: function (){
  1849. var self=this;
  1850. return smalltalk.withContext(function($ctx1) {
  1851. var $1;
  1852. $1=self._newStream();
  1853. return $1;
  1854. }, function($ctx1) {$ctx1.fill(self,"stream",{},smalltalk.SequenceableCollection)})},
  1855. messageSends: ["newStream"]}),
  1856. smalltalk.SequenceableCollection);
  1857. smalltalk.addMethod(
  1858. smalltalk.method({
  1859. selector: "streamClass",
  1860. fn: function (){
  1861. var self=this;
  1862. return smalltalk.withContext(function($ctx1) {
  1863. var $1;
  1864. $1=_st(self._class())._streamClass();
  1865. return $1;
  1866. }, function($ctx1) {$ctx1.fill(self,"streamClass",{},smalltalk.SequenceableCollection)})},
  1867. messageSends: ["streamClass", "class"]}),
  1868. smalltalk.SequenceableCollection);
  1869. smalltalk.addMethod(
  1870. smalltalk.method({
  1871. selector: "third",
  1872. fn: function (){
  1873. var self=this;
  1874. return smalltalk.withContext(function($ctx1) {
  1875. var $1;
  1876. $1=self._at_((3));
  1877. return $1;
  1878. }, function($ctx1) {$ctx1.fill(self,"third",{},smalltalk.SequenceableCollection)})},
  1879. messageSends: ["at:"]}),
  1880. smalltalk.SequenceableCollection);
  1881. smalltalk.addMethod(
  1882. smalltalk.method({
  1883. selector: "with:do:",
  1884. fn: function (anotherCollection,aBlock){
  1885. var self=this;
  1886. return smalltalk.withContext(function($ctx1) {
  1887. for(var i=0;i<self.length;i++){aBlock._value_value_(self[i], anotherCollection[i]);};
  1888. return self}, function($ctx1) {$ctx1.fill(self,"with:do:",{anotherCollection:anotherCollection,aBlock:aBlock},smalltalk.SequenceableCollection)})},
  1889. messageSends: []}),
  1890. smalltalk.SequenceableCollection);
  1891. smalltalk.addMethod(
  1892. smalltalk.method({
  1893. selector: "withIndexDo:",
  1894. fn: function (aBlock){
  1895. var self=this;
  1896. return smalltalk.withContext(function($ctx1) {
  1897. for(var i=0;i<self.length;i++){aBlock._value_value_(self[i], i+1);};
  1898. return self}, function($ctx1) {$ctx1.fill(self,"withIndexDo:",{aBlock:aBlock},smalltalk.SequenceableCollection)})},
  1899. messageSends: []}),
  1900. smalltalk.SequenceableCollection);
  1901. smalltalk.addMethod(
  1902. smalltalk.method({
  1903. selector: "writeStream",
  1904. fn: function (){
  1905. var self=this;
  1906. return smalltalk.withContext(function($ctx1) {
  1907. var $1;
  1908. $1=self._stream();
  1909. return $1;
  1910. }, function($ctx1) {$ctx1.fill(self,"writeStream",{},smalltalk.SequenceableCollection)})},
  1911. messageSends: ["stream"]}),
  1912. smalltalk.SequenceableCollection);
  1913. smalltalk.addMethod(
  1914. smalltalk.method({
  1915. selector: "streamClass",
  1916. fn: function (){
  1917. var self=this;
  1918. function $Stream(){return smalltalk.Stream||(typeof Stream=="undefined"?nil:Stream)}
  1919. return smalltalk.withContext(function($ctx1) {
  1920. var $1;
  1921. $1=$Stream();
  1922. return $1;
  1923. }, function($ctx1) {$ctx1.fill(self,"streamClass",{},smalltalk.SequenceableCollection.klass)})},
  1924. messageSends: []}),
  1925. smalltalk.SequenceableCollection.klass);
  1926. smalltalk.addMethod(
  1927. smalltalk.method({
  1928. selector: "streamContents:",
  1929. fn: function (aBlock){
  1930. var self=this;
  1931. var stream;
  1932. return smalltalk.withContext(function($ctx1) {
  1933. var $1;
  1934. stream=_st(self._streamClass())._on_(self._new());
  1935. _st(aBlock)._value_(stream);
  1936. $1=_st(stream)._contents();
  1937. return $1;
  1938. }, function($ctx1) {$ctx1.fill(self,"streamContents:",{aBlock:aBlock,stream:stream},smalltalk.SequenceableCollection.klass)})},
  1939. messageSends: ["on:", "new", "streamClass", "value:", "contents"]}),
  1940. smalltalk.SequenceableCollection.klass);
  1941. smalltalk.addClass('Array', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
  1942. smalltalk.addMethod(
  1943. smalltalk.method({
  1944. selector: "add:",
  1945. fn: function (anObject){
  1946. var self=this;
  1947. return smalltalk.withContext(function($ctx1) {
  1948. self.push(anObject); return anObject;;
  1949. return self}, function($ctx1) {$ctx1.fill(self,"add:",{anObject:anObject},smalltalk.Array)})},
  1950. messageSends: []}),
  1951. smalltalk.Array);
  1952. smalltalk.addMethod(
  1953. smalltalk.method({
  1954. selector: "asJavascript",
  1955. fn: function (){
  1956. var self=this;
  1957. return smalltalk.withContext(function($ctx1) {
  1958. var $1;
  1959. $1=_st("[".__comma(_st(self._collect_((function(each){
  1960. return smalltalk.withContext(function($ctx2) {
  1961. return _st(each)._asJavascript();
  1962. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._join_(", "))).__comma("]");
  1963. return $1;
  1964. }, function($ctx1) {$ctx1.fill(self,"asJavascript",{},smalltalk.Array)})},
  1965. messageSends: [",", "join:", "collect:", "asJavascript"]}),
  1966. smalltalk.Array);
  1967. smalltalk.addMethod(
  1968. smalltalk.method({
  1969. selector: "at:ifAbsent:",
  1970. fn: function (anIndex,aBlock){
  1971. var self=this;
  1972. return smalltalk.withContext(function($ctx1) {
  1973. if((anIndex < 1) || (self.length < anIndex)) {return aBlock._value()};
  1974. return self[anIndex - 1];
  1975. ;
  1976. return self}, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{anIndex:anIndex,aBlock:aBlock},smalltalk.Array)})},
  1977. messageSends: []}),
  1978. smalltalk.Array);
  1979. smalltalk.addMethod(
  1980. smalltalk.method({
  1981. selector: "at:ifPresent:ifAbsent:",
  1982. fn: function (anIndex,aBlock,anotherBlock){
  1983. var self=this;
  1984. return smalltalk.withContext(function($ctx1) {
  1985. return anIndex < 1 || self.length < anIndex ? anotherBlock._value() : aBlock._value_(self[anIndex - 1]);;
  1986. return self}, function($ctx1) {$ctx1.fill(self,"at:ifPresent:ifAbsent:",{anIndex:anIndex,aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.Array)})},
  1987. messageSends: []}),
  1988. smalltalk.Array);
  1989. smalltalk.addMethod(
  1990. smalltalk.method({
  1991. selector: "at:put:",
  1992. fn: function (anIndex,anObject){
  1993. var self=this;
  1994. return smalltalk.withContext(function($ctx1) {
  1995. return self[anIndex - 1] = anObject;
  1996. return self}, function($ctx1) {$ctx1.fill(self,"at:put:",{anIndex:anIndex,anObject:anObject},smalltalk.Array)})},
  1997. messageSends: []}),
  1998. smalltalk.Array);
  1999. smalltalk.addMethod(
  2000. smalltalk.method({
  2001. selector: "collect:",
  2002. fn: function (aBlock){
  2003. var self=this;
  2004. return smalltalk.withContext(function($ctx1) {
  2005. return self.map(function(each) {return aBlock._value_(each)});
  2006. return self}, function($ctx1) {$ctx1.fill(self,"collect:",{aBlock:aBlock},smalltalk.Array)})},
  2007. messageSends: []}),
  2008. smalltalk.Array);
  2009. smalltalk.addMethod(
  2010. smalltalk.method({
  2011. selector: "join:",
  2012. fn: function (aString){
  2013. var self=this;
  2014. return smalltalk.withContext(function($ctx1) {
  2015. return self.join(aString);
  2016. return self}, function($ctx1) {$ctx1.fill(self,"join:",{aString:aString},smalltalk.Array)})},
  2017. messageSends: []}),
  2018. smalltalk.Array);
  2019. smalltalk.addMethod(
  2020. smalltalk.method({
  2021. selector: "printOn:",
  2022. fn: function (aStream){
  2023. var self=this;
  2024. return smalltalk.withContext(function($ctx1) {
  2025. smalltalk.Array.superclass.fn.prototype._printOn_.apply(_st(self), [aStream]);
  2026. _st(aStream)._nextPutAll_(" (");
  2027. self._do_separatedBy_((function(each){
  2028. return smalltalk.withContext(function($ctx2) {
  2029. return _st(each)._printOn_(aStream);
  2030. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2031. return smalltalk.withContext(function($ctx2) {
  2032. return _st(aStream)._nextPutAll_(" ");
  2033. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2034. _st(aStream)._nextPutAll_(")");
  2035. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Array)})},
  2036. messageSends: ["printOn:", "nextPutAll:", "do:separatedBy:"]}),
  2037. smalltalk.Array);
  2038. smalltalk.addMethod(
  2039. smalltalk.method({
  2040. selector: "remove:ifAbsent:",
  2041. fn: function (anObject,aBlock){
  2042. var self=this;
  2043. return smalltalk.withContext(function($ctx1) {
  2044. for(var i=0;i<self.length;i++) {
  2045. if(_st(self[i]).__eq(anObject)) {
  2046. self.splice(i,1);
  2047. return self;
  2048. }
  2049. };
  2050. aBlock._value();
  2051. ;
  2052. return self}, function($ctx1) {$ctx1.fill(self,"remove:ifAbsent:",{anObject:anObject,aBlock:aBlock},smalltalk.Array)})},
  2053. messageSends: []}),
  2054. smalltalk.Array);
  2055. smalltalk.addMethod(
  2056. smalltalk.method({
  2057. selector: "removeFrom:to:",
  2058. fn: function (aNumber,anotherNumber){
  2059. var self=this;
  2060. return smalltalk.withContext(function($ctx1) {
  2061. self.splice(aNumber -1, anotherNumber - aNumber + 1);
  2062. return self}, function($ctx1) {$ctx1.fill(self,"removeFrom:to:",{aNumber:aNumber,anotherNumber:anotherNumber},smalltalk.Array)})},
  2063. messageSends: []}),
  2064. smalltalk.Array);
  2065. smalltalk.addMethod(
  2066. smalltalk.method({
  2067. selector: "removeIndex:",
  2068. fn: function (anInteger){
  2069. var self=this;
  2070. return smalltalk.withContext(function($ctx1) {
  2071. self.splice(anInteger - 1, 1);
  2072. return self}, function($ctx1) {$ctx1.fill(self,"removeIndex:",{anInteger:anInteger},smalltalk.Array)})},
  2073. messageSends: []}),
  2074. smalltalk.Array);
  2075. smalltalk.addMethod(
  2076. smalltalk.method({
  2077. selector: "reversed",
  2078. fn: function (){
  2079. var self=this;
  2080. return smalltalk.withContext(function($ctx1) {
  2081. return self._copy().reverse();
  2082. return self}, function($ctx1) {$ctx1.fill(self,"reversed",{},smalltalk.Array)})},
  2083. messageSends: []}),
  2084. smalltalk.Array);
  2085. smalltalk.addMethod(
  2086. smalltalk.method({
  2087. selector: "select:",
  2088. fn: function (aBlock){
  2089. var self=this;
  2090. return smalltalk.withContext(function($ctx1) {
  2091. var result = self.klass._new();
  2092. for(var i=0; i<self.length; i++) {
  2093. if(aBlock._value_(self[i])) {
  2094. result.push(self[i]);
  2095. }
  2096. }
  2097. return result;
  2098. ;
  2099. return self}, function($ctx1) {$ctx1.fill(self,"select:",{aBlock:aBlock},smalltalk.Array)})},
  2100. messageSends: []}),
  2101. smalltalk.Array);
  2102. smalltalk.addMethod(
  2103. smalltalk.method({
  2104. selector: "size",
  2105. fn: function (){
  2106. var self=this;
  2107. return smalltalk.withContext(function($ctx1) {
  2108. return self.length;
  2109. return self}, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.Array)})},
  2110. messageSends: []}),
  2111. smalltalk.Array);
  2112. smalltalk.addMethod(
  2113. smalltalk.method({
  2114. selector: "sort",
  2115. fn: function (){
  2116. var self=this;
  2117. return smalltalk.withContext(function($ctx1) {
  2118. var $1;
  2119. $1=self._basicPerform_("sort");
  2120. return $1;
  2121. }, function($ctx1) {$ctx1.fill(self,"sort",{},smalltalk.Array)})},
  2122. messageSends: ["basicPerform:"]}),
  2123. smalltalk.Array);
  2124. smalltalk.addMethod(
  2125. smalltalk.method({
  2126. selector: "sort:",
  2127. fn: function (aBlock){
  2128. var self=this;
  2129. return smalltalk.withContext(function($ctx1) {
  2130. return self.sort(function(a, b) {
  2131. if(aBlock._value_value_(a,b)) {return -1} else {return 1}
  2132. })
  2133. ;
  2134. return self}, function($ctx1) {$ctx1.fill(self,"sort:",{aBlock:aBlock},smalltalk.Array)})},
  2135. messageSends: []}),
  2136. smalltalk.Array);
  2137. smalltalk.addMethod(
  2138. smalltalk.method({
  2139. selector: "sorted",
  2140. fn: function (){
  2141. var self=this;
  2142. return smalltalk.withContext(function($ctx1) {
  2143. var $1;
  2144. $1=_st(self._copy())._sort();
  2145. return $1;
  2146. }, function($ctx1) {$ctx1.fill(self,"sorted",{},smalltalk.Array)})},
  2147. messageSends: ["sort", "copy"]}),
  2148. smalltalk.Array);
  2149. smalltalk.addMethod(
  2150. smalltalk.method({
  2151. selector: "sorted:",
  2152. fn: function (aBlock){
  2153. var self=this;
  2154. return smalltalk.withContext(function($ctx1) {
  2155. var $1;
  2156. $1=_st(self._copy())._sort_(aBlock);
  2157. return $1;
  2158. }, function($ctx1) {$ctx1.fill(self,"sorted:",{aBlock:aBlock},smalltalk.Array)})},
  2159. messageSends: ["sort:", "copy"]}),
  2160. smalltalk.Array);
  2161. smalltalk.addMethod(
  2162. smalltalk.method({
  2163. selector: "new:",
  2164. fn: function (anInteger){
  2165. var self=this;
  2166. return smalltalk.withContext(function($ctx1) {
  2167. return new Array(anInteger);
  2168. return self}, function($ctx1) {$ctx1.fill(self,"new:",{anInteger:anInteger},smalltalk.Array.klass)})},
  2169. messageSends: []}),
  2170. smalltalk.Array.klass);
  2171. smalltalk.addMethod(
  2172. smalltalk.method({
  2173. selector: "with:",
  2174. fn: function (anObject){
  2175. var self=this;
  2176. return smalltalk.withContext(function($ctx1) {
  2177. var $2,$3,$1;
  2178. $2=self._new_((1));
  2179. _st($2)._at_put_((1),anObject);
  2180. $3=_st($2)._yourself();
  2181. $1=$3;
  2182. return $1;
  2183. }, function($ctx1) {$ctx1.fill(self,"with:",{anObject:anObject},smalltalk.Array.klass)})},
  2184. messageSends: ["at:put:", "new:", "yourself"]}),
  2185. smalltalk.Array.klass);
  2186. smalltalk.addMethod(
  2187. smalltalk.method({
  2188. selector: "with:with:",
  2189. fn: function (anObject,anObject2){
  2190. var self=this;
  2191. return smalltalk.withContext(function($ctx1) {
  2192. var $2,$3,$1;
  2193. $2=self._new_((2));
  2194. _st($2)._at_put_((1),anObject);
  2195. _st($2)._at_put_((2),anObject2);
  2196. $3=_st($2)._yourself();
  2197. $1=$3;
  2198. return $1;
  2199. }, function($ctx1) {$ctx1.fill(self,"with:with:",{anObject:anObject,anObject2:anObject2},smalltalk.Array.klass)})},
  2200. messageSends: ["at:put:", "new:", "yourself"]}),
  2201. smalltalk.Array.klass);
  2202. smalltalk.addMethod(
  2203. smalltalk.method({
  2204. selector: "with:with:with:",
  2205. fn: function (anObject,anObject2,anObject3){
  2206. var self=this;
  2207. return smalltalk.withContext(function($ctx1) {
  2208. var $2,$3,$1;
  2209. $2=self._new_((3));
  2210. _st($2)._at_put_((1),anObject);
  2211. _st($2)._at_put_((2),anObject2);
  2212. _st($2)._at_put_((3),anObject3);
  2213. $3=_st($2)._yourself();
  2214. $1=$3;
  2215. return $1;
  2216. }, function($ctx1) {$ctx1.fill(self,"with:with:with:",{anObject:anObject,anObject2:anObject2,anObject3:anObject3},smalltalk.Array.klass)})},
  2217. messageSends: ["at:put:", "new:", "yourself"]}),
  2218. smalltalk.Array.klass);
  2219. smalltalk.addMethod(
  2220. smalltalk.method({
  2221. selector: "withAll:",
  2222. fn: function (aCollection){
  2223. var self=this;
  2224. var instance,index;
  2225. return smalltalk.withContext(function($ctx1) {
  2226. var $1;
  2227. index=(1);
  2228. instance=self._new_(_st(aCollection)._size());
  2229. _st(aCollection)._do_((function(each){
  2230. return smalltalk.withContext(function($ctx2) {
  2231. _st(instance)._at_put_(index,each);
  2232. index=_st(index).__plus((1));
  2233. return index;
  2234. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  2235. $1=instance;
  2236. return $1;
  2237. }, function($ctx1) {$ctx1.fill(self,"withAll:",{aCollection:aCollection,instance:instance,index:index},smalltalk.Array.klass)})},
  2238. messageSends: ["new:", "size", "do:", "at:put:", "+"]}),
  2239. smalltalk.Array.klass);
  2240. smalltalk.addClass('CharacterArray', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
  2241. smalltalk.addMethod(
  2242. smalltalk.method({
  2243. selector: ",",
  2244. fn: function (aString){
  2245. var self=this;
  2246. return smalltalk.withContext(function($ctx1) {
  2247. var $1;
  2248. $1=_st(self._asString()).__comma(_st(aString)._asString());
  2249. return $1;
  2250. }, function($ctx1) {$ctx1.fill(self,",",{aString:aString},smalltalk.CharacterArray)})},
  2251. messageSends: [",", "asString"]}),
  2252. smalltalk.CharacterArray);
  2253. smalltalk.addMethod(
  2254. smalltalk.method({
  2255. selector: "add:",
  2256. fn: function (anObject){
  2257. var self=this;
  2258. return smalltalk.withContext(function($ctx1) {
  2259. self._errorReadOnly();
  2260. return self}, function($ctx1) {$ctx1.fill(self,"add:",{anObject:anObject},smalltalk.CharacterArray)})},
  2261. messageSends: ["errorReadOnly"]}),
  2262. smalltalk.CharacterArray);
  2263. smalltalk.addMethod(
  2264. smalltalk.method({
  2265. selector: "asLowercase",
  2266. fn: function (){
  2267. var self=this;
  2268. return smalltalk.withContext(function($ctx1) {
  2269. var $1;
  2270. $1=_st(self._class())._fromString_(_st(self._asString())._asLowercase());
  2271. return $1;
  2272. }, function($ctx1) {$ctx1.fill(self,"asLowercase",{},smalltalk.CharacterArray)})},
  2273. messageSends: ["fromString:", "asLowercase", "asString", "class"]}),
  2274. smalltalk.CharacterArray);
  2275. smalltalk.addMethod(
  2276. smalltalk.method({
  2277. selector: "asNumber",
  2278. fn: function (){
  2279. var self=this;
  2280. return smalltalk.withContext(function($ctx1) {
  2281. var $1;
  2282. $1=_st(self._asString())._asNumber();
  2283. return $1;
  2284. }, function($ctx1) {$ctx1.fill(self,"asNumber",{},smalltalk.CharacterArray)})},
  2285. messageSends: ["asNumber", "asString"]}),
  2286. smalltalk.CharacterArray);
  2287. smalltalk.addMethod(
  2288. smalltalk.method({
  2289. selector: "asString",
  2290. fn: function (){
  2291. var self=this;
  2292. return smalltalk.withContext(function($ctx1) {
  2293. var $1;
  2294. $1=self._subclassResponsibility();
  2295. return $1;
  2296. }, function($ctx1) {$ctx1.fill(self,"asString",{},smalltalk.CharacterArray)})},
  2297. messageSends: ["subclassResponsibility"]}),
  2298. smalltalk.CharacterArray);
  2299. smalltalk.addMethod(
  2300. smalltalk.method({
  2301. selector: "asSymbol",
  2302. fn: function (){
  2303. var self=this;
  2304. return smalltalk.withContext(function($ctx1) {
  2305. var $1;
  2306. $1=self._asString();
  2307. return $1;
  2308. }, function($ctx1) {$ctx1.fill(self,"asSymbol",{},smalltalk.CharacterArray)})},
  2309. messageSends: ["asString"]}),
  2310. smalltalk.CharacterArray);
  2311. smalltalk.addMethod(
  2312. smalltalk.method({
  2313. selector: "asUppercase",
  2314. fn: function (){
  2315. var self=this;
  2316. return smalltalk.withContext(function($ctx1) {
  2317. var $1;
  2318. $1=_st(self._class())._fromString_(_st(self._asString())._asUppercase());
  2319. return $1;
  2320. }, function($ctx1) {$ctx1.fill(self,"asUppercase",{},smalltalk.CharacterArray)})},
  2321. messageSends: ["fromString:", "asUppercase", "asString", "class"]}),
  2322. smalltalk.CharacterArray);
  2323. smalltalk.addMethod(
  2324. smalltalk.method({
  2325. selector: "at:put:",
  2326. fn: function (anIndex,anObject){
  2327. var self=this;
  2328. return smalltalk.withContext(function($ctx1) {
  2329. self._errorReadOnly();
  2330. return self}, function($ctx1) {$ctx1.fill(self,"at:put:",{anIndex:anIndex,anObject:anObject},smalltalk.CharacterArray)})},
  2331. messageSends: ["errorReadOnly"]}),
  2332. smalltalk.CharacterArray);
  2333. smalltalk.addMethod(
  2334. smalltalk.method({
  2335. selector: "errorReadOnly",
  2336. fn: function (){
  2337. var self=this;
  2338. return smalltalk.withContext(function($ctx1) {
  2339. self._error_("Object is read-only");
  2340. return self}, function($ctx1) {$ctx1.fill(self,"errorReadOnly",{},smalltalk.CharacterArray)})},
  2341. messageSends: ["error:"]}),
  2342. smalltalk.CharacterArray);
  2343. smalltalk.addMethod(
  2344. smalltalk.method({
  2345. selector: "printOn:",
  2346. fn: function (aStream){
  2347. var self=this;
  2348. return smalltalk.withContext(function($ctx1) {
  2349. _st(self._asString())._printOn_(aStream);
  2350. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.CharacterArray)})},
  2351. messageSends: ["printOn:", "asString"]}),
  2352. smalltalk.CharacterArray);
  2353. smalltalk.addMethod(
  2354. smalltalk.method({
  2355. selector: "putOn:",
  2356. fn: function (aStream){
  2357. var self=this;
  2358. return smalltalk.withContext(function($ctx1) {
  2359. _st(aStream)._nextPutString_(self);
  2360. return self}, function($ctx1) {$ctx1.fill(self,"putOn:",{aStream:aStream},smalltalk.CharacterArray)})},
  2361. messageSends: ["nextPutString:"]}),
  2362. smalltalk.CharacterArray);
  2363. smalltalk.addMethod(
  2364. smalltalk.method({
  2365. selector: "remove:",
  2366. fn: function (anObject){
  2367. var self=this;
  2368. return smalltalk.withContext(function($ctx1) {
  2369. self._errorReadOnly();
  2370. return self}, function($ctx1) {$ctx1.fill(self,"remove:",{anObject:anObject},smalltalk.CharacterArray)})},
  2371. messageSends: ["errorReadOnly"]}),
  2372. smalltalk.CharacterArray);
  2373. smalltalk.addMethod(
  2374. smalltalk.method({
  2375. selector: "fromString:",
  2376. fn: function (aString){
  2377. var self=this;
  2378. return smalltalk.withContext(function($ctx1) {
  2379. self._subclassResponsibility();
  2380. return self}, function($ctx1) {$ctx1.fill(self,"fromString:",{aString:aString},smalltalk.CharacterArray.klass)})},
  2381. messageSends: ["subclassResponsibility"]}),
  2382. smalltalk.CharacterArray.klass);
  2383. smalltalk.addClass('String', smalltalk.CharacterArray, [], 'Kernel-Collections');
  2384. smalltalk.addMethod(
  2385. smalltalk.method({
  2386. selector: ",",
  2387. fn: function (aString){
  2388. var self=this;
  2389. return smalltalk.withContext(function($ctx1) {
  2390. return self + aString;
  2391. return self}, function($ctx1) {$ctx1.fill(self,",",{aString:aString},smalltalk.String)})},
  2392. messageSends: []}),
  2393. smalltalk.String);
  2394. smalltalk.addMethod(
  2395. smalltalk.method({
  2396. selector: "<",
  2397. fn: function (aString){
  2398. var self=this;
  2399. return smalltalk.withContext(function($ctx1) {
  2400. return String(self) < aString._asString();
  2401. return self}, function($ctx1) {$ctx1.fill(self,"<",{aString:aString},smalltalk.String)})},
  2402. messageSends: []}),
  2403. smalltalk.String);
  2404. smalltalk.addMethod(
  2405. smalltalk.method({
  2406. selector: "<=",
  2407. fn: function (aString){
  2408. var self=this;
  2409. return smalltalk.withContext(function($ctx1) {
  2410. return String(self) <= aString._asString();
  2411. return self}, function($ctx1) {$ctx1.fill(self,"<=",{aString:aString},smalltalk.String)})},
  2412. messageSends: []}),
  2413. smalltalk.String);
  2414. smalltalk.addMethod(
  2415. smalltalk.method({
  2416. selector: "=",
  2417. fn: function (aString){
  2418. var self=this;
  2419. return smalltalk.withContext(function($ctx1) {
  2420. if(typeof aString === 'undefined') { return false }
  2421. if(!aString._isString || ! aString._isString()) {
  2422. return false;
  2423. }
  2424. return String(self) === String(aString)
  2425. ;
  2426. return self}, function($ctx1) {$ctx1.fill(self,"=",{aString:aString},smalltalk.String)})},
  2427. messageSends: []}),
  2428. smalltalk.String);
  2429. smalltalk.addMethod(
  2430. smalltalk.method({
  2431. selector: "==",
  2432. fn: function (aString){
  2433. var self=this;
  2434. return smalltalk.withContext(function($ctx1) {
  2435. var $1;
  2436. $1=self.__eq(aString);
  2437. return $1;
  2438. }, function($ctx1) {$ctx1.fill(self,"==",{aString:aString},smalltalk.String)})},
  2439. messageSends: ["="]}),
  2440. smalltalk.String);
  2441. smalltalk.addMethod(
  2442. smalltalk.method({
  2443. selector: ">",
  2444. fn: function (aString){
  2445. var self=this;
  2446. return smalltalk.withContext(function($ctx1) {
  2447. return String(self) > aString._asString();
  2448. return self}, function($ctx1) {$ctx1.fill(self,">",{aString:aString},smalltalk.String)})},
  2449. messageSends: []}),
  2450. smalltalk.String);
  2451. smalltalk.addMethod(
  2452. smalltalk.method({
  2453. selector: ">=",
  2454. fn: function (aString){
  2455. var self=this;
  2456. return smalltalk.withContext(function($ctx1) {
  2457. return String(self) >= aString._asString();
  2458. return self}, function($ctx1) {$ctx1.fill(self,">=",{aString:aString},smalltalk.String)})},
  2459. messageSends: []}),
  2460. smalltalk.String);
  2461. smalltalk.addMethod(
  2462. smalltalk.method({
  2463. selector: "asJSON",
  2464. fn: function (){
  2465. var self=this;
  2466. return smalltalk.withContext(function($ctx1) {
  2467. var $1;
  2468. $1=self;
  2469. return $1;
  2470. }, function($ctx1) {$ctx1.fill(self,"asJSON",{},smalltalk.String)})},
  2471. messageSends: []}),
  2472. smalltalk.String);
  2473. smalltalk.addMethod(
  2474. smalltalk.method({
  2475. selector: "asJavascript",
  2476. fn: function (){
  2477. var self=this;
  2478. return smalltalk.withContext(function($ctx1) {
  2479. if(self.search(/^[a-zA-Z0-9_:.$ ]*$/) == -1)
  2480. return "\"" + self.replace(/[\x00-\x1f"\\\x7f-\x9f]/g, function(ch){var c=ch.charCodeAt(0);return "\\x"+("0"+c.toString(16)).slice(-2)}) + "\"";
  2481. else
  2482. return "\"" + self + "\"";
  2483. ;
  2484. return self}, function($ctx1) {$ctx1.fill(self,"asJavascript",{},smalltalk.String)})},
  2485. messageSends: []}),
  2486. smalltalk.String);
  2487. smalltalk.addMethod(
  2488. smalltalk.method({
  2489. selector: "asLowercase",
  2490. fn: function (){
  2491. var self=this;
  2492. return smalltalk.withContext(function($ctx1) {
  2493. return self.toLowerCase();
  2494. return self}, function($ctx1) {$ctx1.fill(self,"asLowercase",{},smalltalk.String)})},
  2495. messageSends: []}),
  2496. smalltalk.String);
  2497. smalltalk.addMethod(
  2498. smalltalk.method({
  2499. selector: "asNumber",
  2500. fn: function (){
  2501. var self=this;
  2502. return smalltalk.withContext(function($ctx1) {
  2503. return Number(self);
  2504. return self}, function($ctx1) {$ctx1.fill(self,"asNumber",{},smalltalk.String)})},
  2505. messageSends: []}),
  2506. smalltalk.String);
  2507. smalltalk.addMethod(
  2508. smalltalk.method({
  2509. selector: "asRegexp",
  2510. fn: function (){
  2511. var self=this;
  2512. function $RegularExpression(){return smalltalk.RegularExpression||(typeof RegularExpression=="undefined"?nil:RegularExpression)}
  2513. return smalltalk.withContext(function($ctx1) {
  2514. var $1;
  2515. $1=_st($RegularExpression())._fromString_(self);
  2516. return $1;
  2517. }, function($ctx1) {$ctx1.fill(self,"asRegexp",{},smalltalk.String)})},
  2518. messageSends: ["fromString:"]}),
  2519. smalltalk.String);
  2520. smalltalk.addMethod(
  2521. smalltalk.method({
  2522. selector: "asSelector",
  2523. fn: function (){
  2524. var self=this;
  2525. return smalltalk.withContext(function($ctx1) {
  2526. return smalltalk.selector(self);
  2527. return self}, function($ctx1) {$ctx1.fill(self,"asSelector",{},smalltalk.String)})},
  2528. messageSends: []}),
  2529. smalltalk.String);
  2530. smalltalk.addMethod(
  2531. smalltalk.method({
  2532. selector: "asString",
  2533. fn: function (){
  2534. var self=this;
  2535. return smalltalk.withContext(function($ctx1) {
  2536. var $1;
  2537. $1=self;
  2538. return $1;
  2539. }, function($ctx1) {$ctx1.fill(self,"asString",{},smalltalk.String)})},
  2540. messageSends: []}),
  2541. smalltalk.String);
  2542. smalltalk.addMethod(
  2543. smalltalk.method({
  2544. selector: "asSymbol",
  2545. fn: function (){
  2546. var self=this;
  2547. return smalltalk.withContext(function($ctx1) {
  2548. var $1;
  2549. $1=self;
  2550. return $1;
  2551. }, function($ctx1) {$ctx1.fill(self,"asSymbol",{},smalltalk.String)})},
  2552. messageSends: []}),
  2553. smalltalk.String);
  2554. smalltalk.addMethod(
  2555. smalltalk.method({
  2556. selector: "asUppercase",
  2557. fn: function (){
  2558. var self=this;
  2559. return smalltalk.withContext(function($ctx1) {
  2560. return self.toUpperCase();
  2561. return self}, function($ctx1) {$ctx1.fill(self,"asUppercase",{},smalltalk.String)})},
  2562. messageSends: []}),
  2563. smalltalk.String);
  2564. smalltalk.addMethod(
  2565. smalltalk.method({
  2566. selector: "asciiValue",
  2567. fn: function (){
  2568. var self=this;
  2569. return smalltalk.withContext(function($ctx1) {
  2570. return self.charCodeAt(0);;
  2571. return self}, function($ctx1) {$ctx1.fill(self,"asciiValue",{},smalltalk.String)})},
  2572. messageSends: []}),
  2573. smalltalk.String);
  2574. smalltalk.addMethod(
  2575. smalltalk.method({
  2576. selector: "at:ifAbsent:",
  2577. fn: function (anIndex,aBlock){
  2578. var self=this;
  2579. return smalltalk.withContext(function($ctx1) {
  2580. return String(self).charAt(anIndex - 1) || aBlock._value();
  2581. return self}, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{anIndex:anIndex,aBlock:aBlock},smalltalk.String)})},
  2582. messageSends: []}),
  2583. smalltalk.String);
  2584. smalltalk.addMethod(
  2585. smalltalk.method({
  2586. selector: "at:ifPresent:ifAbsent:",
  2587. fn: function (anIndex,aBlock,anotherBlock){
  2588. var self=this;
  2589. return smalltalk.withContext(function($ctx1) {
  2590. var result = String(self).charAt(anIndex - 1);
  2591. return result ? aBlock._value_(result) : anotherBlock._value();
  2592. ;
  2593. return self}, function($ctx1) {$ctx1.fill(self,"at:ifPresent:ifAbsent:",{anIndex:anIndex,aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.String)})},
  2594. messageSends: []}),
  2595. smalltalk.String);
  2596. smalltalk.addMethod(
  2597. smalltalk.method({
  2598. selector: "charCodeAt:",
  2599. fn: function (anInteger){
  2600. var self=this;
  2601. return smalltalk.withContext(function($ctx1) {
  2602. return self.charCodeAt(anInteger - 1) ;
  2603. return self}, function($ctx1) {$ctx1.fill(self,"charCodeAt:",{anInteger:anInteger},smalltalk.String)})},
  2604. messageSends: []}),
  2605. smalltalk.String);
  2606. smalltalk.addMethod(
  2607. smalltalk.method({
  2608. selector: "copyFrom:to:",
  2609. fn: function (anIndex,anotherIndex){
  2610. var self=this;
  2611. return smalltalk.withContext(function($ctx1) {
  2612. return self.substring(anIndex - 1, anotherIndex);
  2613. return self}, function($ctx1) {$ctx1.fill(self,"copyFrom:to:",{anIndex:anIndex,anotherIndex:anotherIndex},smalltalk.String)})},
  2614. messageSends: []}),
  2615. smalltalk.String);
  2616. smalltalk.addMethod(
  2617. smalltalk.method({
  2618. selector: "crlfSanitized",
  2619. fn: function (){
  2620. var self=this;
  2621. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  2622. return smalltalk.withContext(function($ctx1) {
  2623. var $1;
  2624. $1=_st(self._lines())._join_(_st($String())._lf());
  2625. return $1;
  2626. }, function($ctx1) {$ctx1.fill(self,"crlfSanitized",{},smalltalk.String)})},
  2627. messageSends: ["join:", "lf", "lines"]}),
  2628. smalltalk.String);
  2629. smalltalk.addMethod(
  2630. smalltalk.method({
  2631. selector: "deepCopy",
  2632. fn: function (){
  2633. var self=this;
  2634. return smalltalk.withContext(function($ctx1) {
  2635. var $1;
  2636. $1=self._shallowCopy();
  2637. return $1;
  2638. }, function($ctx1) {$ctx1.fill(self,"deepCopy",{},smalltalk.String)})},
  2639. messageSends: ["shallowCopy"]}),
  2640. smalltalk.String);
  2641. smalltalk.addMethod(
  2642. smalltalk.method({
  2643. selector: "do:",
  2644. fn: function (aBlock){
  2645. var self=this;
  2646. return smalltalk.withContext(function($ctx1) {
  2647. for(var i=0;i<self.length;i++){aBlock._value_(self.charAt(i));};
  2648. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.String)})},
  2649. messageSends: []}),
  2650. smalltalk.String);
  2651. smalltalk.addMethod(
  2652. smalltalk.method({
  2653. selector: "escaped",
  2654. fn: function (){
  2655. var self=this;
  2656. return smalltalk.withContext(function($ctx1) {
  2657. return escape(self);
  2658. return self}, function($ctx1) {$ctx1.fill(self,"escaped",{},smalltalk.String)})},
  2659. messageSends: []}),
  2660. smalltalk.String);
  2661. smalltalk.addMethod(
  2662. smalltalk.method({
  2663. selector: "includesSubString:",
  2664. fn: function (subString){
  2665. var self=this;
  2666. return smalltalk.withContext(function($ctx1) {
  2667. return self.indexOf(subString) != -1 ;
  2668. return self}, function($ctx1) {$ctx1.fill(self,"includesSubString:",{subString:subString},smalltalk.String)})},
  2669. messageSends: []}),
  2670. smalltalk.String);
  2671. smalltalk.addMethod(
  2672. smalltalk.method({
  2673. selector: "isImmutable",
  2674. fn: function (){
  2675. var self=this;
  2676. return smalltalk.withContext(function($ctx1) {
  2677. return true;
  2678. }, function($ctx1) {$ctx1.fill(self,"isImmutable",{},smalltalk.String)})},
  2679. messageSends: []}),
  2680. smalltalk.String);
  2681. smalltalk.addMethod(
  2682. smalltalk.method({
  2683. selector: "isString",
  2684. fn: function (){
  2685. var self=this;
  2686. return smalltalk.withContext(function($ctx1) {
  2687. return true;
  2688. }, function($ctx1) {$ctx1.fill(self,"isString",{},smalltalk.String)})},
  2689. messageSends: []}),
  2690. smalltalk.String);
  2691. smalltalk.addMethod(
  2692. smalltalk.method({
  2693. selector: "isVowel",
  2694. fn: function (){
  2695. var self=this;
  2696. return smalltalk.withContext(function($ctx1) {
  2697. var $1;
  2698. $1=_st(_st(self._size()).__eq((1)))._and_((function(){
  2699. return smalltalk.withContext(function($ctx2) {
  2700. return "aeiou"._includes_(self._asLowercase());
  2701. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2702. return $1;
  2703. }, function($ctx1) {$ctx1.fill(self,"isVowel",{},smalltalk.String)})},
  2704. messageSends: ["and:", "includes:", "asLowercase", "=", "size"]}),
  2705. smalltalk.String);
  2706. smalltalk.addMethod(
  2707. smalltalk.method({
  2708. selector: "join:",
  2709. fn: function (aCollection){
  2710. var self=this;
  2711. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  2712. return smalltalk.withContext(function($ctx1) {
  2713. var $1;
  2714. $1=_st($String())._streamContents_((function(stream){
  2715. return smalltalk.withContext(function($ctx2) {
  2716. return _st(aCollection)._do_separatedBy_((function(each){
  2717. return smalltalk.withContext(function($ctx3) {
  2718. return _st(stream)._nextPutAll_(_st(each)._asString());
  2719. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2)})}),(function(){
  2720. return smalltalk.withContext(function($ctx3) {
  2721. return _st(stream)._nextPutAll_(self);
  2722. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2723. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
  2724. return $1;
  2725. }, function($ctx1) {$ctx1.fill(self,"join:",{aCollection:aCollection},smalltalk.String)})},
  2726. messageSends: ["streamContents:", "do:separatedBy:", "nextPutAll:", "asString"]}),
  2727. smalltalk.String);
  2728. smalltalk.addMethod(
  2729. smalltalk.method({
  2730. selector: "lineIndicesDo:",
  2731. fn: function (aBlock){
  2732. var self=this;
  2733. var cr,lf,start,sz,nextLF,nextCR;
  2734. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  2735. return smalltalk.withContext(function($ctx1) {
  2736. var $1,$2,$3,$4;
  2737. var $early={};
  2738. try {
  2739. start=(1);
  2740. sz=self._size();
  2741. cr=_st($String())._cr();
  2742. nextCR=self._indexOf_startingAt_(cr,(1));
  2743. lf=_st($String())._lf();
  2744. nextLF=self._indexOf_startingAt_(lf,(1));
  2745. _st((function(){
  2746. return smalltalk.withContext(function($ctx2) {
  2747. return _st(start).__lt_eq(sz);
  2748. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  2749. return smalltalk.withContext(function($ctx2) {
  2750. $1=_st(_st(nextLF).__eq((0)))._and_((function(){
  2751. return smalltalk.withContext(function($ctx3) {
  2752. return _st(nextCR).__eq((0));
  2753. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2754. if(smalltalk.assert($1)){
  2755. _st(aBlock)._value_value_value_(start,sz,sz);
  2756. $2=self;
  2757. throw $early=[$2];
  2758. };
  2759. $3=_st(_st(nextCR).__eq((0)))._or_((function(){
  2760. return smalltalk.withContext(function($ctx3) {
  2761. return _st((0).__lt(nextLF))._and_((function(){
  2762. return smalltalk.withContext(function($ctx4) {
  2763. return _st(nextLF).__lt(nextCR);
  2764. }, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
  2765. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2766. if(smalltalk.assert($3)){
  2767. _st(aBlock)._value_value_value_(start,_st(nextLF).__minus((1)),nextLF);
  2768. start=(1).__plus(nextLF);
  2769. start;
  2770. nextLF=self._indexOf_startingAt_(lf,start);
  2771. return nextLF;
  2772. } else {
  2773. $4=_st((1).__plus(nextCR)).__eq(nextLF);
  2774. if(smalltalk.assert($4)){
  2775. _st(aBlock)._value_value_value_(start,_st(nextCR).__minus((1)),nextLF);
  2776. start=(1).__plus(nextLF);
  2777. start;
  2778. nextCR=self._indexOf_startingAt_(cr,start);
  2779. nextCR;
  2780. nextLF=self._indexOf_startingAt_(lf,start);
  2781. return nextLF;
  2782. } else {
  2783. _st(aBlock)._value_value_value_(start,_st(nextCR).__minus((1)),nextCR);
  2784. start=(1).__plus(nextCR);
  2785. start;
  2786. nextCR=self._indexOf_startingAt_(cr,start);
  2787. return nextCR;
  2788. };
  2789. };
  2790. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2791. return self}
  2792. catch(e) {if(e===$early)return e[0]; throw e}
  2793. }, function($ctx1) {$ctx1.fill(self,"lineIndicesDo:",{aBlock:aBlock,cr:cr,lf:lf,start:start,sz:sz,nextLF:nextLF,nextCR:nextCR},smalltalk.String)})},
  2794. messageSends: ["size", "cr", "indexOf:startingAt:", "lf", "whileTrue:", "ifTrue:", "value:value:value:", "and:", "=", "ifTrue:ifFalse:", "-", "+", "or:", "<", "<="]}),
  2795. smalltalk.String);
  2796. smalltalk.addMethod(
  2797. smalltalk.method({
  2798. selector: "lineNumber:",
  2799. fn: function (anIndex){
  2800. var self=this;
  2801. var lineCount;
  2802. return smalltalk.withContext(function($ctx1) {
  2803. var $1,$2;
  2804. var $early={};
  2805. try {
  2806. lineCount=(0);
  2807. self._lineIndicesDo_((function(start,endWithoutDelimiters,end){
  2808. return smalltalk.withContext(function($ctx2) {
  2809. lineCount=_st(lineCount).__plus((1));
  2810. $1=_st(lineCount).__eq(anIndex);
  2811. if(smalltalk.assert($1)){
  2812. $2=self._copyFrom_to_(start,endWithoutDelimiters);
  2813. throw $early=[$2];
  2814. };
  2815. }, function($ctx2) {$ctx2.fillBlock({start:start,endWithoutDelimiters:endWithoutDelimiters,end:end},$ctx1)})}));
  2816. return nil;
  2817. }
  2818. catch(e) {if(e===$early)return e[0]; throw e}
  2819. }, function($ctx1) {$ctx1.fill(self,"lineNumber:",{anIndex:anIndex,lineCount:lineCount},smalltalk.String)})},
  2820. messageSends: ["lineIndicesDo:", "ifTrue:", "copyFrom:to:", "=", "+"]}),
  2821. smalltalk.String);
  2822. smalltalk.addMethod(
  2823. smalltalk.method({
  2824. selector: "lines",
  2825. fn: function (){
  2826. var self=this;
  2827. var lines;
  2828. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  2829. return smalltalk.withContext(function($ctx1) {
  2830. var $1;
  2831. lines=_st($Array())._new();
  2832. self._linesDo_((function(aLine){
  2833. return smalltalk.withContext(function($ctx2) {
  2834. return _st(lines)._add_(aLine);
  2835. }, function($ctx2) {$ctx2.fillBlock({aLine:aLine},$ctx1)})}));
  2836. $1=lines;
  2837. return $1;
  2838. }, function($ctx1) {$ctx1.fill(self,"lines",{lines:lines},smalltalk.String)})},
  2839. messageSends: ["new", "linesDo:", "add:"]}),
  2840. smalltalk.String);
  2841. smalltalk.addMethod(
  2842. smalltalk.method({
  2843. selector: "linesDo:",
  2844. fn: function (aBlock){
  2845. var self=this;
  2846. return smalltalk.withContext(function($ctx1) {
  2847. self._lineIndicesDo_((function(start,endWithoutDelimiters,end){
  2848. return smalltalk.withContext(function($ctx2) {
  2849. return _st(aBlock)._value_(self._copyFrom_to_(start,endWithoutDelimiters));
  2850. }, function($ctx2) {$ctx2.fillBlock({start:start,endWithoutDelimiters:endWithoutDelimiters,end:end},$ctx1)})}));
  2851. return self}, function($ctx1) {$ctx1.fill(self,"linesDo:",{aBlock:aBlock},smalltalk.String)})},
  2852. messageSends: ["lineIndicesDo:", "value:", "copyFrom:to:"]}),
  2853. smalltalk.String);
  2854. smalltalk.addMethod(
  2855. smalltalk.method({
  2856. selector: "match:",
  2857. fn: function (aRegexp){
  2858. var self=this;
  2859. return smalltalk.withContext(function($ctx1) {
  2860. return self.search(aRegexp) != -1;
  2861. return self}, function($ctx1) {$ctx1.fill(self,"match:",{aRegexp:aRegexp},smalltalk.String)})},
  2862. messageSends: []}),
  2863. smalltalk.String);
  2864. smalltalk.addMethod(
  2865. smalltalk.method({
  2866. selector: "matchesOf:",
  2867. fn: function (aRegularExpression){
  2868. var self=this;
  2869. return smalltalk.withContext(function($ctx1) {
  2870. return self.match(aRegularExpression);
  2871. return self}, function($ctx1) {$ctx1.fill(self,"matchesOf:",{aRegularExpression:aRegularExpression},smalltalk.String)})},
  2872. messageSends: []}),
  2873. smalltalk.String);
  2874. smalltalk.addMethod(
  2875. smalltalk.method({
  2876. selector: "printNl",
  2877. fn: function (){
  2878. var self=this;
  2879. return smalltalk.withContext(function($ctx1) {
  2880. console.log(self);
  2881. return self}, function($ctx1) {$ctx1.fill(self,"printNl",{},smalltalk.String)})},
  2882. messageSends: []}),
  2883. smalltalk.String);
  2884. smalltalk.addMethod(
  2885. smalltalk.method({
  2886. selector: "printOn:",
  2887. fn: function (aStream){
  2888. var self=this;
  2889. return smalltalk.withContext(function($ctx1) {
  2890. var $1,$2;
  2891. $1=aStream;
  2892. _st($1)._nextPutAll_("'");
  2893. _st($1)._nextPutAll_(self);
  2894. $2=_st($1)._nextPutAll_("'");
  2895. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.String)})},
  2896. messageSends: ["nextPutAll:"]}),
  2897. smalltalk.String);
  2898. smalltalk.addMethod(
  2899. smalltalk.method({
  2900. selector: "replace:with:",
  2901. fn: function (aString,anotherString){
  2902. var self=this;
  2903. function $RegularExpression(){return smalltalk.RegularExpression||(typeof RegularExpression=="undefined"?nil:RegularExpression)}
  2904. return smalltalk.withContext(function($ctx1) {
  2905. var $1;
  2906. $1=self._replaceRegexp_with_(_st($RegularExpression())._fromString_flag_(aString,"g"),anotherString);
  2907. return $1;
  2908. }, function($ctx1) {$ctx1.fill(self,"replace:with:",{aString:aString,anotherString:anotherString},smalltalk.String)})},
  2909. messageSends: ["replaceRegexp:with:", "fromString:flag:"]}),
  2910. smalltalk.String);
  2911. smalltalk.addMethod(
  2912. smalltalk.method({
  2913. selector: "replaceRegexp:with:",
  2914. fn: function (aRegexp,aString){
  2915. var self=this;
  2916. return smalltalk.withContext(function($ctx1) {
  2917. return self.replace(aRegexp, aString);
  2918. return self}, function($ctx1) {$ctx1.fill(self,"replaceRegexp:with:",{aRegexp:aRegexp,aString:aString},smalltalk.String)})},
  2919. messageSends: []}),
  2920. smalltalk.String);
  2921. smalltalk.addMethod(
  2922. smalltalk.method({
  2923. selector: "reversed",
  2924. fn: function (){
  2925. var self=this;
  2926. return smalltalk.withContext(function($ctx1) {
  2927. return self.split("").reverse().join("");
  2928. return self}, function($ctx1) {$ctx1.fill(self,"reversed",{},smalltalk.String)})},
  2929. messageSends: []}),
  2930. smalltalk.String);
  2931. smalltalk.addMethod(
  2932. smalltalk.method({
  2933. selector: "shallowCopy",
  2934. fn: function (){
  2935. var self=this;
  2936. return smalltalk.withContext(function($ctx1) {
  2937. var $1;
  2938. $1=_st(self._class())._fromString_(self);
  2939. return $1;
  2940. }, function($ctx1) {$ctx1.fill(self,"shallowCopy",{},smalltalk.String)})},
  2941. messageSends: ["fromString:", "class"]}),
  2942. smalltalk.String);
  2943. smalltalk.addMethod(
  2944. smalltalk.method({
  2945. selector: "size",
  2946. fn: function (){
  2947. var self=this;
  2948. return smalltalk.withContext(function($ctx1) {
  2949. return self.length;
  2950. return self}, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.String)})},
  2951. messageSends: []}),
  2952. smalltalk.String);
  2953. smalltalk.addMethod(
  2954. smalltalk.method({
  2955. selector: "subStrings:",
  2956. fn: function (aString){
  2957. var self=this;
  2958. return smalltalk.withContext(function($ctx1) {
  2959. var $1;
  2960. $1=self._tokenize_(aString);
  2961. return $1;
  2962. }, function($ctx1) {$ctx1.fill(self,"subStrings:",{aString:aString},smalltalk.String)})},
  2963. messageSends: ["tokenize:"]}),
  2964. smalltalk.String);
  2965. smalltalk.addMethod(
  2966. smalltalk.method({
  2967. selector: "tokenize:",
  2968. fn: function (aString){
  2969. var self=this;
  2970. return smalltalk.withContext(function($ctx1) {
  2971. return self.split(aString);
  2972. return self}, function($ctx1) {$ctx1.fill(self,"tokenize:",{aString:aString},smalltalk.String)})},
  2973. messageSends: []}),
  2974. smalltalk.String);
  2975. smalltalk.addMethod(
  2976. smalltalk.method({
  2977. selector: "trimBoth",
  2978. fn: function (){
  2979. var self=this;
  2980. return smalltalk.withContext(function($ctx1) {
  2981. var $1;
  2982. $1=self._trimBoth_("\x5cs");
  2983. return $1;
  2984. }, function($ctx1) {$ctx1.fill(self,"trimBoth",{},smalltalk.String)})},
  2985. messageSends: ["trimBoth:"]}),
  2986. smalltalk.String);
  2987. smalltalk.addMethod(
  2988. smalltalk.method({
  2989. selector: "trimBoth:",
  2990. fn: function (separators){
  2991. var self=this;
  2992. return smalltalk.withContext(function($ctx1) {
  2993. var $1;
  2994. $1=_st(self._trimLeft_(separators))._trimRight_(separators);
  2995. return $1;
  2996. }, function($ctx1) {$ctx1.fill(self,"trimBoth:",{separators:separators},smalltalk.String)})},
  2997. messageSends: ["trimRight:", "trimLeft:"]}),
  2998. smalltalk.String);
  2999. smalltalk.addMethod(
  3000. smalltalk.method({
  3001. selector: "trimLeft",
  3002. fn: function (){
  3003. var self=this;
  3004. return smalltalk.withContext(function($ctx1) {
  3005. var $1;
  3006. $1=self._trimLeft_("\x5cs");
  3007. return $1;
  3008. }, function($ctx1) {$ctx1.fill(self,"trimLeft",{},smalltalk.String)})},
  3009. messageSends: ["trimLeft:"]}),
  3010. smalltalk.String);
  3011. smalltalk.addMethod(
  3012. smalltalk.method({
  3013. selector: "trimLeft:",
  3014. fn: function (separators){
  3015. var self=this;
  3016. function $RegularExpression(){return smalltalk.RegularExpression||(typeof RegularExpression=="undefined"?nil:RegularExpression)}
  3017. return smalltalk.withContext(function($ctx1) {
  3018. var $1;
  3019. $1=self._replaceRegexp_with_(_st($RegularExpression())._fromString_flag_(_st("^[".__comma(separators)).__comma("]+"),"g"),"");
  3020. return $1;
  3021. }, function($ctx1) {$ctx1.fill(self,"trimLeft:",{separators:separators},smalltalk.String)})},
  3022. messageSends: ["replaceRegexp:with:", "fromString:flag:", ","]}),
  3023. smalltalk.String);
  3024. smalltalk.addMethod(
  3025. smalltalk.method({
  3026. selector: "trimRight",
  3027. fn: function (){
  3028. var self=this;
  3029. return smalltalk.withContext(function($ctx1) {
  3030. var $1;
  3031. $1=self._trimRight_("\x5cs");
  3032. return $1;
  3033. }, function($ctx1) {$ctx1.fill(self,"trimRight",{},smalltalk.String)})},
  3034. messageSends: ["trimRight:"]}),
  3035. smalltalk.String);
  3036. smalltalk.addMethod(
  3037. smalltalk.method({
  3038. selector: "trimRight:",
  3039. fn: function (separators){
  3040. var self=this;
  3041. function $RegularExpression(){return smalltalk.RegularExpression||(typeof RegularExpression=="undefined"?nil:RegularExpression)}
  3042. return smalltalk.withContext(function($ctx1) {
  3043. var $1;
  3044. $1=self._replaceRegexp_with_(_st($RegularExpression())._fromString_flag_(_st("[".__comma(separators)).__comma("]+$"),"g"),"");
  3045. return $1;
  3046. }, function($ctx1) {$ctx1.fill(self,"trimRight:",{separators:separators},smalltalk.String)})},
  3047. messageSends: ["replaceRegexp:with:", "fromString:flag:", ","]}),
  3048. smalltalk.String);
  3049. smalltalk.addMethod(
  3050. smalltalk.method({
  3051. selector: "unescaped",
  3052. fn: function (){
  3053. var self=this;
  3054. return smalltalk.withContext(function($ctx1) {
  3055. return unescape(self);
  3056. return self}, function($ctx1) {$ctx1.fill(self,"unescaped",{},smalltalk.String)})},
  3057. messageSends: []}),
  3058. smalltalk.String);
  3059. smalltalk.addMethod(
  3060. smalltalk.method({
  3061. selector: "withIndexDo:",
  3062. fn: function (aBlock){
  3063. var self=this;
  3064. return smalltalk.withContext(function($ctx1) {
  3065. for(var i=0;i<self.length;i++){aBlock._value_value_(self.charAt(i), i+1);};
  3066. return self}, function($ctx1) {$ctx1.fill(self,"withIndexDo:",{aBlock:aBlock},smalltalk.String)})},
  3067. messageSends: []}),
  3068. smalltalk.String);
  3069. smalltalk.addMethod(
  3070. smalltalk.method({
  3071. selector: "cr",
  3072. fn: function (){
  3073. var self=this;
  3074. return smalltalk.withContext(function($ctx1) {
  3075. return '\r';
  3076. return self}, function($ctx1) {$ctx1.fill(self,"cr",{},smalltalk.String.klass)})},
  3077. messageSends: []}),
  3078. smalltalk.String.klass);
  3079. smalltalk.addMethod(
  3080. smalltalk.method({
  3081. selector: "crlf",
  3082. fn: function (){
  3083. var self=this;
  3084. return smalltalk.withContext(function($ctx1) {
  3085. return '\r\n';
  3086. return self}, function($ctx1) {$ctx1.fill(self,"crlf",{},smalltalk.String.klass)})},
  3087. messageSends: []}),
  3088. smalltalk.String.klass);
  3089. smalltalk.addMethod(
  3090. smalltalk.method({
  3091. selector: "esc",
  3092. fn: function (){
  3093. var self=this;
  3094. return smalltalk.withContext(function($ctx1) {
  3095. var $1;
  3096. $1=self._fromCharCode_((27));
  3097. return $1;
  3098. }, function($ctx1) {$ctx1.fill(self,"esc",{},smalltalk.String.klass)})},
  3099. messageSends: ["fromCharCode:"]}),
  3100. smalltalk.String.klass);
  3101. smalltalk.addMethod(
  3102. smalltalk.method({
  3103. selector: "fromCharCode:",
  3104. fn: function (anInteger){
  3105. var self=this;
  3106. return smalltalk.withContext(function($ctx1) {
  3107. return String.fromCharCode(anInteger);
  3108. return self}, function($ctx1) {$ctx1.fill(self,"fromCharCode:",{anInteger:anInteger},smalltalk.String.klass)})},
  3109. messageSends: []}),
  3110. smalltalk.String.klass);
  3111. smalltalk.addMethod(
  3112. smalltalk.method({
  3113. selector: "fromString:",
  3114. fn: function (aString){
  3115. var self=this;
  3116. return smalltalk.withContext(function($ctx1) {
  3117. return String(aString);
  3118. return self}, function($ctx1) {$ctx1.fill(self,"fromString:",{aString:aString},smalltalk.String.klass)})},
  3119. messageSends: []}),
  3120. smalltalk.String.klass);
  3121. smalltalk.addMethod(
  3122. smalltalk.method({
  3123. selector: "lf",
  3124. fn: function (){
  3125. var self=this;
  3126. return smalltalk.withContext(function($ctx1) {
  3127. return '\n';
  3128. return self}, function($ctx1) {$ctx1.fill(self,"lf",{},smalltalk.String.klass)})},
  3129. messageSends: []}),
  3130. smalltalk.String.klass);
  3131. smalltalk.addMethod(
  3132. smalltalk.method({
  3133. selector: "random",
  3134. fn: function (){
  3135. var self=this;
  3136. return smalltalk.withContext(function($ctx1) {
  3137. return (Math.random()*(22/32)+(10/32)).toString(32).slice(2);;
  3138. return self}, function($ctx1) {$ctx1.fill(self,"random",{},smalltalk.String.klass)})},
  3139. messageSends: []}),
  3140. smalltalk.String.klass);
  3141. smalltalk.addMethod(
  3142. smalltalk.method({
  3143. selector: "randomNotIn:",
  3144. fn: function (aString){
  3145. var self=this;
  3146. var result;
  3147. return smalltalk.withContext(function($ctx1) {
  3148. var $1;
  3149. _st((function(){
  3150. return smalltalk.withContext(function($ctx2) {
  3151. result=self._random();
  3152. result;
  3153. return _st(aString)._includesSubString_(result);
  3154. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue();
  3155. $1=result;
  3156. return $1;
  3157. }, function($ctx1) {$ctx1.fill(self,"randomNotIn:",{aString:aString,result:result},smalltalk.String.klass)})},
  3158. messageSends: ["whileTrue", "random", "includesSubString:"]}),
  3159. smalltalk.String.klass);
  3160. smalltalk.addMethod(
  3161. smalltalk.method({
  3162. selector: "space",
  3163. fn: function (){
  3164. var self=this;
  3165. return smalltalk.withContext(function($ctx1) {
  3166. return ' ';
  3167. return self}, function($ctx1) {$ctx1.fill(self,"space",{},smalltalk.String.klass)})},
  3168. messageSends: []}),
  3169. smalltalk.String.klass);
  3170. smalltalk.addMethod(
  3171. smalltalk.method({
  3172. selector: "streamClass",
  3173. fn: function (){
  3174. var self=this;
  3175. function $StringStream(){return smalltalk.StringStream||(typeof StringStream=="undefined"?nil:StringStream)}
  3176. return smalltalk.withContext(function($ctx1) {
  3177. var $1;
  3178. $1=$StringStream();
  3179. return $1;
  3180. }, function($ctx1) {$ctx1.fill(self,"streamClass",{},smalltalk.String.klass)})},
  3181. messageSends: []}),
  3182. smalltalk.String.klass);
  3183. smalltalk.addMethod(
  3184. smalltalk.method({
  3185. selector: "tab",
  3186. fn: function (){
  3187. var self=this;
  3188. return smalltalk.withContext(function($ctx1) {
  3189. return '\t';
  3190. return self}, function($ctx1) {$ctx1.fill(self,"tab",{},smalltalk.String.klass)})},
  3191. messageSends: []}),
  3192. smalltalk.String.klass);
  3193. smalltalk.addMethod(
  3194. smalltalk.method({
  3195. selector: "value:",
  3196. fn: function (aUTFCharCode){
  3197. var self=this;
  3198. return smalltalk.withContext(function($ctx1) {
  3199. return String.fromCharCode(aUTFCharCode);;
  3200. return self}, function($ctx1) {$ctx1.fill(self,"value:",{aUTFCharCode:aUTFCharCode},smalltalk.String.klass)})},
  3201. messageSends: []}),
  3202. smalltalk.String.klass);
  3203. smalltalk.addClass('Set', smalltalk.Collection, ['elements'], 'Kernel-Collections');
  3204. smalltalk.addMethod(
  3205. smalltalk.method({
  3206. selector: "=",
  3207. fn: function (aCollection){
  3208. var self=this;
  3209. return smalltalk.withContext(function($ctx1) {
  3210. var $1,$2,$3;
  3211. var $early={};
  3212. try {
  3213. $1=_st(self._class()).__eq(_st(aCollection)._class());
  3214. if(! smalltalk.assert($1)){
  3215. return false;
  3216. };
  3217. $2=_st(self._size()).__eq(_st(aCollection)._size());
  3218. if(! smalltalk.assert($2)){
  3219. return false;
  3220. };
  3221. self._do_((function(each){
  3222. return smalltalk.withContext(function($ctx2) {
  3223. $3=_st(aCollection)._includes_(each);
  3224. if(! smalltalk.assert($3)){
  3225. throw $early=[false];
  3226. };
  3227. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3228. return true;
  3229. }
  3230. catch(e) {if(e===$early)return e[0]; throw e}
  3231. }, function($ctx1) {$ctx1.fill(self,"=",{aCollection:aCollection},smalltalk.Set)})},
  3232. messageSends: ["ifFalse:", "=", "class", "size", "do:", "includes:"]}),
  3233. smalltalk.Set);
  3234. smalltalk.addMethod(
  3235. smalltalk.method({
  3236. selector: "add:",
  3237. fn: function (anObject){
  3238. var self=this;
  3239. return smalltalk.withContext(function($ctx1) {
  3240. var found;
  3241. for(var i=0; i < self['@elements'].length; i++) {
  3242. if(_st(anObject).__eq(self['@elements'][i])) {
  3243. found = true;
  3244. break;
  3245. }
  3246. }
  3247. if(!found) {self['@elements'].push(anObject)}
  3248. ;
  3249. return self}, function($ctx1) {$ctx1.fill(self,"add:",{anObject:anObject},smalltalk.Set)})},
  3250. messageSends: []}),
  3251. smalltalk.Set);
  3252. smalltalk.addMethod(
  3253. smalltalk.method({
  3254. selector: "asArray",
  3255. fn: function (){
  3256. var self=this;
  3257. return smalltalk.withContext(function($ctx1) {
  3258. var $1;
  3259. $1=_st(self["@elements"])._copy();
  3260. return $1;
  3261. }, function($ctx1) {$ctx1.fill(self,"asArray",{},smalltalk.Set)})},
  3262. messageSends: ["copy"]}),
  3263. smalltalk.Set);
  3264. smalltalk.addMethod(
  3265. smalltalk.method({
  3266. selector: "collect:",
  3267. fn: function (aBlock){
  3268. var self=this;
  3269. return smalltalk.withContext(function($ctx1) {
  3270. var $1;
  3271. $1=_st(self._class())._withAll_(_st(self["@elements"])._collect_(aBlock));
  3272. return $1;
  3273. }, function($ctx1) {$ctx1.fill(self,"collect:",{aBlock:aBlock},smalltalk.Set)})},
  3274. messageSends: ["withAll:", "collect:", "class"]}),
  3275. smalltalk.Set);
  3276. smalltalk.addMethod(
  3277. smalltalk.method({
  3278. selector: "detect:ifNone:",
  3279. fn: function (aBlock,anotherBlock){
  3280. var self=this;
  3281. return smalltalk.withContext(function($ctx1) {
  3282. var $1;
  3283. $1=_st(self["@elements"])._detect_ifNone_(aBlock,anotherBlock);
  3284. return $1;
  3285. }, function($ctx1) {$ctx1.fill(self,"detect:ifNone:",{aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.Set)})},
  3286. messageSends: ["detect:ifNone:"]}),
  3287. smalltalk.Set);
  3288. smalltalk.addMethod(
  3289. smalltalk.method({
  3290. selector: "do:",
  3291. fn: function (aBlock){
  3292. var self=this;
  3293. return smalltalk.withContext(function($ctx1) {
  3294. _st(self["@elements"])._do_(aBlock);
  3295. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.Set)})},
  3296. messageSends: ["do:"]}),
  3297. smalltalk.Set);
  3298. smalltalk.addMethod(
  3299. smalltalk.method({
  3300. selector: "includes:",
  3301. fn: function (anObject){
  3302. var self=this;
  3303. return smalltalk.withContext(function($ctx1) {
  3304. var $1;
  3305. $1=_st(self["@elements"])._includes_(anObject);
  3306. return $1;
  3307. }, function($ctx1) {$ctx1.fill(self,"includes:",{anObject:anObject},smalltalk.Set)})},
  3308. messageSends: ["includes:"]}),
  3309. smalltalk.Set);
  3310. smalltalk.addMethod(
  3311. smalltalk.method({
  3312. selector: "initialize",
  3313. fn: function (){
  3314. var self=this;
  3315. return smalltalk.withContext(function($ctx1) {
  3316. smalltalk.Set.superclass.fn.prototype._initialize.apply(_st(self), []);
  3317. self["@elements"]=[];
  3318. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Set)})},
  3319. messageSends: ["initialize"]}),
  3320. smalltalk.Set);
  3321. smalltalk.addMethod(
  3322. smalltalk.method({
  3323. selector: "printOn:",
  3324. fn: function (aStream){
  3325. var self=this;
  3326. return smalltalk.withContext(function($ctx1) {
  3327. smalltalk.Set.superclass.fn.prototype._printOn_.apply(_st(self), [aStream]);
  3328. _st(aStream)._nextPutAll_(" (");
  3329. self._do_separatedBy_((function(each){
  3330. return smalltalk.withContext(function($ctx2) {
  3331. return _st(each)._printOn_(aStream);
  3332. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  3333. return smalltalk.withContext(function($ctx2) {
  3334. return _st(aStream)._nextPutAll_(" ");
  3335. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3336. _st(aStream)._nextPutAll_(")");
  3337. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Set)})},
  3338. messageSends: ["printOn:", "nextPutAll:", "do:separatedBy:"]}),
  3339. smalltalk.Set);
  3340. smalltalk.addMethod(
  3341. smalltalk.method({
  3342. selector: "remove:",
  3343. fn: function (anObject){
  3344. var self=this;
  3345. return smalltalk.withContext(function($ctx1) {
  3346. _st(self["@elements"])._remove_(anObject);
  3347. return self}, function($ctx1) {$ctx1.fill(self,"remove:",{anObject:anObject},smalltalk.Set)})},
  3348. messageSends: ["remove:"]}),
  3349. smalltalk.Set);
  3350. smalltalk.addMethod(
  3351. smalltalk.method({
  3352. selector: "remove:ifAbsent:",
  3353. fn: function (anObject,aBlock){
  3354. var self=this;
  3355. return smalltalk.withContext(function($ctx1) {
  3356. _st(self["@elements"])._remove_ifAbsent_(anObject,aBlock);
  3357. return self}, function($ctx1) {$ctx1.fill(self,"remove:ifAbsent:",{anObject:anObject,aBlock:aBlock},smalltalk.Set)})},
  3358. messageSends: ["remove:ifAbsent:"]}),
  3359. smalltalk.Set);
  3360. smalltalk.addMethod(
  3361. smalltalk.method({
  3362. selector: "select:",
  3363. fn: function (aBlock){
  3364. var self=this;
  3365. var collection;
  3366. return smalltalk.withContext(function($ctx1) {
  3367. var $1,$2;
  3368. collection=_st(self._class())._new();
  3369. self._do_((function(each){
  3370. return smalltalk.withContext(function($ctx2) {
  3371. $1=_st(aBlock)._value_(each);
  3372. if(smalltalk.assert($1)){
  3373. return _st(collection)._add_(each);
  3374. };
  3375. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3376. $2=collection;
  3377. return $2;
  3378. }, function($ctx1) {$ctx1.fill(self,"select:",{aBlock:aBlock,collection:collection},smalltalk.Set)})},
  3379. messageSends: ["new", "class", "do:", "ifTrue:", "add:", "value:"]}),
  3380. smalltalk.Set);
  3381. smalltalk.addMethod(
  3382. smalltalk.method({
  3383. selector: "size",
  3384. fn: function (){
  3385. var self=this;
  3386. return smalltalk.withContext(function($ctx1) {
  3387. var $1;
  3388. $1=_st(self["@elements"])._size();
  3389. return $1;
  3390. }, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.Set)})},
  3391. messageSends: ["size"]}),
  3392. smalltalk.Set);
  3393. smalltalk.addClass('Queue', smalltalk.Object, ['read', 'readIndex', 'write'], 'Kernel-Collections');
  3394. smalltalk.addMethod(
  3395. smalltalk.method({
  3396. selector: "initialize",
  3397. fn: function (){
  3398. var self=this;
  3399. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  3400. return smalltalk.withContext(function($ctx1) {
  3401. smalltalk.Queue.superclass.fn.prototype._initialize.apply(_st(self), []);
  3402. self["@read"]=_st($OrderedCollection())._new();
  3403. self["@write"]=_st($OrderedCollection())._new();
  3404. self["@readIndex"]=(1);
  3405. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Queue)})},
  3406. messageSends: ["initialize", "new"]}),
  3407. smalltalk.Queue);
  3408. smalltalk.addMethod(
  3409. smalltalk.method({
  3410. selector: "next",
  3411. fn: function (){
  3412. var self=this;
  3413. return smalltalk.withContext(function($ctx1) {
  3414. var $1;
  3415. $1=self._nextIfAbsent_((function(){
  3416. return smalltalk.withContext(function($ctx2) {
  3417. return self._error_("Cannot read from empty Queue.");
  3418. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3419. return $1;
  3420. }, function($ctx1) {$ctx1.fill(self,"next",{},smalltalk.Queue)})},
  3421. messageSends: ["nextIfAbsent:", "error:"]}),
  3422. smalltalk.Queue);
  3423. smalltalk.addMethod(
  3424. smalltalk.method({
  3425. selector: "nextIfAbsent:",
  3426. fn: function (aBlock){
  3427. var self=this;
  3428. var result;
  3429. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  3430. return smalltalk.withContext(function($ctx1) {
  3431. var $1,$2,$3,$4;
  3432. var $early={};
  3433. try {
  3434. result=_st(self["@read"])._at_ifAbsent_(self["@readIndex"],(function(){
  3435. return smalltalk.withContext(function($ctx2) {
  3436. $1=_st(self["@write"])._isEmpty();
  3437. if(smalltalk.assert($1)){
  3438. $2=_st(self["@readIndex"]).__gt((1));
  3439. if(smalltalk.assert($2)){
  3440. self["@read"]=[];
  3441. self["@read"];
  3442. self["@readIndex"]=(1);
  3443. self["@readIndex"];
  3444. };
  3445. $3=_st(aBlock)._value();
  3446. throw $early=[$3];
  3447. };
  3448. self["@read"]=self["@write"];
  3449. self["@read"];
  3450. self["@readIndex"]=(1);
  3451. self["@readIndex"];
  3452. self["@write"]=_st($OrderedCollection())._new();
  3453. self["@write"];
  3454. return _st(self["@read"])._first();
  3455. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3456. _st(self["@read"])._at_put_(self["@readIndex"],nil);
  3457. self["@readIndex"]=_st(self["@readIndex"]).__plus((1));
  3458. $4=result;
  3459. return $4;
  3460. }
  3461. catch(e) {if(e===$early)return e[0]; throw e}
  3462. }, function($ctx1) {$ctx1.fill(self,"nextIfAbsent:",{aBlock:aBlock,result:result},smalltalk.Queue)})},
  3463. messageSends: ["at:ifAbsent:", "ifTrue:", ">", "value", "isEmpty", "new", "first", "at:put:", "+"]}),
  3464. smalltalk.Queue);
  3465. smalltalk.addMethod(
  3466. smalltalk.method({
  3467. selector: "nextPut:",
  3468. fn: function (anObject){
  3469. var self=this;
  3470. return smalltalk.withContext(function($ctx1) {
  3471. _st(self["@write"])._add_(anObject);
  3472. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{anObject:anObject},smalltalk.Queue)})},
  3473. messageSends: ["add:"]}),
  3474. smalltalk.Queue);
  3475. smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel-Collections');
  3476. smalltalk.addMethod(
  3477. smalltalk.method({
  3478. selector: "compile:",
  3479. fn: function (aString){
  3480. var self=this;
  3481. return smalltalk.withContext(function($ctx1) {
  3482. return self.compile(aString);
  3483. return self}, function($ctx1) {$ctx1.fill(self,"compile:",{aString:aString},smalltalk.RegularExpression)})},
  3484. messageSends: []}),
  3485. smalltalk.RegularExpression);
  3486. smalltalk.addMethod(
  3487. smalltalk.method({
  3488. selector: "exec:",
  3489. fn: function (aString){
  3490. var self=this;
  3491. return smalltalk.withContext(function($ctx1) {
  3492. return self.exec(aString) || nil;
  3493. return self}, function($ctx1) {$ctx1.fill(self,"exec:",{aString:aString},smalltalk.RegularExpression)})},
  3494. messageSends: []}),
  3495. smalltalk.RegularExpression);
  3496. smalltalk.addMethod(
  3497. smalltalk.method({
  3498. selector: "test:",
  3499. fn: function (aString){
  3500. var self=this;
  3501. return smalltalk.withContext(function($ctx1) {
  3502. return self.test(aString);
  3503. return self}, function($ctx1) {$ctx1.fill(self,"test:",{aString:aString},smalltalk.RegularExpression)})},
  3504. messageSends: []}),
  3505. smalltalk.RegularExpression);
  3506. smalltalk.addMethod(
  3507. smalltalk.method({
  3508. selector: "fromString:",
  3509. fn: function (aString){
  3510. var self=this;
  3511. return smalltalk.withContext(function($ctx1) {
  3512. var $1;
  3513. $1=self._fromString_flag_(aString,"");
  3514. return $1;
  3515. }, function($ctx1) {$ctx1.fill(self,"fromString:",{aString:aString},smalltalk.RegularExpression.klass)})},
  3516. messageSends: ["fromString:flag:"]}),
  3517. smalltalk.RegularExpression.klass);
  3518. smalltalk.addMethod(
  3519. smalltalk.method({
  3520. selector: "fromString:flag:",
  3521. fn: function (aString,anotherString){
  3522. var self=this;
  3523. return smalltalk.withContext(function($ctx1) {
  3524. return new RegExp(aString, anotherString);
  3525. return self}, function($ctx1) {$ctx1.fill(self,"fromString:flag:",{aString:aString,anotherString:anotherString},smalltalk.RegularExpression.klass)})},
  3526. messageSends: []}),
  3527. smalltalk.RegularExpression.klass);
  3528. smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel-Collections');
  3529. smalltalk.addMethod(
  3530. smalltalk.method({
  3531. selector: "<<",
  3532. fn: function (anObject){
  3533. var self=this;
  3534. return smalltalk.withContext(function($ctx1) {
  3535. self._write_(anObject);
  3536. return self}, function($ctx1) {$ctx1.fill(self,"<<",{anObject:anObject},smalltalk.Stream)})},
  3537. messageSends: ["write:"]}),
  3538. smalltalk.Stream);
  3539. smalltalk.addMethod(
  3540. smalltalk.method({
  3541. selector: "atEnd",
  3542. fn: function (){
  3543. var self=this;
  3544. return smalltalk.withContext(function($ctx1) {
  3545. var $1;
  3546. $1=_st(self._position()).__eq(self._size());
  3547. return $1;
  3548. }, function($ctx1) {$ctx1.fill(self,"atEnd",{},smalltalk.Stream)})},
  3549. messageSends: ["=", "size", "position"]}),
  3550. smalltalk.Stream);
  3551. smalltalk.addMethod(
  3552. smalltalk.method({
  3553. selector: "atStart",
  3554. fn: function (){
  3555. var self=this;
  3556. return smalltalk.withContext(function($ctx1) {
  3557. var $1;
  3558. $1=_st(self._position()).__eq((0));
  3559. return $1;
  3560. }, function($ctx1) {$ctx1.fill(self,"atStart",{},smalltalk.Stream)})},
  3561. messageSends: ["=", "position"]}),
  3562. smalltalk.Stream);
  3563. smalltalk.addMethod(
  3564. smalltalk.method({
  3565. selector: "close",
  3566. fn: function (){
  3567. var self=this;
  3568. return smalltalk.withContext(function($ctx1) {
  3569. return self}, function($ctx1) {$ctx1.fill(self,"close",{},smalltalk.Stream)})},
  3570. messageSends: []}),
  3571. smalltalk.Stream);
  3572. smalltalk.addMethod(
  3573. smalltalk.method({
  3574. selector: "collection",
  3575. fn: function (){
  3576. var self=this;
  3577. return smalltalk.withContext(function($ctx1) {
  3578. var $1;
  3579. $1=self["@collection"];
  3580. return $1;
  3581. }, function($ctx1) {$ctx1.fill(self,"collection",{},smalltalk.Stream)})},
  3582. messageSends: []}),
  3583. smalltalk.Stream);
  3584. smalltalk.addMethod(
  3585. smalltalk.method({
  3586. selector: "contents",
  3587. fn: function (){
  3588. var self=this;
  3589. return smalltalk.withContext(function($ctx1) {
  3590. var $1;
  3591. $1=_st(self._collection())._copyFrom_to_((1),self._streamSize());
  3592. return $1;
  3593. }, function($ctx1) {$ctx1.fill(self,"contents",{},smalltalk.Stream)})},
  3594. messageSends: ["copyFrom:to:", "streamSize", "collection"]}),
  3595. smalltalk.Stream);
  3596. smalltalk.addMethod(
  3597. smalltalk.method({
  3598. selector: "do:",
  3599. fn: function (aBlock){
  3600. var self=this;
  3601. return smalltalk.withContext(function($ctx1) {
  3602. _st((function(){
  3603. return smalltalk.withContext(function($ctx2) {
  3604. return self._atEnd();
  3605. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  3606. return smalltalk.withContext(function($ctx2) {
  3607. return _st(aBlock)._value_(self._next());
  3608. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3609. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.Stream)})},
  3610. messageSends: ["whileFalse:", "value:", "next", "atEnd"]}),
  3611. smalltalk.Stream);
  3612. smalltalk.addMethod(
  3613. smalltalk.method({
  3614. selector: "flush",
  3615. fn: function (){
  3616. var self=this;
  3617. return smalltalk.withContext(function($ctx1) {
  3618. return self}, function($ctx1) {$ctx1.fill(self,"flush",{},smalltalk.Stream)})},
  3619. messageSends: []}),
  3620. smalltalk.Stream);
  3621. smalltalk.addMethod(
  3622. smalltalk.method({
  3623. selector: "isEmpty",
  3624. fn: function (){
  3625. var self=this;
  3626. return smalltalk.withContext(function($ctx1) {
  3627. var $1;
  3628. $1=_st(self._size()).__eq((0));
  3629. return $1;
  3630. }, function($ctx1) {$ctx1.fill(self,"isEmpty",{},smalltalk.Stream)})},
  3631. messageSends: ["=", "size"]}),
  3632. smalltalk.Stream);
  3633. smalltalk.addMethod(
  3634. smalltalk.method({
  3635. selector: "next",
  3636. fn: function (){
  3637. var self=this;
  3638. return smalltalk.withContext(function($ctx1) {
  3639. var $2,$1;
  3640. $2=self._atEnd();
  3641. if(smalltalk.assert($2)){
  3642. $1=nil;
  3643. } else {
  3644. self._position_(_st(self._position()).__plus((1)));
  3645. $1=_st(self["@collection"])._at_(self._position());
  3646. };
  3647. return $1;
  3648. }, function($ctx1) {$ctx1.fill(self,"next",{},smalltalk.Stream)})},
  3649. messageSends: ["ifTrue:ifFalse:", "position:", "+", "position", "at:", "atEnd"]}),
  3650. smalltalk.Stream);
  3651. smalltalk.addMethod(
  3652. smalltalk.method({
  3653. selector: "next:",
  3654. fn: function (anInteger){
  3655. var self=this;
  3656. var tempCollection;
  3657. return smalltalk.withContext(function($ctx1) {
  3658. var $1,$2;
  3659. tempCollection=_st(_st(self._collection())._class())._new();
  3660. _st(anInteger)._timesRepeat_((function(){
  3661. return smalltalk.withContext(function($ctx2) {
  3662. $1=self._atEnd();
  3663. if(! smalltalk.assert($1)){
  3664. return _st(tempCollection)._add_(self._next());
  3665. };
  3666. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3667. $2=tempCollection;
  3668. return $2;
  3669. }, function($ctx1) {$ctx1.fill(self,"next:",{anInteger:anInteger,tempCollection:tempCollection},smalltalk.Stream)})},
  3670. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", "add:", "next", "atEnd"]}),
  3671. smalltalk.Stream);
  3672. smalltalk.addMethod(
  3673. smalltalk.method({
  3674. selector: "nextPut:",
  3675. fn: function (anObject){
  3676. var self=this;
  3677. return smalltalk.withContext(function($ctx1) {
  3678. self._position_(_st(self._position()).__plus((1)));
  3679. _st(self._collection())._at_put_(self._position(),anObject);
  3680. self._setStreamSize_(_st(self._streamSize())._max_(self._position()));
  3681. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{anObject:anObject},smalltalk.Stream)})},
  3682. messageSends: ["position:", "+", "position", "at:put:", "collection", "setStreamSize:", "max:", "streamSize"]}),
  3683. smalltalk.Stream);
  3684. smalltalk.addMethod(
  3685. smalltalk.method({
  3686. selector: "nextPutAll:",
  3687. fn: function (aCollection){
  3688. var self=this;
  3689. return smalltalk.withContext(function($ctx1) {
  3690. _st(aCollection)._do_((function(each){
  3691. return smalltalk.withContext(function($ctx2) {
  3692. return self._nextPut_(each);
  3693. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3694. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAll:",{aCollection:aCollection},smalltalk.Stream)})},
  3695. messageSends: ["do:", "nextPut:"]}),
  3696. smalltalk.Stream);
  3697. smalltalk.addMethod(
  3698. smalltalk.method({
  3699. selector: "nextPutString:",
  3700. fn: function (aString){
  3701. var self=this;
  3702. return smalltalk.withContext(function($ctx1) {
  3703. self._nextPut_(aString);
  3704. return self}, function($ctx1) {$ctx1.fill(self,"nextPutString:",{aString:aString},smalltalk.Stream)})},
  3705. messageSends: ["nextPut:"]}),
  3706. smalltalk.Stream);
  3707. smalltalk.addMethod(
  3708. smalltalk.method({
  3709. selector: "peek",
  3710. fn: function (){
  3711. var self=this;
  3712. return smalltalk.withContext(function($ctx1) {
  3713. var $2,$1;
  3714. $2=self._atEnd();
  3715. if(! smalltalk.assert($2)){
  3716. $1=_st(self._collection())._at_(_st(self._position()).__plus((1)));
  3717. };
  3718. return $1;
  3719. }, function($ctx1) {$ctx1.fill(self,"peek",{},smalltalk.Stream)})},
  3720. messageSends: ["ifFalse:", "at:", "+", "position", "collection", "atEnd"]}),
  3721. smalltalk.Stream);
  3722. smalltalk.addMethod(
  3723. smalltalk.method({
  3724. selector: "position",
  3725. fn: function (){
  3726. var self=this;
  3727. return smalltalk.withContext(function($ctx1) {
  3728. var $2,$1;
  3729. $2=self["@position"];
  3730. if(($receiver = $2) == nil || $receiver == undefined){
  3731. self["@position"]=(0);
  3732. $1=self["@position"];
  3733. } else {
  3734. $1=$2;
  3735. };
  3736. return $1;
  3737. }, function($ctx1) {$ctx1.fill(self,"position",{},smalltalk.Stream)})},
  3738. messageSends: ["ifNil:"]}),
  3739. smalltalk.Stream);
  3740. smalltalk.addMethod(
  3741. smalltalk.method({
  3742. selector: "position:",
  3743. fn: function (anInteger){
  3744. var self=this;
  3745. return smalltalk.withContext(function($ctx1) {
  3746. self["@position"]=anInteger;
  3747. return self}, function($ctx1) {$ctx1.fill(self,"position:",{anInteger:anInteger},smalltalk.Stream)})},
  3748. messageSends: []}),
  3749. smalltalk.Stream);
  3750. smalltalk.addMethod(
  3751. smalltalk.method({
  3752. selector: "reset",
  3753. fn: function (){
  3754. var self=this;
  3755. return smalltalk.withContext(function($ctx1) {
  3756. self._position_((0));
  3757. return self}, function($ctx1) {$ctx1.fill(self,"reset",{},smalltalk.Stream)})},
  3758. messageSends: ["position:"]}),
  3759. smalltalk.Stream);
  3760. smalltalk.addMethod(
  3761. smalltalk.method({
  3762. selector: "resetContents",
  3763. fn: function (){
  3764. var self=this;
  3765. return smalltalk.withContext(function($ctx1) {
  3766. self._reset();
  3767. self._setStreamSize_((0));
  3768. return self}, function($ctx1) {$ctx1.fill(self,"resetContents",{},smalltalk.Stream)})},
  3769. messageSends: ["reset", "setStreamSize:"]}),
  3770. smalltalk.Stream);
  3771. smalltalk.addMethod(
  3772. smalltalk.method({
  3773. selector: "setCollection:",
  3774. fn: function (aCollection){
  3775. var self=this;
  3776. return smalltalk.withContext(function($ctx1) {
  3777. self["@collection"]=aCollection;
  3778. return self}, function($ctx1) {$ctx1.fill(self,"setCollection:",{aCollection:aCollection},smalltalk.Stream)})},
  3779. messageSends: []}),
  3780. smalltalk.Stream);
  3781. smalltalk.addMethod(
  3782. smalltalk.method({
  3783. selector: "setStreamSize:",
  3784. fn: function (anInteger){
  3785. var self=this;
  3786. return smalltalk.withContext(function($ctx1) {
  3787. self["@streamSize"]=anInteger;
  3788. return self}, function($ctx1) {$ctx1.fill(self,"setStreamSize:",{anInteger:anInteger},smalltalk.Stream)})},
  3789. messageSends: []}),
  3790. smalltalk.Stream);
  3791. smalltalk.addMethod(
  3792. smalltalk.method({
  3793. selector: "setToEnd",
  3794. fn: function (){
  3795. var self=this;
  3796. return smalltalk.withContext(function($ctx1) {
  3797. self._position_(self._size());
  3798. return self}, function($ctx1) {$ctx1.fill(self,"setToEnd",{},smalltalk.Stream)})},
  3799. messageSends: ["position:", "size"]}),
  3800. smalltalk.Stream);
  3801. smalltalk.addMethod(
  3802. smalltalk.method({
  3803. selector: "size",
  3804. fn: function (){
  3805. var self=this;
  3806. return smalltalk.withContext(function($ctx1) {
  3807. var $1;
  3808. $1=self._streamSize();
  3809. return $1;
  3810. }, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.Stream)})},
  3811. messageSends: ["streamSize"]}),
  3812. smalltalk.Stream);
  3813. smalltalk.addMethod(
  3814. smalltalk.method({
  3815. selector: "skip:",
  3816. fn: function (anInteger){
  3817. var self=this;
  3818. return smalltalk.withContext(function($ctx1) {
  3819. self._position_(_st(_st(self._position()).__plus(anInteger))._min_max_(self._size(),(0)));
  3820. return self}, function($ctx1) {$ctx1.fill(self,"skip:",{anInteger:anInteger},smalltalk.Stream)})},
  3821. messageSends: ["position:", "min:max:", "size", "+", "position"]}),
  3822. smalltalk.Stream);
  3823. smalltalk.addMethod(
  3824. smalltalk.method({
  3825. selector: "streamSize",
  3826. fn: function (){
  3827. var self=this;
  3828. return smalltalk.withContext(function($ctx1) {
  3829. var $1;
  3830. $1=self["@streamSize"];
  3831. return $1;
  3832. }, function($ctx1) {$ctx1.fill(self,"streamSize",{},smalltalk.Stream)})},
  3833. messageSends: []}),
  3834. smalltalk.Stream);
  3835. smalltalk.addMethod(
  3836. smalltalk.method({
  3837. selector: "write:",
  3838. fn: function (anObject){
  3839. var self=this;
  3840. return smalltalk.withContext(function($ctx1) {
  3841. _st(anObject)._putOn_(self);
  3842. return self}, function($ctx1) {$ctx1.fill(self,"write:",{anObject:anObject},smalltalk.Stream)})},
  3843. messageSends: ["putOn:"]}),
  3844. smalltalk.Stream);
  3845. smalltalk.addMethod(
  3846. smalltalk.method({
  3847. selector: "on:",
  3848. fn: function (aCollection){
  3849. var self=this;
  3850. return smalltalk.withContext(function($ctx1) {
  3851. var $2,$3,$1;
  3852. $2=self._new();
  3853. _st($2)._setCollection_(aCollection);
  3854. _st($2)._setStreamSize_(_st(aCollection)._size());
  3855. $3=_st($2)._yourself();
  3856. $1=$3;
  3857. return $1;
  3858. }, function($ctx1) {$ctx1.fill(self,"on:",{aCollection:aCollection},smalltalk.Stream.klass)})},
  3859. messageSends: ["setCollection:", "new", "setStreamSize:", "size", "yourself"]}),
  3860. smalltalk.Stream.klass);
  3861. smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel-Collections');
  3862. smalltalk.addMethod(
  3863. smalltalk.method({
  3864. selector: "cr",
  3865. fn: function (){
  3866. var self=this;
  3867. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  3868. return smalltalk.withContext(function($ctx1) {
  3869. var $1;
  3870. $1=self._nextPutAll_(_st($String())._cr());
  3871. return $1;
  3872. }, function($ctx1) {$ctx1.fill(self,"cr",{},smalltalk.StringStream)})},
  3873. messageSends: ["nextPutAll:", "cr"]}),
  3874. smalltalk.StringStream);
  3875. smalltalk.addMethod(
  3876. smalltalk.method({
  3877. selector: "crlf",
  3878. fn: function (){
  3879. var self=this;
  3880. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  3881. return smalltalk.withContext(function($ctx1) {
  3882. var $1;
  3883. $1=self._nextPutAll_(_st($String())._crlf());
  3884. return $1;
  3885. }, function($ctx1) {$ctx1.fill(self,"crlf",{},smalltalk.StringStream)})},
  3886. messageSends: ["nextPutAll:", "crlf"]}),
  3887. smalltalk.StringStream);
  3888. smalltalk.addMethod(
  3889. smalltalk.method({
  3890. selector: "lf",
  3891. fn: function (){
  3892. var self=this;
  3893. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  3894. return smalltalk.withContext(function($ctx1) {
  3895. var $1;
  3896. $1=self._nextPutAll_(_st($String())._lf());
  3897. return $1;
  3898. }, function($ctx1) {$ctx1.fill(self,"lf",{},smalltalk.StringStream)})},
  3899. messageSends: ["nextPutAll:", "lf"]}),
  3900. smalltalk.StringStream);
  3901. smalltalk.addMethod(
  3902. smalltalk.method({
  3903. selector: "next:",
  3904. fn: function (anInteger){
  3905. var self=this;
  3906. var tempCollection;
  3907. return smalltalk.withContext(function($ctx1) {
  3908. var $1,$2;
  3909. tempCollection=_st(_st(self._collection())._class())._new();
  3910. _st(anInteger)._timesRepeat_((function(){
  3911. return smalltalk.withContext(function($ctx2) {
  3912. $1=self._atEnd();
  3913. if(! smalltalk.assert($1)){
  3914. tempCollection=_st(tempCollection).__comma(self._next());
  3915. return tempCollection;
  3916. };
  3917. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3918. $2=tempCollection;
  3919. return $2;
  3920. }, function($ctx1) {$ctx1.fill(self,"next:",{anInteger:anInteger,tempCollection:tempCollection},smalltalk.StringStream)})},
  3921. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", ",", "next", "atEnd"]}),
  3922. smalltalk.StringStream);
  3923. smalltalk.addMethod(
  3924. smalltalk.method({
  3925. selector: "nextPut:",
  3926. fn: function (aString){
  3927. var self=this;
  3928. return smalltalk.withContext(function($ctx1) {
  3929. self._nextPutAll_(aString);
  3930. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{aString:aString},smalltalk.StringStream)})},
  3931. messageSends: ["nextPutAll:"]}),
  3932. smalltalk.StringStream);
  3933. smalltalk.addMethod(
  3934. smalltalk.method({
  3935. selector: "nextPutAll:",
  3936. fn: function (aString){
  3937. var self=this;
  3938. var pre,post;
  3939. return smalltalk.withContext(function($ctx1) {
  3940. var $1;
  3941. $1=self._atEnd();
  3942. if(smalltalk.assert($1)){
  3943. self._setCollection_(_st(self._collection()).__comma(aString));
  3944. } else {
  3945. pre=_st(self._collection())._copyFrom_to_((1),self._position());
  3946. pre;
  3947. post=_st(self._collection())._copyFrom_to_(_st(_st(self._position()).__plus((1))).__plus(_st(aString)._size()),_st(self._collection())._size());
  3948. post;
  3949. self._setCollection_(_st(_st(pre).__comma(aString)).__comma(post));
  3950. };
  3951. self._position_(_st(self._position()).__plus(_st(aString)._size()));
  3952. self._setStreamSize_(_st(self._streamSize())._max_(self._position()));
  3953. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAll:",{aString:aString,pre:pre,post:post},smalltalk.StringStream)})},
  3954. messageSends: ["ifTrue:ifFalse:", "setCollection:", ",", "collection", "copyFrom:to:", "position", "+", "size", "atEnd", "position:", "setStreamSize:", "max:", "streamSize"]}),
  3955. smalltalk.StringStream);
  3956. smalltalk.addMethod(
  3957. smalltalk.method({
  3958. selector: "nextPutString:",
  3959. fn: function (aString){
  3960. var self=this;
  3961. return smalltalk.withContext(function($ctx1) {
  3962. self._nextPutAll_(aString);
  3963. return self}, function($ctx1) {$ctx1.fill(self,"nextPutString:",{aString:aString},smalltalk.StringStream)})},
  3964. messageSends: ["nextPutAll:"]}),
  3965. smalltalk.StringStream);
  3966. smalltalk.addMethod(
  3967. smalltalk.method({
  3968. selector: "space",
  3969. fn: function (){
  3970. var self=this;
  3971. return smalltalk.withContext(function($ctx1) {
  3972. self._nextPut_(" ");
  3973. return self}, function($ctx1) {$ctx1.fill(self,"space",{},smalltalk.StringStream)})},
  3974. messageSends: ["nextPut:"]}),
  3975. smalltalk.StringStream);
  3976. smalltalk.addMethod(
  3977. smalltalk.method({
  3978. selector: "tab",
  3979. fn: function (){
  3980. var self=this;
  3981. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  3982. return smalltalk.withContext(function($ctx1) {
  3983. var $1;
  3984. $1=self._nextPutAll_(_st($String())._tab());
  3985. return $1;
  3986. }, function($ctx1) {$ctx1.fill(self,"tab",{},smalltalk.StringStream)})},
  3987. messageSends: ["nextPutAll:", "tab"]}),
  3988. smalltalk.StringStream);
  3989. });