1
0

Kernel-Collections.deploy.js 127 KB

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