Kernel-Collections.deploy.js 130 KB

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