Kernel-Collections.deploy.js 130 KB

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