Kernel-Collections.deploy.js 131 KB

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