1
0

Kernel-Collections.deploy.js 127 KB

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