Kernel-Collections.deploy.js 131 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330
  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[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: "asNumber",
  2499. fn: function (){
  2500. var self=this;
  2501. return smalltalk.withContext(function($ctx1) {
  2502. return Number(self);
  2503. return self}, function($ctx1) {$ctx1.fill(self,"asNumber",{},smalltalk.String)})},
  2504. messageSends: []}),
  2505. smalltalk.String);
  2506. smalltalk.addMethod(
  2507. smalltalk.method({
  2508. selector: "asRegexp",
  2509. fn: function (){
  2510. var self=this;
  2511. function $RegularExpression(){return smalltalk.RegularExpression||(typeof RegularExpression=="undefined"?nil:RegularExpression)}
  2512. return smalltalk.withContext(function($ctx1) {
  2513. var $1;
  2514. $1=_st($RegularExpression())._fromString_(self);
  2515. return $1;
  2516. }, function($ctx1) {$ctx1.fill(self,"asRegexp",{},smalltalk.String)})},
  2517. messageSends: ["fromString:"]}),
  2518. smalltalk.String);
  2519. smalltalk.addMethod(
  2520. smalltalk.method({
  2521. selector: "asSelector",
  2522. fn: function (){
  2523. var self=this;
  2524. return smalltalk.withContext(function($ctx1) {
  2525. return smalltalk.selector(self);
  2526. return self}, function($ctx1) {$ctx1.fill(self,"asSelector",{},smalltalk.String)})},
  2527. messageSends: []}),
  2528. smalltalk.String);
  2529. smalltalk.addMethod(
  2530. smalltalk.method({
  2531. selector: "asString",
  2532. fn: function (){
  2533. var self=this;
  2534. return smalltalk.withContext(function($ctx1) {
  2535. var $1;
  2536. $1=self;
  2537. return $1;
  2538. }, function($ctx1) {$ctx1.fill(self,"asString",{},smalltalk.String)})},
  2539. messageSends: []}),
  2540. smalltalk.String);
  2541. smalltalk.addMethod(
  2542. smalltalk.method({
  2543. selector: "asSymbol",
  2544. fn: function (){
  2545. var self=this;
  2546. return smalltalk.withContext(function($ctx1) {
  2547. var $1;
  2548. $1=self;
  2549. return $1;
  2550. }, function($ctx1) {$ctx1.fill(self,"asSymbol",{},smalltalk.String)})},
  2551. messageSends: []}),
  2552. smalltalk.String);
  2553. smalltalk.addMethod(
  2554. smalltalk.method({
  2555. selector: "asUppercase",
  2556. fn: function (){
  2557. var self=this;
  2558. return smalltalk.withContext(function($ctx1) {
  2559. return self.toUpperCase();
  2560. return self}, function($ctx1) {$ctx1.fill(self,"asUppercase",{},smalltalk.String)})},
  2561. messageSends: []}),
  2562. smalltalk.String);
  2563. smalltalk.addMethod(
  2564. smalltalk.method({
  2565. selector: "asciiValue",
  2566. fn: function (){
  2567. var self=this;
  2568. return smalltalk.withContext(function($ctx1) {
  2569. return self.charCodeAt(0);;
  2570. return self}, function($ctx1) {$ctx1.fill(self,"asciiValue",{},smalltalk.String)})},
  2571. messageSends: []}),
  2572. smalltalk.String);
  2573. smalltalk.addMethod(
  2574. smalltalk.method({
  2575. selector: "at:ifAbsent:",
  2576. fn: function (anIndex,aBlock){
  2577. var self=this;
  2578. return smalltalk.withContext(function($ctx1) {
  2579. return String(self).charAt(anIndex - 1) || aBlock._value();
  2580. return self}, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{anIndex:anIndex,aBlock:aBlock},smalltalk.String)})},
  2581. messageSends: []}),
  2582. smalltalk.String);
  2583. smalltalk.addMethod(
  2584. smalltalk.method({
  2585. selector: "at:ifPresent:ifAbsent:",
  2586. fn: function (anIndex,aBlock,anotherBlock){
  2587. var self=this;
  2588. return smalltalk.withContext(function($ctx1) {
  2589. var result = String(self).charAt(anIndex - 1);
  2590. return result ? aBlock._value_(result) : anotherBlock._value();
  2591. ;
  2592. return self}, function($ctx1) {$ctx1.fill(self,"at:ifPresent:ifAbsent:",{anIndex:anIndex,aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.String)})},
  2593. messageSends: []}),
  2594. smalltalk.String);
  2595. smalltalk.addMethod(
  2596. smalltalk.method({
  2597. selector: "charCodeAt:",
  2598. fn: function (anInteger){
  2599. var self=this;
  2600. return smalltalk.withContext(function($ctx1) {
  2601. return self.charCodeAt(anInteger - 1) ;
  2602. return self}, function($ctx1) {$ctx1.fill(self,"charCodeAt:",{anInteger:anInteger},smalltalk.String)})},
  2603. messageSends: []}),
  2604. smalltalk.String);
  2605. smalltalk.addMethod(
  2606. smalltalk.method({
  2607. selector: "copyFrom:to:",
  2608. fn: function (anIndex,anotherIndex){
  2609. var self=this;
  2610. return smalltalk.withContext(function($ctx1) {
  2611. return self.substring(anIndex - 1, anotherIndex);
  2612. return self}, function($ctx1) {$ctx1.fill(self,"copyFrom:to:",{anIndex:anIndex,anotherIndex:anotherIndex},smalltalk.String)})},
  2613. messageSends: []}),
  2614. smalltalk.String);
  2615. smalltalk.addMethod(
  2616. smalltalk.method({
  2617. selector: "crlfSanitized",
  2618. fn: function (){
  2619. var self=this;
  2620. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  2621. return smalltalk.withContext(function($ctx1) {
  2622. var $1;
  2623. $1=_st(self._lines())._join_(_st($String())._lf());
  2624. return $1;
  2625. }, function($ctx1) {$ctx1.fill(self,"crlfSanitized",{},smalltalk.String)})},
  2626. messageSends: ["join:", "lf", "lines"]}),
  2627. smalltalk.String);
  2628. smalltalk.addMethod(
  2629. smalltalk.method({
  2630. selector: "deepCopy",
  2631. fn: function (){
  2632. var self=this;
  2633. return smalltalk.withContext(function($ctx1) {
  2634. var $1;
  2635. $1=self._shallowCopy();
  2636. return $1;
  2637. }, function($ctx1) {$ctx1.fill(self,"deepCopy",{},smalltalk.String)})},
  2638. messageSends: ["shallowCopy"]}),
  2639. smalltalk.String);
  2640. smalltalk.addMethod(
  2641. smalltalk.method({
  2642. selector: "do:",
  2643. fn: function (aBlock){
  2644. var self=this;
  2645. return smalltalk.withContext(function($ctx1) {
  2646. for(var i=0;i<self.length;i++){aBlock._value_(self.charAt(i));};
  2647. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.String)})},
  2648. messageSends: []}),
  2649. smalltalk.String);
  2650. smalltalk.addMethod(
  2651. smalltalk.method({
  2652. selector: "escaped",
  2653. fn: function (){
  2654. var self=this;
  2655. return smalltalk.withContext(function($ctx1) {
  2656. return escape(self);
  2657. return self}, function($ctx1) {$ctx1.fill(self,"escaped",{},smalltalk.String)})},
  2658. messageSends: []}),
  2659. smalltalk.String);
  2660. smalltalk.addMethod(
  2661. smalltalk.method({
  2662. selector: "includesSubString:",
  2663. fn: function (subString){
  2664. var self=this;
  2665. return smalltalk.withContext(function($ctx1) {
  2666. return self.indexOf(subString) != -1 ;
  2667. return self}, function($ctx1) {$ctx1.fill(self,"includesSubString:",{subString:subString},smalltalk.String)})},
  2668. messageSends: []}),
  2669. smalltalk.String);
  2670. smalltalk.addMethod(
  2671. smalltalk.method({
  2672. selector: "isImmutable",
  2673. fn: function (){
  2674. var self=this;
  2675. return smalltalk.withContext(function($ctx1) {
  2676. return true;
  2677. }, function($ctx1) {$ctx1.fill(self,"isImmutable",{},smalltalk.String)})},
  2678. messageSends: []}),
  2679. smalltalk.String);
  2680. smalltalk.addMethod(
  2681. smalltalk.method({
  2682. selector: "isString",
  2683. fn: function (){
  2684. var self=this;
  2685. return smalltalk.withContext(function($ctx1) {
  2686. return true;
  2687. }, function($ctx1) {$ctx1.fill(self,"isString",{},smalltalk.String)})},
  2688. messageSends: []}),
  2689. smalltalk.String);
  2690. smalltalk.addMethod(
  2691. smalltalk.method({
  2692. selector: "isVowel",
  2693. fn: function (){
  2694. var self=this;
  2695. return smalltalk.withContext(function($ctx1) {
  2696. var $1;
  2697. $1=_st(_st(self._size()).__eq((1)))._and_((function(){
  2698. return smalltalk.withContext(function($ctx2) {
  2699. return "aeiou"._includes_(self._asLowercase());
  2700. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2701. return $1;
  2702. }, function($ctx1) {$ctx1.fill(self,"isVowel",{},smalltalk.String)})},
  2703. messageSends: ["and:", "includes:", "asLowercase", "=", "size"]}),
  2704. smalltalk.String);
  2705. smalltalk.addMethod(
  2706. smalltalk.method({
  2707. selector: "join:",
  2708. fn: function (aCollection){
  2709. var self=this;
  2710. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  2711. return smalltalk.withContext(function($ctx1) {
  2712. var $1;
  2713. $1=_st($String())._streamContents_((function(stream){
  2714. return smalltalk.withContext(function($ctx2) {
  2715. return _st(aCollection)._do_separatedBy_((function(each){
  2716. return smalltalk.withContext(function($ctx3) {
  2717. return _st(stream)._nextPutAll_(_st(each)._asString());
  2718. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2)})}),(function(){
  2719. return smalltalk.withContext(function($ctx3) {
  2720. return _st(stream)._nextPutAll_(self);
  2721. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2722. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
  2723. return $1;
  2724. }, function($ctx1) {$ctx1.fill(self,"join:",{aCollection:aCollection},smalltalk.String)})},
  2725. messageSends: ["streamContents:", "do:separatedBy:", "nextPutAll:", "asString"]}),
  2726. smalltalk.String);
  2727. smalltalk.addMethod(
  2728. smalltalk.method({
  2729. selector: "lineIndicesDo:",
  2730. fn: function (aBlock){
  2731. var self=this;
  2732. var cr,lf,start,sz,nextLF,nextCR;
  2733. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  2734. return smalltalk.withContext(function($ctx1) {
  2735. var $1,$2,$3,$4;
  2736. var $early={};
  2737. try {
  2738. start=(1);
  2739. sz=self._size();
  2740. cr=_st($String())._cr();
  2741. nextCR=self._indexOf_startingAt_(cr,(1));
  2742. lf=_st($String())._lf();
  2743. nextLF=self._indexOf_startingAt_(lf,(1));
  2744. _st((function(){
  2745. return smalltalk.withContext(function($ctx2) {
  2746. return _st(start).__lt_eq(sz);
  2747. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  2748. return smalltalk.withContext(function($ctx2) {
  2749. $1=_st(_st(nextLF).__eq((0)))._and_((function(){
  2750. return smalltalk.withContext(function($ctx3) {
  2751. return _st(nextCR).__eq((0));
  2752. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2753. if(smalltalk.assert($1)){
  2754. _st(aBlock)._value_value_value_(start,sz,sz);
  2755. $2=self;
  2756. throw $early=[$2];
  2757. };
  2758. $3=_st(_st(nextCR).__eq((0)))._or_((function(){
  2759. return smalltalk.withContext(function($ctx3) {
  2760. return _st((0).__lt(nextLF))._and_((function(){
  2761. return smalltalk.withContext(function($ctx4) {
  2762. return _st(nextLF).__lt(nextCR);
  2763. }, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
  2764. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2765. if(smalltalk.assert($3)){
  2766. _st(aBlock)._value_value_value_(start,_st(nextLF).__minus((1)),nextLF);
  2767. start=(1).__plus(nextLF);
  2768. start;
  2769. nextLF=self._indexOf_startingAt_(lf,start);
  2770. return nextLF;
  2771. } else {
  2772. $4=_st((1).__plus(nextCR)).__eq(nextLF);
  2773. if(smalltalk.assert($4)){
  2774. _st(aBlock)._value_value_value_(start,_st(nextCR).__minus((1)),nextLF);
  2775. start=(1).__plus(nextLF);
  2776. start;
  2777. nextCR=self._indexOf_startingAt_(cr,start);
  2778. nextCR;
  2779. nextLF=self._indexOf_startingAt_(lf,start);
  2780. return nextLF;
  2781. } else {
  2782. _st(aBlock)._value_value_value_(start,_st(nextCR).__minus((1)),nextCR);
  2783. start=(1).__plus(nextCR);
  2784. start;
  2785. nextCR=self._indexOf_startingAt_(cr,start);
  2786. return nextCR;
  2787. };
  2788. };
  2789. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2790. return self}
  2791. catch(e) {if(e===$early)return e[0]; throw e}
  2792. }, function($ctx1) {$ctx1.fill(self,"lineIndicesDo:",{aBlock:aBlock,cr:cr,lf:lf,start:start,sz:sz,nextLF:nextLF,nextCR:nextCR},smalltalk.String)})},
  2793. messageSends: ["size", "cr", "indexOf:startingAt:", "lf", "whileTrue:", "ifTrue:", "value:value:value:", "and:", "=", "ifTrue:ifFalse:", "-", "+", "or:", "<", "<="]}),
  2794. smalltalk.String);
  2795. smalltalk.addMethod(
  2796. smalltalk.method({
  2797. selector: "lineNumber:",
  2798. fn: function (anIndex){
  2799. var self=this;
  2800. var lineCount;
  2801. return smalltalk.withContext(function($ctx1) {
  2802. var $1,$2;
  2803. var $early={};
  2804. try {
  2805. lineCount=(0);
  2806. self._lineIndicesDo_((function(start,endWithoutDelimiters,end){
  2807. return smalltalk.withContext(function($ctx2) {
  2808. lineCount=_st(lineCount).__plus((1));
  2809. $1=_st(lineCount).__eq(anIndex);
  2810. if(smalltalk.assert($1)){
  2811. $2=self._copyFrom_to_(start,endWithoutDelimiters);
  2812. throw $early=[$2];
  2813. };
  2814. }, function($ctx2) {$ctx2.fillBlock({start:start,endWithoutDelimiters:endWithoutDelimiters,end:end},$ctx1)})}));
  2815. return nil;
  2816. }
  2817. catch(e) {if(e===$early)return e[0]; throw e}
  2818. }, function($ctx1) {$ctx1.fill(self,"lineNumber:",{anIndex:anIndex,lineCount:lineCount},smalltalk.String)})},
  2819. messageSends: ["lineIndicesDo:", "ifTrue:", "copyFrom:to:", "=", "+"]}),
  2820. smalltalk.String);
  2821. smalltalk.addMethod(
  2822. smalltalk.method({
  2823. selector: "lines",
  2824. fn: function (){
  2825. var self=this;
  2826. var lines;
  2827. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  2828. return smalltalk.withContext(function($ctx1) {
  2829. var $1;
  2830. lines=_st($Array())._new();
  2831. self._linesDo_((function(aLine){
  2832. return smalltalk.withContext(function($ctx2) {
  2833. return _st(lines)._add_(aLine);
  2834. }, function($ctx2) {$ctx2.fillBlock({aLine:aLine},$ctx1)})}));
  2835. $1=lines;
  2836. return $1;
  2837. }, function($ctx1) {$ctx1.fill(self,"lines",{lines:lines},smalltalk.String)})},
  2838. messageSends: ["new", "linesDo:", "add:"]}),
  2839. smalltalk.String);
  2840. smalltalk.addMethod(
  2841. smalltalk.method({
  2842. selector: "linesDo:",
  2843. fn: function (aBlock){
  2844. var self=this;
  2845. return smalltalk.withContext(function($ctx1) {
  2846. self._lineIndicesDo_((function(start,endWithoutDelimiters,end){
  2847. return smalltalk.withContext(function($ctx2) {
  2848. return _st(aBlock)._value_(self._copyFrom_to_(start,endWithoutDelimiters));
  2849. }, function($ctx2) {$ctx2.fillBlock({start:start,endWithoutDelimiters:endWithoutDelimiters,end:end},$ctx1)})}));
  2850. return self}, function($ctx1) {$ctx1.fill(self,"linesDo:",{aBlock:aBlock},smalltalk.String)})},
  2851. messageSends: ["lineIndicesDo:", "value:", "copyFrom:to:"]}),
  2852. smalltalk.String);
  2853. smalltalk.addMethod(
  2854. smalltalk.method({
  2855. selector: "match:",
  2856. fn: function (aRegexp){
  2857. var self=this;
  2858. return smalltalk.withContext(function($ctx1) {
  2859. return self.search(aRegexp) != -1;
  2860. return self}, function($ctx1) {$ctx1.fill(self,"match:",{aRegexp:aRegexp},smalltalk.String)})},
  2861. messageSends: []}),
  2862. smalltalk.String);
  2863. smalltalk.addMethod(
  2864. smalltalk.method({
  2865. selector: "matchesOf:",
  2866. fn: function (aRegularExpression){
  2867. var self=this;
  2868. return smalltalk.withContext(function($ctx1) {
  2869. return self.match(aRegularExpression);
  2870. return self}, function($ctx1) {$ctx1.fill(self,"matchesOf:",{aRegularExpression:aRegularExpression},smalltalk.String)})},
  2871. messageSends: []}),
  2872. smalltalk.String);
  2873. smalltalk.addMethod(
  2874. smalltalk.method({
  2875. selector: "printNl",
  2876. fn: function (){
  2877. var self=this;
  2878. return smalltalk.withContext(function($ctx1) {
  2879. console.log(self);
  2880. return self}, function($ctx1) {$ctx1.fill(self,"printNl",{},smalltalk.String)})},
  2881. messageSends: []}),
  2882. smalltalk.String);
  2883. smalltalk.addMethod(
  2884. smalltalk.method({
  2885. selector: "printOn:",
  2886. fn: function (aStream){
  2887. var self=this;
  2888. return smalltalk.withContext(function($ctx1) {
  2889. var $1,$2;
  2890. $1=aStream;
  2891. _st($1)._nextPutAll_("'");
  2892. _st($1)._nextPutAll_(self);
  2893. $2=_st($1)._nextPutAll_("'");
  2894. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.String)})},
  2895. messageSends: ["nextPutAll:"]}),
  2896. smalltalk.String);
  2897. smalltalk.addMethod(
  2898. smalltalk.method({
  2899. selector: "replace:with:",
  2900. fn: function (aString,anotherString){
  2901. var self=this;
  2902. function $RegularExpression(){return smalltalk.RegularExpression||(typeof RegularExpression=="undefined"?nil:RegularExpression)}
  2903. return smalltalk.withContext(function($ctx1) {
  2904. var $1;
  2905. $1=self._replaceRegexp_with_(_st($RegularExpression())._fromString_flag_(aString,"g"),anotherString);
  2906. return $1;
  2907. }, function($ctx1) {$ctx1.fill(self,"replace:with:",{aString:aString,anotherString:anotherString},smalltalk.String)})},
  2908. messageSends: ["replaceRegexp:with:", "fromString:flag:"]}),
  2909. smalltalk.String);
  2910. smalltalk.addMethod(
  2911. smalltalk.method({
  2912. selector: "replaceRegexp:with:",
  2913. fn: function (aRegexp,aString){
  2914. var self=this;
  2915. return smalltalk.withContext(function($ctx1) {
  2916. return self.replace(aRegexp, aString);
  2917. return self}, function($ctx1) {$ctx1.fill(self,"replaceRegexp:with:",{aRegexp:aRegexp,aString:aString},smalltalk.String)})},
  2918. messageSends: []}),
  2919. smalltalk.String);
  2920. smalltalk.addMethod(
  2921. smalltalk.method({
  2922. selector: "reversed",
  2923. fn: function (){
  2924. var self=this;
  2925. return smalltalk.withContext(function($ctx1) {
  2926. return self.split("").reverse().join("");
  2927. return self}, function($ctx1) {$ctx1.fill(self,"reversed",{},smalltalk.String)})},
  2928. messageSends: []}),
  2929. smalltalk.String);
  2930. smalltalk.addMethod(
  2931. smalltalk.method({
  2932. selector: "shallowCopy",
  2933. fn: function (){
  2934. var self=this;
  2935. return smalltalk.withContext(function($ctx1) {
  2936. var $1;
  2937. $1=_st(self._class())._fromString_(self);
  2938. return $1;
  2939. }, function($ctx1) {$ctx1.fill(self,"shallowCopy",{},smalltalk.String)})},
  2940. messageSends: ["fromString:", "class"]}),
  2941. smalltalk.String);
  2942. smalltalk.addMethod(
  2943. smalltalk.method({
  2944. selector: "size",
  2945. fn: function (){
  2946. var self=this;
  2947. return smalltalk.withContext(function($ctx1) {
  2948. return self.length;
  2949. return self}, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.String)})},
  2950. messageSends: []}),
  2951. smalltalk.String);
  2952. smalltalk.addMethod(
  2953. smalltalk.method({
  2954. selector: "subStrings:",
  2955. fn: function (aString){
  2956. var self=this;
  2957. return smalltalk.withContext(function($ctx1) {
  2958. var $1;
  2959. $1=self._tokenize_(aString);
  2960. return $1;
  2961. }, function($ctx1) {$ctx1.fill(self,"subStrings:",{aString:aString},smalltalk.String)})},
  2962. messageSends: ["tokenize:"]}),
  2963. smalltalk.String);
  2964. smalltalk.addMethod(
  2965. smalltalk.method({
  2966. selector: "tokenize:",
  2967. fn: function (aString){
  2968. var self=this;
  2969. return smalltalk.withContext(function($ctx1) {
  2970. return self.split(aString);
  2971. return self}, function($ctx1) {$ctx1.fill(self,"tokenize:",{aString:aString},smalltalk.String)})},
  2972. messageSends: []}),
  2973. smalltalk.String);
  2974. smalltalk.addMethod(
  2975. smalltalk.method({
  2976. selector: "trimBoth",
  2977. fn: function (){
  2978. var self=this;
  2979. return smalltalk.withContext(function($ctx1) {
  2980. var $1;
  2981. $1=self._trimBoth_("\x5cs");
  2982. return $1;
  2983. }, function($ctx1) {$ctx1.fill(self,"trimBoth",{},smalltalk.String)})},
  2984. messageSends: ["trimBoth:"]}),
  2985. smalltalk.String);
  2986. smalltalk.addMethod(
  2987. smalltalk.method({
  2988. selector: "trimBoth:",
  2989. fn: function (separators){
  2990. var self=this;
  2991. return smalltalk.withContext(function($ctx1) {
  2992. var $1;
  2993. $1=_st(self._trimLeft_(separators))._trimRight_(separators);
  2994. return $1;
  2995. }, function($ctx1) {$ctx1.fill(self,"trimBoth:",{separators:separators},smalltalk.String)})},
  2996. messageSends: ["trimRight:", "trimLeft:"]}),
  2997. smalltalk.String);
  2998. smalltalk.addMethod(
  2999. smalltalk.method({
  3000. selector: "trimLeft",
  3001. fn: function (){
  3002. var self=this;
  3003. return smalltalk.withContext(function($ctx1) {
  3004. var $1;
  3005. $1=self._trimLeft_("\x5cs");
  3006. return $1;
  3007. }, function($ctx1) {$ctx1.fill(self,"trimLeft",{},smalltalk.String)})},
  3008. messageSends: ["trimLeft:"]}),
  3009. smalltalk.String);
  3010. smalltalk.addMethod(
  3011. smalltalk.method({
  3012. selector: "trimLeft:",
  3013. fn: function (separators){
  3014. var self=this;
  3015. function $RegularExpression(){return smalltalk.RegularExpression||(typeof RegularExpression=="undefined"?nil:RegularExpression)}
  3016. return smalltalk.withContext(function($ctx1) {
  3017. var $1;
  3018. $1=self._replaceRegexp_with_(_st($RegularExpression())._fromString_flag_(_st("^[".__comma(separators)).__comma("]+"),"g"),"");
  3019. return $1;
  3020. }, function($ctx1) {$ctx1.fill(self,"trimLeft:",{separators:separators},smalltalk.String)})},
  3021. messageSends: ["replaceRegexp:with:", "fromString:flag:", ","]}),
  3022. smalltalk.String);
  3023. smalltalk.addMethod(
  3024. smalltalk.method({
  3025. selector: "trimRight",
  3026. fn: function (){
  3027. var self=this;
  3028. return smalltalk.withContext(function($ctx1) {
  3029. var $1;
  3030. $1=self._trimRight_("\x5cs");
  3031. return $1;
  3032. }, function($ctx1) {$ctx1.fill(self,"trimRight",{},smalltalk.String)})},
  3033. messageSends: ["trimRight:"]}),
  3034. smalltalk.String);
  3035. smalltalk.addMethod(
  3036. smalltalk.method({
  3037. selector: "trimRight:",
  3038. fn: function (separators){
  3039. var self=this;
  3040. function $RegularExpression(){return smalltalk.RegularExpression||(typeof RegularExpression=="undefined"?nil:RegularExpression)}
  3041. return smalltalk.withContext(function($ctx1) {
  3042. var $1;
  3043. $1=self._replaceRegexp_with_(_st($RegularExpression())._fromString_flag_(_st("[".__comma(separators)).__comma("]+$"),"g"),"");
  3044. return $1;
  3045. }, function($ctx1) {$ctx1.fill(self,"trimRight:",{separators:separators},smalltalk.String)})},
  3046. messageSends: ["replaceRegexp:with:", "fromString:flag:", ","]}),
  3047. smalltalk.String);
  3048. smalltalk.addMethod(
  3049. smalltalk.method({
  3050. selector: "unescaped",
  3051. fn: function (){
  3052. var self=this;
  3053. return smalltalk.withContext(function($ctx1) {
  3054. return unescape(self);
  3055. return self}, function($ctx1) {$ctx1.fill(self,"unescaped",{},smalltalk.String)})},
  3056. messageSends: []}),
  3057. smalltalk.String);
  3058. smalltalk.addMethod(
  3059. smalltalk.method({
  3060. selector: "withIndexDo:",
  3061. fn: function (aBlock){
  3062. var self=this;
  3063. return smalltalk.withContext(function($ctx1) {
  3064. for(var i=0;i<self.length;i++){aBlock._value_value_(self.charAt(i), i+1);};
  3065. return self}, function($ctx1) {$ctx1.fill(self,"withIndexDo:",{aBlock:aBlock},smalltalk.String)})},
  3066. messageSends: []}),
  3067. smalltalk.String);
  3068. smalltalk.addMethod(
  3069. smalltalk.method({
  3070. selector: "cr",
  3071. fn: function (){
  3072. var self=this;
  3073. return smalltalk.withContext(function($ctx1) {
  3074. return '\r';
  3075. return self}, function($ctx1) {$ctx1.fill(self,"cr",{},smalltalk.String.klass)})},
  3076. messageSends: []}),
  3077. smalltalk.String.klass);
  3078. smalltalk.addMethod(
  3079. smalltalk.method({
  3080. selector: "crlf",
  3081. fn: function (){
  3082. var self=this;
  3083. return smalltalk.withContext(function($ctx1) {
  3084. return '\r\n';
  3085. return self}, function($ctx1) {$ctx1.fill(self,"crlf",{},smalltalk.String.klass)})},
  3086. messageSends: []}),
  3087. smalltalk.String.klass);
  3088. smalltalk.addMethod(
  3089. smalltalk.method({
  3090. selector: "esc",
  3091. fn: function (){
  3092. var self=this;
  3093. return smalltalk.withContext(function($ctx1) {
  3094. var $1;
  3095. $1=self._fromCharCode_((27));
  3096. return $1;
  3097. }, function($ctx1) {$ctx1.fill(self,"esc",{},smalltalk.String.klass)})},
  3098. messageSends: ["fromCharCode:"]}),
  3099. smalltalk.String.klass);
  3100. smalltalk.addMethod(
  3101. smalltalk.method({
  3102. selector: "fromCharCode:",
  3103. fn: function (anInteger){
  3104. var self=this;
  3105. return smalltalk.withContext(function($ctx1) {
  3106. return String.fromCharCode(anInteger);
  3107. return self}, function($ctx1) {$ctx1.fill(self,"fromCharCode:",{anInteger:anInteger},smalltalk.String.klass)})},
  3108. messageSends: []}),
  3109. smalltalk.String.klass);
  3110. smalltalk.addMethod(
  3111. smalltalk.method({
  3112. selector: "fromString:",
  3113. fn: function (aString){
  3114. var self=this;
  3115. return smalltalk.withContext(function($ctx1) {
  3116. return String(aString);
  3117. return self}, function($ctx1) {$ctx1.fill(self,"fromString:",{aString:aString},smalltalk.String.klass)})},
  3118. messageSends: []}),
  3119. smalltalk.String.klass);
  3120. smalltalk.addMethod(
  3121. smalltalk.method({
  3122. selector: "lf",
  3123. fn: function (){
  3124. var self=this;
  3125. return smalltalk.withContext(function($ctx1) {
  3126. return '\n';
  3127. return self}, function($ctx1) {$ctx1.fill(self,"lf",{},smalltalk.String.klass)})},
  3128. messageSends: []}),
  3129. smalltalk.String.klass);
  3130. smalltalk.addMethod(
  3131. smalltalk.method({
  3132. selector: "random",
  3133. fn: function (){
  3134. var self=this;
  3135. return smalltalk.withContext(function($ctx1) {
  3136. return (Math.random()*(22/32)+(10/32)).toString(32).slice(2);;
  3137. return self}, function($ctx1) {$ctx1.fill(self,"random",{},smalltalk.String.klass)})},
  3138. messageSends: []}),
  3139. smalltalk.String.klass);
  3140. smalltalk.addMethod(
  3141. smalltalk.method({
  3142. selector: "randomNotIn:",
  3143. fn: function (aString){
  3144. var self=this;
  3145. var result;
  3146. return smalltalk.withContext(function($ctx1) {
  3147. var $1;
  3148. _st((function(){
  3149. return smalltalk.withContext(function($ctx2) {
  3150. result=self._random();
  3151. result;
  3152. return _st(aString)._includesSubString_(result);
  3153. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue();
  3154. $1=result;
  3155. return $1;
  3156. }, function($ctx1) {$ctx1.fill(self,"randomNotIn:",{aString:aString,result:result},smalltalk.String.klass)})},
  3157. messageSends: ["whileTrue", "random", "includesSubString:"]}),
  3158. smalltalk.String.klass);
  3159. smalltalk.addMethod(
  3160. smalltalk.method({
  3161. selector: "space",
  3162. fn: function (){
  3163. var self=this;
  3164. return smalltalk.withContext(function($ctx1) {
  3165. return ' ';
  3166. return self}, function($ctx1) {$ctx1.fill(self,"space",{},smalltalk.String.klass)})},
  3167. messageSends: []}),
  3168. smalltalk.String.klass);
  3169. smalltalk.addMethod(
  3170. smalltalk.method({
  3171. selector: "streamClass",
  3172. fn: function (){
  3173. var self=this;
  3174. function $StringStream(){return smalltalk.StringStream||(typeof StringStream=="undefined"?nil:StringStream)}
  3175. return smalltalk.withContext(function($ctx1) {
  3176. var $1;
  3177. $1=$StringStream();
  3178. return $1;
  3179. }, function($ctx1) {$ctx1.fill(self,"streamClass",{},smalltalk.String.klass)})},
  3180. messageSends: []}),
  3181. smalltalk.String.klass);
  3182. smalltalk.addMethod(
  3183. smalltalk.method({
  3184. selector: "tab",
  3185. fn: function (){
  3186. var self=this;
  3187. return smalltalk.withContext(function($ctx1) {
  3188. return '\t';
  3189. return self}, function($ctx1) {$ctx1.fill(self,"tab",{},smalltalk.String.klass)})},
  3190. messageSends: []}),
  3191. smalltalk.String.klass);
  3192. smalltalk.addMethod(
  3193. smalltalk.method({
  3194. selector: "value:",
  3195. fn: function (aUTFCharCode){
  3196. var self=this;
  3197. return smalltalk.withContext(function($ctx1) {
  3198. return String.fromCharCode(aUTFCharCode);;
  3199. return self}, function($ctx1) {$ctx1.fill(self,"value:",{aUTFCharCode:aUTFCharCode},smalltalk.String.klass)})},
  3200. messageSends: []}),
  3201. smalltalk.String.klass);
  3202. smalltalk.addClass('Set', smalltalk.Collection, ['elements'], 'Kernel-Collections');
  3203. smalltalk.addMethod(
  3204. smalltalk.method({
  3205. selector: "=",
  3206. fn: function (aCollection){
  3207. var self=this;
  3208. return smalltalk.withContext(function($ctx1) {
  3209. var $1,$2,$3;
  3210. var $early={};
  3211. try {
  3212. $1=_st(self._class()).__eq(_st(aCollection)._class());
  3213. if(! smalltalk.assert($1)){
  3214. return false;
  3215. };
  3216. $2=_st(self._size()).__eq(_st(aCollection)._size());
  3217. if(! smalltalk.assert($2)){
  3218. return false;
  3219. };
  3220. self._do_((function(each){
  3221. return smalltalk.withContext(function($ctx2) {
  3222. $3=_st(aCollection)._includes_(each);
  3223. if(! smalltalk.assert($3)){
  3224. throw $early=[false];
  3225. };
  3226. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3227. return true;
  3228. }
  3229. catch(e) {if(e===$early)return e[0]; throw e}
  3230. }, function($ctx1) {$ctx1.fill(self,"=",{aCollection:aCollection},smalltalk.Set)})},
  3231. messageSends: ["ifFalse:", "=", "class", "size", "do:", "includes:"]}),
  3232. smalltalk.Set);
  3233. smalltalk.addMethod(
  3234. smalltalk.method({
  3235. selector: "add:",
  3236. fn: function (anObject){
  3237. var self=this;
  3238. return smalltalk.withContext(function($ctx1) {
  3239. var found;
  3240. for(var i=0; i < self['@elements'].length; i++) {
  3241. if(_st(anObject).__eq(self['@elements'][i])) {
  3242. found = true;
  3243. break;
  3244. }
  3245. }
  3246. if(!found) {self['@elements'].push(anObject)}
  3247. ;
  3248. return self}, function($ctx1) {$ctx1.fill(self,"add:",{anObject:anObject},smalltalk.Set)})},
  3249. messageSends: []}),
  3250. smalltalk.Set);
  3251. smalltalk.addMethod(
  3252. smalltalk.method({
  3253. selector: "asArray",
  3254. fn: function (){
  3255. var self=this;
  3256. return smalltalk.withContext(function($ctx1) {
  3257. var $1;
  3258. $1=_st(self["@elements"])._copy();
  3259. return $1;
  3260. }, function($ctx1) {$ctx1.fill(self,"asArray",{},smalltalk.Set)})},
  3261. messageSends: ["copy"]}),
  3262. smalltalk.Set);
  3263. smalltalk.addMethod(
  3264. smalltalk.method({
  3265. selector: "collect:",
  3266. fn: function (aBlock){
  3267. var self=this;
  3268. return smalltalk.withContext(function($ctx1) {
  3269. var $1;
  3270. $1=_st(self._class())._withAll_(_st(self["@elements"])._collect_(aBlock));
  3271. return $1;
  3272. }, function($ctx1) {$ctx1.fill(self,"collect:",{aBlock:aBlock},smalltalk.Set)})},
  3273. messageSends: ["withAll:", "collect:", "class"]}),
  3274. smalltalk.Set);
  3275. smalltalk.addMethod(
  3276. smalltalk.method({
  3277. selector: "detect:ifNone:",
  3278. fn: function (aBlock,anotherBlock){
  3279. var self=this;
  3280. return smalltalk.withContext(function($ctx1) {
  3281. var $1;
  3282. $1=_st(self["@elements"])._detect_ifNone_(aBlock,anotherBlock);
  3283. return $1;
  3284. }, function($ctx1) {$ctx1.fill(self,"detect:ifNone:",{aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.Set)})},
  3285. messageSends: ["detect:ifNone:"]}),
  3286. smalltalk.Set);
  3287. smalltalk.addMethod(
  3288. smalltalk.method({
  3289. selector: "do:",
  3290. fn: function (aBlock){
  3291. var self=this;
  3292. return smalltalk.withContext(function($ctx1) {
  3293. _st(self["@elements"])._do_(aBlock);
  3294. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.Set)})},
  3295. messageSends: ["do:"]}),
  3296. smalltalk.Set);
  3297. smalltalk.addMethod(
  3298. smalltalk.method({
  3299. selector: "includes:",
  3300. fn: function (anObject){
  3301. var self=this;
  3302. return smalltalk.withContext(function($ctx1) {
  3303. var $1;
  3304. $1=_st(self["@elements"])._includes_(anObject);
  3305. return $1;
  3306. }, function($ctx1) {$ctx1.fill(self,"includes:",{anObject:anObject},smalltalk.Set)})},
  3307. messageSends: ["includes:"]}),
  3308. smalltalk.Set);
  3309. smalltalk.addMethod(
  3310. smalltalk.method({
  3311. selector: "initialize",
  3312. fn: function (){
  3313. var self=this;
  3314. return smalltalk.withContext(function($ctx1) {
  3315. smalltalk.Set.superclass.fn.prototype._initialize.apply(_st(self), []);
  3316. self["@elements"]=[];
  3317. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Set)})},
  3318. messageSends: ["initialize"]}),
  3319. smalltalk.Set);
  3320. smalltalk.addMethod(
  3321. smalltalk.method({
  3322. selector: "printOn:",
  3323. fn: function (aStream){
  3324. var self=this;
  3325. return smalltalk.withContext(function($ctx1) {
  3326. smalltalk.Set.superclass.fn.prototype._printOn_.apply(_st(self), [aStream]);
  3327. _st(aStream)._nextPutAll_(" (");
  3328. self._do_separatedBy_((function(each){
  3329. return smalltalk.withContext(function($ctx2) {
  3330. return _st(each)._printOn_(aStream);
  3331. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  3332. return smalltalk.withContext(function($ctx2) {
  3333. return _st(aStream)._nextPutAll_(" ");
  3334. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3335. _st(aStream)._nextPutAll_(")");
  3336. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Set)})},
  3337. messageSends: ["printOn:", "nextPutAll:", "do:separatedBy:"]}),
  3338. smalltalk.Set);
  3339. smalltalk.addMethod(
  3340. smalltalk.method({
  3341. selector: "remove:",
  3342. fn: function (anObject){
  3343. var self=this;
  3344. return smalltalk.withContext(function($ctx1) {
  3345. _st(self["@elements"])._remove_(anObject);
  3346. return self}, function($ctx1) {$ctx1.fill(self,"remove:",{anObject:anObject},smalltalk.Set)})},
  3347. messageSends: ["remove:"]}),
  3348. smalltalk.Set);
  3349. smalltalk.addMethod(
  3350. smalltalk.method({
  3351. selector: "remove:ifAbsent:",
  3352. fn: function (anObject,aBlock){
  3353. var self=this;
  3354. return smalltalk.withContext(function($ctx1) {
  3355. _st(self["@elements"])._remove_ifAbsent_(anObject,aBlock);
  3356. return self}, function($ctx1) {$ctx1.fill(self,"remove:ifAbsent:",{anObject:anObject,aBlock:aBlock},smalltalk.Set)})},
  3357. messageSends: ["remove:ifAbsent:"]}),
  3358. smalltalk.Set);
  3359. smalltalk.addMethod(
  3360. smalltalk.method({
  3361. selector: "select:",
  3362. fn: function (aBlock){
  3363. var self=this;
  3364. var collection;
  3365. return smalltalk.withContext(function($ctx1) {
  3366. var $1,$2;
  3367. collection=_st(self._class())._new();
  3368. self._do_((function(each){
  3369. return smalltalk.withContext(function($ctx2) {
  3370. $1=_st(aBlock)._value_(each);
  3371. if(smalltalk.assert($1)){
  3372. return _st(collection)._add_(each);
  3373. };
  3374. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3375. $2=collection;
  3376. return $2;
  3377. }, function($ctx1) {$ctx1.fill(self,"select:",{aBlock:aBlock,collection:collection},smalltalk.Set)})},
  3378. messageSends: ["new", "class", "do:", "ifTrue:", "add:", "value:"]}),
  3379. smalltalk.Set);
  3380. smalltalk.addMethod(
  3381. smalltalk.method({
  3382. selector: "size",
  3383. fn: function (){
  3384. var self=this;
  3385. return smalltalk.withContext(function($ctx1) {
  3386. var $1;
  3387. $1=_st(self["@elements"])._size();
  3388. return $1;
  3389. }, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.Set)})},
  3390. messageSends: ["size"]}),
  3391. smalltalk.Set);
  3392. smalltalk.addClass('Queue', smalltalk.Object, ['read', 'readIndex', 'write'], 'Kernel-Collections');
  3393. smalltalk.addMethod(
  3394. smalltalk.method({
  3395. selector: "initialize",
  3396. fn: function (){
  3397. var self=this;
  3398. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  3399. return smalltalk.withContext(function($ctx1) {
  3400. smalltalk.Queue.superclass.fn.prototype._initialize.apply(_st(self), []);
  3401. self["@read"]=_st($OrderedCollection())._new();
  3402. self["@write"]=_st($OrderedCollection())._new();
  3403. self["@readIndex"]=(1);
  3404. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Queue)})},
  3405. messageSends: ["initialize", "new"]}),
  3406. smalltalk.Queue);
  3407. smalltalk.addMethod(
  3408. smalltalk.method({
  3409. selector: "next",
  3410. fn: function (){
  3411. var self=this;
  3412. return smalltalk.withContext(function($ctx1) {
  3413. var $1;
  3414. $1=self._nextIfAbsent_((function(){
  3415. return smalltalk.withContext(function($ctx2) {
  3416. return self._error_("Cannot read from empty Queue.");
  3417. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3418. return $1;
  3419. }, function($ctx1) {$ctx1.fill(self,"next",{},smalltalk.Queue)})},
  3420. messageSends: ["nextIfAbsent:", "error:"]}),
  3421. smalltalk.Queue);
  3422. smalltalk.addMethod(
  3423. smalltalk.method({
  3424. selector: "nextIfAbsent:",
  3425. fn: function (aBlock){
  3426. var self=this;
  3427. var result;
  3428. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  3429. return smalltalk.withContext(function($ctx1) {
  3430. var $1,$2,$3,$4;
  3431. var $early={};
  3432. try {
  3433. result=_st(self["@read"])._at_ifAbsent_(self["@readIndex"],(function(){
  3434. return smalltalk.withContext(function($ctx2) {
  3435. $1=_st(self["@write"])._isEmpty();
  3436. if(smalltalk.assert($1)){
  3437. $2=_st(self["@readIndex"]).__gt((1));
  3438. if(smalltalk.assert($2)){
  3439. self["@read"]=[];
  3440. self["@read"];
  3441. self["@readIndex"]=(1);
  3442. self["@readIndex"];
  3443. };
  3444. $3=_st(aBlock)._value();
  3445. throw $early=[$3];
  3446. };
  3447. self["@read"]=self["@write"];
  3448. self["@read"];
  3449. self["@readIndex"]=(1);
  3450. self["@readIndex"];
  3451. self["@write"]=_st($OrderedCollection())._new();
  3452. self["@write"];
  3453. return _st(self["@read"])._first();
  3454. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3455. _st(self["@read"])._at_put_(self["@readIndex"],nil);
  3456. self["@readIndex"]=_st(self["@readIndex"]).__plus((1));
  3457. $4=result;
  3458. return $4;
  3459. }
  3460. catch(e) {if(e===$early)return e[0]; throw e}
  3461. }, function($ctx1) {$ctx1.fill(self,"nextIfAbsent:",{aBlock:aBlock,result:result},smalltalk.Queue)})},
  3462. messageSends: ["at:ifAbsent:", "ifTrue:", ">", "value", "isEmpty", "new", "first", "at:put:", "+"]}),
  3463. smalltalk.Queue);
  3464. smalltalk.addMethod(
  3465. smalltalk.method({
  3466. selector: "nextPut:",
  3467. fn: function (anObject){
  3468. var self=this;
  3469. return smalltalk.withContext(function($ctx1) {
  3470. _st(self["@write"])._add_(anObject);
  3471. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{anObject:anObject},smalltalk.Queue)})},
  3472. messageSends: ["add:"]}),
  3473. smalltalk.Queue);
  3474. smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel-Collections');
  3475. smalltalk.addMethod(
  3476. smalltalk.method({
  3477. selector: "compile:",
  3478. fn: function (aString){
  3479. var self=this;
  3480. return smalltalk.withContext(function($ctx1) {
  3481. return self.compile(aString);
  3482. return self}, function($ctx1) {$ctx1.fill(self,"compile:",{aString:aString},smalltalk.RegularExpression)})},
  3483. messageSends: []}),
  3484. smalltalk.RegularExpression);
  3485. smalltalk.addMethod(
  3486. smalltalk.method({
  3487. selector: "exec:",
  3488. fn: function (aString){
  3489. var self=this;
  3490. return smalltalk.withContext(function($ctx1) {
  3491. return self.exec(aString) || nil;
  3492. return self}, function($ctx1) {$ctx1.fill(self,"exec:",{aString:aString},smalltalk.RegularExpression)})},
  3493. messageSends: []}),
  3494. smalltalk.RegularExpression);
  3495. smalltalk.addMethod(
  3496. smalltalk.method({
  3497. selector: "test:",
  3498. fn: function (aString){
  3499. var self=this;
  3500. return smalltalk.withContext(function($ctx1) {
  3501. return self.test(aString);
  3502. return self}, function($ctx1) {$ctx1.fill(self,"test:",{aString:aString},smalltalk.RegularExpression)})},
  3503. messageSends: []}),
  3504. smalltalk.RegularExpression);
  3505. smalltalk.addMethod(
  3506. smalltalk.method({
  3507. selector: "fromString:",
  3508. fn: function (aString){
  3509. var self=this;
  3510. return smalltalk.withContext(function($ctx1) {
  3511. var $1;
  3512. $1=self._fromString_flag_(aString,"");
  3513. return $1;
  3514. }, function($ctx1) {$ctx1.fill(self,"fromString:",{aString:aString},smalltalk.RegularExpression.klass)})},
  3515. messageSends: ["fromString:flag:"]}),
  3516. smalltalk.RegularExpression.klass);
  3517. smalltalk.addMethod(
  3518. smalltalk.method({
  3519. selector: "fromString:flag:",
  3520. fn: function (aString,anotherString){
  3521. var self=this;
  3522. return smalltalk.withContext(function($ctx1) {
  3523. return new RegExp(aString, anotherString);
  3524. return self}, function($ctx1) {$ctx1.fill(self,"fromString:flag:",{aString:aString,anotherString:anotherString},smalltalk.RegularExpression.klass)})},
  3525. messageSends: []}),
  3526. smalltalk.RegularExpression.klass);
  3527. smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel-Collections');
  3528. smalltalk.addMethod(
  3529. smalltalk.method({
  3530. selector: "<<",
  3531. fn: function (anObject){
  3532. var self=this;
  3533. return smalltalk.withContext(function($ctx1) {
  3534. self._write_(anObject);
  3535. return self}, function($ctx1) {$ctx1.fill(self,"<<",{anObject:anObject},smalltalk.Stream)})},
  3536. messageSends: ["write:"]}),
  3537. smalltalk.Stream);
  3538. smalltalk.addMethod(
  3539. smalltalk.method({
  3540. selector: "atEnd",
  3541. fn: function (){
  3542. var self=this;
  3543. return smalltalk.withContext(function($ctx1) {
  3544. var $1;
  3545. $1=_st(self._position()).__eq(self._size());
  3546. return $1;
  3547. }, function($ctx1) {$ctx1.fill(self,"atEnd",{},smalltalk.Stream)})},
  3548. messageSends: ["=", "size", "position"]}),
  3549. smalltalk.Stream);
  3550. smalltalk.addMethod(
  3551. smalltalk.method({
  3552. selector: "atStart",
  3553. fn: function (){
  3554. var self=this;
  3555. return smalltalk.withContext(function($ctx1) {
  3556. var $1;
  3557. $1=_st(self._position()).__eq((0));
  3558. return $1;
  3559. }, function($ctx1) {$ctx1.fill(self,"atStart",{},smalltalk.Stream)})},
  3560. messageSends: ["=", "position"]}),
  3561. smalltalk.Stream);
  3562. smalltalk.addMethod(
  3563. smalltalk.method({
  3564. selector: "close",
  3565. fn: function (){
  3566. var self=this;
  3567. return smalltalk.withContext(function($ctx1) {
  3568. return self}, function($ctx1) {$ctx1.fill(self,"close",{},smalltalk.Stream)})},
  3569. messageSends: []}),
  3570. smalltalk.Stream);
  3571. smalltalk.addMethod(
  3572. smalltalk.method({
  3573. selector: "collection",
  3574. fn: function (){
  3575. var self=this;
  3576. return smalltalk.withContext(function($ctx1) {
  3577. var $1;
  3578. $1=self["@collection"];
  3579. return $1;
  3580. }, function($ctx1) {$ctx1.fill(self,"collection",{},smalltalk.Stream)})},
  3581. messageSends: []}),
  3582. smalltalk.Stream);
  3583. smalltalk.addMethod(
  3584. smalltalk.method({
  3585. selector: "contents",
  3586. fn: function (){
  3587. var self=this;
  3588. return smalltalk.withContext(function($ctx1) {
  3589. var $1;
  3590. $1=_st(self._collection())._copyFrom_to_((1),self._streamSize());
  3591. return $1;
  3592. }, function($ctx1) {$ctx1.fill(self,"contents",{},smalltalk.Stream)})},
  3593. messageSends: ["copyFrom:to:", "streamSize", "collection"]}),
  3594. smalltalk.Stream);
  3595. smalltalk.addMethod(
  3596. smalltalk.method({
  3597. selector: "do:",
  3598. fn: function (aBlock){
  3599. var self=this;
  3600. return smalltalk.withContext(function($ctx1) {
  3601. _st((function(){
  3602. return smalltalk.withContext(function($ctx2) {
  3603. return self._atEnd();
  3604. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  3605. return smalltalk.withContext(function($ctx2) {
  3606. return _st(aBlock)._value_(self._next());
  3607. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3608. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.Stream)})},
  3609. messageSends: ["whileFalse:", "value:", "next", "atEnd"]}),
  3610. smalltalk.Stream);
  3611. smalltalk.addMethod(
  3612. smalltalk.method({
  3613. selector: "flush",
  3614. fn: function (){
  3615. var self=this;
  3616. return smalltalk.withContext(function($ctx1) {
  3617. return self}, function($ctx1) {$ctx1.fill(self,"flush",{},smalltalk.Stream)})},
  3618. messageSends: []}),
  3619. smalltalk.Stream);
  3620. smalltalk.addMethod(
  3621. smalltalk.method({
  3622. selector: "isEmpty",
  3623. fn: function (){
  3624. var self=this;
  3625. return smalltalk.withContext(function($ctx1) {
  3626. var $1;
  3627. $1=_st(self._size()).__eq((0));
  3628. return $1;
  3629. }, function($ctx1) {$ctx1.fill(self,"isEmpty",{},smalltalk.Stream)})},
  3630. messageSends: ["=", "size"]}),
  3631. smalltalk.Stream);
  3632. smalltalk.addMethod(
  3633. smalltalk.method({
  3634. selector: "next",
  3635. fn: function (){
  3636. var self=this;
  3637. return smalltalk.withContext(function($ctx1) {
  3638. var $2,$1;
  3639. $2=self._atEnd();
  3640. if(smalltalk.assert($2)){
  3641. $1=nil;
  3642. } else {
  3643. self._position_(_st(self._position()).__plus((1)));
  3644. $1=_st(self["@collection"])._at_(self._position());
  3645. };
  3646. return $1;
  3647. }, function($ctx1) {$ctx1.fill(self,"next",{},smalltalk.Stream)})},
  3648. messageSends: ["ifTrue:ifFalse:", "position:", "+", "position", "at:", "atEnd"]}),
  3649. smalltalk.Stream);
  3650. smalltalk.addMethod(
  3651. smalltalk.method({
  3652. selector: "next:",
  3653. fn: function (anInteger){
  3654. var self=this;
  3655. var tempCollection;
  3656. return smalltalk.withContext(function($ctx1) {
  3657. var $1,$2;
  3658. tempCollection=_st(_st(self._collection())._class())._new();
  3659. _st(anInteger)._timesRepeat_((function(){
  3660. return smalltalk.withContext(function($ctx2) {
  3661. $1=self._atEnd();
  3662. if(! smalltalk.assert($1)){
  3663. return _st(tempCollection)._add_(self._next());
  3664. };
  3665. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3666. $2=tempCollection;
  3667. return $2;
  3668. }, function($ctx1) {$ctx1.fill(self,"next:",{anInteger:anInteger,tempCollection:tempCollection},smalltalk.Stream)})},
  3669. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", "add:", "next", "atEnd"]}),
  3670. smalltalk.Stream);
  3671. smalltalk.addMethod(
  3672. smalltalk.method({
  3673. selector: "nextPut:",
  3674. fn: function (anObject){
  3675. var self=this;
  3676. return smalltalk.withContext(function($ctx1) {
  3677. self._position_(_st(self._position()).__plus((1)));
  3678. _st(self._collection())._at_put_(self._position(),anObject);
  3679. self._setStreamSize_(_st(self._streamSize())._max_(self._position()));
  3680. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{anObject:anObject},smalltalk.Stream)})},
  3681. messageSends: ["position:", "+", "position", "at:put:", "collection", "setStreamSize:", "max:", "streamSize"]}),
  3682. smalltalk.Stream);
  3683. smalltalk.addMethod(
  3684. smalltalk.method({
  3685. selector: "nextPutAll:",
  3686. fn: function (aCollection){
  3687. var self=this;
  3688. return smalltalk.withContext(function($ctx1) {
  3689. _st(aCollection)._do_((function(each){
  3690. return smalltalk.withContext(function($ctx2) {
  3691. return self._nextPut_(each);
  3692. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3693. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAll:",{aCollection:aCollection},smalltalk.Stream)})},
  3694. messageSends: ["do:", "nextPut:"]}),
  3695. smalltalk.Stream);
  3696. smalltalk.addMethod(
  3697. smalltalk.method({
  3698. selector: "nextPutString:",
  3699. fn: function (aString){
  3700. var self=this;
  3701. return smalltalk.withContext(function($ctx1) {
  3702. self._nextPut_(aString);
  3703. return self}, function($ctx1) {$ctx1.fill(self,"nextPutString:",{aString:aString},smalltalk.Stream)})},
  3704. messageSends: ["nextPut:"]}),
  3705. smalltalk.Stream);
  3706. smalltalk.addMethod(
  3707. smalltalk.method({
  3708. selector: "peek",
  3709. fn: function (){
  3710. var self=this;
  3711. return smalltalk.withContext(function($ctx1) {
  3712. var $2,$1;
  3713. $2=self._atEnd();
  3714. if(! smalltalk.assert($2)){
  3715. $1=_st(self._collection())._at_(_st(self._position()).__plus((1)));
  3716. };
  3717. return $1;
  3718. }, function($ctx1) {$ctx1.fill(self,"peek",{},smalltalk.Stream)})},
  3719. messageSends: ["ifFalse:", "at:", "+", "position", "collection", "atEnd"]}),
  3720. smalltalk.Stream);
  3721. smalltalk.addMethod(
  3722. smalltalk.method({
  3723. selector: "position",
  3724. fn: function (){
  3725. var self=this;
  3726. return smalltalk.withContext(function($ctx1) {
  3727. var $2,$1;
  3728. $2=self["@position"];
  3729. if(($receiver = $2) == nil || $receiver == undefined){
  3730. self["@position"]=(0);
  3731. $1=self["@position"];
  3732. } else {
  3733. $1=$2;
  3734. };
  3735. return $1;
  3736. }, function($ctx1) {$ctx1.fill(self,"position",{},smalltalk.Stream)})},
  3737. messageSends: ["ifNil:"]}),
  3738. smalltalk.Stream);
  3739. smalltalk.addMethod(
  3740. smalltalk.method({
  3741. selector: "position:",
  3742. fn: function (anInteger){
  3743. var self=this;
  3744. return smalltalk.withContext(function($ctx1) {
  3745. self["@position"]=anInteger;
  3746. return self}, function($ctx1) {$ctx1.fill(self,"position:",{anInteger:anInteger},smalltalk.Stream)})},
  3747. messageSends: []}),
  3748. smalltalk.Stream);
  3749. smalltalk.addMethod(
  3750. smalltalk.method({
  3751. selector: "reset",
  3752. fn: function (){
  3753. var self=this;
  3754. return smalltalk.withContext(function($ctx1) {
  3755. self._position_((0));
  3756. return self}, function($ctx1) {$ctx1.fill(self,"reset",{},smalltalk.Stream)})},
  3757. messageSends: ["position:"]}),
  3758. smalltalk.Stream);
  3759. smalltalk.addMethod(
  3760. smalltalk.method({
  3761. selector: "resetContents",
  3762. fn: function (){
  3763. var self=this;
  3764. return smalltalk.withContext(function($ctx1) {
  3765. self._reset();
  3766. self._setStreamSize_((0));
  3767. return self}, function($ctx1) {$ctx1.fill(self,"resetContents",{},smalltalk.Stream)})},
  3768. messageSends: ["reset", "setStreamSize:"]}),
  3769. smalltalk.Stream);
  3770. smalltalk.addMethod(
  3771. smalltalk.method({
  3772. selector: "setCollection:",
  3773. fn: function (aCollection){
  3774. var self=this;
  3775. return smalltalk.withContext(function($ctx1) {
  3776. self["@collection"]=aCollection;
  3777. return self}, function($ctx1) {$ctx1.fill(self,"setCollection:",{aCollection:aCollection},smalltalk.Stream)})},
  3778. messageSends: []}),
  3779. smalltalk.Stream);
  3780. smalltalk.addMethod(
  3781. smalltalk.method({
  3782. selector: "setStreamSize:",
  3783. fn: function (anInteger){
  3784. var self=this;
  3785. return smalltalk.withContext(function($ctx1) {
  3786. self["@streamSize"]=anInteger;
  3787. return self}, function($ctx1) {$ctx1.fill(self,"setStreamSize:",{anInteger:anInteger},smalltalk.Stream)})},
  3788. messageSends: []}),
  3789. smalltalk.Stream);
  3790. smalltalk.addMethod(
  3791. smalltalk.method({
  3792. selector: "setToEnd",
  3793. fn: function (){
  3794. var self=this;
  3795. return smalltalk.withContext(function($ctx1) {
  3796. self._position_(self._size());
  3797. return self}, function($ctx1) {$ctx1.fill(self,"setToEnd",{},smalltalk.Stream)})},
  3798. messageSends: ["position:", "size"]}),
  3799. smalltalk.Stream);
  3800. smalltalk.addMethod(
  3801. smalltalk.method({
  3802. selector: "size",
  3803. fn: function (){
  3804. var self=this;
  3805. return smalltalk.withContext(function($ctx1) {
  3806. var $1;
  3807. $1=self._streamSize();
  3808. return $1;
  3809. }, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.Stream)})},
  3810. messageSends: ["streamSize"]}),
  3811. smalltalk.Stream);
  3812. smalltalk.addMethod(
  3813. smalltalk.method({
  3814. selector: "skip:",
  3815. fn: function (anInteger){
  3816. var self=this;
  3817. return smalltalk.withContext(function($ctx1) {
  3818. self._position_(_st(_st(self._position()).__plus(anInteger))._min_max_(self._size(),(0)));
  3819. return self}, function($ctx1) {$ctx1.fill(self,"skip:",{anInteger:anInteger},smalltalk.Stream)})},
  3820. messageSends: ["position:", "min:max:", "size", "+", "position"]}),
  3821. smalltalk.Stream);
  3822. smalltalk.addMethod(
  3823. smalltalk.method({
  3824. selector: "streamSize",
  3825. fn: function (){
  3826. var self=this;
  3827. return smalltalk.withContext(function($ctx1) {
  3828. var $1;
  3829. $1=self["@streamSize"];
  3830. return $1;
  3831. }, function($ctx1) {$ctx1.fill(self,"streamSize",{},smalltalk.Stream)})},
  3832. messageSends: []}),
  3833. smalltalk.Stream);
  3834. smalltalk.addMethod(
  3835. smalltalk.method({
  3836. selector: "write:",
  3837. fn: function (anObject){
  3838. var self=this;
  3839. return smalltalk.withContext(function($ctx1) {
  3840. _st(anObject)._putOn_(self);
  3841. return self}, function($ctx1) {$ctx1.fill(self,"write:",{anObject:anObject},smalltalk.Stream)})},
  3842. messageSends: ["putOn:"]}),
  3843. smalltalk.Stream);
  3844. smalltalk.addMethod(
  3845. smalltalk.method({
  3846. selector: "on:",
  3847. fn: function (aCollection){
  3848. var self=this;
  3849. return smalltalk.withContext(function($ctx1) {
  3850. var $2,$3,$1;
  3851. $2=self._new();
  3852. _st($2)._setCollection_(aCollection);
  3853. _st($2)._setStreamSize_(_st(aCollection)._size());
  3854. $3=_st($2)._yourself();
  3855. $1=$3;
  3856. return $1;
  3857. }, function($ctx1) {$ctx1.fill(self,"on:",{aCollection:aCollection},smalltalk.Stream.klass)})},
  3858. messageSends: ["setCollection:", "new", "setStreamSize:", "size", "yourself"]}),
  3859. smalltalk.Stream.klass);
  3860. smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel-Collections');
  3861. smalltalk.addMethod(
  3862. smalltalk.method({
  3863. selector: "cr",
  3864. fn: function (){
  3865. var self=this;
  3866. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  3867. return smalltalk.withContext(function($ctx1) {
  3868. var $1;
  3869. $1=self._nextPutAll_(_st($String())._cr());
  3870. return $1;
  3871. }, function($ctx1) {$ctx1.fill(self,"cr",{},smalltalk.StringStream)})},
  3872. messageSends: ["nextPutAll:", "cr"]}),
  3873. smalltalk.StringStream);
  3874. smalltalk.addMethod(
  3875. smalltalk.method({
  3876. selector: "crlf",
  3877. fn: function (){
  3878. var self=this;
  3879. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  3880. return smalltalk.withContext(function($ctx1) {
  3881. var $1;
  3882. $1=self._nextPutAll_(_st($String())._crlf());
  3883. return $1;
  3884. }, function($ctx1) {$ctx1.fill(self,"crlf",{},smalltalk.StringStream)})},
  3885. messageSends: ["nextPutAll:", "crlf"]}),
  3886. smalltalk.StringStream);
  3887. smalltalk.addMethod(
  3888. smalltalk.method({
  3889. selector: "lf",
  3890. fn: function (){
  3891. var self=this;
  3892. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  3893. return smalltalk.withContext(function($ctx1) {
  3894. var $1;
  3895. $1=self._nextPutAll_(_st($String())._lf());
  3896. return $1;
  3897. }, function($ctx1) {$ctx1.fill(self,"lf",{},smalltalk.StringStream)})},
  3898. messageSends: ["nextPutAll:", "lf"]}),
  3899. smalltalk.StringStream);
  3900. smalltalk.addMethod(
  3901. smalltalk.method({
  3902. selector: "next:",
  3903. fn: function (anInteger){
  3904. var self=this;
  3905. var tempCollection;
  3906. return smalltalk.withContext(function($ctx1) {
  3907. var $1,$2;
  3908. tempCollection=_st(_st(self._collection())._class())._new();
  3909. _st(anInteger)._timesRepeat_((function(){
  3910. return smalltalk.withContext(function($ctx2) {
  3911. $1=self._atEnd();
  3912. if(! smalltalk.assert($1)){
  3913. tempCollection=_st(tempCollection).__comma(self._next());
  3914. return tempCollection;
  3915. };
  3916. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3917. $2=tempCollection;
  3918. return $2;
  3919. }, function($ctx1) {$ctx1.fill(self,"next:",{anInteger:anInteger,tempCollection:tempCollection},smalltalk.StringStream)})},
  3920. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", ",", "next", "atEnd"]}),
  3921. smalltalk.StringStream);
  3922. smalltalk.addMethod(
  3923. smalltalk.method({
  3924. selector: "nextPut:",
  3925. fn: function (aString){
  3926. var self=this;
  3927. return smalltalk.withContext(function($ctx1) {
  3928. self._nextPutAll_(aString);
  3929. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{aString:aString},smalltalk.StringStream)})},
  3930. messageSends: ["nextPutAll:"]}),
  3931. smalltalk.StringStream);
  3932. smalltalk.addMethod(
  3933. smalltalk.method({
  3934. selector: "nextPutAll:",
  3935. fn: function (aString){
  3936. var self=this;
  3937. var pre,post;
  3938. return smalltalk.withContext(function($ctx1) {
  3939. var $1;
  3940. $1=self._atEnd();
  3941. if(smalltalk.assert($1)){
  3942. self._setCollection_(_st(self._collection()).__comma(aString));
  3943. } else {
  3944. pre=_st(self._collection())._copyFrom_to_((1),self._position());
  3945. pre;
  3946. post=_st(self._collection())._copyFrom_to_(_st(_st(self._position()).__plus((1))).__plus(_st(aString)._size()),_st(self._collection())._size());
  3947. post;
  3948. self._setCollection_(_st(_st(pre).__comma(aString)).__comma(post));
  3949. };
  3950. self._position_(_st(self._position()).__plus(_st(aString)._size()));
  3951. self._setStreamSize_(_st(self._streamSize())._max_(self._position()));
  3952. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAll:",{aString:aString,pre:pre,post:post},smalltalk.StringStream)})},
  3953. messageSends: ["ifTrue:ifFalse:", "setCollection:", ",", "collection", "copyFrom:to:", "position", "+", "size", "atEnd", "position:", "setStreamSize:", "max:", "streamSize"]}),
  3954. smalltalk.StringStream);
  3955. smalltalk.addMethod(
  3956. smalltalk.method({
  3957. selector: "nextPutString:",
  3958. fn: function (aString){
  3959. var self=this;
  3960. return smalltalk.withContext(function($ctx1) {
  3961. self._nextPutAll_(aString);
  3962. return self}, function($ctx1) {$ctx1.fill(self,"nextPutString:",{aString:aString},smalltalk.StringStream)})},
  3963. messageSends: ["nextPutAll:"]}),
  3964. smalltalk.StringStream);
  3965. smalltalk.addMethod(
  3966. smalltalk.method({
  3967. selector: "space",
  3968. fn: function (){
  3969. var self=this;
  3970. return smalltalk.withContext(function($ctx1) {
  3971. self._nextPut_(" ");
  3972. return self}, function($ctx1) {$ctx1.fill(self,"space",{},smalltalk.StringStream)})},
  3973. messageSends: ["nextPut:"]}),
  3974. smalltalk.StringStream);
  3975. smalltalk.addMethod(
  3976. smalltalk.method({
  3977. selector: "tab",
  3978. fn: function (){
  3979. var self=this;
  3980. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  3981. return smalltalk.withContext(function($ctx1) {
  3982. var $1;
  3983. $1=self._nextPutAll_(_st($String())._tab());
  3984. return $1;
  3985. }, function($ctx1) {$ctx1.fill(self,"tab",{},smalltalk.StringStream)})},
  3986. messageSends: ["nextPutAll:", "tab"]}),
  3987. smalltalk.StringStream);
  3988. })(global_smalltalk,global_nil,global__st);