Kernel-Collections.deploy.js 127 KB

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