Kernel-Collections.deploy.js 129 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232
  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(_st(self)._class()).__eq(_st(anAssociation)._class()))._and_((function(){
  11. return smalltalk.withContext(function($ctx2) {
  12. return _st(_st(_st(self)._key()).__eq(_st(anAssociation)._key()))._and_((function(){
  13. return smalltalk.withContext(function($ctx3) {
  14. return _st(_st(self)._value()).__eq(_st(anAssociation)._value());
  15. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  16. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  17. return $1;
  18. }, function($ctx1) {$ctx1.fill(self,"=",{anAssociation:anAssociation},smalltalk.Association)})},
  19. messageSends: ["and:", "=", "value", "key", "class"]}),
  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(_st(self)._key())._printOn_(aStream);
  50. _st(aStream)._nextPutAll_(" -> ");
  51. _st(_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=_st(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=_st(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. _st(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 _st(self)._add_(each);
  129. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  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(_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)})}));
  159. return $1;
  160. }, function($ctx1) {$ctx1.fill(self,"asJSON",{},smalltalk.Collection)})},
  161. messageSends: ["collect:", "asJSON", "asArray"]}),
  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=_st(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(_st(self)._class())._new())._writeStream();
  197. _st(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)})}));
  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. _st(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)})}));
  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=_st(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=_st(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=_st(self)._reject_((function(each){
  266. return smalltalk.withContext(function($ctx2) {
  267. return _st(aCollection)._includes_(each);
  268. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  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=_st(self)._detect_ifNone_(aBlock,(function(){
  281. return smalltalk.withContext(function($ctx2) {
  282. return _st(self)._errorNotFound();
  283. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  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. _st(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. _st(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)})});
  320. _st(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)})}));
  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. _st(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=_st(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:", "value", "isEmpty"]}),
  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=_st(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(_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)})}),(function(){
  381. return smalltalk.withContext(function($ctx2) {
  382. return sentinel;
  383. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))).__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. _st(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)})}));
  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=_st(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({},$ctx1)})}));
  424. if(smalltalk.assert($1)){
  425. return _st(outputSet)._add_(each);
  426. };
  427. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  428. $2=_st(_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:", "add:", "and:", "not", "includes:", "withAll:", "asArray", "class"]}),
  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(_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(_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. _st(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)})}));
  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. _st(self)._do_((function(each){
  486. return smalltalk.withContext(function($ctx2) {
  487. return _st(each)._putOn_(aStream);
  488. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  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=_st(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)})}));
  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=_st(self)._remove_ifAbsent_(anObject,(function(){
  515. return smalltalk.withContext(function($ctx2) {
  516. return _st(self)._errorNotFound();
  517. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  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. _st(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(_st(self)._class())._new())._writeStream();
  541. _st(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)})}));
  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:", "nextPut:", "value:", "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. _st(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=_st(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=_st(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=_st(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=_st(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=_st(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=_st(self)._at_ifAbsent_(anIndex,(function(){
  657. return smalltalk.withContext(function($ctx2) {
  658. return _st(self)._errorNotFound();
  659. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  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. _st(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=_st(self)._at_ifPresent_ifAbsent_(anIndex,aBlock,(function(){
  682. return smalltalk.withContext(function($ctx2) {
  683. return nil;
  684. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  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. _st(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. _st(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=_st(self)._indexOf_ifAbsent_(anObject,(function(){
  717. return smalltalk.withContext(function($ctx2) {
  718. return _st(self)._errorNotFound();
  719. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  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. _st(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. _st(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)})}));
  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. _st(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. _st(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(_st(self)._class()).__eq(_st(aHashedCollection)._class());
  776. if(! smalltalk.assert($1)){
  777. return false;
  778. };
  779. $2=_st(_st(self)._size()).__eq(_st(aHashedCollection)._size());
  780. if(! smalltalk.assert($2)){
  781. return false;
  782. };
  783. $3=_st(_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. _st(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.IndexableCollection.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())._fromPairs_(_st(self)._associations());
  820. return $1;
  821. }, function($ctx1) {$ctx1.fill(self,"asDictionary",{},smalltalk.HashedCollection)})},
  822. messageSends: ["fromPairs:", "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(_st(self)._class())._new();
  833. _st(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)})}));
  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. _st(self)._associationsDo_((function(each){
  852. return smalltalk.withContext(function($ctx2) {
  853. return _st(associations)._add_(each);
  854. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  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. _st(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)})}));
  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=_st(self)._includesKey_(aKey);
  882. $1=_st($2)._ifTrue_ifFalse_((function(){
  883. return smalltalk.withContext(function($ctx2) {
  884. return _st(self)._basicAt_(aKey);
  885. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),aBlock);
  886. return $1;
  887. }, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{aKey:aKey,aBlock:aBlock},smalltalk.HashedCollection)})},
  888. messageSends: ["ifTrue:ifFalse:", "basicAt:", "includesKey:"]}),
  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=_st(self)._at_ifAbsent_(aKey,(function(){
  898. return smalltalk.withContext(function($ctx2) {
  899. return _st(self)._at_put_(aKey,_st(aBlock)._value());
  900. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  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=_st(self)._includesKey_(aKey);
  913. $1=_st($2)._ifTrue_ifFalse_((function(){
  914. return smalltalk.withContext(function($ctx2) {
  915. return _st(aBlock)._value_(_st(self)._at_(aKey));
  916. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),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:", "value:", "at:", "includesKey:"]}),
  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=_st(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(_st(self)._class())._new();
  942. _st(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)})}));
  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(_st(self)._class())._new();
  960. _st(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)})}));
  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(_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. _st(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(_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(_st(self)._keys())._detect_ifNone_((function(each){
  1021. return smalltalk.withContext(function($ctx2) {
  1022. return _st(_st(self)._at_(each)).__eq(anObject);
  1023. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),aBlock);
  1024. return $1;
  1025. }, function($ctx1) {$ctx1.fill(self,"indexOf:ifAbsent:",{anObject:anObject,aBlock:aBlock},smalltalk.HashedCollection)})},
  1026. messageSends: ["detect:ifNone:", "=", "at:", "keys"]}),
  1027. smalltalk.HashedCollection);
  1028. smalltalk.addMethod(
  1029. smalltalk.method({
  1030. selector: "keys",
  1031. fn: function (){
  1032. var self=this;
  1033. return smalltalk.withContext(function($ctx1) {
  1034. if ('function'===typeof Object.keys) return Object.keys(self);
  1035. var keys = [];
  1036. for(var i in self) {
  1037. if(self.hasOwnProperty(i)) {
  1038. keys.push(i);
  1039. }
  1040. };
  1041. return keys;
  1042. ;
  1043. return self}, function($ctx1) {$ctx1.fill(self,"keys",{},smalltalk.HashedCollection)})},
  1044. messageSends: []}),
  1045. smalltalk.HashedCollection);
  1046. smalltalk.addMethod(
  1047. smalltalk.method({
  1048. selector: "keysAndValuesDo:",
  1049. fn: function (aBlock){
  1050. var self=this;
  1051. return smalltalk.withContext(function($ctx1) {
  1052. _st(self)._keysDo_((function(each){
  1053. return smalltalk.withContext(function($ctx2) {
  1054. return _st(aBlock)._value_value_(each,_st(self)._at_(each));
  1055. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1056. return self}, function($ctx1) {$ctx1.fill(self,"keysAndValuesDo:",{aBlock:aBlock},smalltalk.HashedCollection)})},
  1057. messageSends: ["keysDo:", "value:value:", "at:"]}),
  1058. smalltalk.HashedCollection);
  1059. smalltalk.addMethod(
  1060. smalltalk.method({
  1061. selector: "keysDo:",
  1062. fn: function (aBlock){
  1063. var self=this;
  1064. return smalltalk.withContext(function($ctx1) {
  1065. _st(_st(self)._keys())._do_(aBlock);
  1066. return self}, function($ctx1) {$ctx1.fill(self,"keysDo:",{aBlock:aBlock},smalltalk.HashedCollection)})},
  1067. messageSends: ["do:", "keys"]}),
  1068. smalltalk.HashedCollection);
  1069. smalltalk.addMethod(
  1070. smalltalk.method({
  1071. selector: "printOn:",
  1072. fn: function (aStream){
  1073. var self=this;
  1074. return smalltalk.withContext(function($ctx1) {
  1075. smalltalk.IndexableCollection.fn.prototype._printOn_.apply(_st(self), [aStream]);
  1076. _st(aStream)._nextPutAll_(" (");
  1077. _st(_st(self)._associations())._do_separatedBy_((function(each){
  1078. return smalltalk.withContext(function($ctx2) {
  1079. return _st(each)._printOn_(aStream);
  1080. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  1081. return smalltalk.withContext(function($ctx2) {
  1082. return _st(aStream)._nextPutAll_(" , ");
  1083. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1084. _st(aStream)._nextPutAll_(")");
  1085. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.HashedCollection)})},
  1086. messageSends: ["printOn:", "nextPutAll:", "do:separatedBy:", "associations"]}),
  1087. smalltalk.HashedCollection);
  1088. smalltalk.addMethod(
  1089. smalltalk.method({
  1090. selector: "remove:ifAbsent:",
  1091. fn: function (aKey,aBlock){
  1092. var self=this;
  1093. return smalltalk.withContext(function($ctx1) {
  1094. var $1;
  1095. $1=_st(self)._removeKey_ifAbsent_(aKey,aBlock);
  1096. return $1;
  1097. }, function($ctx1) {$ctx1.fill(self,"remove:ifAbsent:",{aKey:aKey,aBlock:aBlock},smalltalk.HashedCollection)})},
  1098. messageSends: ["removeKey:ifAbsent:"]}),
  1099. smalltalk.HashedCollection);
  1100. smalltalk.addMethod(
  1101. smalltalk.method({
  1102. selector: "removeKey:",
  1103. fn: function (aKey){
  1104. var self=this;
  1105. return smalltalk.withContext(function($ctx1) {
  1106. var $1;
  1107. $1=_st(self)._remove_(aKey);
  1108. return $1;
  1109. }, function($ctx1) {$ctx1.fill(self,"removeKey:",{aKey:aKey},smalltalk.HashedCollection)})},
  1110. messageSends: ["remove:"]}),
  1111. smalltalk.HashedCollection);
  1112. smalltalk.addMethod(
  1113. smalltalk.method({
  1114. selector: "removeKey:ifAbsent:",
  1115. fn: function (aKey,aBlock){
  1116. var self=this;
  1117. return smalltalk.withContext(function($ctx1) {
  1118. var $2,$1;
  1119. $2=_st(self)._includesKey_(aKey);
  1120. if(smalltalk.assert($2)){
  1121. $1=_st(self)._basicDelete_(aKey);
  1122. } else {
  1123. $1=_st(aBlock)._value();
  1124. };
  1125. return $1;
  1126. }, function($ctx1) {$ctx1.fill(self,"removeKey:ifAbsent:",{aKey:aKey,aBlock:aBlock},smalltalk.HashedCollection)})},
  1127. messageSends: ["ifFalse:ifTrue:", "value", "basicDelete:", "includesKey:"]}),
  1128. smalltalk.HashedCollection);
  1129. smalltalk.addMethod(
  1130. smalltalk.method({
  1131. selector: "select:",
  1132. fn: function (aBlock){
  1133. var self=this;
  1134. var newDict;
  1135. return smalltalk.withContext(function($ctx1) {
  1136. var $1,$2;
  1137. newDict=_st(_st(self)._class())._new();
  1138. _st(self)._keysAndValuesDo_((function(key,value){
  1139. return smalltalk.withContext(function($ctx2) {
  1140. $1=_st(aBlock)._value_(value);
  1141. if(smalltalk.assert($1)){
  1142. return _st(newDict)._at_put_(key,value);
  1143. };
  1144. }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1)})}));
  1145. $2=newDict;
  1146. return $2;
  1147. }, function($ctx1) {$ctx1.fill(self,"select:",{aBlock:aBlock,newDict:newDict},smalltalk.HashedCollection)})},
  1148. messageSends: ["new", "class", "keysAndValuesDo:", "ifTrue:", "at:put:", "value:"]}),
  1149. smalltalk.HashedCollection);
  1150. smalltalk.addMethod(
  1151. smalltalk.method({
  1152. selector: "shallowCopy",
  1153. fn: function (){
  1154. var self=this;
  1155. var copy;
  1156. return smalltalk.withContext(function($ctx1) {
  1157. var $1;
  1158. copy=_st(_st(self)._class())._new();
  1159. _st(self)._keysAndValuesDo_((function(key,value){
  1160. return smalltalk.withContext(function($ctx2) {
  1161. return _st(copy)._at_put_(key,value);
  1162. }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1)})}));
  1163. $1=copy;
  1164. return $1;
  1165. }, function($ctx1) {$ctx1.fill(self,"shallowCopy",{copy:copy},smalltalk.HashedCollection)})},
  1166. messageSends: ["new", "class", "keysAndValuesDo:", "at:put:"]}),
  1167. smalltalk.HashedCollection);
  1168. smalltalk.addMethod(
  1169. smalltalk.method({
  1170. selector: "size",
  1171. fn: function (){
  1172. var self=this;
  1173. return smalltalk.withContext(function($ctx1) {
  1174. var $1;
  1175. $1=_st(_st(self)._keys())._size();
  1176. return $1;
  1177. }, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.HashedCollection)})},
  1178. messageSends: ["size", "keys"]}),
  1179. smalltalk.HashedCollection);
  1180. smalltalk.addMethod(
  1181. smalltalk.method({
  1182. selector: "values",
  1183. fn: function (){
  1184. var self=this;
  1185. return smalltalk.withContext(function($ctx1) {
  1186. var $1;
  1187. $1=_st(_st(self)._keys())._collect_((function(each){
  1188. return smalltalk.withContext(function($ctx2) {
  1189. return _st(self)._at_(each);
  1190. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1191. return $1;
  1192. }, function($ctx1) {$ctx1.fill(self,"values",{},smalltalk.HashedCollection)})},
  1193. messageSends: ["collect:", "at:", "keys"]}),
  1194. smalltalk.HashedCollection);
  1195. smalltalk.addMethod(
  1196. smalltalk.method({
  1197. selector: "valuesDo:",
  1198. fn: function (aBlock){
  1199. var self=this;
  1200. return smalltalk.withContext(function($ctx1) {
  1201. _st(self)._keysAndValuesDo_((function(key,value){
  1202. return smalltalk.withContext(function($ctx2) {
  1203. return _st(aBlock)._value_(value);
  1204. }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1)})}));
  1205. return self}, function($ctx1) {$ctx1.fill(self,"valuesDo:",{aBlock:aBlock},smalltalk.HashedCollection)})},
  1206. messageSends: ["keysAndValuesDo:", "value:"]}),
  1207. smalltalk.HashedCollection);
  1208. smalltalk.addMethod(
  1209. smalltalk.method({
  1210. selector: "withIndexDo:",
  1211. fn: function (aBlock){
  1212. var self=this;
  1213. return smalltalk.withContext(function($ctx1) {
  1214. _st(self)._keysAndValuesDo_((function(key,value){
  1215. return smalltalk.withContext(function($ctx2) {
  1216. return _st(aBlock)._value_value_(value,key);
  1217. }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1)})}));
  1218. return self}, function($ctx1) {$ctx1.fill(self,"withIndexDo:",{aBlock:aBlock},smalltalk.HashedCollection)})},
  1219. messageSends: ["keysAndValuesDo:", "value:value:"]}),
  1220. smalltalk.HashedCollection);
  1221. smalltalk.addMethod(
  1222. smalltalk.method({
  1223. selector: "fromPairs:",
  1224. fn: function (aCollection){
  1225. var self=this;
  1226. var dict;
  1227. return smalltalk.withContext(function($ctx1) {
  1228. var $1;
  1229. _st(self)._deprecatedAPI();
  1230. dict=_st(self)._new();
  1231. _st(aCollection)._do_((function(each){
  1232. return smalltalk.withContext(function($ctx2) {
  1233. return _st(dict)._add_(each);
  1234. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1235. $1=dict;
  1236. return $1;
  1237. }, function($ctx1) {$ctx1.fill(self,"fromPairs:",{aCollection:aCollection,dict:dict},smalltalk.HashedCollection.klass)})},
  1238. messageSends: ["deprecatedAPI", "new", "do:", "add:"]}),
  1239. smalltalk.HashedCollection.klass);
  1240. smalltalk.addMethod(
  1241. smalltalk.method({
  1242. selector: "newFrom:",
  1243. fn: function (aCollection){
  1244. var self=this;
  1245. var newCollection;
  1246. return smalltalk.withContext(function($ctx1) {
  1247. var $1;
  1248. newCollection=_st(self)._new();
  1249. _st(aCollection)._do_((function(each){
  1250. return smalltalk.withContext(function($ctx2) {
  1251. return _st(newCollection)._add_(each);
  1252. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1253. $1=newCollection;
  1254. return $1;
  1255. }, function($ctx1) {$ctx1.fill(self,"newFrom:",{aCollection:aCollection,newCollection:newCollection},smalltalk.HashedCollection.klass)})},
  1256. messageSends: ["new", "do:", "add:"]}),
  1257. smalltalk.HashedCollection.klass);
  1258. smalltalk.addMethod(
  1259. smalltalk.method({
  1260. selector: "newFromPairs:",
  1261. fn: function (aCollection){
  1262. var self=this;
  1263. var newCollection;
  1264. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  1265. return smalltalk.withContext(function($ctx1) {
  1266. var $1,$2;
  1267. $1=_st(_st(aCollection)._size())._even();
  1268. if(! smalltalk.assert($1)){
  1269. _st($Error())._signal_("#newFromPairs only accepts arrays of an even length");
  1270. };
  1271. newCollection=_st(self)._new();
  1272. _st(_st((1))._to_by_(_st(aCollection)._size(),(2)))._do_((function(keyIndex){
  1273. return smalltalk.withContext(function($ctx2) {
  1274. return _st(newCollection)._at_put_(_st(aCollection)._at_(keyIndex),_st(aCollection)._at_(_st(keyIndex).__plus((1))));
  1275. }, function($ctx2) {$ctx2.fillBlock({keyIndex:keyIndex},$ctx1)})}));
  1276. $2=newCollection;
  1277. return $2;
  1278. }, function($ctx1) {$ctx1.fill(self,"newFromPairs:",{aCollection:aCollection,newCollection:newCollection},smalltalk.HashedCollection.klass)})},
  1279. messageSends: ["ifFalse:", "signal:", "even", "size", "new", "do:", "at:put:", "at:", "+", "to:by:"]}),
  1280. smalltalk.HashedCollection.klass);
  1281. smalltalk.addClass('Dictionary', smalltalk.HashedCollection, ['keys', 'values'], 'Kernel-Collections');
  1282. smalltalk.addMethod(
  1283. smalltalk.method({
  1284. selector: "asHashedCollection",
  1285. fn: function (){
  1286. var self=this;
  1287. function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  1288. return smalltalk.withContext(function($ctx1) {
  1289. var $1;
  1290. $1=_st($HashedCollection())._fromPairs_(_st(self)._associations());
  1291. return $1;
  1292. }, function($ctx1) {$ctx1.fill(self,"asHashedCollection",{},smalltalk.Dictionary)})},
  1293. messageSends: ["fromPairs:", "associations"]}),
  1294. smalltalk.Dictionary);
  1295. smalltalk.addMethod(
  1296. smalltalk.method({
  1297. selector: "asJSON",
  1298. fn: function (){
  1299. var self=this;
  1300. return smalltalk.withContext(function($ctx1) {
  1301. var $1;
  1302. $1=_st(_st(self)._asHashedCollection())._asJSON();
  1303. return $1;
  1304. }, function($ctx1) {$ctx1.fill(self,"asJSON",{},smalltalk.Dictionary)})},
  1305. messageSends: ["asJSON", "asHashedCollection"]}),
  1306. smalltalk.Dictionary);
  1307. smalltalk.addMethod(
  1308. smalltalk.method({
  1309. selector: "at:ifAbsent:",
  1310. fn: function (aKey,aBlock){
  1311. var self=this;
  1312. return smalltalk.withContext(function($ctx1) {
  1313. var index = self._positionOfKey_(aKey);
  1314. return index >=0 ? self['@values'][index] : aBlock();
  1315. ;
  1316. return self}, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{aKey:aKey,aBlock:aBlock},smalltalk.Dictionary)})},
  1317. messageSends: []}),
  1318. smalltalk.Dictionary);
  1319. smalltalk.addMethod(
  1320. smalltalk.method({
  1321. selector: "at:put:",
  1322. fn: function (aKey,aValue){
  1323. var self=this;
  1324. return smalltalk.withContext(function($ctx1) {
  1325. var index = self._positionOfKey_(aKey);
  1326. if(index === -1) {
  1327. var keys = self['@keys'];
  1328. index = keys.length;
  1329. keys.push(aKey);
  1330. }
  1331. return self['@values'][index] = aValue;
  1332. ;
  1333. return self}, function($ctx1) {$ctx1.fill(self,"at:put:",{aKey:aKey,aValue:aValue},smalltalk.Dictionary)})},
  1334. messageSends: []}),
  1335. smalltalk.Dictionary);
  1336. smalltalk.addMethod(
  1337. smalltalk.method({
  1338. selector: "includesKey:",
  1339. fn: function (aKey){
  1340. var self=this;
  1341. return smalltalk.withContext(function($ctx1) {
  1342. return self._positionOfKey_(aKey) >= 0; ;
  1343. return self}, function($ctx1) {$ctx1.fill(self,"includesKey:",{aKey:aKey},smalltalk.Dictionary)})},
  1344. messageSends: []}),
  1345. smalltalk.Dictionary);
  1346. smalltalk.addMethod(
  1347. smalltalk.method({
  1348. selector: "indexOf:ifAbsent:",
  1349. fn: function (anObject,aBlock){
  1350. var self=this;
  1351. var index;
  1352. return smalltalk.withContext(function($ctx1) {
  1353. var $2,$1;
  1354. index=_st(self["@values"])._indexOf_ifAbsent_(anObject,(function(){
  1355. return smalltalk.withContext(function($ctx2) {
  1356. return (0);
  1357. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1358. $2=_st(index).__eq((0));
  1359. if(smalltalk.assert($2)){
  1360. $1=_st(aBlock)._value();
  1361. } else {
  1362. $1=_st(self["@keys"])._at_(index);
  1363. };
  1364. return $1;
  1365. }, function($ctx1) {$ctx1.fill(self,"indexOf:ifAbsent:",{anObject:anObject,aBlock:aBlock,index:index},smalltalk.Dictionary)})},
  1366. messageSends: ["indexOf:ifAbsent:", "ifTrue:ifFalse:", "value", "at:", "="]}),
  1367. smalltalk.Dictionary);
  1368. smalltalk.addMethod(
  1369. smalltalk.method({
  1370. selector: "initialize",
  1371. fn: function (){
  1372. var self=this;
  1373. return smalltalk.withContext(function($ctx1) {
  1374. smalltalk.HashedCollection.fn.prototype._initialize.apply(_st(self), []);
  1375. self["@keys"]=[];
  1376. self["@values"]=[];
  1377. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Dictionary)})},
  1378. messageSends: ["initialize"]}),
  1379. smalltalk.Dictionary);
  1380. smalltalk.addMethod(
  1381. smalltalk.method({
  1382. selector: "keys",
  1383. fn: function (){
  1384. var self=this;
  1385. return smalltalk.withContext(function($ctx1) {
  1386. var $1;
  1387. $1=_st(self["@keys"])._copy();
  1388. return $1;
  1389. }, function($ctx1) {$ctx1.fill(self,"keys",{},smalltalk.Dictionary)})},
  1390. messageSends: ["copy"]}),
  1391. smalltalk.Dictionary);
  1392. smalltalk.addMethod(
  1393. smalltalk.method({
  1394. selector: "keysAndValuesDo:",
  1395. fn: function (aBlock){
  1396. var self=this;
  1397. return smalltalk.withContext(function($ctx1) {
  1398. var $1;
  1399. $1=_st(self["@keys"])._with_do_(self["@values"],aBlock);
  1400. return $1;
  1401. }, function($ctx1) {$ctx1.fill(self,"keysAndValuesDo:",{aBlock:aBlock},smalltalk.Dictionary)})},
  1402. messageSends: ["with:do:"]}),
  1403. smalltalk.Dictionary);
  1404. smalltalk.addMethod(
  1405. smalltalk.method({
  1406. selector: "keysDo:",
  1407. fn: function (aBlock){
  1408. var self=this;
  1409. return smalltalk.withContext(function($ctx1) {
  1410. var $1;
  1411. $1=_st(self["@keys"])._do_(aBlock);
  1412. return $1;
  1413. }, function($ctx1) {$ctx1.fill(self,"keysDo:",{aBlock:aBlock},smalltalk.Dictionary)})},
  1414. messageSends: ["do:"]}),
  1415. smalltalk.Dictionary);
  1416. smalltalk.addMethod(
  1417. smalltalk.method({
  1418. selector: "positionOfKey:",
  1419. fn: function (anObject){
  1420. var self=this;
  1421. return smalltalk.withContext(function($ctx1) {
  1422. var keys = self['@keys'];
  1423. for(var i=0;i<keys.length;i++){
  1424. if(keys[i].__eq(anObject)) { return i;}
  1425. }
  1426. return -1;
  1427. ;
  1428. return self}, function($ctx1) {$ctx1.fill(self,"positionOfKey:",{anObject:anObject},smalltalk.Dictionary)})},
  1429. messageSends: []}),
  1430. smalltalk.Dictionary);
  1431. smalltalk.addMethod(
  1432. smalltalk.method({
  1433. selector: "removeKey:ifAbsent:",
  1434. fn: function (aKey,aBlock){
  1435. var self=this;
  1436. return smalltalk.withContext(function($ctx1) {
  1437. var index = self._positionOfKey_(aKey);
  1438. if(index === -1) {
  1439. return aBlock()
  1440. } else {
  1441. var keys = self['@keys'], values = self['@values'];
  1442. var value = values[index], l = keys.length;
  1443. keys[index] = keys[l-1];
  1444. keys.pop();
  1445. values[index] = values[l-1];
  1446. values.pop();
  1447. return value;
  1448. }
  1449. ;
  1450. return self}, function($ctx1) {$ctx1.fill(self,"removeKey:ifAbsent:",{aKey:aKey,aBlock:aBlock},smalltalk.Dictionary)})},
  1451. messageSends: []}),
  1452. smalltalk.Dictionary);
  1453. smalltalk.addMethod(
  1454. smalltalk.method({
  1455. selector: "values",
  1456. fn: function (){
  1457. var self=this;
  1458. return smalltalk.withContext(function($ctx1) {
  1459. var $1;
  1460. $1=_st(self["@values"])._copy();
  1461. return $1;
  1462. }, function($ctx1) {$ctx1.fill(self,"values",{},smalltalk.Dictionary)})},
  1463. messageSends: ["copy"]}),
  1464. smalltalk.Dictionary);
  1465. smalltalk.addMethod(
  1466. smalltalk.method({
  1467. selector: "valuesDo:",
  1468. fn: function (aBlock){
  1469. var self=this;
  1470. return smalltalk.withContext(function($ctx1) {
  1471. var $1;
  1472. $1=_st(self["@values"])._do_(aBlock);
  1473. return $1;
  1474. }, function($ctx1) {$ctx1.fill(self,"valuesDo:",{aBlock:aBlock},smalltalk.Dictionary)})},
  1475. messageSends: ["do:"]}),
  1476. smalltalk.Dictionary);
  1477. smalltalk.addClass('SequenceableCollection', smalltalk.IndexableCollection, [], 'Kernel-Collections');
  1478. smalltalk.addMethod(
  1479. smalltalk.method({
  1480. selector: "=",
  1481. fn: function (aCollection){
  1482. var self=this;
  1483. return smalltalk.withContext(function($ctx1) {
  1484. var $1,$2;
  1485. var $early={};
  1486. try {
  1487. $1=_st(_st(_st(self)._class()).__eq(_st(aCollection)._class()))._and_((function(){
  1488. return smalltalk.withContext(function($ctx2) {
  1489. return _st(_st(self)._size()).__eq(_st(aCollection)._size());
  1490. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1491. if(! smalltalk.assert($1)){
  1492. return false;
  1493. };
  1494. _st(self)._withIndexDo_((function(each,i){
  1495. return smalltalk.withContext(function($ctx2) {
  1496. $2=_st(_st(aCollection)._at_(i)).__eq(each);
  1497. if(! smalltalk.assert($2)){
  1498. throw $early=[false];
  1499. };
  1500. }, function($ctx2) {$ctx2.fillBlock({each:each,i:i},$ctx1)})}));
  1501. return true;
  1502. }
  1503. catch(e) {if(e===$early)return e[0]; throw e}
  1504. }, function($ctx1) {$ctx1.fill(self,"=",{aCollection:aCollection},smalltalk.SequenceableCollection)})},
  1505. messageSends: ["ifFalse:", "and:", "=", "size", "class", "withIndexDo:", "at:"]}),
  1506. smalltalk.SequenceableCollection);
  1507. smalltalk.addMethod(
  1508. smalltalk.method({
  1509. selector: "addLast:",
  1510. fn: function (anObject){
  1511. var self=this;
  1512. return smalltalk.withContext(function($ctx1) {
  1513. _st(self)._add_(anObject);
  1514. return self}, function($ctx1) {$ctx1.fill(self,"addLast:",{anObject:anObject},smalltalk.SequenceableCollection)})},
  1515. messageSends: ["add:"]}),
  1516. smalltalk.SequenceableCollection);
  1517. smalltalk.addMethod(
  1518. smalltalk.method({
  1519. selector: "allButFirst",
  1520. fn: function (){
  1521. var self=this;
  1522. return smalltalk.withContext(function($ctx1) {
  1523. var $1;
  1524. $1=_st(self)._copyFrom_to_((2),_st(self)._size());
  1525. return $1;
  1526. }, function($ctx1) {$ctx1.fill(self,"allButFirst",{},smalltalk.SequenceableCollection)})},
  1527. messageSends: ["copyFrom:to:", "size"]}),
  1528. smalltalk.SequenceableCollection);
  1529. smalltalk.addMethod(
  1530. smalltalk.method({
  1531. selector: "allButLast",
  1532. fn: function (){
  1533. var self=this;
  1534. return smalltalk.withContext(function($ctx1) {
  1535. var $1;
  1536. $1=_st(self)._copyFrom_to_((1),_st(_st(self)._size()).__minus((1)));
  1537. return $1;
  1538. }, function($ctx1) {$ctx1.fill(self,"allButLast",{},smalltalk.SequenceableCollection)})},
  1539. messageSends: ["copyFrom:to:", "-", "size"]}),
  1540. smalltalk.SequenceableCollection);
  1541. smalltalk.addMethod(
  1542. smalltalk.method({
  1543. selector: "atRandom",
  1544. fn: function (){
  1545. var self=this;
  1546. return smalltalk.withContext(function($ctx1) {
  1547. var $1;
  1548. $1=_st(self)._at_(_st(_st(self)._size())._atRandom());
  1549. return $1;
  1550. }, function($ctx1) {$ctx1.fill(self,"atRandom",{},smalltalk.SequenceableCollection)})},
  1551. messageSends: ["at:", "atRandom", "size"]}),
  1552. smalltalk.SequenceableCollection);
  1553. smalltalk.addMethod(
  1554. smalltalk.method({
  1555. selector: "copyFrom:to:",
  1556. fn: function (anIndex,anotherIndex){
  1557. var self=this;
  1558. var range,newCollection;
  1559. return smalltalk.withContext(function($ctx1) {
  1560. var $1;
  1561. range=_st(anIndex)._to_(anotherIndex);
  1562. newCollection=_st(_st(self)._class())._new_(_st(range)._size());
  1563. _st(range)._withIndexDo_((function(each,i){
  1564. return smalltalk.withContext(function($ctx2) {
  1565. return _st(newCollection)._at_put_(i,_st(self)._at_(each));
  1566. }, function($ctx2) {$ctx2.fillBlock({each:each,i:i},$ctx1)})}));
  1567. $1=newCollection;
  1568. return $1;
  1569. }, function($ctx1) {$ctx1.fill(self,"copyFrom:to:",{anIndex:anIndex,anotherIndex:anotherIndex,range:range,newCollection:newCollection},smalltalk.SequenceableCollection)})},
  1570. messageSends: ["to:", "new:", "size", "class", "withIndexDo:", "at:put:", "at:"]}),
  1571. smalltalk.SequenceableCollection);
  1572. smalltalk.addMethod(
  1573. smalltalk.method({
  1574. selector: "deepCopy",
  1575. fn: function (){
  1576. var self=this;
  1577. var newCollection;
  1578. return smalltalk.withContext(function($ctx1) {
  1579. var $1;
  1580. newCollection=_st(_st(self)._class())._new_(_st(self)._size());
  1581. _st(self)._withIndexDo_((function(each,index){
  1582. return smalltalk.withContext(function($ctx2) {
  1583. return _st(newCollection)._at_put_(index,_st(each)._deepCopy());
  1584. }, function($ctx2) {$ctx2.fillBlock({each:each,index:index},$ctx1)})}));
  1585. $1=newCollection;
  1586. return $1;
  1587. }, function($ctx1) {$ctx1.fill(self,"deepCopy",{newCollection:newCollection},smalltalk.SequenceableCollection)})},
  1588. messageSends: ["new:", "size", "class", "withIndexDo:", "at:put:", "deepCopy"]}),
  1589. smalltalk.SequenceableCollection);
  1590. smalltalk.addMethod(
  1591. smalltalk.method({
  1592. selector: "detect:ifNone:",
  1593. fn: function (aBlock,anotherBlock){
  1594. var self=this;
  1595. return smalltalk.withContext(function($ctx1) {
  1596. for(var i = 0; i < self.length; i++)
  1597. if(aBlock(self[i]))
  1598. return self[i];
  1599. return anotherBlock();
  1600. ;
  1601. return self}, function($ctx1) {$ctx1.fill(self,"detect:ifNone:",{aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.SequenceableCollection)})},
  1602. messageSends: []}),
  1603. smalltalk.SequenceableCollection);
  1604. smalltalk.addMethod(
  1605. smalltalk.method({
  1606. selector: "do:",
  1607. fn: function (aBlock){
  1608. var self=this;
  1609. return smalltalk.withContext(function($ctx1) {
  1610. for(var i=0;i<self.length;i++){aBlock(self[i]);};
  1611. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.SequenceableCollection)})},
  1612. messageSends: []}),
  1613. smalltalk.SequenceableCollection);
  1614. smalltalk.addMethod(
  1615. smalltalk.method({
  1616. selector: "do:displayingProgress:",
  1617. fn: function (aBlock,aString){
  1618. var self=this;
  1619. function $ProgressHandler(){return smalltalk.ProgressHandler||(typeof ProgressHandler=="undefined"?nil:ProgressHandler)}
  1620. return smalltalk.withContext(function($ctx1) {
  1621. _st(_st($ProgressHandler())._current())._do_on_displaying_(aBlock,self,aString);
  1622. return self}, function($ctx1) {$ctx1.fill(self,"do:displayingProgress:",{aBlock:aBlock,aString:aString},smalltalk.SequenceableCollection)})},
  1623. messageSends: ["do:on:displaying:", "current"]}),
  1624. smalltalk.SequenceableCollection);
  1625. smalltalk.addMethod(
  1626. smalltalk.method({
  1627. selector: "first",
  1628. fn: function (){
  1629. var self=this;
  1630. return smalltalk.withContext(function($ctx1) {
  1631. var $1;
  1632. $1=_st(self)._at_((1));
  1633. return $1;
  1634. }, function($ctx1) {$ctx1.fill(self,"first",{},smalltalk.SequenceableCollection)})},
  1635. messageSends: ["at:"]}),
  1636. smalltalk.SequenceableCollection);
  1637. smalltalk.addMethod(
  1638. smalltalk.method({
  1639. selector: "first:",
  1640. fn: function (n){
  1641. var self=this;
  1642. return smalltalk.withContext(function($ctx1) {
  1643. var $1;
  1644. $1=_st(self)._copyFrom_to_((1),n);
  1645. return $1;
  1646. }, function($ctx1) {$ctx1.fill(self,"first:",{n:n},smalltalk.SequenceableCollection)})},
  1647. messageSends: ["copyFrom:to:"]}),
  1648. smalltalk.SequenceableCollection);
  1649. smalltalk.addMethod(
  1650. smalltalk.method({
  1651. selector: "fourth",
  1652. fn: function (){
  1653. var self=this;
  1654. return smalltalk.withContext(function($ctx1) {
  1655. var $1;
  1656. $1=_st(self)._at_((4));
  1657. return $1;
  1658. }, function($ctx1) {$ctx1.fill(self,"fourth",{},smalltalk.SequenceableCollection)})},
  1659. messageSends: ["at:"]}),
  1660. smalltalk.SequenceableCollection);
  1661. smalltalk.addMethod(
  1662. smalltalk.method({
  1663. selector: "includes:",
  1664. fn: function (anObject){
  1665. var self=this;
  1666. return smalltalk.withContext(function($ctx1) {
  1667. var $1;
  1668. $1=_st(_st(self)._indexOf_ifAbsent_(anObject,(function(){
  1669. return smalltalk.withContext(function($ctx2) {
  1670. return nil;
  1671. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._notNil();
  1672. return $1;
  1673. }, function($ctx1) {$ctx1.fill(self,"includes:",{anObject:anObject},smalltalk.SequenceableCollection)})},
  1674. messageSends: ["notNil", "indexOf:ifAbsent:"]}),
  1675. smalltalk.SequenceableCollection);
  1676. smalltalk.addMethod(
  1677. smalltalk.method({
  1678. selector: "indexOf:ifAbsent:",
  1679. fn: function (anObject,aBlock){
  1680. var self=this;
  1681. return smalltalk.withContext(function($ctx1) {
  1682. for(var i=0;i<self.length;i++) {
  1683. if(self[i].__eq(anObject)) {return i+1}
  1684. };
  1685. return aBlock();
  1686. ;
  1687. return self}, function($ctx1) {$ctx1.fill(self,"indexOf:ifAbsent:",{anObject:anObject,aBlock:aBlock},smalltalk.SequenceableCollection)})},
  1688. messageSends: []}),
  1689. smalltalk.SequenceableCollection);
  1690. smalltalk.addMethod(
  1691. smalltalk.method({
  1692. selector: "indexOf:startingAt:",
  1693. fn: function (anObject,start){
  1694. var self=this;
  1695. return smalltalk.withContext(function($ctx1) {
  1696. var $1;
  1697. $1=_st(self)._indexOf_startingAt_ifAbsent_(anObject,start,(function(){
  1698. return smalltalk.withContext(function($ctx2) {
  1699. return (0);
  1700. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1701. return $1;
  1702. }, function($ctx1) {$ctx1.fill(self,"indexOf:startingAt:",{anObject:anObject,start:start},smalltalk.SequenceableCollection)})},
  1703. messageSends: ["indexOf:startingAt:ifAbsent:"]}),
  1704. smalltalk.SequenceableCollection);
  1705. smalltalk.addMethod(
  1706. smalltalk.method({
  1707. selector: "indexOf:startingAt:ifAbsent:",
  1708. fn: function (anObject,start,aBlock){
  1709. var self=this;
  1710. return smalltalk.withContext(function($ctx1) {
  1711. for(var i=start-1;i<self.length;i++){
  1712. if(self[i].__eq(anObject)) {return i+1}
  1713. }
  1714. return aBlock();
  1715. ;
  1716. return self}, function($ctx1) {$ctx1.fill(self,"indexOf:startingAt:ifAbsent:",{anObject:anObject,start:start,aBlock:aBlock},smalltalk.SequenceableCollection)})},
  1717. messageSends: []}),
  1718. smalltalk.SequenceableCollection);
  1719. smalltalk.addMethod(
  1720. smalltalk.method({
  1721. selector: "last",
  1722. fn: function (){
  1723. var self=this;
  1724. return smalltalk.withContext(function($ctx1) {
  1725. var $1;
  1726. $1=_st(self)._at_(_st(self)._size());
  1727. return $1;
  1728. }, function($ctx1) {$ctx1.fill(self,"last",{},smalltalk.SequenceableCollection)})},
  1729. messageSends: ["at:", "size"]}),
  1730. smalltalk.SequenceableCollection);
  1731. smalltalk.addMethod(
  1732. smalltalk.method({
  1733. selector: "newStream",
  1734. fn: function (){
  1735. var self=this;
  1736. return smalltalk.withContext(function($ctx1) {
  1737. var $1;
  1738. $1=_st(_st(self)._streamClass())._on_(self);
  1739. return $1;
  1740. }, function($ctx1) {$ctx1.fill(self,"newStream",{},smalltalk.SequenceableCollection)})},
  1741. messageSends: ["on:", "streamClass"]}),
  1742. smalltalk.SequenceableCollection);
  1743. smalltalk.addMethod(
  1744. smalltalk.method({
  1745. selector: "readStream",
  1746. fn: function (){
  1747. var self=this;
  1748. return smalltalk.withContext(function($ctx1) {
  1749. var $1;
  1750. $1=_st(self)._stream();
  1751. return $1;
  1752. }, function($ctx1) {$ctx1.fill(self,"readStream",{},smalltalk.SequenceableCollection)})},
  1753. messageSends: ["stream"]}),
  1754. smalltalk.SequenceableCollection);
  1755. smalltalk.addMethod(
  1756. smalltalk.method({
  1757. selector: "removeLast",
  1758. fn: function (){
  1759. var self=this;
  1760. return smalltalk.withContext(function($ctx1) {
  1761. _st(self)._remove_(_st(self)._last());
  1762. return self}, function($ctx1) {$ctx1.fill(self,"removeLast",{},smalltalk.SequenceableCollection)})},
  1763. messageSends: ["remove:", "last"]}),
  1764. smalltalk.SequenceableCollection);
  1765. smalltalk.addMethod(
  1766. smalltalk.method({
  1767. selector: "reversed",
  1768. fn: function (){
  1769. var self=this;
  1770. return smalltalk.withContext(function($ctx1) {
  1771. _st(self)._subclassResponsibility();
  1772. return self}, function($ctx1) {$ctx1.fill(self,"reversed",{},smalltalk.SequenceableCollection)})},
  1773. messageSends: ["subclassResponsibility"]}),
  1774. smalltalk.SequenceableCollection);
  1775. smalltalk.addMethod(
  1776. smalltalk.method({
  1777. selector: "second",
  1778. fn: function (){
  1779. var self=this;
  1780. return smalltalk.withContext(function($ctx1) {
  1781. var $1;
  1782. $1=_st(self)._at_((2));
  1783. return $1;
  1784. }, function($ctx1) {$ctx1.fill(self,"second",{},smalltalk.SequenceableCollection)})},
  1785. messageSends: ["at:"]}),
  1786. smalltalk.SequenceableCollection);
  1787. smalltalk.addMethod(
  1788. smalltalk.method({
  1789. selector: "shallowCopy",
  1790. fn: function (){
  1791. var self=this;
  1792. var newCollection;
  1793. return smalltalk.withContext(function($ctx1) {
  1794. var $1;
  1795. newCollection=_st(_st(self)._class())._new_(_st(self)._size());
  1796. _st(self)._withIndexDo_((function(each,index){
  1797. return smalltalk.withContext(function($ctx2) {
  1798. return _st(newCollection)._at_put_(index,each);
  1799. }, function($ctx2) {$ctx2.fillBlock({each:each,index:index},$ctx1)})}));
  1800. $1=newCollection;
  1801. return $1;
  1802. }, function($ctx1) {$ctx1.fill(self,"shallowCopy",{newCollection:newCollection},smalltalk.SequenceableCollection)})},
  1803. messageSends: ["new:", "size", "class", "withIndexDo:", "at:put:"]}),
  1804. smalltalk.SequenceableCollection);
  1805. smalltalk.addMethod(
  1806. smalltalk.method({
  1807. selector: "stream",
  1808. fn: function (){
  1809. var self=this;
  1810. return smalltalk.withContext(function($ctx1) {
  1811. var $1;
  1812. $1=_st(self)._newStream();
  1813. return $1;
  1814. }, function($ctx1) {$ctx1.fill(self,"stream",{},smalltalk.SequenceableCollection)})},
  1815. messageSends: ["newStream"]}),
  1816. smalltalk.SequenceableCollection);
  1817. smalltalk.addMethod(
  1818. smalltalk.method({
  1819. selector: "streamClass",
  1820. fn: function (){
  1821. var self=this;
  1822. return smalltalk.withContext(function($ctx1) {
  1823. var $1;
  1824. $1=_st(_st(self)._class())._streamClass();
  1825. return $1;
  1826. }, function($ctx1) {$ctx1.fill(self,"streamClass",{},smalltalk.SequenceableCollection)})},
  1827. messageSends: ["streamClass", "class"]}),
  1828. smalltalk.SequenceableCollection);
  1829. smalltalk.addMethod(
  1830. smalltalk.method({
  1831. selector: "third",
  1832. fn: function (){
  1833. var self=this;
  1834. return smalltalk.withContext(function($ctx1) {
  1835. var $1;
  1836. $1=_st(self)._at_((3));
  1837. return $1;
  1838. }, function($ctx1) {$ctx1.fill(self,"third",{},smalltalk.SequenceableCollection)})},
  1839. messageSends: ["at:"]}),
  1840. smalltalk.SequenceableCollection);
  1841. smalltalk.addMethod(
  1842. smalltalk.method({
  1843. selector: "with:do:",
  1844. fn: function (anotherCollection,aBlock){
  1845. var self=this;
  1846. return smalltalk.withContext(function($ctx1) {
  1847. for(var i=0;i<self.length;i++){aBlock(self[i], anotherCollection[i]);};
  1848. return self}, function($ctx1) {$ctx1.fill(self,"with:do:",{anotherCollection:anotherCollection,aBlock:aBlock},smalltalk.SequenceableCollection)})},
  1849. messageSends: []}),
  1850. smalltalk.SequenceableCollection);
  1851. smalltalk.addMethod(
  1852. smalltalk.method({
  1853. selector: "withIndexDo:",
  1854. fn: function (aBlock){
  1855. var self=this;
  1856. return smalltalk.withContext(function($ctx1) {
  1857. for(var i=0;i<self.length;i++){aBlock(self[i], i+1);};
  1858. return self}, function($ctx1) {$ctx1.fill(self,"withIndexDo:",{aBlock:aBlock},smalltalk.SequenceableCollection)})},
  1859. messageSends: []}),
  1860. smalltalk.SequenceableCollection);
  1861. smalltalk.addMethod(
  1862. smalltalk.method({
  1863. selector: "writeStream",
  1864. fn: function (){
  1865. var self=this;
  1866. return smalltalk.withContext(function($ctx1) {
  1867. var $1;
  1868. $1=_st(self)._stream();
  1869. return $1;
  1870. }, function($ctx1) {$ctx1.fill(self,"writeStream",{},smalltalk.SequenceableCollection)})},
  1871. messageSends: ["stream"]}),
  1872. smalltalk.SequenceableCollection);
  1873. smalltalk.addMethod(
  1874. smalltalk.method({
  1875. selector: "streamClass",
  1876. fn: function (){
  1877. var self=this;
  1878. function $Stream(){return smalltalk.Stream||(typeof Stream=="undefined"?nil:Stream)}
  1879. return smalltalk.withContext(function($ctx1) {
  1880. var $1;
  1881. $1=$Stream();
  1882. return $1;
  1883. }, function($ctx1) {$ctx1.fill(self,"streamClass",{},smalltalk.SequenceableCollection.klass)})},
  1884. messageSends: []}),
  1885. smalltalk.SequenceableCollection.klass);
  1886. smalltalk.addMethod(
  1887. smalltalk.method({
  1888. selector: "streamContents:",
  1889. fn: function (aBlock){
  1890. var self=this;
  1891. var stream;
  1892. return smalltalk.withContext(function($ctx1) {
  1893. var $1;
  1894. stream=_st(_st(self)._streamClass())._on_(_st(self)._new());
  1895. _st(aBlock)._value_(stream);
  1896. $1=_st(stream)._contents();
  1897. return $1;
  1898. }, function($ctx1) {$ctx1.fill(self,"streamContents:",{aBlock:aBlock,stream:stream},smalltalk.SequenceableCollection.klass)})},
  1899. messageSends: ["on:", "new", "streamClass", "value:", "contents"]}),
  1900. smalltalk.SequenceableCollection.klass);
  1901. smalltalk.addClass('Array', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
  1902. smalltalk.addMethod(
  1903. smalltalk.method({
  1904. selector: "add:",
  1905. fn: function (anObject){
  1906. var self=this;
  1907. return smalltalk.withContext(function($ctx1) {
  1908. self.push(anObject); return anObject;;
  1909. return self}, function($ctx1) {$ctx1.fill(self,"add:",{anObject:anObject},smalltalk.Array)})},
  1910. messageSends: []}),
  1911. smalltalk.Array);
  1912. smalltalk.addMethod(
  1913. smalltalk.method({
  1914. selector: "asJavascript",
  1915. fn: function (){
  1916. var self=this;
  1917. return smalltalk.withContext(function($ctx1) {
  1918. var $1;
  1919. $1=_st(_st("[").__comma(_st(_st(self)._collect_((function(each){
  1920. return smalltalk.withContext(function($ctx2) {
  1921. return _st(each)._asJavascript();
  1922. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._join_(", "))).__comma("]");
  1923. return $1;
  1924. }, function($ctx1) {$ctx1.fill(self,"asJavascript",{},smalltalk.Array)})},
  1925. messageSends: [",", "join:", "collect:", "asJavascript"]}),
  1926. smalltalk.Array);
  1927. smalltalk.addMethod(
  1928. smalltalk.method({
  1929. selector: "at:ifAbsent:",
  1930. fn: function (anIndex,aBlock){
  1931. var self=this;
  1932. return smalltalk.withContext(function($ctx1) {
  1933. if((anIndex < 1) || (self.length < anIndex)) {return aBlock()};
  1934. return self[anIndex - 1];
  1935. ;
  1936. return self}, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{anIndex:anIndex,aBlock:aBlock},smalltalk.Array)})},
  1937. messageSends: []}),
  1938. smalltalk.Array);
  1939. smalltalk.addMethod(
  1940. smalltalk.method({
  1941. selector: "at:ifPresent:ifAbsent:",
  1942. fn: function (anIndex,aBlock,anotherBlock){
  1943. var self=this;
  1944. return smalltalk.withContext(function($ctx1) {
  1945. return anIndex < 1 || self.length < anIndex ? anotherBlock._value() : aBlock._value_(self[anIndex - 1]);;
  1946. return self}, function($ctx1) {$ctx1.fill(self,"at:ifPresent:ifAbsent:",{anIndex:anIndex,aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.Array)})},
  1947. messageSends: []}),
  1948. smalltalk.Array);
  1949. smalltalk.addMethod(
  1950. smalltalk.method({
  1951. selector: "at:put:",
  1952. fn: function (anIndex,anObject){
  1953. var self=this;
  1954. return smalltalk.withContext(function($ctx1) {
  1955. return self[anIndex - 1] = anObject;
  1956. return self}, function($ctx1) {$ctx1.fill(self,"at:put:",{anIndex:anIndex,anObject:anObject},smalltalk.Array)})},
  1957. messageSends: []}),
  1958. smalltalk.Array);
  1959. smalltalk.addMethod(
  1960. smalltalk.method({
  1961. selector: "join:",
  1962. fn: function (aString){
  1963. var self=this;
  1964. return smalltalk.withContext(function($ctx1) {
  1965. return self.join(aString);
  1966. return self}, function($ctx1) {$ctx1.fill(self,"join:",{aString:aString},smalltalk.Array)})},
  1967. messageSends: []}),
  1968. smalltalk.Array);
  1969. smalltalk.addMethod(
  1970. smalltalk.method({
  1971. selector: "printOn:",
  1972. fn: function (aStream){
  1973. var self=this;
  1974. return smalltalk.withContext(function($ctx1) {
  1975. smalltalk.SequenceableCollection.fn.prototype._printOn_.apply(_st(self), [aStream]);
  1976. _st(aStream)._nextPutAll_(" (");
  1977. _st(self)._do_separatedBy_((function(each){
  1978. return smalltalk.withContext(function($ctx2) {
  1979. return _st(each)._printOn_(aStream);
  1980. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  1981. return smalltalk.withContext(function($ctx2) {
  1982. return _st(aStream)._nextPutAll_(" ");
  1983. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1984. _st(aStream)._nextPutAll_(")");
  1985. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Array)})},
  1986. messageSends: ["printOn:", "nextPutAll:", "do:separatedBy:"]}),
  1987. smalltalk.Array);
  1988. smalltalk.addMethod(
  1989. smalltalk.method({
  1990. selector: "remove:ifAbsent:",
  1991. fn: function (anObject,aBlock){
  1992. var self=this;
  1993. return smalltalk.withContext(function($ctx1) {
  1994. for(var i=0;i<self.length;i++) {
  1995. if(self[i] == anObject) {
  1996. self.splice(i,1);
  1997. return self;
  1998. }
  1999. };
  2000. aBlock._value();
  2001. ;
  2002. return self}, function($ctx1) {$ctx1.fill(self,"remove:ifAbsent:",{anObject:anObject,aBlock:aBlock},smalltalk.Array)})},
  2003. messageSends: []}),
  2004. smalltalk.Array);
  2005. smalltalk.addMethod(
  2006. smalltalk.method({
  2007. selector: "removeFrom:to:",
  2008. fn: function (aNumber,anotherNumber){
  2009. var self=this;
  2010. return smalltalk.withContext(function($ctx1) {
  2011. self.splice(aNumber - 1,anotherNumber - 1);
  2012. return self}, function($ctx1) {$ctx1.fill(self,"removeFrom:to:",{aNumber:aNumber,anotherNumber:anotherNumber},smalltalk.Array)})},
  2013. messageSends: []}),
  2014. smalltalk.Array);
  2015. smalltalk.addMethod(
  2016. smalltalk.method({
  2017. selector: "reversed",
  2018. fn: function (){
  2019. var self=this;
  2020. return smalltalk.withContext(function($ctx1) {
  2021. return self._copy().reverse();
  2022. return self}, function($ctx1) {$ctx1.fill(self,"reversed",{},smalltalk.Array)})},
  2023. messageSends: []}),
  2024. smalltalk.Array);
  2025. smalltalk.addMethod(
  2026. smalltalk.method({
  2027. selector: "size",
  2028. fn: function (){
  2029. var self=this;
  2030. return smalltalk.withContext(function($ctx1) {
  2031. return self.length;
  2032. return self}, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.Array)})},
  2033. messageSends: []}),
  2034. smalltalk.Array);
  2035. smalltalk.addMethod(
  2036. smalltalk.method({
  2037. selector: "sort",
  2038. fn: function (){
  2039. var self=this;
  2040. return smalltalk.withContext(function($ctx1) {
  2041. var $1;
  2042. $1=_st(self)._basicPerform_("sort");
  2043. return $1;
  2044. }, function($ctx1) {$ctx1.fill(self,"sort",{},smalltalk.Array)})},
  2045. messageSends: ["basicPerform:"]}),
  2046. smalltalk.Array);
  2047. smalltalk.addMethod(
  2048. smalltalk.method({
  2049. selector: "sort:",
  2050. fn: function (aBlock){
  2051. var self=this;
  2052. return smalltalk.withContext(function($ctx1) {
  2053. return self.sort(function(a, b) {
  2054. if(aBlock(a,b)) {return -1} else {return 1}
  2055. })
  2056. ;
  2057. return self}, function($ctx1) {$ctx1.fill(self,"sort:",{aBlock:aBlock},smalltalk.Array)})},
  2058. messageSends: []}),
  2059. smalltalk.Array);
  2060. smalltalk.addMethod(
  2061. smalltalk.method({
  2062. selector: "sorted",
  2063. fn: function (){
  2064. var self=this;
  2065. return smalltalk.withContext(function($ctx1) {
  2066. var $1;
  2067. $1=_st(_st(self)._copy())._sort();
  2068. return $1;
  2069. }, function($ctx1) {$ctx1.fill(self,"sorted",{},smalltalk.Array)})},
  2070. messageSends: ["sort", "copy"]}),
  2071. smalltalk.Array);
  2072. smalltalk.addMethod(
  2073. smalltalk.method({
  2074. selector: "sorted:",
  2075. fn: function (aBlock){
  2076. var self=this;
  2077. return smalltalk.withContext(function($ctx1) {
  2078. var $1;
  2079. $1=_st(_st(self)._copy())._sort_(aBlock);
  2080. return $1;
  2081. }, function($ctx1) {$ctx1.fill(self,"sorted:",{aBlock:aBlock},smalltalk.Array)})},
  2082. messageSends: ["sort:", "copy"]}),
  2083. smalltalk.Array);
  2084. smalltalk.addMethod(
  2085. smalltalk.method({
  2086. selector: "new:",
  2087. fn: function (anInteger){
  2088. var self=this;
  2089. return smalltalk.withContext(function($ctx1) {
  2090. return new Array(anInteger);
  2091. return self}, function($ctx1) {$ctx1.fill(self,"new:",{anInteger:anInteger},smalltalk.Array.klass)})},
  2092. messageSends: []}),
  2093. smalltalk.Array.klass);
  2094. smalltalk.addMethod(
  2095. smalltalk.method({
  2096. selector: "with:",
  2097. fn: function (anObject){
  2098. var self=this;
  2099. return smalltalk.withContext(function($ctx1) {
  2100. var $2,$3,$1;
  2101. $2=_st(self)._new_((1));
  2102. _st($2)._at_put_((1),anObject);
  2103. $3=_st($2)._yourself();
  2104. $1=$3;
  2105. return $1;
  2106. }, function($ctx1) {$ctx1.fill(self,"with:",{anObject:anObject},smalltalk.Array.klass)})},
  2107. messageSends: ["at:put:", "new:", "yourself"]}),
  2108. smalltalk.Array.klass);
  2109. smalltalk.addMethod(
  2110. smalltalk.method({
  2111. selector: "with:with:",
  2112. fn: function (anObject,anObject2){
  2113. var self=this;
  2114. return smalltalk.withContext(function($ctx1) {
  2115. var $2,$3,$1;
  2116. $2=_st(self)._new_((2));
  2117. _st($2)._at_put_((1),anObject);
  2118. _st($2)._at_put_((2),anObject2);
  2119. $3=_st($2)._yourself();
  2120. $1=$3;
  2121. return $1;
  2122. }, function($ctx1) {$ctx1.fill(self,"with:with:",{anObject:anObject,anObject2:anObject2},smalltalk.Array.klass)})},
  2123. messageSends: ["at:put:", "new:", "yourself"]}),
  2124. smalltalk.Array.klass);
  2125. smalltalk.addMethod(
  2126. smalltalk.method({
  2127. selector: "with:with:with:",
  2128. fn: function (anObject,anObject2,anObject3){
  2129. var self=this;
  2130. return smalltalk.withContext(function($ctx1) {
  2131. var $2,$3,$1;
  2132. $2=_st(self)._new_((3));
  2133. _st($2)._at_put_((1),anObject);
  2134. _st($2)._at_put_((2),anObject2);
  2135. _st($2)._at_put_((3),anObject3);
  2136. $3=_st($2)._yourself();
  2137. $1=$3;
  2138. return $1;
  2139. }, function($ctx1) {$ctx1.fill(self,"with:with:with:",{anObject:anObject,anObject2:anObject2,anObject3:anObject3},smalltalk.Array.klass)})},
  2140. messageSends: ["at:put:", "new:", "yourself"]}),
  2141. smalltalk.Array.klass);
  2142. smalltalk.addMethod(
  2143. smalltalk.method({
  2144. selector: "withAll:",
  2145. fn: function (aCollection){
  2146. var self=this;
  2147. var instance,index;
  2148. return smalltalk.withContext(function($ctx1) {
  2149. var $1;
  2150. index=(1);
  2151. instance=_st(self)._new_(_st(aCollection)._size());
  2152. _st(aCollection)._do_((function(each){
  2153. return smalltalk.withContext(function($ctx2) {
  2154. _st(instance)._at_put_(index,each);
  2155. index=_st(index).__plus((1));
  2156. return index;
  2157. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  2158. $1=instance;
  2159. return $1;
  2160. }, function($ctx1) {$ctx1.fill(self,"withAll:",{aCollection:aCollection,instance:instance,index:index},smalltalk.Array.klass)})},
  2161. messageSends: ["new:", "size", "do:", "at:put:", "+"]}),
  2162. smalltalk.Array.klass);
  2163. smalltalk.addClass('CharacterArray', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
  2164. smalltalk.addMethod(
  2165. smalltalk.method({
  2166. selector: ",",
  2167. fn: function (aString){
  2168. var self=this;
  2169. return smalltalk.withContext(function($ctx1) {
  2170. var $1;
  2171. $1=_st(_st(self)._asString()).__comma(_st(aString)._asString());
  2172. return $1;
  2173. }, function($ctx1) {$ctx1.fill(self,",",{aString:aString},smalltalk.CharacterArray)})},
  2174. messageSends: [",", "asString"]}),
  2175. smalltalk.CharacterArray);
  2176. smalltalk.addMethod(
  2177. smalltalk.method({
  2178. selector: "add:",
  2179. fn: function (anObject){
  2180. var self=this;
  2181. return smalltalk.withContext(function($ctx1) {
  2182. _st(self)._errorReadOnly();
  2183. return self}, function($ctx1) {$ctx1.fill(self,"add:",{anObject:anObject},smalltalk.CharacterArray)})},
  2184. messageSends: ["errorReadOnly"]}),
  2185. smalltalk.CharacterArray);
  2186. smalltalk.addMethod(
  2187. smalltalk.method({
  2188. selector: "asLowercase",
  2189. fn: function (){
  2190. var self=this;
  2191. return smalltalk.withContext(function($ctx1) {
  2192. var $1;
  2193. $1=_st(_st(self)._class())._fromString_(_st(_st(self)._asString())._asLowercase());
  2194. return $1;
  2195. }, function($ctx1) {$ctx1.fill(self,"asLowercase",{},smalltalk.CharacterArray)})},
  2196. messageSends: ["fromString:", "asLowercase", "asString", "class"]}),
  2197. smalltalk.CharacterArray);
  2198. smalltalk.addMethod(
  2199. smalltalk.method({
  2200. selector: "asNumber",
  2201. fn: function (){
  2202. var self=this;
  2203. return smalltalk.withContext(function($ctx1) {
  2204. var $1;
  2205. $1=_st(_st(self)._asString())._asNumber();
  2206. return $1;
  2207. }, function($ctx1) {$ctx1.fill(self,"asNumber",{},smalltalk.CharacterArray)})},
  2208. messageSends: ["asNumber", "asString"]}),
  2209. smalltalk.CharacterArray);
  2210. smalltalk.addMethod(
  2211. smalltalk.method({
  2212. selector: "asString",
  2213. fn: function (){
  2214. var self=this;
  2215. return smalltalk.withContext(function($ctx1) {
  2216. var $1;
  2217. $1=_st(self)._subclassResponsibility();
  2218. return $1;
  2219. }, function($ctx1) {$ctx1.fill(self,"asString",{},smalltalk.CharacterArray)})},
  2220. messageSends: ["subclassResponsibility"]}),
  2221. smalltalk.CharacterArray);
  2222. smalltalk.addMethod(
  2223. smalltalk.method({
  2224. selector: "asSymbol",
  2225. fn: function (){
  2226. var self=this;
  2227. return smalltalk.withContext(function($ctx1) {
  2228. var $1;
  2229. $1=_st(self)._asString();
  2230. return $1;
  2231. }, function($ctx1) {$ctx1.fill(self,"asSymbol",{},smalltalk.CharacterArray)})},
  2232. messageSends: ["asString"]}),
  2233. smalltalk.CharacterArray);
  2234. smalltalk.addMethod(
  2235. smalltalk.method({
  2236. selector: "asUppercase",
  2237. fn: function (){
  2238. var self=this;
  2239. return smalltalk.withContext(function($ctx1) {
  2240. var $1;
  2241. $1=_st(_st(self)._class())._fromString_(_st(_st(self)._asString())._asUppercase());
  2242. return $1;
  2243. }, function($ctx1) {$ctx1.fill(self,"asUppercase",{},smalltalk.CharacterArray)})},
  2244. messageSends: ["fromString:", "asUppercase", "asString", "class"]}),
  2245. smalltalk.CharacterArray);
  2246. smalltalk.addMethod(
  2247. smalltalk.method({
  2248. selector: "at:put:",
  2249. fn: function (anIndex,anObject){
  2250. var self=this;
  2251. return smalltalk.withContext(function($ctx1) {
  2252. _st(self)._errorReadOnly();
  2253. return self}, function($ctx1) {$ctx1.fill(self,"at:put:",{anIndex:anIndex,anObject:anObject},smalltalk.CharacterArray)})},
  2254. messageSends: ["errorReadOnly"]}),
  2255. smalltalk.CharacterArray);
  2256. smalltalk.addMethod(
  2257. smalltalk.method({
  2258. selector: "errorReadOnly",
  2259. fn: function (){
  2260. var self=this;
  2261. return smalltalk.withContext(function($ctx1) {
  2262. _st(self)._error_("Object is read-only");
  2263. return self}, function($ctx1) {$ctx1.fill(self,"errorReadOnly",{},smalltalk.CharacterArray)})},
  2264. messageSends: ["error:"]}),
  2265. smalltalk.CharacterArray);
  2266. smalltalk.addMethod(
  2267. smalltalk.method({
  2268. selector: "printOn:",
  2269. fn: function (aStream){
  2270. var self=this;
  2271. return smalltalk.withContext(function($ctx1) {
  2272. _st(_st(self)._asString())._printOn_(aStream);
  2273. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.CharacterArray)})},
  2274. messageSends: ["printOn:", "asString"]}),
  2275. smalltalk.CharacterArray);
  2276. smalltalk.addMethod(
  2277. smalltalk.method({
  2278. selector: "putOn:",
  2279. fn: function (aStream){
  2280. var self=this;
  2281. return smalltalk.withContext(function($ctx1) {
  2282. _st(aStream)._nextPutString_(self);
  2283. return self}, function($ctx1) {$ctx1.fill(self,"putOn:",{aStream:aStream},smalltalk.CharacterArray)})},
  2284. messageSends: ["nextPutString:"]}),
  2285. smalltalk.CharacterArray);
  2286. smalltalk.addMethod(
  2287. smalltalk.method({
  2288. selector: "remove:",
  2289. fn: function (anObject){
  2290. var self=this;
  2291. return smalltalk.withContext(function($ctx1) {
  2292. _st(self)._errorReadOnly();
  2293. return self}, function($ctx1) {$ctx1.fill(self,"remove:",{anObject:anObject},smalltalk.CharacterArray)})},
  2294. messageSends: ["errorReadOnly"]}),
  2295. smalltalk.CharacterArray);
  2296. smalltalk.addMethod(
  2297. smalltalk.method({
  2298. selector: "fromString:",
  2299. fn: function (aString){
  2300. var self=this;
  2301. return smalltalk.withContext(function($ctx1) {
  2302. _st(self)._subclassResponsibility();
  2303. return self}, function($ctx1) {$ctx1.fill(self,"fromString:",{aString:aString},smalltalk.CharacterArray.klass)})},
  2304. messageSends: ["subclassResponsibility"]}),
  2305. smalltalk.CharacterArray.klass);
  2306. smalltalk.addClass('String', smalltalk.CharacterArray, [], 'Kernel-Collections');
  2307. smalltalk.addMethod(
  2308. smalltalk.method({
  2309. selector: ",",
  2310. fn: function (aString){
  2311. var self=this;
  2312. return smalltalk.withContext(function($ctx1) {
  2313. return self + aString;
  2314. return self}, function($ctx1) {$ctx1.fill(self,",",{aString:aString},smalltalk.String)})},
  2315. messageSends: []}),
  2316. smalltalk.String);
  2317. smalltalk.addMethod(
  2318. smalltalk.method({
  2319. selector: "<",
  2320. fn: function (aString){
  2321. var self=this;
  2322. return smalltalk.withContext(function($ctx1) {
  2323. return String(self) < aString._asString();
  2324. return self}, function($ctx1) {$ctx1.fill(self,"<",{aString:aString},smalltalk.String)})},
  2325. messageSends: []}),
  2326. smalltalk.String);
  2327. smalltalk.addMethod(
  2328. smalltalk.method({
  2329. selector: "<=",
  2330. fn: function (aString){
  2331. var self=this;
  2332. return smalltalk.withContext(function($ctx1) {
  2333. return String(self) <= aString._asString();
  2334. return self}, function($ctx1) {$ctx1.fill(self,"<=",{aString:aString},smalltalk.String)})},
  2335. messageSends: []}),
  2336. smalltalk.String);
  2337. smalltalk.addMethod(
  2338. smalltalk.method({
  2339. selector: "=",
  2340. fn: function (aString){
  2341. var self=this;
  2342. return smalltalk.withContext(function($ctx1) {
  2343. if(typeof aString === 'undefined') { return false }
  2344. if(!aString._isString || ! aString._isString()) {
  2345. return false;
  2346. }
  2347. return String(self) === String(aString)
  2348. ;
  2349. return self}, function($ctx1) {$ctx1.fill(self,"=",{aString:aString},smalltalk.String)})},
  2350. messageSends: []}),
  2351. smalltalk.String);
  2352. smalltalk.addMethod(
  2353. smalltalk.method({
  2354. selector: "==",
  2355. fn: function (aString){
  2356. var self=this;
  2357. return smalltalk.withContext(function($ctx1) {
  2358. var $1;
  2359. $1=_st(self).__eq(aString);
  2360. return $1;
  2361. }, function($ctx1) {$ctx1.fill(self,"==",{aString:aString},smalltalk.String)})},
  2362. messageSends: ["="]}),
  2363. smalltalk.String);
  2364. smalltalk.addMethod(
  2365. smalltalk.method({
  2366. selector: ">",
  2367. fn: function (aString){
  2368. var self=this;
  2369. return smalltalk.withContext(function($ctx1) {
  2370. return String(self) > aString._asString();
  2371. return self}, function($ctx1) {$ctx1.fill(self,">",{aString:aString},smalltalk.String)})},
  2372. messageSends: []}),
  2373. smalltalk.String);
  2374. smalltalk.addMethod(
  2375. smalltalk.method({
  2376. selector: ">=",
  2377. fn: function (aString){
  2378. var self=this;
  2379. return smalltalk.withContext(function($ctx1) {
  2380. return String(self) >= aString._asString();
  2381. return self}, function($ctx1) {$ctx1.fill(self,">=",{aString:aString},smalltalk.String)})},
  2382. messageSends: []}),
  2383. smalltalk.String);
  2384. smalltalk.addMethod(
  2385. smalltalk.method({
  2386. selector: "asJSON",
  2387. fn: function (){
  2388. var self=this;
  2389. return smalltalk.withContext(function($ctx1) {
  2390. var $1;
  2391. $1=self;
  2392. return $1;
  2393. }, function($ctx1) {$ctx1.fill(self,"asJSON",{},smalltalk.String)})},
  2394. messageSends: []}),
  2395. smalltalk.String);
  2396. smalltalk.addMethod(
  2397. smalltalk.method({
  2398. selector: "asJavascript",
  2399. fn: function (){
  2400. var self=this;
  2401. return smalltalk.withContext(function($ctx1) {
  2402. if(self.search(/^[a-zA-Z0-9_:.$ ]*$/) == -1)
  2403. return "\"" + self.replace(/[\x00-\x1f"\\\x7f-\x9f]/g, function(ch){var c=ch.charCodeAt(0);return "\\x"+("0"+c.toString(16)).slice(-2)}) + "\"";
  2404. else
  2405. return "\"" + self + "\"";
  2406. ;
  2407. return self}, function($ctx1) {$ctx1.fill(self,"asJavascript",{},smalltalk.String)})},
  2408. messageSends: []}),
  2409. smalltalk.String);
  2410. smalltalk.addMethod(
  2411. smalltalk.method({
  2412. selector: "asLowercase",
  2413. fn: function (){
  2414. var self=this;
  2415. return smalltalk.withContext(function($ctx1) {
  2416. return self.toLowerCase();
  2417. return self}, function($ctx1) {$ctx1.fill(self,"asLowercase",{},smalltalk.String)})},
  2418. messageSends: []}),
  2419. smalltalk.String);
  2420. smalltalk.addMethod(
  2421. smalltalk.method({
  2422. selector: "asNumber",
  2423. fn: function (){
  2424. var self=this;
  2425. return smalltalk.withContext(function($ctx1) {
  2426. return Number(self);
  2427. return self}, function($ctx1) {$ctx1.fill(self,"asNumber",{},smalltalk.String)})},
  2428. messageSends: []}),
  2429. smalltalk.String);
  2430. smalltalk.addMethod(
  2431. smalltalk.method({
  2432. selector: "asRegexp",
  2433. fn: function (){
  2434. var self=this;
  2435. function $RegularExpression(){return smalltalk.RegularExpression||(typeof RegularExpression=="undefined"?nil:RegularExpression)}
  2436. return smalltalk.withContext(function($ctx1) {
  2437. var $1;
  2438. $1=_st($RegularExpression())._fromString_(self);
  2439. return $1;
  2440. }, function($ctx1) {$ctx1.fill(self,"asRegexp",{},smalltalk.String)})},
  2441. messageSends: ["fromString:"]}),
  2442. smalltalk.String);
  2443. smalltalk.addMethod(
  2444. smalltalk.method({
  2445. selector: "asSelector",
  2446. fn: function (){
  2447. var self=this;
  2448. return smalltalk.withContext(function($ctx1) {
  2449. return smalltalk.selector(self);
  2450. return self}, function($ctx1) {$ctx1.fill(self,"asSelector",{},smalltalk.String)})},
  2451. messageSends: []}),
  2452. smalltalk.String);
  2453. smalltalk.addMethod(
  2454. smalltalk.method({
  2455. selector: "asString",
  2456. fn: function (){
  2457. var self=this;
  2458. return smalltalk.withContext(function($ctx1) {
  2459. var $1;
  2460. $1=self;
  2461. return $1;
  2462. }, function($ctx1) {$ctx1.fill(self,"asString",{},smalltalk.String)})},
  2463. messageSends: []}),
  2464. smalltalk.String);
  2465. smalltalk.addMethod(
  2466. smalltalk.method({
  2467. selector: "asSymbol",
  2468. fn: function (){
  2469. var self=this;
  2470. return smalltalk.withContext(function($ctx1) {
  2471. var $1;
  2472. $1=self;
  2473. return $1;
  2474. }, function($ctx1) {$ctx1.fill(self,"asSymbol",{},smalltalk.String)})},
  2475. messageSends: []}),
  2476. smalltalk.String);
  2477. smalltalk.addMethod(
  2478. smalltalk.method({
  2479. selector: "asUppercase",
  2480. fn: function (){
  2481. var self=this;
  2482. return smalltalk.withContext(function($ctx1) {
  2483. return self.toUpperCase();
  2484. return self}, function($ctx1) {$ctx1.fill(self,"asUppercase",{},smalltalk.String)})},
  2485. messageSends: []}),
  2486. smalltalk.String);
  2487. smalltalk.addMethod(
  2488. smalltalk.method({
  2489. selector: "asciiValue",
  2490. fn: function (){
  2491. var self=this;
  2492. return smalltalk.withContext(function($ctx1) {
  2493. return self.charCodeAt(0);;
  2494. return self}, function($ctx1) {$ctx1.fill(self,"asciiValue",{},smalltalk.String)})},
  2495. messageSends: []}),
  2496. smalltalk.String);
  2497. smalltalk.addMethod(
  2498. smalltalk.method({
  2499. selector: "at:ifAbsent:",
  2500. fn: function (anIndex,aBlock){
  2501. var self=this;
  2502. return smalltalk.withContext(function($ctx1) {
  2503. return String(self).charAt(anIndex - 1) || aBlock();
  2504. return self}, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{anIndex:anIndex,aBlock:aBlock},smalltalk.String)})},
  2505. messageSends: []}),
  2506. smalltalk.String);
  2507. smalltalk.addMethod(
  2508. smalltalk.method({
  2509. selector: "at:ifPresent:ifAbsent:",
  2510. fn: function (anIndex,aBlock,anotherBlock){
  2511. var self=this;
  2512. return smalltalk.withContext(function($ctx1) {
  2513. var result = String(self).charAt(anIndex - 1);
  2514. return result ? aBlock._value_(result) : anotherBlock._value();
  2515. ;
  2516. return self}, function($ctx1) {$ctx1.fill(self,"at:ifPresent:ifAbsent:",{anIndex:anIndex,aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.String)})},
  2517. messageSends: []}),
  2518. smalltalk.String);
  2519. smalltalk.addMethod(
  2520. smalltalk.method({
  2521. selector: "charCodeAt:",
  2522. fn: function (anInteger){
  2523. var self=this;
  2524. return smalltalk.withContext(function($ctx1) {
  2525. return self.charCodeAt(anInteger - 1) ;
  2526. return self}, function($ctx1) {$ctx1.fill(self,"charCodeAt:",{anInteger:anInteger},smalltalk.String)})},
  2527. messageSends: []}),
  2528. smalltalk.String);
  2529. smalltalk.addMethod(
  2530. smalltalk.method({
  2531. selector: "copyFrom:to:",
  2532. fn: function (anIndex,anotherIndex){
  2533. var self=this;
  2534. return smalltalk.withContext(function($ctx1) {
  2535. return self.substring(anIndex - 1, anotherIndex);
  2536. return self}, function($ctx1) {$ctx1.fill(self,"copyFrom:to:",{anIndex:anIndex,anotherIndex:anotherIndex},smalltalk.String)})},
  2537. messageSends: []}),
  2538. smalltalk.String);
  2539. smalltalk.addMethod(
  2540. smalltalk.method({
  2541. selector: "crlfSanitized",
  2542. fn: function (){
  2543. var self=this;
  2544. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  2545. return smalltalk.withContext(function($ctx1) {
  2546. var $1;
  2547. $1=_st(_st(self)._lines())._join_(_st($String())._lf());
  2548. return $1;
  2549. }, function($ctx1) {$ctx1.fill(self,"crlfSanitized",{},smalltalk.String)})},
  2550. messageSends: ["join:", "lf", "lines"]}),
  2551. smalltalk.String);
  2552. smalltalk.addMethod(
  2553. smalltalk.method({
  2554. selector: "deepCopy",
  2555. fn: function (){
  2556. var self=this;
  2557. return smalltalk.withContext(function($ctx1) {
  2558. var $1;
  2559. $1=_st(self)._shallowCopy();
  2560. return $1;
  2561. }, function($ctx1) {$ctx1.fill(self,"deepCopy",{},smalltalk.String)})},
  2562. messageSends: ["shallowCopy"]}),
  2563. smalltalk.String);
  2564. smalltalk.addMethod(
  2565. smalltalk.method({
  2566. selector: "do:",
  2567. fn: function (aBlock){
  2568. var self=this;
  2569. return smalltalk.withContext(function($ctx1) {
  2570. for(var i=0;i<self.length;i++){aBlock(self.charAt(i));};
  2571. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.String)})},
  2572. messageSends: []}),
  2573. smalltalk.String);
  2574. smalltalk.addMethod(
  2575. smalltalk.method({
  2576. selector: "escaped",
  2577. fn: function (){
  2578. var self=this;
  2579. return smalltalk.withContext(function($ctx1) {
  2580. return escape(self);
  2581. return self}, function($ctx1) {$ctx1.fill(self,"escaped",{},smalltalk.String)})},
  2582. messageSends: []}),
  2583. smalltalk.String);
  2584. smalltalk.addMethod(
  2585. smalltalk.method({
  2586. selector: "includesSubString:",
  2587. fn: function (subString){
  2588. var self=this;
  2589. return smalltalk.withContext(function($ctx1) {
  2590. return self.indexOf(subString) != -1 ;
  2591. return self}, function($ctx1) {$ctx1.fill(self,"includesSubString:",{subString:subString},smalltalk.String)})},
  2592. messageSends: []}),
  2593. smalltalk.String);
  2594. smalltalk.addMethod(
  2595. smalltalk.method({
  2596. selector: "isImmutable",
  2597. fn: function (){
  2598. var self=this;
  2599. return smalltalk.withContext(function($ctx1) {
  2600. return true;
  2601. }, function($ctx1) {$ctx1.fill(self,"isImmutable",{},smalltalk.String)})},
  2602. messageSends: []}),
  2603. smalltalk.String);
  2604. smalltalk.addMethod(
  2605. smalltalk.method({
  2606. selector: "isString",
  2607. fn: function (){
  2608. var self=this;
  2609. return smalltalk.withContext(function($ctx1) {
  2610. return true;
  2611. }, function($ctx1) {$ctx1.fill(self,"isString",{},smalltalk.String)})},
  2612. messageSends: []}),
  2613. smalltalk.String);
  2614. smalltalk.addMethod(
  2615. smalltalk.method({
  2616. selector: "isVowel",
  2617. fn: function (){
  2618. var self=this;
  2619. return smalltalk.withContext(function($ctx1) {
  2620. var $1;
  2621. $1=_st(_st(_st(self)._size()).__eq((1)))._and_((function(){
  2622. return smalltalk.withContext(function($ctx2) {
  2623. return _st("aeiou")._includes_(_st(self)._asLowercase());
  2624. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2625. return $1;
  2626. }, function($ctx1) {$ctx1.fill(self,"isVowel",{},smalltalk.String)})},
  2627. messageSends: ["and:", "includes:", "asLowercase", "=", "size"]}),
  2628. smalltalk.String);
  2629. smalltalk.addMethod(
  2630. smalltalk.method({
  2631. selector: "join:",
  2632. fn: function (aCollection){
  2633. var self=this;
  2634. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  2635. return smalltalk.withContext(function($ctx1) {
  2636. var $1;
  2637. $1=_st($String())._streamContents_((function(stream){
  2638. return smalltalk.withContext(function($ctx2) {
  2639. return _st(aCollection)._do_separatedBy_((function(each){
  2640. return smalltalk.withContext(function($ctx3) {
  2641. return _st(stream)._nextPutAll_(_st(each)._asString());
  2642. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}),(function(){
  2643. return smalltalk.withContext(function($ctx3) {
  2644. return _st(stream)._nextPutAll_(self);
  2645. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2646. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
  2647. return $1;
  2648. }, function($ctx1) {$ctx1.fill(self,"join:",{aCollection:aCollection},smalltalk.String)})},
  2649. messageSends: ["streamContents:", "do:separatedBy:", "nextPutAll:", "asString"]}),
  2650. smalltalk.String);
  2651. smalltalk.addMethod(
  2652. smalltalk.method({
  2653. selector: "lineIndicesDo:",
  2654. fn: function (aBlock){
  2655. var self=this;
  2656. var cr,lf,start,sz,nextLF,nextCR;
  2657. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  2658. return smalltalk.withContext(function($ctx1) {
  2659. var $1,$2,$3,$4;
  2660. var $early={};
  2661. try {
  2662. start=(1);
  2663. sz=_st(self)._size();
  2664. cr=_st($String())._cr();
  2665. nextCR=_st(self)._indexOf_startingAt_(cr,(1));
  2666. lf=_st($String())._lf();
  2667. nextLF=_st(self)._indexOf_startingAt_(lf,(1));
  2668. _st((function(){
  2669. return smalltalk.withContext(function($ctx2) {
  2670. return _st(start).__lt_eq(sz);
  2671. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  2672. return smalltalk.withContext(function($ctx2) {
  2673. $1=_st(_st(nextLF).__eq((0)))._and_((function(){
  2674. return smalltalk.withContext(function($ctx3) {
  2675. return _st(nextCR).__eq((0));
  2676. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2677. if(smalltalk.assert($1)){
  2678. _st(aBlock)._value_value_value_(start,sz,sz);
  2679. $2=self;
  2680. throw $early=[$2];
  2681. };
  2682. $3=_st(_st(nextCR).__eq((0)))._or_((function(){
  2683. return smalltalk.withContext(function($ctx3) {
  2684. return _st(_st((0)).__lt(nextLF))._and_((function(){
  2685. return smalltalk.withContext(function($ctx4) {
  2686. return _st(nextLF).__lt(nextCR);
  2687. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  2688. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2689. if(smalltalk.assert($3)){
  2690. _st(aBlock)._value_value_value_(start,_st(nextLF).__minus((1)),nextLF);
  2691. start=_st((1)).__plus(nextLF);
  2692. start;
  2693. nextLF=_st(self)._indexOf_startingAt_(lf,start);
  2694. return nextLF;
  2695. } else {
  2696. $4=_st(_st((1)).__plus(nextCR)).__eq(nextLF);
  2697. if(smalltalk.assert($4)){
  2698. _st(aBlock)._value_value_value_(start,_st(nextCR).__minus((1)),nextLF);
  2699. start=_st((1)).__plus(nextLF);
  2700. start;
  2701. nextCR=_st(self)._indexOf_startingAt_(cr,start);
  2702. nextCR;
  2703. nextLF=_st(self)._indexOf_startingAt_(lf,start);
  2704. return nextLF;
  2705. } else {
  2706. _st(aBlock)._value_value_value_(start,_st(nextCR).__minus((1)),nextCR);
  2707. start=_st((1)).__plus(nextCR);
  2708. start;
  2709. nextCR=_st(self)._indexOf_startingAt_(cr,start);
  2710. return nextCR;
  2711. };
  2712. };
  2713. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2714. return self}
  2715. catch(e) {if(e===$early)return e[0]; throw e}
  2716. }, function($ctx1) {$ctx1.fill(self,"lineIndicesDo:",{aBlock:aBlock,cr:cr,lf:lf,start:start,sz:sz,nextLF:nextLF,nextCR:nextCR},smalltalk.String)})},
  2717. messageSends: ["size", "cr", "indexOf:startingAt:", "lf", "whileTrue:", "ifTrue:", "value:value:value:", "and:", "=", "ifTrue:ifFalse:", "-", "+", "or:", "<", "<="]}),
  2718. smalltalk.String);
  2719. smalltalk.addMethod(
  2720. smalltalk.method({
  2721. selector: "lineNumber:",
  2722. fn: function (anIndex){
  2723. var self=this;
  2724. var lineCount;
  2725. return smalltalk.withContext(function($ctx1) {
  2726. var $1,$2;
  2727. var $early={};
  2728. try {
  2729. lineCount=(0);
  2730. _st(self)._lineIndicesDo_((function(start,endWithoutDelimiters,end){
  2731. return smalltalk.withContext(function($ctx2) {
  2732. lineCount=_st(lineCount).__plus((1));
  2733. $1=_st(lineCount).__eq(anIndex);
  2734. if(smalltalk.assert($1)){
  2735. $2=_st(self)._copyFrom_to_(start,endWithoutDelimiters);
  2736. throw $early=[$2];
  2737. };
  2738. }, function($ctx2) {$ctx2.fillBlock({start:start,endWithoutDelimiters:endWithoutDelimiters,end:end},$ctx1)})}));
  2739. return nil;
  2740. }
  2741. catch(e) {if(e===$early)return e[0]; throw e}
  2742. }, function($ctx1) {$ctx1.fill(self,"lineNumber:",{anIndex:anIndex,lineCount:lineCount},smalltalk.String)})},
  2743. messageSends: ["lineIndicesDo:", "ifTrue:", "copyFrom:to:", "=", "+"]}),
  2744. smalltalk.String);
  2745. smalltalk.addMethod(
  2746. smalltalk.method({
  2747. selector: "lines",
  2748. fn: function (){
  2749. var self=this;
  2750. var lines;
  2751. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  2752. return smalltalk.withContext(function($ctx1) {
  2753. var $1;
  2754. lines=_st($Array())._new();
  2755. _st(self)._linesDo_((function(aLine){
  2756. return smalltalk.withContext(function($ctx2) {
  2757. return _st(lines)._add_(aLine);
  2758. }, function($ctx2) {$ctx2.fillBlock({aLine:aLine},$ctx1)})}));
  2759. $1=lines;
  2760. return $1;
  2761. }, function($ctx1) {$ctx1.fill(self,"lines",{lines:lines},smalltalk.String)})},
  2762. messageSends: ["new", "linesDo:", "add:"]}),
  2763. smalltalk.String);
  2764. smalltalk.addMethod(
  2765. smalltalk.method({
  2766. selector: "linesDo:",
  2767. fn: function (aBlock){
  2768. var self=this;
  2769. return smalltalk.withContext(function($ctx1) {
  2770. _st(self)._lineIndicesDo_((function(start,endWithoutDelimiters,end){
  2771. return smalltalk.withContext(function($ctx2) {
  2772. return _st(aBlock)._value_(_st(self)._copyFrom_to_(start,endWithoutDelimiters));
  2773. }, function($ctx2) {$ctx2.fillBlock({start:start,endWithoutDelimiters:endWithoutDelimiters,end:end},$ctx1)})}));
  2774. return self}, function($ctx1) {$ctx1.fill(self,"linesDo:",{aBlock:aBlock},smalltalk.String)})},
  2775. messageSends: ["lineIndicesDo:", "value:", "copyFrom:to:"]}),
  2776. smalltalk.String);
  2777. smalltalk.addMethod(
  2778. smalltalk.method({
  2779. selector: "match:",
  2780. fn: function (aRegexp){
  2781. var self=this;
  2782. return smalltalk.withContext(function($ctx1) {
  2783. return self.search(aRegexp) != -1;
  2784. return self}, function($ctx1) {$ctx1.fill(self,"match:",{aRegexp:aRegexp},smalltalk.String)})},
  2785. messageSends: []}),
  2786. smalltalk.String);
  2787. smalltalk.addMethod(
  2788. smalltalk.method({
  2789. selector: "matchesOf:",
  2790. fn: function (aRegularExpression){
  2791. var self=this;
  2792. return smalltalk.withContext(function($ctx1) {
  2793. return self.match(aRegularExpression);
  2794. return self}, function($ctx1) {$ctx1.fill(self,"matchesOf:",{aRegularExpression:aRegularExpression},smalltalk.String)})},
  2795. messageSends: []}),
  2796. smalltalk.String);
  2797. smalltalk.addMethod(
  2798. smalltalk.method({
  2799. selector: "printNl",
  2800. fn: function (){
  2801. var self=this;
  2802. return smalltalk.withContext(function($ctx1) {
  2803. console.log(self);
  2804. return self}, function($ctx1) {$ctx1.fill(self,"printNl",{},smalltalk.String)})},
  2805. messageSends: []}),
  2806. smalltalk.String);
  2807. smalltalk.addMethod(
  2808. smalltalk.method({
  2809. selector: "printOn:",
  2810. fn: function (aStream){
  2811. var self=this;
  2812. return smalltalk.withContext(function($ctx1) {
  2813. var $1,$2;
  2814. $1=aStream;
  2815. _st($1)._nextPutAll_("'");
  2816. _st($1)._nextPutAll_(self);
  2817. $2=_st($1)._nextPutAll_("'");
  2818. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.String)})},
  2819. messageSends: ["nextPutAll:"]}),
  2820. smalltalk.String);
  2821. smalltalk.addMethod(
  2822. smalltalk.method({
  2823. selector: "replace:with:",
  2824. fn: function (aString,anotherString){
  2825. var self=this;
  2826. function $RegularExpression(){return smalltalk.RegularExpression||(typeof RegularExpression=="undefined"?nil:RegularExpression)}
  2827. return smalltalk.withContext(function($ctx1) {
  2828. var $1;
  2829. $1=_st(self)._replaceRegexp_with_(_st($RegularExpression())._fromString_flag_(aString,"g"),anotherString);
  2830. return $1;
  2831. }, function($ctx1) {$ctx1.fill(self,"replace:with:",{aString:aString,anotherString:anotherString},smalltalk.String)})},
  2832. messageSends: ["replaceRegexp:with:", "fromString:flag:"]}),
  2833. smalltalk.String);
  2834. smalltalk.addMethod(
  2835. smalltalk.method({
  2836. selector: "replaceRegexp:with:",
  2837. fn: function (aRegexp,aString){
  2838. var self=this;
  2839. return smalltalk.withContext(function($ctx1) {
  2840. return self.replace(aRegexp, aString);
  2841. return self}, function($ctx1) {$ctx1.fill(self,"replaceRegexp:with:",{aRegexp:aRegexp,aString:aString},smalltalk.String)})},
  2842. messageSends: []}),
  2843. smalltalk.String);
  2844. smalltalk.addMethod(
  2845. smalltalk.method({
  2846. selector: "reversed",
  2847. fn: function (){
  2848. var self=this;
  2849. return smalltalk.withContext(function($ctx1) {
  2850. return self.split("").reverse().join("");
  2851. return self}, function($ctx1) {$ctx1.fill(self,"reversed",{},smalltalk.String)})},
  2852. messageSends: []}),
  2853. smalltalk.String);
  2854. smalltalk.addMethod(
  2855. smalltalk.method({
  2856. selector: "shallowCopy",
  2857. fn: function (){
  2858. var self=this;
  2859. return smalltalk.withContext(function($ctx1) {
  2860. var $1;
  2861. $1=_st(_st(self)._class())._fromString_(self);
  2862. return $1;
  2863. }, function($ctx1) {$ctx1.fill(self,"shallowCopy",{},smalltalk.String)})},
  2864. messageSends: ["fromString:", "class"]}),
  2865. smalltalk.String);
  2866. smalltalk.addMethod(
  2867. smalltalk.method({
  2868. selector: "size",
  2869. fn: function (){
  2870. var self=this;
  2871. return smalltalk.withContext(function($ctx1) {
  2872. return self.length;
  2873. return self}, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.String)})},
  2874. messageSends: []}),
  2875. smalltalk.String);
  2876. smalltalk.addMethod(
  2877. smalltalk.method({
  2878. selector: "subStrings:",
  2879. fn: function (aString){
  2880. var self=this;
  2881. return smalltalk.withContext(function($ctx1) {
  2882. var $1;
  2883. $1=_st(self)._tokenize_(aString);
  2884. return $1;
  2885. }, function($ctx1) {$ctx1.fill(self,"subStrings:",{aString:aString},smalltalk.String)})},
  2886. messageSends: ["tokenize:"]}),
  2887. smalltalk.String);
  2888. smalltalk.addMethod(
  2889. smalltalk.method({
  2890. selector: "tokenize:",
  2891. fn: function (aString){
  2892. var self=this;
  2893. return smalltalk.withContext(function($ctx1) {
  2894. return self.split(aString);
  2895. return self}, function($ctx1) {$ctx1.fill(self,"tokenize:",{aString:aString},smalltalk.String)})},
  2896. messageSends: []}),
  2897. smalltalk.String);
  2898. smalltalk.addMethod(
  2899. smalltalk.method({
  2900. selector: "trimBoth",
  2901. fn: function (){
  2902. var self=this;
  2903. return smalltalk.withContext(function($ctx1) {
  2904. var $1;
  2905. $1=_st(self)._trimBoth_("\x5cs");
  2906. return $1;
  2907. }, function($ctx1) {$ctx1.fill(self,"trimBoth",{},smalltalk.String)})},
  2908. messageSends: ["trimBoth:"]}),
  2909. smalltalk.String);
  2910. smalltalk.addMethod(
  2911. smalltalk.method({
  2912. selector: "trimBoth:",
  2913. fn: function (separators){
  2914. var self=this;
  2915. return smalltalk.withContext(function($ctx1) {
  2916. var $1;
  2917. $1=_st(_st(self)._trimLeft_(separators))._trimRight_(separators);
  2918. return $1;
  2919. }, function($ctx1) {$ctx1.fill(self,"trimBoth:",{separators:separators},smalltalk.String)})},
  2920. messageSends: ["trimRight:", "trimLeft:"]}),
  2921. smalltalk.String);
  2922. smalltalk.addMethod(
  2923. smalltalk.method({
  2924. selector: "trimLeft",
  2925. fn: function (){
  2926. var self=this;
  2927. return smalltalk.withContext(function($ctx1) {
  2928. var $1;
  2929. $1=_st(self)._trimLeft_("\x5cs");
  2930. return $1;
  2931. }, function($ctx1) {$ctx1.fill(self,"trimLeft",{},smalltalk.String)})},
  2932. messageSends: ["trimLeft:"]}),
  2933. smalltalk.String);
  2934. smalltalk.addMethod(
  2935. smalltalk.method({
  2936. selector: "trimLeft:",
  2937. fn: function (separators){
  2938. var self=this;
  2939. function $RegularExpression(){return smalltalk.RegularExpression||(typeof RegularExpression=="undefined"?nil:RegularExpression)}
  2940. return smalltalk.withContext(function($ctx1) {
  2941. var $1;
  2942. $1=_st(self)._replaceRegexp_with_(_st($RegularExpression())._fromString_flag_(_st(_st("^[").__comma(separators)).__comma("]+"),"g"),"");
  2943. return $1;
  2944. }, function($ctx1) {$ctx1.fill(self,"trimLeft:",{separators:separators},smalltalk.String)})},
  2945. messageSends: ["replaceRegexp:with:", "fromString:flag:", ","]}),
  2946. smalltalk.String);
  2947. smalltalk.addMethod(
  2948. smalltalk.method({
  2949. selector: "trimRight",
  2950. fn: function (){
  2951. var self=this;
  2952. return smalltalk.withContext(function($ctx1) {
  2953. var $1;
  2954. $1=_st(self)._trimRight_("\x5cs");
  2955. return $1;
  2956. }, function($ctx1) {$ctx1.fill(self,"trimRight",{},smalltalk.String)})},
  2957. messageSends: ["trimRight:"]}),
  2958. smalltalk.String);
  2959. smalltalk.addMethod(
  2960. smalltalk.method({
  2961. selector: "trimRight:",
  2962. fn: function (separators){
  2963. var self=this;
  2964. function $RegularExpression(){return smalltalk.RegularExpression||(typeof RegularExpression=="undefined"?nil:RegularExpression)}
  2965. return smalltalk.withContext(function($ctx1) {
  2966. var $1;
  2967. $1=_st(self)._replaceRegexp_with_(_st($RegularExpression())._fromString_flag_(_st(_st("[").__comma(separators)).__comma("]+$"),"g"),"");
  2968. return $1;
  2969. }, function($ctx1) {$ctx1.fill(self,"trimRight:",{separators:separators},smalltalk.String)})},
  2970. messageSends: ["replaceRegexp:with:", "fromString:flag:", ","]}),
  2971. smalltalk.String);
  2972. smalltalk.addMethod(
  2973. smalltalk.method({
  2974. selector: "unescaped",
  2975. fn: function (){
  2976. var self=this;
  2977. return smalltalk.withContext(function($ctx1) {
  2978. return unescape(self);
  2979. return self}, function($ctx1) {$ctx1.fill(self,"unescaped",{},smalltalk.String)})},
  2980. messageSends: []}),
  2981. smalltalk.String);
  2982. smalltalk.addMethod(
  2983. smalltalk.method({
  2984. selector: "withIndexDo:",
  2985. fn: function (aBlock){
  2986. var self=this;
  2987. return smalltalk.withContext(function($ctx1) {
  2988. for(var i=0;i<self.length;i++){aBlock(self.charAt(i), i+1);};
  2989. return self}, function($ctx1) {$ctx1.fill(self,"withIndexDo:",{aBlock:aBlock},smalltalk.String)})},
  2990. messageSends: []}),
  2991. smalltalk.String);
  2992. smalltalk.addMethod(
  2993. smalltalk.method({
  2994. selector: "cr",
  2995. fn: function (){
  2996. var self=this;
  2997. return smalltalk.withContext(function($ctx1) {
  2998. return '\r';
  2999. return self}, function($ctx1) {$ctx1.fill(self,"cr",{},smalltalk.String.klass)})},
  3000. messageSends: []}),
  3001. smalltalk.String.klass);
  3002. smalltalk.addMethod(
  3003. smalltalk.method({
  3004. selector: "crlf",
  3005. fn: function (){
  3006. var self=this;
  3007. return smalltalk.withContext(function($ctx1) {
  3008. return '\r\n';
  3009. return self}, function($ctx1) {$ctx1.fill(self,"crlf",{},smalltalk.String.klass)})},
  3010. messageSends: []}),
  3011. smalltalk.String.klass);
  3012. smalltalk.addMethod(
  3013. smalltalk.method({
  3014. selector: "fromCharCode:",
  3015. fn: function (anInteger){
  3016. var self=this;
  3017. return smalltalk.withContext(function($ctx1) {
  3018. return String.fromCharCode(anInteger);
  3019. return self}, function($ctx1) {$ctx1.fill(self,"fromCharCode:",{anInteger:anInteger},smalltalk.String.klass)})},
  3020. messageSends: []}),
  3021. smalltalk.String.klass);
  3022. smalltalk.addMethod(
  3023. smalltalk.method({
  3024. selector: "fromString:",
  3025. fn: function (aString){
  3026. var self=this;
  3027. return smalltalk.withContext(function($ctx1) {
  3028. return String(aString);
  3029. return self}, function($ctx1) {$ctx1.fill(self,"fromString:",{aString:aString},smalltalk.String.klass)})},
  3030. messageSends: []}),
  3031. smalltalk.String.klass);
  3032. smalltalk.addMethod(
  3033. smalltalk.method({
  3034. selector: "lf",
  3035. fn: function (){
  3036. var self=this;
  3037. return smalltalk.withContext(function($ctx1) {
  3038. return '\n';
  3039. return self}, function($ctx1) {$ctx1.fill(self,"lf",{},smalltalk.String.klass)})},
  3040. messageSends: []}),
  3041. smalltalk.String.klass);
  3042. smalltalk.addMethod(
  3043. smalltalk.method({
  3044. selector: "random",
  3045. fn: function (){
  3046. var self=this;
  3047. return smalltalk.withContext(function($ctx1) {
  3048. return (Math.random()*(22/32)+(10/32)).toString(32).slice(2);;
  3049. return self}, function($ctx1) {$ctx1.fill(self,"random",{},smalltalk.String.klass)})},
  3050. messageSends: []}),
  3051. smalltalk.String.klass);
  3052. smalltalk.addMethod(
  3053. smalltalk.method({
  3054. selector: "randomNotIn:",
  3055. fn: function (aString){
  3056. var self=this;
  3057. var result;
  3058. return smalltalk.withContext(function($ctx1) {
  3059. var $1;
  3060. _st((function(){
  3061. return smalltalk.withContext(function($ctx2) {
  3062. result=_st(self)._random();
  3063. result;
  3064. return _st(aString)._includesSubString_(result);
  3065. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue();
  3066. $1=result;
  3067. return $1;
  3068. }, function($ctx1) {$ctx1.fill(self,"randomNotIn:",{aString:aString,result:result},smalltalk.String.klass)})},
  3069. messageSends: ["whileTrue", "random", "includesSubString:"]}),
  3070. smalltalk.String.klass);
  3071. smalltalk.addMethod(
  3072. smalltalk.method({
  3073. selector: "space",
  3074. fn: function (){
  3075. var self=this;
  3076. return smalltalk.withContext(function($ctx1) {
  3077. return ' ';
  3078. return self}, function($ctx1) {$ctx1.fill(self,"space",{},smalltalk.String.klass)})},
  3079. messageSends: []}),
  3080. smalltalk.String.klass);
  3081. smalltalk.addMethod(
  3082. smalltalk.method({
  3083. selector: "streamClass",
  3084. fn: function (){
  3085. var self=this;
  3086. function $StringStream(){return smalltalk.StringStream||(typeof StringStream=="undefined"?nil:StringStream)}
  3087. return smalltalk.withContext(function($ctx1) {
  3088. var $1;
  3089. $1=$StringStream();
  3090. return $1;
  3091. }, function($ctx1) {$ctx1.fill(self,"streamClass",{},smalltalk.String.klass)})},
  3092. messageSends: []}),
  3093. smalltalk.String.klass);
  3094. smalltalk.addMethod(
  3095. smalltalk.method({
  3096. selector: "tab",
  3097. fn: function (){
  3098. var self=this;
  3099. return smalltalk.withContext(function($ctx1) {
  3100. return '\t';
  3101. return self}, function($ctx1) {$ctx1.fill(self,"tab",{},smalltalk.String.klass)})},
  3102. messageSends: []}),
  3103. smalltalk.String.klass);
  3104. smalltalk.addMethod(
  3105. smalltalk.method({
  3106. selector: "value:",
  3107. fn: function (aUTFCharCode){
  3108. var self=this;
  3109. return smalltalk.withContext(function($ctx1) {
  3110. return String.fromCharCode(aUTFCharCode);;
  3111. return self}, function($ctx1) {$ctx1.fill(self,"value:",{aUTFCharCode:aUTFCharCode},smalltalk.String.klass)})},
  3112. messageSends: []}),
  3113. smalltalk.String.klass);
  3114. smalltalk.addClass('Set', smalltalk.Collection, ['elements'], 'Kernel-Collections');
  3115. smalltalk.addMethod(
  3116. smalltalk.method({
  3117. selector: "=",
  3118. fn: function (aCollection){
  3119. var self=this;
  3120. return smalltalk.withContext(function($ctx1) {
  3121. var $1,$2,$3;
  3122. var $early={};
  3123. try {
  3124. $1=_st(_st(self)._class()).__eq(_st(aCollection)._class());
  3125. if(! smalltalk.assert($1)){
  3126. return false;
  3127. };
  3128. $2=_st(_st(self)._size()).__eq(_st(aCollection)._size());
  3129. if(! smalltalk.assert($2)){
  3130. return false;
  3131. };
  3132. _st(self)._do_((function(each){
  3133. return smalltalk.withContext(function($ctx2) {
  3134. $3=_st(aCollection)._includes_(each);
  3135. if(! smalltalk.assert($3)){
  3136. throw $early=[false];
  3137. };
  3138. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3139. return true;
  3140. }
  3141. catch(e) {if(e===$early)return e[0]; throw e}
  3142. }, function($ctx1) {$ctx1.fill(self,"=",{aCollection:aCollection},smalltalk.Set)})},
  3143. messageSends: ["ifFalse:", "=", "class", "size", "do:", "includes:"]}),
  3144. smalltalk.Set);
  3145. smalltalk.addMethod(
  3146. smalltalk.method({
  3147. selector: "add:",
  3148. fn: function (anObject){
  3149. var self=this;
  3150. return smalltalk.withContext(function($ctx1) {
  3151. var found;
  3152. for(var i=0; i < self['@elements'].length; i++) {
  3153. if(anObject == self['@elements'][i]) {
  3154. found = true;
  3155. break;
  3156. }
  3157. }
  3158. if(!found) {self['@elements'].push(anObject)}
  3159. ;
  3160. return self}, function($ctx1) {$ctx1.fill(self,"add:",{anObject:anObject},smalltalk.Set)})},
  3161. messageSends: []}),
  3162. smalltalk.Set);
  3163. smalltalk.addMethod(
  3164. smalltalk.method({
  3165. selector: "asArray",
  3166. fn: function (){
  3167. var self=this;
  3168. return smalltalk.withContext(function($ctx1) {
  3169. var $1;
  3170. $1=_st(self["@elements"])._copy();
  3171. return $1;
  3172. }, function($ctx1) {$ctx1.fill(self,"asArray",{},smalltalk.Set)})},
  3173. messageSends: ["copy"]}),
  3174. smalltalk.Set);
  3175. smalltalk.addMethod(
  3176. smalltalk.method({
  3177. selector: "collect:",
  3178. fn: function (aBlock){
  3179. var self=this;
  3180. return smalltalk.withContext(function($ctx1) {
  3181. var $1;
  3182. $1=_st(_st(self)._class())._withAll_(_st(self["@elements"])._collect_(aBlock));
  3183. return $1;
  3184. }, function($ctx1) {$ctx1.fill(self,"collect:",{aBlock:aBlock},smalltalk.Set)})},
  3185. messageSends: ["withAll:", "collect:", "class"]}),
  3186. smalltalk.Set);
  3187. smalltalk.addMethod(
  3188. smalltalk.method({
  3189. selector: "detect:ifNone:",
  3190. fn: function (aBlock,anotherBlock){
  3191. var self=this;
  3192. return smalltalk.withContext(function($ctx1) {
  3193. var $1;
  3194. $1=_st(self["@elements"])._detect_ifNone_(aBlock,anotherBlock);
  3195. return $1;
  3196. }, function($ctx1) {$ctx1.fill(self,"detect:ifNone:",{aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.Set)})},
  3197. messageSends: ["detect:ifNone:"]}),
  3198. smalltalk.Set);
  3199. smalltalk.addMethod(
  3200. smalltalk.method({
  3201. selector: "do:",
  3202. fn: function (aBlock){
  3203. var self=this;
  3204. return smalltalk.withContext(function($ctx1) {
  3205. _st(self["@elements"])._do_(aBlock);
  3206. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.Set)})},
  3207. messageSends: ["do:"]}),
  3208. smalltalk.Set);
  3209. smalltalk.addMethod(
  3210. smalltalk.method({
  3211. selector: "includes:",
  3212. fn: function (anObject){
  3213. var self=this;
  3214. return smalltalk.withContext(function($ctx1) {
  3215. var $1;
  3216. $1=_st(self["@elements"])._includes_(anObject);
  3217. return $1;
  3218. }, function($ctx1) {$ctx1.fill(self,"includes:",{anObject:anObject},smalltalk.Set)})},
  3219. messageSends: ["includes:"]}),
  3220. smalltalk.Set);
  3221. smalltalk.addMethod(
  3222. smalltalk.method({
  3223. selector: "initialize",
  3224. fn: function (){
  3225. var self=this;
  3226. return smalltalk.withContext(function($ctx1) {
  3227. smalltalk.Collection.fn.prototype._initialize.apply(_st(self), []);
  3228. self["@elements"]=[];
  3229. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Set)})},
  3230. messageSends: ["initialize"]}),
  3231. smalltalk.Set);
  3232. smalltalk.addMethod(
  3233. smalltalk.method({
  3234. selector: "printOn:",
  3235. fn: function (aStream){
  3236. var self=this;
  3237. return smalltalk.withContext(function($ctx1) {
  3238. smalltalk.Collection.fn.prototype._printOn_.apply(_st(self), [aStream]);
  3239. _st(aStream)._nextPutAll_(" (");
  3240. _st(self)._do_separatedBy_((function(each){
  3241. return smalltalk.withContext(function($ctx2) {
  3242. return _st(each)._printOn_(aStream);
  3243. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  3244. return smalltalk.withContext(function($ctx2) {
  3245. return _st(aStream)._nextPutAll_(" ");
  3246. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3247. _st(aStream)._nextPutAll_(")");
  3248. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Set)})},
  3249. messageSends: ["printOn:", "nextPutAll:", "do:separatedBy:"]}),
  3250. smalltalk.Set);
  3251. smalltalk.addMethod(
  3252. smalltalk.method({
  3253. selector: "remove:",
  3254. fn: function (anObject){
  3255. var self=this;
  3256. return smalltalk.withContext(function($ctx1) {
  3257. _st(self["@elements"])._remove_(anObject);
  3258. return self}, function($ctx1) {$ctx1.fill(self,"remove:",{anObject:anObject},smalltalk.Set)})},
  3259. messageSends: ["remove:"]}),
  3260. smalltalk.Set);
  3261. smalltalk.addMethod(
  3262. smalltalk.method({
  3263. selector: "remove:ifAbsent:",
  3264. fn: function (anObject,aBlock){
  3265. var self=this;
  3266. return smalltalk.withContext(function($ctx1) {
  3267. _st(self["@elements"])._remove_ifAbsent_(anObject,aBlock);
  3268. return self}, function($ctx1) {$ctx1.fill(self,"remove:ifAbsent:",{anObject:anObject,aBlock:aBlock},smalltalk.Set)})},
  3269. messageSends: ["remove:ifAbsent:"]}),
  3270. smalltalk.Set);
  3271. smalltalk.addMethod(
  3272. smalltalk.method({
  3273. selector: "select:",
  3274. fn: function (aBlock){
  3275. var self=this;
  3276. var collection;
  3277. return smalltalk.withContext(function($ctx1) {
  3278. var $1,$2;
  3279. collection=_st(_st(self)._class())._new();
  3280. _st(self)._do_((function(each){
  3281. return smalltalk.withContext(function($ctx2) {
  3282. $1=_st(aBlock)._value_(each);
  3283. if(smalltalk.assert($1)){
  3284. return _st(collection)._add_(each);
  3285. };
  3286. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3287. $2=collection;
  3288. return $2;
  3289. }, function($ctx1) {$ctx1.fill(self,"select:",{aBlock:aBlock,collection:collection},smalltalk.Set)})},
  3290. messageSends: ["new", "class", "do:", "ifTrue:", "add:", "value:"]}),
  3291. smalltalk.Set);
  3292. smalltalk.addMethod(
  3293. smalltalk.method({
  3294. selector: "size",
  3295. fn: function (){
  3296. var self=this;
  3297. return smalltalk.withContext(function($ctx1) {
  3298. var $1;
  3299. $1=_st(self["@elements"])._size();
  3300. return $1;
  3301. }, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.Set)})},
  3302. messageSends: ["size"]}),
  3303. smalltalk.Set);
  3304. smalltalk.addClass('Queue', smalltalk.Object, ['read', 'readIndex', 'write'], 'Kernel-Collections');
  3305. smalltalk.addMethod(
  3306. smalltalk.method({
  3307. selector: "initialize",
  3308. fn: function (){
  3309. var self=this;
  3310. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  3311. return smalltalk.withContext(function($ctx1) {
  3312. smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  3313. self["@read"]=_st($OrderedCollection())._new();
  3314. self["@write"]=_st($OrderedCollection())._new();
  3315. self["@readIndex"]=(1);
  3316. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Queue)})},
  3317. messageSends: ["initialize", "new"]}),
  3318. smalltalk.Queue);
  3319. smalltalk.addMethod(
  3320. smalltalk.method({
  3321. selector: "next",
  3322. fn: function (){
  3323. var self=this;
  3324. return smalltalk.withContext(function($ctx1) {
  3325. var $1;
  3326. $1=_st(self)._nextIfAbsent_((function(){
  3327. return smalltalk.withContext(function($ctx2) {
  3328. return _st(self)._error_("Cannot read from empty Queue.");
  3329. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3330. return $1;
  3331. }, function($ctx1) {$ctx1.fill(self,"next",{},smalltalk.Queue)})},
  3332. messageSends: ["nextIfAbsent:", "error:"]}),
  3333. smalltalk.Queue);
  3334. smalltalk.addMethod(
  3335. smalltalk.method({
  3336. selector: "nextIfAbsent:",
  3337. fn: function (aBlock){
  3338. var self=this;
  3339. var result;
  3340. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  3341. return smalltalk.withContext(function($ctx1) {
  3342. var $1,$2,$3,$4;
  3343. var $early={};
  3344. try {
  3345. result=_st(self["@read"])._at_ifAbsent_(self["@readIndex"],(function(){
  3346. return smalltalk.withContext(function($ctx2) {
  3347. $1=_st(self["@write"])._isEmpty();
  3348. if(smalltalk.assert($1)){
  3349. $2=_st(self["@readIndex"]).__gt((1));
  3350. if(smalltalk.assert($2)){
  3351. self["@read"]=[];
  3352. self["@read"];
  3353. self["@readIndex"]=(1);
  3354. self["@readIndex"];
  3355. };
  3356. $3=_st(aBlock)._value();
  3357. throw $early=[$3];
  3358. };
  3359. self["@read"]=self["@write"];
  3360. self["@read"];
  3361. self["@readIndex"]=(1);
  3362. self["@readIndex"];
  3363. self["@write"]=_st($OrderedCollection())._new();
  3364. self["@write"];
  3365. return _st(self["@read"])._first();
  3366. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3367. _st(self["@read"])._at_put_(self["@readIndex"],nil);
  3368. self["@readIndex"]=_st(self["@readIndex"]).__plus((1));
  3369. $4=result;
  3370. return $4;
  3371. }
  3372. catch(e) {if(e===$early)return e[0]; throw e}
  3373. }, function($ctx1) {$ctx1.fill(self,"nextIfAbsent:",{aBlock:aBlock,result:result},smalltalk.Queue)})},
  3374. messageSends: ["at:ifAbsent:", "ifTrue:", ">", "value", "isEmpty", "new", "first", "at:put:", "+"]}),
  3375. smalltalk.Queue);
  3376. smalltalk.addMethod(
  3377. smalltalk.method({
  3378. selector: "nextPut:",
  3379. fn: function (anObject){
  3380. var self=this;
  3381. return smalltalk.withContext(function($ctx1) {
  3382. _st(self["@write"])._add_(anObject);
  3383. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{anObject:anObject},smalltalk.Queue)})},
  3384. messageSends: ["add:"]}),
  3385. smalltalk.Queue);
  3386. smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel-Collections');
  3387. smalltalk.addMethod(
  3388. smalltalk.method({
  3389. selector: "compile:",
  3390. fn: function (aString){
  3391. var self=this;
  3392. return smalltalk.withContext(function($ctx1) {
  3393. return self.compile(aString);
  3394. return self}, function($ctx1) {$ctx1.fill(self,"compile:",{aString:aString},smalltalk.RegularExpression)})},
  3395. messageSends: []}),
  3396. smalltalk.RegularExpression);
  3397. smalltalk.addMethod(
  3398. smalltalk.method({
  3399. selector: "exec:",
  3400. fn: function (aString){
  3401. var self=this;
  3402. return smalltalk.withContext(function($ctx1) {
  3403. return self.exec(aString) || nil;
  3404. return self}, function($ctx1) {$ctx1.fill(self,"exec:",{aString:aString},smalltalk.RegularExpression)})},
  3405. messageSends: []}),
  3406. smalltalk.RegularExpression);
  3407. smalltalk.addMethod(
  3408. smalltalk.method({
  3409. selector: "test:",
  3410. fn: function (aString){
  3411. var self=this;
  3412. return smalltalk.withContext(function($ctx1) {
  3413. return self.test(aString);
  3414. return self}, function($ctx1) {$ctx1.fill(self,"test:",{aString:aString},smalltalk.RegularExpression)})},
  3415. messageSends: []}),
  3416. smalltalk.RegularExpression);
  3417. smalltalk.addMethod(
  3418. smalltalk.method({
  3419. selector: "fromString:",
  3420. fn: function (aString){
  3421. var self=this;
  3422. return smalltalk.withContext(function($ctx1) {
  3423. var $1;
  3424. $1=_st(self)._fromString_flag_(aString,"");
  3425. return $1;
  3426. }, function($ctx1) {$ctx1.fill(self,"fromString:",{aString:aString},smalltalk.RegularExpression.klass)})},
  3427. messageSends: ["fromString:flag:"]}),
  3428. smalltalk.RegularExpression.klass);
  3429. smalltalk.addMethod(
  3430. smalltalk.method({
  3431. selector: "fromString:flag:",
  3432. fn: function (aString,anotherString){
  3433. var self=this;
  3434. return smalltalk.withContext(function($ctx1) {
  3435. return new RegExp(aString, anotherString);
  3436. return self}, function($ctx1) {$ctx1.fill(self,"fromString:flag:",{aString:aString,anotherString:anotherString},smalltalk.RegularExpression.klass)})},
  3437. messageSends: []}),
  3438. smalltalk.RegularExpression.klass);
  3439. smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel-Collections');
  3440. smalltalk.addMethod(
  3441. smalltalk.method({
  3442. selector: "<<",
  3443. fn: function (anObject){
  3444. var self=this;
  3445. return smalltalk.withContext(function($ctx1) {
  3446. _st(self)._write_(anObject);
  3447. return self}, function($ctx1) {$ctx1.fill(self,"<<",{anObject:anObject},smalltalk.Stream)})},
  3448. messageSends: ["write:"]}),
  3449. smalltalk.Stream);
  3450. smalltalk.addMethod(
  3451. smalltalk.method({
  3452. selector: "atEnd",
  3453. fn: function (){
  3454. var self=this;
  3455. return smalltalk.withContext(function($ctx1) {
  3456. var $1;
  3457. $1=_st(_st(self)._position()).__eq(_st(self)._size());
  3458. return $1;
  3459. }, function($ctx1) {$ctx1.fill(self,"atEnd",{},smalltalk.Stream)})},
  3460. messageSends: ["=", "size", "position"]}),
  3461. smalltalk.Stream);
  3462. smalltalk.addMethod(
  3463. smalltalk.method({
  3464. selector: "atStart",
  3465. fn: function (){
  3466. var self=this;
  3467. return smalltalk.withContext(function($ctx1) {
  3468. var $1;
  3469. $1=_st(_st(self)._position()).__eq((0));
  3470. return $1;
  3471. }, function($ctx1) {$ctx1.fill(self,"atStart",{},smalltalk.Stream)})},
  3472. messageSends: ["=", "position"]}),
  3473. smalltalk.Stream);
  3474. smalltalk.addMethod(
  3475. smalltalk.method({
  3476. selector: "close",
  3477. fn: function (){
  3478. var self=this;
  3479. return smalltalk.withContext(function($ctx1) {
  3480. return self}, function($ctx1) {$ctx1.fill(self,"close",{},smalltalk.Stream)})},
  3481. messageSends: []}),
  3482. smalltalk.Stream);
  3483. smalltalk.addMethod(
  3484. smalltalk.method({
  3485. selector: "collection",
  3486. fn: function (){
  3487. var self=this;
  3488. return smalltalk.withContext(function($ctx1) {
  3489. var $1;
  3490. $1=self["@collection"];
  3491. return $1;
  3492. }, function($ctx1) {$ctx1.fill(self,"collection",{},smalltalk.Stream)})},
  3493. messageSends: []}),
  3494. smalltalk.Stream);
  3495. smalltalk.addMethod(
  3496. smalltalk.method({
  3497. selector: "contents",
  3498. fn: function (){
  3499. var self=this;
  3500. return smalltalk.withContext(function($ctx1) {
  3501. var $1;
  3502. $1=_st(_st(self)._collection())._copyFrom_to_((1),_st(self)._streamSize());
  3503. return $1;
  3504. }, function($ctx1) {$ctx1.fill(self,"contents",{},smalltalk.Stream)})},
  3505. messageSends: ["copyFrom:to:", "streamSize", "collection"]}),
  3506. smalltalk.Stream);
  3507. smalltalk.addMethod(
  3508. smalltalk.method({
  3509. selector: "do:",
  3510. fn: function (aBlock){
  3511. var self=this;
  3512. return smalltalk.withContext(function($ctx1) {
  3513. _st((function(){
  3514. return smalltalk.withContext(function($ctx2) {
  3515. return _st(self)._atEnd();
  3516. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  3517. return smalltalk.withContext(function($ctx2) {
  3518. return _st(aBlock)._value_(_st(self)._next());
  3519. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3520. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.Stream)})},
  3521. messageSends: ["whileFalse:", "value:", "next", "atEnd"]}),
  3522. smalltalk.Stream);
  3523. smalltalk.addMethod(
  3524. smalltalk.method({
  3525. selector: "flush",
  3526. fn: function (){
  3527. var self=this;
  3528. return smalltalk.withContext(function($ctx1) {
  3529. return self}, function($ctx1) {$ctx1.fill(self,"flush",{},smalltalk.Stream)})},
  3530. messageSends: []}),
  3531. smalltalk.Stream);
  3532. smalltalk.addMethod(
  3533. smalltalk.method({
  3534. selector: "isEmpty",
  3535. fn: function (){
  3536. var self=this;
  3537. return smalltalk.withContext(function($ctx1) {
  3538. var $1;
  3539. $1=_st(_st(self)._size()).__eq((0));
  3540. return $1;
  3541. }, function($ctx1) {$ctx1.fill(self,"isEmpty",{},smalltalk.Stream)})},
  3542. messageSends: ["=", "size"]}),
  3543. smalltalk.Stream);
  3544. smalltalk.addMethod(
  3545. smalltalk.method({
  3546. selector: "next",
  3547. fn: function (){
  3548. var self=this;
  3549. return smalltalk.withContext(function($ctx1) {
  3550. var $2,$1;
  3551. $2=_st(self)._atEnd();
  3552. if(smalltalk.assert($2)){
  3553. $1=nil;
  3554. } else {
  3555. _st(self)._position_(_st(_st(self)._position()).__plus((1)));
  3556. $1=_st(self["@collection"])._at_(_st(self)._position());
  3557. };
  3558. return $1;
  3559. }, function($ctx1) {$ctx1.fill(self,"next",{},smalltalk.Stream)})},
  3560. messageSends: ["ifTrue:ifFalse:", "position:", "+", "position", "at:", "atEnd"]}),
  3561. smalltalk.Stream);
  3562. smalltalk.addMethod(
  3563. smalltalk.method({
  3564. selector: "next:",
  3565. fn: function (anInteger){
  3566. var self=this;
  3567. var tempCollection;
  3568. return smalltalk.withContext(function($ctx1) {
  3569. var $1,$2;
  3570. tempCollection=_st(_st(_st(self)._collection())._class())._new();
  3571. _st(anInteger)._timesRepeat_((function(){
  3572. return smalltalk.withContext(function($ctx2) {
  3573. $1=_st(self)._atEnd();
  3574. if(! smalltalk.assert($1)){
  3575. return _st(tempCollection)._add_(_st(self)._next());
  3576. };
  3577. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3578. $2=tempCollection;
  3579. return $2;
  3580. }, function($ctx1) {$ctx1.fill(self,"next:",{anInteger:anInteger,tempCollection:tempCollection},smalltalk.Stream)})},
  3581. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", "add:", "next", "atEnd"]}),
  3582. smalltalk.Stream);
  3583. smalltalk.addMethod(
  3584. smalltalk.method({
  3585. selector: "nextPut:",
  3586. fn: function (anObject){
  3587. var self=this;
  3588. return smalltalk.withContext(function($ctx1) {
  3589. _st(self)._position_(_st(_st(self)._position()).__plus((1)));
  3590. _st(_st(self)._collection())._at_put_(_st(self)._position(),anObject);
  3591. _st(self)._setStreamSize_(_st(_st(self)._streamSize())._max_(_st(self)._position()));
  3592. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{anObject:anObject},smalltalk.Stream)})},
  3593. messageSends: ["position:", "+", "position", "at:put:", "collection", "setStreamSize:", "max:", "streamSize"]}),
  3594. smalltalk.Stream);
  3595. smalltalk.addMethod(
  3596. smalltalk.method({
  3597. selector: "nextPutAll:",
  3598. fn: function (aCollection){
  3599. var self=this;
  3600. return smalltalk.withContext(function($ctx1) {
  3601. _st(aCollection)._do_((function(each){
  3602. return smalltalk.withContext(function($ctx2) {
  3603. return _st(self)._nextPut_(each);
  3604. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3605. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAll:",{aCollection:aCollection},smalltalk.Stream)})},
  3606. messageSends: ["do:", "nextPut:"]}),
  3607. smalltalk.Stream);
  3608. smalltalk.addMethod(
  3609. smalltalk.method({
  3610. selector: "nextPutString:",
  3611. fn: function (aString){
  3612. var self=this;
  3613. return smalltalk.withContext(function($ctx1) {
  3614. _st(self)._nextPut_(aString);
  3615. return self}, function($ctx1) {$ctx1.fill(self,"nextPutString:",{aString:aString},smalltalk.Stream)})},
  3616. messageSends: ["nextPut:"]}),
  3617. smalltalk.Stream);
  3618. smalltalk.addMethod(
  3619. smalltalk.method({
  3620. selector: "peek",
  3621. fn: function (){
  3622. var self=this;
  3623. return smalltalk.withContext(function($ctx1) {
  3624. var $2,$1;
  3625. $2=_st(self)._atEnd();
  3626. if(! smalltalk.assert($2)){
  3627. $1=_st(_st(self)._collection())._at_(_st(_st(self)._position()).__plus((1)));
  3628. };
  3629. return $1;
  3630. }, function($ctx1) {$ctx1.fill(self,"peek",{},smalltalk.Stream)})},
  3631. messageSends: ["ifFalse:", "at:", "+", "position", "collection", "atEnd"]}),
  3632. smalltalk.Stream);
  3633. smalltalk.addMethod(
  3634. smalltalk.method({
  3635. selector: "position",
  3636. fn: function (){
  3637. var self=this;
  3638. return smalltalk.withContext(function($ctx1) {
  3639. var $2,$1;
  3640. $2=self["@position"];
  3641. if(($receiver = $2) == nil || $receiver == undefined){
  3642. self["@position"]=(0);
  3643. $1=self["@position"];
  3644. } else {
  3645. $1=$2;
  3646. };
  3647. return $1;
  3648. }, function($ctx1) {$ctx1.fill(self,"position",{},smalltalk.Stream)})},
  3649. messageSends: ["ifNil:"]}),
  3650. smalltalk.Stream);
  3651. smalltalk.addMethod(
  3652. smalltalk.method({
  3653. selector: "position:",
  3654. fn: function (anInteger){
  3655. var self=this;
  3656. return smalltalk.withContext(function($ctx1) {
  3657. self["@position"]=anInteger;
  3658. return self}, function($ctx1) {$ctx1.fill(self,"position:",{anInteger:anInteger},smalltalk.Stream)})},
  3659. messageSends: []}),
  3660. smalltalk.Stream);
  3661. smalltalk.addMethod(
  3662. smalltalk.method({
  3663. selector: "reset",
  3664. fn: function (){
  3665. var self=this;
  3666. return smalltalk.withContext(function($ctx1) {
  3667. _st(self)._position_((0));
  3668. return self}, function($ctx1) {$ctx1.fill(self,"reset",{},smalltalk.Stream)})},
  3669. messageSends: ["position:"]}),
  3670. smalltalk.Stream);
  3671. smalltalk.addMethod(
  3672. smalltalk.method({
  3673. selector: "resetContents",
  3674. fn: function (){
  3675. var self=this;
  3676. return smalltalk.withContext(function($ctx1) {
  3677. _st(self)._reset();
  3678. _st(self)._setStreamSize_((0));
  3679. return self}, function($ctx1) {$ctx1.fill(self,"resetContents",{},smalltalk.Stream)})},
  3680. messageSends: ["reset", "setStreamSize:"]}),
  3681. smalltalk.Stream);
  3682. smalltalk.addMethod(
  3683. smalltalk.method({
  3684. selector: "setCollection:",
  3685. fn: function (aCollection){
  3686. var self=this;
  3687. return smalltalk.withContext(function($ctx1) {
  3688. self["@collection"]=aCollection;
  3689. return self}, function($ctx1) {$ctx1.fill(self,"setCollection:",{aCollection:aCollection},smalltalk.Stream)})},
  3690. messageSends: []}),
  3691. smalltalk.Stream);
  3692. smalltalk.addMethod(
  3693. smalltalk.method({
  3694. selector: "setStreamSize:",
  3695. fn: function (anInteger){
  3696. var self=this;
  3697. return smalltalk.withContext(function($ctx1) {
  3698. self["@streamSize"]=anInteger;
  3699. return self}, function($ctx1) {$ctx1.fill(self,"setStreamSize:",{anInteger:anInteger},smalltalk.Stream)})},
  3700. messageSends: []}),
  3701. smalltalk.Stream);
  3702. smalltalk.addMethod(
  3703. smalltalk.method({
  3704. selector: "setToEnd",
  3705. fn: function (){
  3706. var self=this;
  3707. return smalltalk.withContext(function($ctx1) {
  3708. _st(self)._position_(_st(self)._size());
  3709. return self}, function($ctx1) {$ctx1.fill(self,"setToEnd",{},smalltalk.Stream)})},
  3710. messageSends: ["position:", "size"]}),
  3711. smalltalk.Stream);
  3712. smalltalk.addMethod(
  3713. smalltalk.method({
  3714. selector: "size",
  3715. fn: function (){
  3716. var self=this;
  3717. return smalltalk.withContext(function($ctx1) {
  3718. var $1;
  3719. $1=_st(self)._streamSize();
  3720. return $1;
  3721. }, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.Stream)})},
  3722. messageSends: ["streamSize"]}),
  3723. smalltalk.Stream);
  3724. smalltalk.addMethod(
  3725. smalltalk.method({
  3726. selector: "skip:",
  3727. fn: function (anInteger){
  3728. var self=this;
  3729. return smalltalk.withContext(function($ctx1) {
  3730. _st(self)._position_(_st(_st(_st(self)._position()).__plus(anInteger))._min_max_(_st(self)._size(),(0)));
  3731. return self}, function($ctx1) {$ctx1.fill(self,"skip:",{anInteger:anInteger},smalltalk.Stream)})},
  3732. messageSends: ["position:", "min:max:", "size", "+", "position"]}),
  3733. smalltalk.Stream);
  3734. smalltalk.addMethod(
  3735. smalltalk.method({
  3736. selector: "streamSize",
  3737. fn: function (){
  3738. var self=this;
  3739. return smalltalk.withContext(function($ctx1) {
  3740. var $1;
  3741. $1=self["@streamSize"];
  3742. return $1;
  3743. }, function($ctx1) {$ctx1.fill(self,"streamSize",{},smalltalk.Stream)})},
  3744. messageSends: []}),
  3745. smalltalk.Stream);
  3746. smalltalk.addMethod(
  3747. smalltalk.method({
  3748. selector: "write:",
  3749. fn: function (anObject){
  3750. var self=this;
  3751. return smalltalk.withContext(function($ctx1) {
  3752. _st(anObject)._putOn_(self);
  3753. return self}, function($ctx1) {$ctx1.fill(self,"write:",{anObject:anObject},smalltalk.Stream)})},
  3754. messageSends: ["putOn:"]}),
  3755. smalltalk.Stream);
  3756. smalltalk.addMethod(
  3757. smalltalk.method({
  3758. selector: "on:",
  3759. fn: function (aCollection){
  3760. var self=this;
  3761. return smalltalk.withContext(function($ctx1) {
  3762. var $2,$3,$1;
  3763. $2=_st(self)._new();
  3764. _st($2)._setCollection_(aCollection);
  3765. _st($2)._setStreamSize_(_st(aCollection)._size());
  3766. $3=_st($2)._yourself();
  3767. $1=$3;
  3768. return $1;
  3769. }, function($ctx1) {$ctx1.fill(self,"on:",{aCollection:aCollection},smalltalk.Stream.klass)})},
  3770. messageSends: ["setCollection:", "new", "setStreamSize:", "size", "yourself"]}),
  3771. smalltalk.Stream.klass);
  3772. smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel-Collections');
  3773. smalltalk.addMethod(
  3774. smalltalk.method({
  3775. selector: "cr",
  3776. fn: function (){
  3777. var self=this;
  3778. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  3779. return smalltalk.withContext(function($ctx1) {
  3780. var $1;
  3781. $1=_st(self)._nextPutAll_(_st($String())._cr());
  3782. return $1;
  3783. }, function($ctx1) {$ctx1.fill(self,"cr",{},smalltalk.StringStream)})},
  3784. messageSends: ["nextPutAll:", "cr"]}),
  3785. smalltalk.StringStream);
  3786. smalltalk.addMethod(
  3787. smalltalk.method({
  3788. selector: "crlf",
  3789. fn: function (){
  3790. var self=this;
  3791. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  3792. return smalltalk.withContext(function($ctx1) {
  3793. var $1;
  3794. $1=_st(self)._nextPutAll_(_st($String())._crlf());
  3795. return $1;
  3796. }, function($ctx1) {$ctx1.fill(self,"crlf",{},smalltalk.StringStream)})},
  3797. messageSends: ["nextPutAll:", "crlf"]}),
  3798. smalltalk.StringStream);
  3799. smalltalk.addMethod(
  3800. smalltalk.method({
  3801. selector: "lf",
  3802. fn: function (){
  3803. var self=this;
  3804. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  3805. return smalltalk.withContext(function($ctx1) {
  3806. var $1;
  3807. $1=_st(self)._nextPutAll_(_st($String())._lf());
  3808. return $1;
  3809. }, function($ctx1) {$ctx1.fill(self,"lf",{},smalltalk.StringStream)})},
  3810. messageSends: ["nextPutAll:", "lf"]}),
  3811. smalltalk.StringStream);
  3812. smalltalk.addMethod(
  3813. smalltalk.method({
  3814. selector: "next:",
  3815. fn: function (anInteger){
  3816. var self=this;
  3817. var tempCollection;
  3818. return smalltalk.withContext(function($ctx1) {
  3819. var $1,$2;
  3820. tempCollection=_st(_st(_st(self)._collection())._class())._new();
  3821. _st(anInteger)._timesRepeat_((function(){
  3822. return smalltalk.withContext(function($ctx2) {
  3823. $1=_st(self)._atEnd();
  3824. if(! smalltalk.assert($1)){
  3825. tempCollection=_st(tempCollection).__comma(_st(self)._next());
  3826. return tempCollection;
  3827. };
  3828. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3829. $2=tempCollection;
  3830. return $2;
  3831. }, function($ctx1) {$ctx1.fill(self,"next:",{anInteger:anInteger,tempCollection:tempCollection},smalltalk.StringStream)})},
  3832. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", ",", "next", "atEnd"]}),
  3833. smalltalk.StringStream);
  3834. smalltalk.addMethod(
  3835. smalltalk.method({
  3836. selector: "nextPut:",
  3837. fn: function (aString){
  3838. var self=this;
  3839. return smalltalk.withContext(function($ctx1) {
  3840. _st(self)._nextPutAll_(aString);
  3841. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{aString:aString},smalltalk.StringStream)})},
  3842. messageSends: ["nextPutAll:"]}),
  3843. smalltalk.StringStream);
  3844. smalltalk.addMethod(
  3845. smalltalk.method({
  3846. selector: "nextPutAll:",
  3847. fn: function (aString){
  3848. var self=this;
  3849. var pre,post;
  3850. return smalltalk.withContext(function($ctx1) {
  3851. var $1;
  3852. $1=_st(self)._atEnd();
  3853. if(smalltalk.assert($1)){
  3854. _st(self)._setCollection_(_st(_st(self)._collection()).__comma(aString));
  3855. } else {
  3856. pre=_st(_st(self)._collection())._copyFrom_to_((1),_st(self)._position());
  3857. pre;
  3858. post=_st(_st(self)._collection())._copyFrom_to_(_st(_st(_st(self)._position()).__plus((1))).__plus(_st(aString)._size()),_st(_st(self)._collection())._size());
  3859. post;
  3860. _st(self)._setCollection_(_st(_st(pre).__comma(aString)).__comma(post));
  3861. };
  3862. _st(self)._position_(_st(_st(self)._position()).__plus(_st(aString)._size()));
  3863. _st(self)._setStreamSize_(_st(_st(self)._streamSize())._max_(_st(self)._position()));
  3864. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAll:",{aString:aString,pre:pre,post:post},smalltalk.StringStream)})},
  3865. messageSends: ["ifTrue:ifFalse:", "setCollection:", ",", "collection", "copyFrom:to:", "position", "+", "size", "atEnd", "position:", "setStreamSize:", "max:", "streamSize"]}),
  3866. smalltalk.StringStream);
  3867. smalltalk.addMethod(
  3868. smalltalk.method({
  3869. selector: "nextPutString:",
  3870. fn: function (aString){
  3871. var self=this;
  3872. return smalltalk.withContext(function($ctx1) {
  3873. _st(self)._nextPutAll_(aString);
  3874. return self}, function($ctx1) {$ctx1.fill(self,"nextPutString:",{aString:aString},smalltalk.StringStream)})},
  3875. messageSends: ["nextPutAll:"]}),
  3876. smalltalk.StringStream);
  3877. smalltalk.addMethod(
  3878. smalltalk.method({
  3879. selector: "space",
  3880. fn: function (){
  3881. var self=this;
  3882. return smalltalk.withContext(function($ctx1) {
  3883. _st(self)._nextPut_(" ");
  3884. return self}, function($ctx1) {$ctx1.fill(self,"space",{},smalltalk.StringStream)})},
  3885. messageSends: ["nextPut:"]}),
  3886. smalltalk.StringStream);
  3887. smalltalk.addMethod(
  3888. smalltalk.method({
  3889. selector: "tab",
  3890. fn: function (){
  3891. var self=this;
  3892. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  3893. return smalltalk.withContext(function($ctx1) {
  3894. var $1;
  3895. $1=_st(self)._nextPutAll_(_st($String())._tab());
  3896. return $1;
  3897. }, function($ctx1) {$ctx1.fill(self,"tab",{},smalltalk.StringStream)})},
  3898. messageSends: ["nextPutAll:", "tab"]}),
  3899. smalltalk.StringStream);