2
0

Kernel-Collections.deploy.js 125 KB

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