Kernel-Collections.deploy.js 135 KB

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