Kernel-Collections.deploy.js 133 KB

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