Kernel-Collections.deploy.js 130 KB

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