Kernel-Collections.deploy.js 128 KB

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