1
0

Kernel-Collections.deploy.js 133 KB

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