Kernel-Collections.deploy.js 129 KB

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