Kernel-Collections.deploy.js 135 KB

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