Kernel-Collections.deploy.js 126 KB

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