Kernel-Collections.deploy.js 132 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216
  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. "_remove_ifAbsent_",
  1788. smalltalk.method({
  1789. selector: "remove:ifAbsent:",
  1790. fn: function (anObject,aBlock){
  1791. var self=this;
  1792. return smalltalk.withContext(function($ctx1) {
  1793. for(var i=0;i<self.length;i++) {
  1794. if(self[i] == anObject) {
  1795. self.splice(i,1);
  1796. return self;
  1797. }
  1798. };
  1799. aBlock._value();
  1800. ;
  1801. return self}, function($ctx1) {$ctx1.fill(self,"remove:ifAbsent:",{anObject:anObject,aBlock:aBlock},smalltalk.Array)})},
  1802. messageSends: []}),
  1803. smalltalk.Array);
  1804. smalltalk.addMethod(
  1805. "_removeFrom_to_",
  1806. smalltalk.method({
  1807. selector: "removeFrom:to:",
  1808. fn: function (aNumber,anotherNumber){
  1809. var self=this;
  1810. return smalltalk.withContext(function($ctx1) { self.splice(aNumber - 1,anotherNumber - 1);
  1811. return self}, function($ctx1) {$ctx1.fill(self,"removeFrom:to:",{aNumber:aNumber,anotherNumber:anotherNumber},smalltalk.Array)})},
  1812. messageSends: []}),
  1813. smalltalk.Array);
  1814. smalltalk.addMethod(
  1815. "_reversed",
  1816. smalltalk.method({
  1817. selector: "reversed",
  1818. fn: function (){
  1819. var self=this;
  1820. return smalltalk.withContext(function($ctx1) { return self._copy().reverse();
  1821. return self}, function($ctx1) {$ctx1.fill(self,"reversed",{},smalltalk.Array)})},
  1822. messageSends: []}),
  1823. smalltalk.Array);
  1824. smalltalk.addMethod(
  1825. "_size",
  1826. smalltalk.method({
  1827. selector: "size",
  1828. fn: function (){
  1829. var self=this;
  1830. return smalltalk.withContext(function($ctx1) { return self.length;
  1831. return self}, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.Array)})},
  1832. messageSends: []}),
  1833. smalltalk.Array);
  1834. smalltalk.addMethod(
  1835. "_sort",
  1836. smalltalk.method({
  1837. selector: "sort",
  1838. fn: function (){
  1839. var self=this;
  1840. return smalltalk.withContext(function($ctx1) { var $1;
  1841. $1=_st(self)._basicPerform_("sort");
  1842. return $1;
  1843. }, function($ctx1) {$ctx1.fill(self,"sort",{},smalltalk.Array)})},
  1844. messageSends: ["basicPerform:"]}),
  1845. smalltalk.Array);
  1846. smalltalk.addMethod(
  1847. "_sort_",
  1848. smalltalk.method({
  1849. selector: "sort:",
  1850. fn: function (aBlock){
  1851. var self=this;
  1852. return smalltalk.withContext(function($ctx1) {
  1853. return self.sort(function(a, b) {
  1854. if(aBlock(a,b)) {return -1} else {return 1}
  1855. })
  1856. ;
  1857. return self}, function($ctx1) {$ctx1.fill(self,"sort:",{aBlock:aBlock},smalltalk.Array)})},
  1858. messageSends: []}),
  1859. smalltalk.Array);
  1860. smalltalk.addMethod(
  1861. "_sorted",
  1862. smalltalk.method({
  1863. selector: "sorted",
  1864. fn: function (){
  1865. var self=this;
  1866. return smalltalk.withContext(function($ctx1) { var $1;
  1867. $1=_st(_st(self)._copy())._sort();
  1868. return $1;
  1869. }, function($ctx1) {$ctx1.fill(self,"sorted",{},smalltalk.Array)})},
  1870. messageSends: ["sort", "copy"]}),
  1871. smalltalk.Array);
  1872. smalltalk.addMethod(
  1873. "_sorted_",
  1874. smalltalk.method({
  1875. selector: "sorted:",
  1876. fn: function (aBlock){
  1877. var self=this;
  1878. return smalltalk.withContext(function($ctx1) { var $1;
  1879. $1=_st(_st(self)._copy())._sort_(aBlock);
  1880. return $1;
  1881. }, function($ctx1) {$ctx1.fill(self,"sorted:",{aBlock:aBlock},smalltalk.Array)})},
  1882. messageSends: ["sort:", "copy"]}),
  1883. smalltalk.Array);
  1884. smalltalk.addMethod(
  1885. "_new_",
  1886. smalltalk.method({
  1887. selector: "new:",
  1888. fn: function (anInteger){
  1889. var self=this;
  1890. return smalltalk.withContext(function($ctx1) { return new Array(anInteger);
  1891. return self}, function($ctx1) {$ctx1.fill(self,"new:",{anInteger:anInteger},smalltalk.Array.klass)})},
  1892. messageSends: []}),
  1893. smalltalk.Array.klass);
  1894. smalltalk.addMethod(
  1895. "_with_",
  1896. smalltalk.method({
  1897. selector: "with:",
  1898. fn: function (anObject){
  1899. var self=this;
  1900. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  1901. $2=_st(self)._new_((1));
  1902. _st($2)._at_put_((1),anObject);
  1903. $3=_st($2)._yourself();
  1904. $1=$3;
  1905. return $1;
  1906. }, function($ctx1) {$ctx1.fill(self,"with:",{anObject:anObject},smalltalk.Array.klass)})},
  1907. messageSends: ["at:put:", "new:", "yourself"]}),
  1908. smalltalk.Array.klass);
  1909. smalltalk.addMethod(
  1910. "_with_with_",
  1911. smalltalk.method({
  1912. selector: "with:with:",
  1913. fn: function (anObject,anObject2){
  1914. var self=this;
  1915. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  1916. $2=_st(self)._new_((2));
  1917. _st($2)._at_put_((1),anObject);
  1918. _st($2)._at_put_((2),anObject2);
  1919. $3=_st($2)._yourself();
  1920. $1=$3;
  1921. return $1;
  1922. }, function($ctx1) {$ctx1.fill(self,"with:with:",{anObject:anObject,anObject2:anObject2},smalltalk.Array.klass)})},
  1923. messageSends: ["at:put:", "new:", "yourself"]}),
  1924. smalltalk.Array.klass);
  1925. smalltalk.addMethod(
  1926. "_with_with_with_",
  1927. smalltalk.method({
  1928. selector: "with:with:with:",
  1929. fn: function (anObject,anObject2,anObject3){
  1930. var self=this;
  1931. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  1932. $2=_st(self)._new_((3));
  1933. _st($2)._at_put_((1),anObject);
  1934. _st($2)._at_put_((2),anObject2);
  1935. _st($2)._at_put_((3),anObject3);
  1936. $3=_st($2)._yourself();
  1937. $1=$3;
  1938. return $1;
  1939. }, function($ctx1) {$ctx1.fill(self,"with:with:with:",{anObject:anObject,anObject2:anObject2,anObject3:anObject3},smalltalk.Array.klass)})},
  1940. messageSends: ["at:put:", "new:", "yourself"]}),
  1941. smalltalk.Array.klass);
  1942. smalltalk.addMethod(
  1943. "_withAll_",
  1944. smalltalk.method({
  1945. selector: "withAll:",
  1946. fn: function (aCollection){
  1947. var self=this;
  1948. var instance,index;
  1949. return smalltalk.withContext(function($ctx1) { var $1;
  1950. index=(1);
  1951. instance=_st(self)._new_(_st(aCollection)._size());
  1952. _st(aCollection)._do_((function(each){
  1953. return smalltalk.withContext(function($ctx2) { _st(instance)._at_put_(index,each);
  1954. index=_st(index).__plus((1));
  1955. return index;
  1956. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1957. $1=instance;
  1958. return $1;
  1959. }, function($ctx1) {$ctx1.fill(self,"withAll:",{aCollection:aCollection,instance:instance,index:index},smalltalk.Array.klass)})},
  1960. messageSends: ["new:", "size", "do:", "at:put:", "+"]}),
  1961. smalltalk.Array.klass);
  1962. smalltalk.addClass('CharacterArray', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
  1963. smalltalk.addMethod(
  1964. "__comma",
  1965. smalltalk.method({
  1966. selector: ",",
  1967. fn: function (aString){
  1968. var self=this;
  1969. return smalltalk.withContext(function($ctx1) { var $1;
  1970. $1=_st(_st(self)._asString()).__comma(_st(aString)._asString());
  1971. return $1;
  1972. }, function($ctx1) {$ctx1.fill(self,",",{aString:aString},smalltalk.CharacterArray)})},
  1973. messageSends: [",", "asString"]}),
  1974. smalltalk.CharacterArray);
  1975. smalltalk.addMethod(
  1976. "_add_",
  1977. smalltalk.method({
  1978. selector: "add:",
  1979. fn: function (anObject){
  1980. var self=this;
  1981. return smalltalk.withContext(function($ctx1) { _st(self)._errorReadOnly();
  1982. return self}, function($ctx1) {$ctx1.fill(self,"add:",{anObject:anObject},smalltalk.CharacterArray)})},
  1983. messageSends: ["errorReadOnly"]}),
  1984. smalltalk.CharacterArray);
  1985. smalltalk.addMethod(
  1986. "_asLowercase",
  1987. smalltalk.method({
  1988. selector: "asLowercase",
  1989. fn: function (){
  1990. var self=this;
  1991. return smalltalk.withContext(function($ctx1) { var $1;
  1992. $1=_st(_st(self)._class())._fromString_(_st(_st(self)._asString())._asLowercase());
  1993. return $1;
  1994. }, function($ctx1) {$ctx1.fill(self,"asLowercase",{},smalltalk.CharacterArray)})},
  1995. messageSends: ["fromString:", "asLowercase", "asString", "class"]}),
  1996. smalltalk.CharacterArray);
  1997. smalltalk.addMethod(
  1998. "_asNumber",
  1999. smalltalk.method({
  2000. selector: "asNumber",
  2001. fn: function (){
  2002. var self=this;
  2003. return smalltalk.withContext(function($ctx1) { var $1;
  2004. $1=_st(_st(self)._asString())._asNumber();
  2005. return $1;
  2006. }, function($ctx1) {$ctx1.fill(self,"asNumber",{},smalltalk.CharacterArray)})},
  2007. messageSends: ["asNumber", "asString"]}),
  2008. smalltalk.CharacterArray);
  2009. smalltalk.addMethod(
  2010. "_asString",
  2011. smalltalk.method({
  2012. selector: "asString",
  2013. fn: function (){
  2014. var self=this;
  2015. return smalltalk.withContext(function($ctx1) { var $1;
  2016. $1=_st(self)._subclassResponsibility();
  2017. return $1;
  2018. }, function($ctx1) {$ctx1.fill(self,"asString",{},smalltalk.CharacterArray)})},
  2019. messageSends: ["subclassResponsibility"]}),
  2020. smalltalk.CharacterArray);
  2021. smalltalk.addMethod(
  2022. "_asSymbol",
  2023. smalltalk.method({
  2024. selector: "asSymbol",
  2025. fn: function (){
  2026. var self=this;
  2027. return smalltalk.withContext(function($ctx1) { var $1;
  2028. $1=_st(self)._subclassResponsibility();
  2029. return $1;
  2030. }, function($ctx1) {$ctx1.fill(self,"asSymbol",{},smalltalk.CharacterArray)})},
  2031. messageSends: ["subclassResponsibility"]}),
  2032. smalltalk.CharacterArray);
  2033. smalltalk.addMethod(
  2034. "_asUppercase",
  2035. smalltalk.method({
  2036. selector: "asUppercase",
  2037. fn: function (){
  2038. var self=this;
  2039. return smalltalk.withContext(function($ctx1) { var $1;
  2040. $1=_st(_st(self)._class())._fromString_(_st(_st(self)._asString())._asUppercase());
  2041. return $1;
  2042. }, function($ctx1) {$ctx1.fill(self,"asUppercase",{},smalltalk.CharacterArray)})},
  2043. messageSends: ["fromString:", "asUppercase", "asString", "class"]}),
  2044. smalltalk.CharacterArray);
  2045. smalltalk.addMethod(
  2046. "_at_put_",
  2047. smalltalk.method({
  2048. selector: "at:put:",
  2049. fn: function (anIndex,anObject){
  2050. var self=this;
  2051. return smalltalk.withContext(function($ctx1) { _st(self)._errorReadOnly();
  2052. return self}, function($ctx1) {$ctx1.fill(self,"at:put:",{anIndex:anIndex,anObject:anObject},smalltalk.CharacterArray)})},
  2053. messageSends: ["errorReadOnly"]}),
  2054. smalltalk.CharacterArray);
  2055. smalltalk.addMethod(
  2056. "_errorReadOnly",
  2057. smalltalk.method({
  2058. selector: "errorReadOnly",
  2059. fn: function (){
  2060. var self=this;
  2061. return smalltalk.withContext(function($ctx1) { _st(self)._error_("Object is read-only");
  2062. return self}, function($ctx1) {$ctx1.fill(self,"errorReadOnly",{},smalltalk.CharacterArray)})},
  2063. messageSends: ["error:"]}),
  2064. smalltalk.CharacterArray);
  2065. smalltalk.addMethod(
  2066. "_printOn_",
  2067. smalltalk.method({
  2068. selector: "printOn:",
  2069. fn: function (aStream){
  2070. var self=this;
  2071. return smalltalk.withContext(function($ctx1) { _st(_st(self)._asString())._printOn_(aStream);
  2072. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.CharacterArray)})},
  2073. messageSends: ["printOn:", "asString"]}),
  2074. smalltalk.CharacterArray);
  2075. smalltalk.addMethod(
  2076. "_remove_",
  2077. smalltalk.method({
  2078. selector: "remove:",
  2079. fn: function (anObject){
  2080. var self=this;
  2081. return smalltalk.withContext(function($ctx1) { _st(self)._errorReadOnly();
  2082. return self}, function($ctx1) {$ctx1.fill(self,"remove:",{anObject:anObject},smalltalk.CharacterArray)})},
  2083. messageSends: ["errorReadOnly"]}),
  2084. smalltalk.CharacterArray);
  2085. smalltalk.addMethod(
  2086. "_fromString_",
  2087. smalltalk.method({
  2088. selector: "fromString:",
  2089. fn: function (aString){
  2090. var self=this;
  2091. return smalltalk.withContext(function($ctx1) { _st(self)._subclassResponsibility();
  2092. return self}, function($ctx1) {$ctx1.fill(self,"fromString:",{aString:aString},smalltalk.CharacterArray.klass)})},
  2093. messageSends: ["subclassResponsibility"]}),
  2094. smalltalk.CharacterArray.klass);
  2095. smalltalk.addClass('String', smalltalk.CharacterArray, [], 'Kernel-Collections');
  2096. smalltalk.addMethod(
  2097. "__comma",
  2098. smalltalk.method({
  2099. selector: ",",
  2100. fn: function (aString){
  2101. var self=this;
  2102. return smalltalk.withContext(function($ctx1) { return self + aString;
  2103. return self}, function($ctx1) {$ctx1.fill(self,",",{aString:aString},smalltalk.String)})},
  2104. messageSends: []}),
  2105. smalltalk.String);
  2106. smalltalk.addMethod(
  2107. "__lt",
  2108. smalltalk.method({
  2109. selector: "<",
  2110. fn: function (aString){
  2111. var self=this;
  2112. return smalltalk.withContext(function($ctx1) { return String(self) < aString._asString();
  2113. return self}, function($ctx1) {$ctx1.fill(self,"<",{aString:aString},smalltalk.String)})},
  2114. messageSends: []}),
  2115. smalltalk.String);
  2116. smalltalk.addMethod(
  2117. "__lt_eq",
  2118. smalltalk.method({
  2119. selector: "<=",
  2120. fn: function (aString){
  2121. var self=this;
  2122. return smalltalk.withContext(function($ctx1) { return String(self) <= aString._asString();
  2123. return self}, function($ctx1) {$ctx1.fill(self,"<=",{aString:aString},smalltalk.String)})},
  2124. messageSends: []}),
  2125. smalltalk.String);
  2126. smalltalk.addMethod(
  2127. "__eq",
  2128. smalltalk.method({
  2129. selector: "=",
  2130. fn: function (aString){
  2131. var self=this;
  2132. return smalltalk.withContext(function($ctx1) {
  2133. if(! aString._isString || ! aString._isString()) {
  2134. return false;
  2135. }
  2136. return String(self) === String(aString)
  2137. ;
  2138. return self}, function($ctx1) {$ctx1.fill(self,"=",{aString:aString},smalltalk.String)})},
  2139. messageSends: []}),
  2140. smalltalk.String);
  2141. smalltalk.addMethod(
  2142. "__eq_eq",
  2143. smalltalk.method({
  2144. selector: "==",
  2145. fn: function (aString){
  2146. var self=this;
  2147. return smalltalk.withContext(function($ctx1) { var $1;
  2148. $1=_st(self).__eq(aString);
  2149. return $1;
  2150. }, function($ctx1) {$ctx1.fill(self,"==",{aString:aString},smalltalk.String)})},
  2151. messageSends: ["="]}),
  2152. smalltalk.String);
  2153. smalltalk.addMethod(
  2154. "__gt",
  2155. smalltalk.method({
  2156. selector: ">",
  2157. fn: function (aString){
  2158. var self=this;
  2159. return smalltalk.withContext(function($ctx1) { return String(self) > aString._asString();
  2160. return self}, function($ctx1) {$ctx1.fill(self,">",{aString:aString},smalltalk.String)})},
  2161. messageSends: []}),
  2162. smalltalk.String);
  2163. smalltalk.addMethod(
  2164. "__gt_eq",
  2165. smalltalk.method({
  2166. selector: ">=",
  2167. fn: function (aString){
  2168. var self=this;
  2169. return smalltalk.withContext(function($ctx1) { return String(self) >= aString._asString();
  2170. return self}, function($ctx1) {$ctx1.fill(self,">=",{aString:aString},smalltalk.String)})},
  2171. messageSends: []}),
  2172. smalltalk.String);
  2173. smalltalk.addMethod(
  2174. "_asJSON",
  2175. smalltalk.method({
  2176. selector: "asJSON",
  2177. fn: function (){
  2178. var self=this;
  2179. return smalltalk.withContext(function($ctx1) { var $1;
  2180. $1=self;
  2181. return $1;
  2182. }, function($ctx1) {$ctx1.fill(self,"asJSON",{},smalltalk.String)})},
  2183. messageSends: []}),
  2184. smalltalk.String);
  2185. smalltalk.addMethod(
  2186. "_asJavaScriptSelector",
  2187. smalltalk.method({
  2188. selector: "asJavaScriptSelector",
  2189. fn: function (){
  2190. var self=this;
  2191. return smalltalk.withContext(function($ctx1) { var $1;
  2192. $1=_st(_st(_st(self)._asSelector())._replace_with_("^_",""))._replace_with_("_.*","");
  2193. return $1;
  2194. }, function($ctx1) {$ctx1.fill(self,"asJavaScriptSelector",{},smalltalk.String)})},
  2195. messageSends: ["replace:with:", "asSelector"]}),
  2196. smalltalk.String);
  2197. smalltalk.addMethod(
  2198. "_asJavascript",
  2199. smalltalk.method({
  2200. selector: "asJavascript",
  2201. fn: function (){
  2202. var self=this;
  2203. return smalltalk.withContext(function($ctx1) {
  2204. if(self.search(/^[a-zA-Z0-9_:.$ ]*$/) == -1)
  2205. return "\"" + self.replace(/[\x00-\x1f"\\\x7f-\x9f]/g, function(ch){var c=ch.charCodeAt(0);return "\\x"+("0"+c.toString(16)).slice(-2)}) + "\"";
  2206. else
  2207. return "\"" + self + "\"";
  2208. ;
  2209. return self}, function($ctx1) {$ctx1.fill(self,"asJavascript",{},smalltalk.String)})},
  2210. messageSends: []}),
  2211. smalltalk.String);
  2212. smalltalk.addMethod(
  2213. "_asLowercase",
  2214. smalltalk.method({
  2215. selector: "asLowercase",
  2216. fn: function (){
  2217. var self=this;
  2218. return smalltalk.withContext(function($ctx1) { return self.toLowerCase();
  2219. return self}, function($ctx1) {$ctx1.fill(self,"asLowercase",{},smalltalk.String)})},
  2220. messageSends: []}),
  2221. smalltalk.String);
  2222. smalltalk.addMethod(
  2223. "_asNumber",
  2224. smalltalk.method({
  2225. selector: "asNumber",
  2226. fn: function (){
  2227. var self=this;
  2228. return smalltalk.withContext(function($ctx1) { return Number(self);
  2229. return self}, function($ctx1) {$ctx1.fill(self,"asNumber",{},smalltalk.String)})},
  2230. messageSends: []}),
  2231. smalltalk.String);
  2232. smalltalk.addMethod(
  2233. "_asRegexp",
  2234. smalltalk.method({
  2235. selector: "asRegexp",
  2236. fn: function (){
  2237. var self=this;
  2238. return smalltalk.withContext(function($ctx1) { var $1;
  2239. $1=_st((smalltalk.RegularExpression || RegularExpression))._fromString_(self);
  2240. return $1;
  2241. }, function($ctx1) {$ctx1.fill(self,"asRegexp",{},smalltalk.String)})},
  2242. messageSends: ["fromString:"]}),
  2243. smalltalk.String);
  2244. smalltalk.addMethod(
  2245. "_asSelector",
  2246. smalltalk.method({
  2247. selector: "asSelector",
  2248. fn: function (){
  2249. var self=this;
  2250. return smalltalk.withContext(function($ctx1) { return smalltalk.selector(self);
  2251. return self}, function($ctx1) {$ctx1.fill(self,"asSelector",{},smalltalk.String)})},
  2252. messageSends: []}),
  2253. smalltalk.String);
  2254. smalltalk.addMethod(
  2255. "_asString",
  2256. smalltalk.method({
  2257. selector: "asString",
  2258. fn: function (){
  2259. var self=this;
  2260. return smalltalk.withContext(function($ctx1) { var $1;
  2261. $1=self;
  2262. return $1;
  2263. }, function($ctx1) {$ctx1.fill(self,"asString",{},smalltalk.String)})},
  2264. messageSends: []}),
  2265. smalltalk.String);
  2266. smalltalk.addMethod(
  2267. "_asSymbol",
  2268. smalltalk.method({
  2269. selector: "asSymbol",
  2270. fn: function (){
  2271. var self=this;
  2272. return smalltalk.withContext(function($ctx1) { var $1;
  2273. $1=_st((smalltalk.Symbol || Symbol))._lookup_(self);
  2274. return $1;
  2275. }, function($ctx1) {$ctx1.fill(self,"asSymbol",{},smalltalk.String)})},
  2276. messageSends: ["lookup:"]}),
  2277. smalltalk.String);
  2278. smalltalk.addMethod(
  2279. "_asUppercase",
  2280. smalltalk.method({
  2281. selector: "asUppercase",
  2282. fn: function (){
  2283. var self=this;
  2284. return smalltalk.withContext(function($ctx1) { return self.toUpperCase();
  2285. return self}, function($ctx1) {$ctx1.fill(self,"asUppercase",{},smalltalk.String)})},
  2286. messageSends: []}),
  2287. smalltalk.String);
  2288. smalltalk.addMethod(
  2289. "_asciiValue",
  2290. smalltalk.method({
  2291. selector: "asciiValue",
  2292. fn: function (){
  2293. var self=this;
  2294. return smalltalk.withContext(function($ctx1) { return self.charCodeAt(0);;
  2295. return self}, function($ctx1) {$ctx1.fill(self,"asciiValue",{},smalltalk.String)})},
  2296. messageSends: []}),
  2297. smalltalk.String);
  2298. smalltalk.addMethod(
  2299. "_at_ifAbsent_",
  2300. smalltalk.method({
  2301. selector: "at:ifAbsent:",
  2302. fn: function (anIndex,aBlock){
  2303. var self=this;
  2304. return smalltalk.withContext(function($ctx1) { return String(self).charAt(anIndex - 1) || aBlock();
  2305. return self}, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{anIndex:anIndex,aBlock:aBlock},smalltalk.String)})},
  2306. messageSends: []}),
  2307. smalltalk.String);
  2308. smalltalk.addMethod(
  2309. "_copyFrom_to_",
  2310. smalltalk.method({
  2311. selector: "copyFrom:to:",
  2312. fn: function (anIndex,anotherIndex){
  2313. var self=this;
  2314. return smalltalk.withContext(function($ctx1) { return self.substring(anIndex - 1, anotherIndex);
  2315. return self}, function($ctx1) {$ctx1.fill(self,"copyFrom:to:",{anIndex:anIndex,anotherIndex:anotherIndex},smalltalk.String)})},
  2316. messageSends: []}),
  2317. smalltalk.String);
  2318. smalltalk.addMethod(
  2319. "_deepCopy",
  2320. smalltalk.method({
  2321. selector: "deepCopy",
  2322. fn: function (){
  2323. var self=this;
  2324. return smalltalk.withContext(function($ctx1) { var $1;
  2325. $1=_st(self)._shallowCopy();
  2326. return $1;
  2327. }, function($ctx1) {$ctx1.fill(self,"deepCopy",{},smalltalk.String)})},
  2328. messageSends: ["shallowCopy"]}),
  2329. smalltalk.String);
  2330. smalltalk.addMethod(
  2331. "_do_",
  2332. smalltalk.method({
  2333. selector: "do:",
  2334. fn: function (aBlock){
  2335. var self=this;
  2336. return smalltalk.withContext(function($ctx1) { for(var i=0;i<self.length;i++){aBlock(self.charAt(i));};
  2337. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.String)})},
  2338. messageSends: []}),
  2339. smalltalk.String);
  2340. smalltalk.addMethod(
  2341. "_escaped",
  2342. smalltalk.method({
  2343. selector: "escaped",
  2344. fn: function (){
  2345. var self=this;
  2346. return smalltalk.withContext(function($ctx1) { return escape(self);
  2347. return self}, function($ctx1) {$ctx1.fill(self,"escaped",{},smalltalk.String)})},
  2348. messageSends: []}),
  2349. smalltalk.String);
  2350. smalltalk.addMethod(
  2351. "_includesSubString_",
  2352. smalltalk.method({
  2353. selector: "includesSubString:",
  2354. fn: function (subString){
  2355. var self=this;
  2356. return smalltalk.withContext(function($ctx1) { return self.indexOf(subString) != -1 ;
  2357. return self}, function($ctx1) {$ctx1.fill(self,"includesSubString:",{subString:subString},smalltalk.String)})},
  2358. messageSends: []}),
  2359. smalltalk.String);
  2360. smalltalk.addMethod(
  2361. "_isString",
  2362. smalltalk.method({
  2363. selector: "isString",
  2364. fn: function (){
  2365. var self=this;
  2366. return smalltalk.withContext(function($ctx1) { return true;
  2367. }, function($ctx1) {$ctx1.fill(self,"isString",{},smalltalk.String)})},
  2368. messageSends: []}),
  2369. smalltalk.String);
  2370. smalltalk.addMethod(
  2371. "_isVowel",
  2372. smalltalk.method({
  2373. selector: "isVowel",
  2374. fn: function (){
  2375. var self=this;
  2376. return smalltalk.withContext(function($ctx1) { var $1;
  2377. $1=_st(_st(_st(self)._size()).__eq((1)))._and_((function(){
  2378. return smalltalk.withContext(function($ctx2) { return _st("aeiou")._includes_(_st(self)._asLowercase());
  2379. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2380. return $1;
  2381. }, function($ctx1) {$ctx1.fill(self,"isVowel",{},smalltalk.String)})},
  2382. messageSends: ["and:", "includes:", "asLowercase", "=", "size"]}),
  2383. smalltalk.String);
  2384. smalltalk.addMethod(
  2385. "_join_",
  2386. smalltalk.method({
  2387. selector: "join:",
  2388. fn: function (aCollection){
  2389. var self=this;
  2390. return smalltalk.withContext(function($ctx1) { var $1;
  2391. $1=_st((smalltalk.String || String))._streamContents_((function(stream){
  2392. return smalltalk.withContext(function($ctx2) { return _st(aCollection)._do_separatedBy_((function(each){
  2393. return smalltalk.withContext(function($ctx3) { return _st(stream)._nextPutAll_(_st(each)._asString());
  2394. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}),(function(){
  2395. return smalltalk.withContext(function($ctx3) { return _st(stream)._nextPutAll_(self);
  2396. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2397. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
  2398. return $1;
  2399. }, function($ctx1) {$ctx1.fill(self,"join:",{aCollection:aCollection},smalltalk.String)})},
  2400. messageSends: ["streamContents:", "do:separatedBy:", "nextPutAll:", "asString"]}),
  2401. smalltalk.String);
  2402. smalltalk.addMethod(
  2403. "_lineIndicesDo_",
  2404. smalltalk.method({
  2405. selector: "lineIndicesDo:",
  2406. fn: function (aBlock){
  2407. var self=this;
  2408. var cr,lf,start,sz,nextLF,nextCR;
  2409. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  2410. var $early={};
  2411. try {
  2412. start=(1);
  2413. sz=_st(self)._size();
  2414. cr=_st((smalltalk.String || String))._cr();
  2415. nextCR=_st(self)._indexOf_startingAt_(cr,(1));
  2416. lf=_st((smalltalk.String || String))._lf();
  2417. nextLF=_st(self)._indexOf_startingAt_(lf,(1));
  2418. _st((function(){
  2419. return smalltalk.withContext(function($ctx2) { return _st(start).__lt_eq(sz);
  2420. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  2421. return smalltalk.withContext(function($ctx2) { $1=_st(_st(nextLF).__eq((0)))._and_((function(){
  2422. return smalltalk.withContext(function($ctx3) { return _st(nextCR).__eq((0));
  2423. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2424. if(smalltalk.assert($1)){
  2425. _st(aBlock)._value_value_value_(start,sz,sz);
  2426. $2=self;
  2427. throw $early=[$2];
  2428. };
  2429. $3=_st(_st(nextCR).__eq((0)))._or_((function(){
  2430. return smalltalk.withContext(function($ctx3) { return _st(_st((0)).__lt(nextLF))._and_((function(){
  2431. return smalltalk.withContext(function($ctx4) { return _st(nextLF).__lt(nextCR);
  2432. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  2433. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2434. if(smalltalk.assert($3)){
  2435. _st(aBlock)._value_value_value_(start,_st(nextLF).__minus((1)),nextLF);
  2436. start=_st((1)).__plus(nextLF);
  2437. start;
  2438. nextLF=_st(self)._indexOf_startingAt_(lf,start);
  2439. return nextLF;
  2440. } else {
  2441. $4=_st(_st((1)).__plus(nextCR)).__eq(nextLF);
  2442. if(smalltalk.assert($4)){
  2443. _st(aBlock)._value_value_value_(start,_st(nextCR).__minus((1)),nextLF);
  2444. start=_st((1)).__plus(nextLF);
  2445. start;
  2446. nextCR=_st(self)._indexOf_startingAt_(cr,start);
  2447. nextCR;
  2448. nextLF=_st(self)._indexOf_startingAt_(lf,start);
  2449. return nextLF;
  2450. } else {
  2451. _st(aBlock)._value_value_value_(start,_st(nextCR).__minus((1)),nextCR);
  2452. start=_st((1)).__plus(nextCR);
  2453. start;
  2454. nextCR=_st(self)._indexOf_startingAt_(cr,start);
  2455. return nextCR;
  2456. };
  2457. };
  2458. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2459. return self}
  2460. catch(e) {if(e===$early)return e[0]; throw e}
  2461. }, function($ctx1) {$ctx1.fill(self,"lineIndicesDo:",{aBlock:aBlock,cr:cr,lf:lf,start:start,sz:sz,nextLF:nextLF,nextCR:nextCR},smalltalk.String)})},
  2462. messageSends: ["size", "cr", "indexOf:startingAt:", "lf", "whileTrue:", "ifTrue:", "value:value:value:", "and:", "=", "ifTrue:ifFalse:", "-", "+", "or:", "<", "<="]}),
  2463. smalltalk.String);
  2464. smalltalk.addMethod(
  2465. "_lineNumber_",
  2466. smalltalk.method({
  2467. selector: "lineNumber:",
  2468. fn: function (anIndex){
  2469. var self=this;
  2470. var lineCount;
  2471. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2472. var $early={};
  2473. try {
  2474. lineCount=(0);
  2475. _st(self)._lineIndicesDo_((function(start,endWithoutDelimiters,end){
  2476. return smalltalk.withContext(function($ctx2) { lineCount=_st(lineCount).__plus((1));
  2477. $1=_st(lineCount).__eq(anIndex);
  2478. if(smalltalk.assert($1)){
  2479. $2=_st(self)._copyFrom_to_(start,endWithoutDelimiters);
  2480. throw $early=[$2];
  2481. };
  2482. }, function($ctx2) {$ctx2.fillBlock({start:start,endWithoutDelimiters:endWithoutDelimiters,end:end},$ctx1)})}));
  2483. return nil;
  2484. }
  2485. catch(e) {if(e===$early)return e[0]; throw e}
  2486. }, function($ctx1) {$ctx1.fill(self,"lineNumber:",{anIndex:anIndex,lineCount:lineCount},smalltalk.String)})},
  2487. messageSends: ["lineIndicesDo:", "ifTrue:", "copyFrom:to:", "=", "+"]}),
  2488. smalltalk.String);
  2489. smalltalk.addMethod(
  2490. "_lines",
  2491. smalltalk.method({
  2492. selector: "lines",
  2493. fn: function (){
  2494. var self=this;
  2495. var lines;
  2496. return smalltalk.withContext(function($ctx1) { var $1;
  2497. lines=_st((smalltalk.Array || Array))._new();
  2498. _st(self)._linesDo_((function(aLine){
  2499. return smalltalk.withContext(function($ctx2) { return _st(lines)._add_(aLine);
  2500. }, function($ctx2) {$ctx2.fillBlock({aLine:aLine},$ctx1)})}));
  2501. $1=lines;
  2502. return $1;
  2503. }, function($ctx1) {$ctx1.fill(self,"lines",{lines:lines},smalltalk.String)})},
  2504. messageSends: ["new", "linesDo:", "add:"]}),
  2505. smalltalk.String);
  2506. smalltalk.addMethod(
  2507. "_linesDo_",
  2508. smalltalk.method({
  2509. selector: "linesDo:",
  2510. fn: function (aBlock){
  2511. var self=this;
  2512. return smalltalk.withContext(function($ctx1) { _st(self)._lineIndicesDo_((function(start,endWithoutDelimiters,end){
  2513. return smalltalk.withContext(function($ctx2) { return _st(aBlock)._value_(_st(self)._copyFrom_to_(start,endWithoutDelimiters));
  2514. }, function($ctx2) {$ctx2.fillBlock({start:start,endWithoutDelimiters:endWithoutDelimiters,end:end},$ctx1)})}));
  2515. return self}, function($ctx1) {$ctx1.fill(self,"linesDo:",{aBlock:aBlock},smalltalk.String)})},
  2516. messageSends: ["lineIndicesDo:", "value:", "copyFrom:to:"]}),
  2517. smalltalk.String);
  2518. smalltalk.addMethod(
  2519. "_match_",
  2520. smalltalk.method({
  2521. selector: "match:",
  2522. fn: function (aRegexp){
  2523. var self=this;
  2524. return smalltalk.withContext(function($ctx1) { return self.search(aRegexp) != -1;
  2525. return self}, function($ctx1) {$ctx1.fill(self,"match:",{aRegexp:aRegexp},smalltalk.String)})},
  2526. messageSends: []}),
  2527. smalltalk.String);
  2528. smalltalk.addMethod(
  2529. "_matchesOf_",
  2530. smalltalk.method({
  2531. selector: "matchesOf:",
  2532. fn: function (aRegularExpression){
  2533. var self=this;
  2534. return smalltalk.withContext(function($ctx1) { return self.match(aRegularExpression);
  2535. return self}, function($ctx1) {$ctx1.fill(self,"matchesOf:",{aRegularExpression:aRegularExpression},smalltalk.String)})},
  2536. messageSends: []}),
  2537. smalltalk.String);
  2538. smalltalk.addMethod(
  2539. "_printNl",
  2540. smalltalk.method({
  2541. selector: "printNl",
  2542. fn: function (){
  2543. var self=this;
  2544. return smalltalk.withContext(function($ctx1) { console.log(self);
  2545. return self}, function($ctx1) {$ctx1.fill(self,"printNl",{},smalltalk.String)})},
  2546. messageSends: []}),
  2547. smalltalk.String);
  2548. smalltalk.addMethod(
  2549. "_printOn_",
  2550. smalltalk.method({
  2551. selector: "printOn:",
  2552. fn: function (aStream){
  2553. var self=this;
  2554. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2555. $1=aStream;
  2556. _st($1)._nextPutAll_("'");
  2557. _st($1)._nextPutAll_(self);
  2558. $2=_st($1)._nextPutAll_("'");
  2559. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.String)})},
  2560. messageSends: ["nextPutAll:"]}),
  2561. smalltalk.String);
  2562. smalltalk.addMethod(
  2563. "_replace_with_",
  2564. smalltalk.method({
  2565. selector: "replace:with:",
  2566. fn: function (aString,anotherString){
  2567. var self=this;
  2568. return smalltalk.withContext(function($ctx1) { var $1;
  2569. $1=_st(self)._replaceRegexp_with_(_st((smalltalk.RegularExpression || RegularExpression))._fromString_flag_(aString,"g"),anotherString);
  2570. return $1;
  2571. }, function($ctx1) {$ctx1.fill(self,"replace:with:",{aString:aString,anotherString:anotherString},smalltalk.String)})},
  2572. messageSends: ["replaceRegexp:with:", "fromString:flag:"]}),
  2573. smalltalk.String);
  2574. smalltalk.addMethod(
  2575. "_replaceRegexp_with_",
  2576. smalltalk.method({
  2577. selector: "replaceRegexp:with:",
  2578. fn: function (aRegexp,aString){
  2579. var self=this;
  2580. return smalltalk.withContext(function($ctx1) { return self.replace(aRegexp, aString);
  2581. return self}, function($ctx1) {$ctx1.fill(self,"replaceRegexp:with:",{aRegexp:aRegexp,aString:aString},smalltalk.String)})},
  2582. messageSends: []}),
  2583. smalltalk.String);
  2584. smalltalk.addMethod(
  2585. "_reversed",
  2586. smalltalk.method({
  2587. selector: "reversed",
  2588. fn: function (){
  2589. var self=this;
  2590. return smalltalk.withContext(function($ctx1) { return self.split("").reverse().join("");
  2591. return self}, function($ctx1) {$ctx1.fill(self,"reversed",{},smalltalk.String)})},
  2592. messageSends: []}),
  2593. smalltalk.String);
  2594. smalltalk.addMethod(
  2595. "_shallowCopy",
  2596. smalltalk.method({
  2597. selector: "shallowCopy",
  2598. fn: function (){
  2599. var self=this;
  2600. return smalltalk.withContext(function($ctx1) { var $1;
  2601. $1=_st(_st(self)._class())._fromString_(self);
  2602. return $1;
  2603. }, function($ctx1) {$ctx1.fill(self,"shallowCopy",{},smalltalk.String)})},
  2604. messageSends: ["fromString:", "class"]}),
  2605. smalltalk.String);
  2606. smalltalk.addMethod(
  2607. "_size",
  2608. smalltalk.method({
  2609. selector: "size",
  2610. fn: function (){
  2611. var self=this;
  2612. return smalltalk.withContext(function($ctx1) { return self.length;
  2613. return self}, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.String)})},
  2614. messageSends: []}),
  2615. smalltalk.String);
  2616. smalltalk.addMethod(
  2617. "_tokenize_",
  2618. smalltalk.method({
  2619. selector: "tokenize:",
  2620. fn: function (aString){
  2621. var self=this;
  2622. return smalltalk.withContext(function($ctx1) { return self.split(aString);
  2623. return self}, function($ctx1) {$ctx1.fill(self,"tokenize:",{aString:aString},smalltalk.String)})},
  2624. messageSends: []}),
  2625. smalltalk.String);
  2626. smalltalk.addMethod(
  2627. "_trimBoth",
  2628. smalltalk.method({
  2629. selector: "trimBoth",
  2630. fn: function (){
  2631. var self=this;
  2632. return smalltalk.withContext(function($ctx1) { var $1;
  2633. $1=_st(self)._trimBoth_("\x5cs");
  2634. return $1;
  2635. }, function($ctx1) {$ctx1.fill(self,"trimBoth",{},smalltalk.String)})},
  2636. messageSends: ["trimBoth:"]}),
  2637. smalltalk.String);
  2638. smalltalk.addMethod(
  2639. "_trimBoth_",
  2640. smalltalk.method({
  2641. selector: "trimBoth:",
  2642. fn: function (separators){
  2643. var self=this;
  2644. return smalltalk.withContext(function($ctx1) { var $1;
  2645. $1=_st(_st(self)._trimLeft_(separators))._trimRight_(separators);
  2646. return $1;
  2647. }, function($ctx1) {$ctx1.fill(self,"trimBoth:",{separators:separators},smalltalk.String)})},
  2648. messageSends: ["trimRight:", "trimLeft:"]}),
  2649. smalltalk.String);
  2650. smalltalk.addMethod(
  2651. "_trimLeft",
  2652. smalltalk.method({
  2653. selector: "trimLeft",
  2654. fn: function (){
  2655. var self=this;
  2656. return smalltalk.withContext(function($ctx1) { var $1;
  2657. $1=_st(self)._trimLeft_("\x5cs");
  2658. return $1;
  2659. }, function($ctx1) {$ctx1.fill(self,"trimLeft",{},smalltalk.String)})},
  2660. messageSends: ["trimLeft:"]}),
  2661. smalltalk.String);
  2662. smalltalk.addMethod(
  2663. "_trimLeft_",
  2664. smalltalk.method({
  2665. selector: "trimLeft:",
  2666. fn: function (separators){
  2667. var self=this;
  2668. return smalltalk.withContext(function($ctx1) { var $1;
  2669. $1=_st(self)._replaceRegexp_with_(_st((smalltalk.RegularExpression || RegularExpression))._fromString_flag_(_st(_st("^[").__comma(separators)).__comma("]+"),"g"),"");
  2670. return $1;
  2671. }, function($ctx1) {$ctx1.fill(self,"trimLeft:",{separators:separators},smalltalk.String)})},
  2672. messageSends: ["replaceRegexp:with:", "fromString:flag:", ","]}),
  2673. smalltalk.String);
  2674. smalltalk.addMethod(
  2675. "_trimRight",
  2676. smalltalk.method({
  2677. selector: "trimRight",
  2678. fn: function (){
  2679. var self=this;
  2680. return smalltalk.withContext(function($ctx1) { var $1;
  2681. $1=_st(self)._trimRight_("\x5cs");
  2682. return $1;
  2683. }, function($ctx1) {$ctx1.fill(self,"trimRight",{},smalltalk.String)})},
  2684. messageSends: ["trimRight:"]}),
  2685. smalltalk.String);
  2686. smalltalk.addMethod(
  2687. "_trimRight_",
  2688. smalltalk.method({
  2689. selector: "trimRight:",
  2690. fn: function (separators){
  2691. var self=this;
  2692. return smalltalk.withContext(function($ctx1) { var $1;
  2693. $1=_st(self)._replaceRegexp_with_(_st((smalltalk.RegularExpression || RegularExpression))._fromString_flag_(_st(_st("[").__comma(separators)).__comma("]+$"),"g"),"");
  2694. return $1;
  2695. }, function($ctx1) {$ctx1.fill(self,"trimRight:",{separators:separators},smalltalk.String)})},
  2696. messageSends: ["replaceRegexp:with:", "fromString:flag:", ","]}),
  2697. smalltalk.String);
  2698. smalltalk.addMethod(
  2699. "_unescaped",
  2700. smalltalk.method({
  2701. selector: "unescaped",
  2702. fn: function (){
  2703. var self=this;
  2704. return smalltalk.withContext(function($ctx1) { return unescape(self);
  2705. return self}, function($ctx1) {$ctx1.fill(self,"unescaped",{},smalltalk.String)})},
  2706. messageSends: []}),
  2707. smalltalk.String);
  2708. smalltalk.addMethod(
  2709. "_withIndexDo_",
  2710. smalltalk.method({
  2711. selector: "withIndexDo:",
  2712. fn: function (aBlock){
  2713. var self=this;
  2714. return smalltalk.withContext(function($ctx1) { for(var i=0;i<self.length;i++){aBlock(self.charAt(i), i+1);};
  2715. return self}, function($ctx1) {$ctx1.fill(self,"withIndexDo:",{aBlock:aBlock},smalltalk.String)})},
  2716. messageSends: []}),
  2717. smalltalk.String);
  2718. smalltalk.addMethod(
  2719. "_cr",
  2720. smalltalk.method({
  2721. selector: "cr",
  2722. fn: function (){
  2723. var self=this;
  2724. return smalltalk.withContext(function($ctx1) { return '\r';
  2725. return self}, function($ctx1) {$ctx1.fill(self,"cr",{},smalltalk.String.klass)})},
  2726. messageSends: []}),
  2727. smalltalk.String.klass);
  2728. smalltalk.addMethod(
  2729. "_crlf",
  2730. smalltalk.method({
  2731. selector: "crlf",
  2732. fn: function (){
  2733. var self=this;
  2734. return smalltalk.withContext(function($ctx1) { return '\r\n';
  2735. return self}, function($ctx1) {$ctx1.fill(self,"crlf",{},smalltalk.String.klass)})},
  2736. messageSends: []}),
  2737. smalltalk.String.klass);
  2738. smalltalk.addMethod(
  2739. "_fromCharCode_",
  2740. smalltalk.method({
  2741. selector: "fromCharCode:",
  2742. fn: function (anInteger){
  2743. var self=this;
  2744. return smalltalk.withContext(function($ctx1) { return String.fromCharCode(anInteger);
  2745. return self}, function($ctx1) {$ctx1.fill(self,"fromCharCode:",{anInteger:anInteger},smalltalk.String.klass)})},
  2746. messageSends: []}),
  2747. smalltalk.String.klass);
  2748. smalltalk.addMethod(
  2749. "_fromString_",
  2750. smalltalk.method({
  2751. selector: "fromString:",
  2752. fn: function (aString){
  2753. var self=this;
  2754. return smalltalk.withContext(function($ctx1) { return new self.fn(aString);
  2755. return self}, function($ctx1) {$ctx1.fill(self,"fromString:",{aString:aString},smalltalk.String.klass)})},
  2756. messageSends: []}),
  2757. smalltalk.String.klass);
  2758. smalltalk.addMethod(
  2759. "_lf",
  2760. smalltalk.method({
  2761. selector: "lf",
  2762. fn: function (){
  2763. var self=this;
  2764. return smalltalk.withContext(function($ctx1) { return '\n';
  2765. return self}, function($ctx1) {$ctx1.fill(self,"lf",{},smalltalk.String.klass)})},
  2766. messageSends: []}),
  2767. smalltalk.String.klass);
  2768. smalltalk.addMethod(
  2769. "_random",
  2770. smalltalk.method({
  2771. selector: "random",
  2772. fn: function (){
  2773. var self=this;
  2774. return smalltalk.withContext(function($ctx1) { return (Math.random()*(22/32)+(10/32)).toString(32).slice(2);;
  2775. return self}, function($ctx1) {$ctx1.fill(self,"random",{}, smalltalk.String.klass)})},
  2776. messageSends: []}),
  2777. smalltalk.String.klass);
  2778. smalltalk.addMethod(
  2779. "_randomNotIn_",
  2780. smalltalk.method({
  2781. selector: "randomNotIn:",
  2782. fn: function (aString){
  2783. var self=this;
  2784. var result;
  2785. return smalltalk.withContext(function($ctx1) { var $1;
  2786. _st((function(){
  2787. return smalltalk.withContext(function($ctx2) { result=_st(self)._random();
  2788. result;
  2789. return _st(aString)._includesSubString_(result);
  2790. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue();
  2791. $1=result;
  2792. return $1;
  2793. }, function($ctx1) {$ctx1.fill(self,"randomNotIn:",{aString:aString,result:result}, smalltalk.String.klass)})},
  2794. messageSends: ["whileTrue", "random", "includesSubString:"]}),
  2795. smalltalk.String.klass);
  2796. smalltalk.addMethod(
  2797. "_space",
  2798. smalltalk.method({
  2799. selector: "space",
  2800. fn: function (){
  2801. var self=this;
  2802. return smalltalk.withContext(function($ctx1) { return ' ';
  2803. return self}, function($ctx1) {$ctx1.fill(self,"space",{},smalltalk.String.klass)})},
  2804. messageSends: []}),
  2805. smalltalk.String.klass);
  2806. smalltalk.addMethod(
  2807. "_streamClass",
  2808. smalltalk.method({
  2809. selector: "streamClass",
  2810. fn: function (){
  2811. var self=this;
  2812. return smalltalk.withContext(function($ctx1) { var $1;
  2813. $1=(smalltalk.StringStream || StringStream);
  2814. return $1;
  2815. }, function($ctx1) {$ctx1.fill(self,"streamClass",{},smalltalk.String.klass)})},
  2816. messageSends: []}),
  2817. smalltalk.String.klass);
  2818. smalltalk.addMethod(
  2819. "_streamContents_",
  2820. smalltalk.method({
  2821. selector: "streamContents:",
  2822. fn: function (blockWithArg){
  2823. var self=this;
  2824. var stream;
  2825. return smalltalk.withContext(function($ctx1) { var $1;
  2826. stream=_st(_st(self)._streamClass())._on_(_st((smalltalk.String || String))._new());
  2827. _st(blockWithArg)._value_(stream);
  2828. $1=_st(stream)._contents();
  2829. return $1;
  2830. }, function($ctx1) {$ctx1.fill(self,"streamContents:",{blockWithArg:blockWithArg,stream:stream},smalltalk.String.klass)})},
  2831. messageSends: ["on:", "new", "streamClass", "value:", "contents"]}),
  2832. smalltalk.String.klass);
  2833. smalltalk.addMethod(
  2834. "_tab",
  2835. smalltalk.method({
  2836. selector: "tab",
  2837. fn: function (){
  2838. var self=this;
  2839. return smalltalk.withContext(function($ctx1) { return '\t';
  2840. return self}, function($ctx1) {$ctx1.fill(self,"tab",{},smalltalk.String.klass)})},
  2841. messageSends: []}),
  2842. smalltalk.String.klass);
  2843. smalltalk.addMethod(
  2844. "_value_",
  2845. smalltalk.method({
  2846. selector: "value:",
  2847. fn: function (aUTFCharCode){
  2848. var self=this;
  2849. return smalltalk.withContext(function($ctx1) { return String.fromCharCode(aUTFCharCode);;
  2850. return self}, function($ctx1) {$ctx1.fill(self,"value:",{aUTFCharCode:aUTFCharCode},smalltalk.String.klass)})},
  2851. messageSends: []}),
  2852. smalltalk.String.klass);
  2853. smalltalk.addClass('Symbol', smalltalk.CharacterArray, [], 'Kernel-Collections');
  2854. smalltalk.addMethod(
  2855. "__lt",
  2856. smalltalk.method({
  2857. selector: "<",
  2858. fn: function (aSymbol){
  2859. var self=this;
  2860. return smalltalk.withContext(function($ctx1) { var $1;
  2861. $1=_st(_st(self)._asString()).__lt(_st(aSymbol)._asString());
  2862. return $1;
  2863. }, function($ctx1) {$ctx1.fill(self,"<",{aSymbol:aSymbol},smalltalk.Symbol)})},
  2864. messageSends: ["<", "asString"]}),
  2865. smalltalk.Symbol);
  2866. smalltalk.addMethod(
  2867. "__lt_eq",
  2868. smalltalk.method({
  2869. selector: "<=",
  2870. fn: function (aSymbol){
  2871. var self=this;
  2872. return smalltalk.withContext(function($ctx1) { var $1;
  2873. $1=_st(_st(self)._asString()).__lt_eq(_st(aSymbol)._asString());
  2874. return $1;
  2875. }, function($ctx1) {$ctx1.fill(self,"<=",{aSymbol:aSymbol},smalltalk.Symbol)})},
  2876. messageSends: ["<=", "asString"]}),
  2877. smalltalk.Symbol);
  2878. smalltalk.addMethod(
  2879. "__eq",
  2880. smalltalk.method({
  2881. selector: "=",
  2882. fn: function (aSymbol){
  2883. var self=this;
  2884. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2885. $1=_st(_st(aSymbol)._class()).__eq(_st(self)._class());
  2886. if(! smalltalk.assert($1)){
  2887. return false;
  2888. };
  2889. $2=_st(_st(self)._asString()).__eq(_st(aSymbol)._asString());
  2890. return $2;
  2891. }, function($ctx1) {$ctx1.fill(self,"=",{aSymbol:aSymbol},smalltalk.Symbol)})},
  2892. messageSends: ["ifFalse:", "=", "class", "asString"]}),
  2893. smalltalk.Symbol);
  2894. smalltalk.addMethod(
  2895. "__gt",
  2896. smalltalk.method({
  2897. selector: ">",
  2898. fn: function (aSymbol){
  2899. var self=this;
  2900. return smalltalk.withContext(function($ctx1) { var $1;
  2901. $1=_st(_st(self)._asString()).__gt(_st(aSymbol)._asString());
  2902. return $1;
  2903. }, function($ctx1) {$ctx1.fill(self,">",{aSymbol:aSymbol},smalltalk.Symbol)})},
  2904. messageSends: [">", "asString"]}),
  2905. smalltalk.Symbol);
  2906. smalltalk.addMethod(
  2907. "__gt_eq",
  2908. smalltalk.method({
  2909. selector: ">=",
  2910. fn: function (aSymbol){
  2911. var self=this;
  2912. return smalltalk.withContext(function($ctx1) { var $1;
  2913. $1=_st(_st(self)._asString()).__gt_eq(_st(aSymbol)._asString());
  2914. return $1;
  2915. }, function($ctx1) {$ctx1.fill(self,">=",{aSymbol:aSymbol},smalltalk.Symbol)})},
  2916. messageSends: [">=", "asString"]}),
  2917. smalltalk.Symbol);
  2918. smalltalk.addMethod(
  2919. "_asJSON",
  2920. smalltalk.method({
  2921. selector: "asJSON",
  2922. fn: function (){
  2923. var self=this;
  2924. return smalltalk.withContext(function($ctx1) { var $1;
  2925. $1=_st(_st(self)._asString())._asJSON();
  2926. return $1;
  2927. }, function($ctx1) {$ctx1.fill(self,"asJSON",{},smalltalk.Symbol)})},
  2928. messageSends: ["asJSON", "asString"]}),
  2929. smalltalk.Symbol);
  2930. smalltalk.addMethod(
  2931. "_asJavascript",
  2932. smalltalk.method({
  2933. selector: "asJavascript",
  2934. fn: function (){
  2935. var self=this;
  2936. return smalltalk.withContext(function($ctx1) { var $1;
  2937. $1=_st(_st("smalltalk.symbolFor(").__comma(_st(_st(self)._asString())._asJavascript())).__comma(")");
  2938. return $1;
  2939. }, function($ctx1) {$ctx1.fill(self,"asJavascript",{},smalltalk.Symbol)})},
  2940. messageSends: [",", "asJavascript", "asString"]}),
  2941. smalltalk.Symbol);
  2942. smalltalk.addMethod(
  2943. "_asSelector",
  2944. smalltalk.method({
  2945. selector: "asSelector",
  2946. fn: function (){
  2947. var self=this;
  2948. return smalltalk.withContext(function($ctx1) { var $1;
  2949. $1=_st(_st(self)._asString())._asSelector();
  2950. return $1;
  2951. }, function($ctx1) {$ctx1.fill(self,"asSelector",{},smalltalk.Symbol)})},
  2952. messageSends: ["asSelector", "asString"]}),
  2953. smalltalk.Symbol);
  2954. smalltalk.addMethod(
  2955. "_asString",
  2956. smalltalk.method({
  2957. selector: "asString",
  2958. fn: function (){
  2959. var self=this;
  2960. return smalltalk.withContext(function($ctx1) { return self.value;
  2961. return self}, function($ctx1) {$ctx1.fill(self,"asString",{},smalltalk.Symbol)})},
  2962. messageSends: []}),
  2963. smalltalk.Symbol);
  2964. smalltalk.addMethod(
  2965. "_asSuperSelector",
  2966. smalltalk.method({
  2967. selector: "asSuperSelector",
  2968. fn: function (){
  2969. var self=this;
  2970. return smalltalk.withContext(function($ctx1) { var $1;
  2971. $1=_st(_st(self)._asString())._asSuperSelector();
  2972. return $1;
  2973. }, function($ctx1) {$ctx1.fill(self,"asSuperSelector",{},smalltalk.Symbol)})},
  2974. messageSends: ["asSuperSelector", "asString"]}),
  2975. smalltalk.Symbol);
  2976. smalltalk.addMethod(
  2977. "_asSymbol",
  2978. smalltalk.method({
  2979. selector: "asSymbol",
  2980. fn: function (){
  2981. var self=this;
  2982. return smalltalk.withContext(function($ctx1) { var $1;
  2983. $1=self;
  2984. return $1;
  2985. }, function($ctx1) {$ctx1.fill(self,"asSymbol",{},smalltalk.Symbol)})},
  2986. messageSends: []}),
  2987. smalltalk.Symbol);
  2988. smalltalk.addMethod(
  2989. "_at_ifAbsent_",
  2990. smalltalk.method({
  2991. selector: "at:ifAbsent:",
  2992. fn: function (anIndex,aBlock){
  2993. var self=this;
  2994. return smalltalk.withContext(function($ctx1) { var $1;
  2995. $1=_st(_st(self)._asString())._at_ifAbsent_(anIndex,aBlock);
  2996. return $1;
  2997. }, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{anIndex:anIndex,aBlock:aBlock},smalltalk.Symbol)})},
  2998. messageSends: ["at:ifAbsent:", "asString"]}),
  2999. smalltalk.Symbol);
  3000. smalltalk.addMethod(
  3001. "_collect_",
  3002. smalltalk.method({
  3003. selector: "collect:",
  3004. fn: function (aBlock){
  3005. var self=this;
  3006. return smalltalk.withContext(function($ctx1) { var $1;
  3007. $1=_st(_st(_st(self)._asString())._collect_(aBlock))._asSymbol();
  3008. return $1;
  3009. }, function($ctx1) {$ctx1.fill(self,"collect:",{aBlock:aBlock},smalltalk.Symbol)})},
  3010. messageSends: ["asSymbol", "collect:", "asString"]}),
  3011. smalltalk.Symbol);
  3012. smalltalk.addMethod(
  3013. "_copyFrom_to_",
  3014. smalltalk.method({
  3015. selector: "copyFrom:to:",
  3016. fn: function (anIndex,anotherIndex){
  3017. var self=this;
  3018. return smalltalk.withContext(function($ctx1) { var $1;
  3019. $1=_st(_st(self)._class())._fromString_(_st(_st(self)._asString())._copyFrom_to_(anIndex,anotherIndex));
  3020. return $1;
  3021. }, function($ctx1) {$ctx1.fill(self,"copyFrom:to:",{anIndex:anIndex,anotherIndex:anotherIndex},smalltalk.Symbol)})},
  3022. messageSends: ["fromString:", "copyFrom:to:", "asString", "class"]}),
  3023. smalltalk.Symbol);
  3024. smalltalk.addMethod(
  3025. "_deepCopy",
  3026. smalltalk.method({
  3027. selector: "deepCopy",
  3028. fn: function (){
  3029. var self=this;
  3030. return smalltalk.withContext(function($ctx1) { var $1;
  3031. $1=self;
  3032. return $1;
  3033. }, function($ctx1) {$ctx1.fill(self,"deepCopy",{},smalltalk.Symbol)})},
  3034. messageSends: []}),
  3035. smalltalk.Symbol);
  3036. smalltalk.addMethod(
  3037. "_detect_",
  3038. smalltalk.method({
  3039. selector: "detect:",
  3040. fn: function (aBlock){
  3041. var self=this;
  3042. return smalltalk.withContext(function($ctx1) { var $1;
  3043. $1=_st(_st(self)._asString())._detect_(aBlock);
  3044. return $1;
  3045. }, function($ctx1) {$ctx1.fill(self,"detect:",{aBlock:aBlock},smalltalk.Symbol)})},
  3046. messageSends: ["detect:", "asString"]}),
  3047. smalltalk.Symbol);
  3048. smalltalk.addMethod(
  3049. "_do_",
  3050. smalltalk.method({
  3051. selector: "do:",
  3052. fn: function (aBlock){
  3053. var self=this;
  3054. return smalltalk.withContext(function($ctx1) { _st(_st(self)._asString())._do_(aBlock);
  3055. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.Symbol)})},
  3056. messageSends: ["do:", "asString"]}),
  3057. smalltalk.Symbol);
  3058. smalltalk.addMethod(
  3059. "_isSymbol",
  3060. smalltalk.method({
  3061. selector: "isSymbol",
  3062. fn: function (){
  3063. var self=this;
  3064. return smalltalk.withContext(function($ctx1) { return true;
  3065. }, function($ctx1) {$ctx1.fill(self,"isSymbol",{},smalltalk.Symbol)})},
  3066. messageSends: []}),
  3067. smalltalk.Symbol);
  3068. smalltalk.addMethod(
  3069. "_printOn_",
  3070. smalltalk.method({
  3071. selector: "printOn:",
  3072. fn: function (aStream){
  3073. var self=this;
  3074. return smalltalk.withContext(function($ctx1) { _st(aStream)._nextPutAll_("#");
  3075. smalltalk.CharacterArray.fn.prototype._printOn_.apply(_st(self), [aStream]);
  3076. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Symbol)})},
  3077. messageSends: ["nextPutAll:", "printOn:"]}),
  3078. smalltalk.Symbol);
  3079. smalltalk.addMethod(
  3080. "_select_",
  3081. smalltalk.method({
  3082. selector: "select:",
  3083. fn: function (aBlock){
  3084. var self=this;
  3085. return smalltalk.withContext(function($ctx1) { var $1;
  3086. $1=_st(_st(_st(self)._asString())._select_(aBlock))._asSymbol();
  3087. return $1;
  3088. }, function($ctx1) {$ctx1.fill(self,"select:",{aBlock:aBlock},smalltalk.Symbol)})},
  3089. messageSends: ["asSymbol", "select:", "asString"]}),
  3090. smalltalk.Symbol);
  3091. smalltalk.addMethod(
  3092. "_shallowCopy",
  3093. smalltalk.method({
  3094. selector: "shallowCopy",
  3095. fn: function (){
  3096. var self=this;
  3097. return smalltalk.withContext(function($ctx1) { var $1;
  3098. $1=self;
  3099. return $1;
  3100. }, function($ctx1) {$ctx1.fill(self,"shallowCopy",{},smalltalk.Symbol)})},
  3101. messageSends: []}),
  3102. smalltalk.Symbol);
  3103. smalltalk.addMethod(
  3104. "_size",
  3105. smalltalk.method({
  3106. selector: "size",
  3107. fn: function (){
  3108. var self=this;
  3109. return smalltalk.withContext(function($ctx1) { var $1;
  3110. $1=_st(_st(self)._asString())._size();
  3111. return $1;
  3112. }, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.Symbol)})},
  3113. messageSends: ["size", "asString"]}),
  3114. smalltalk.Symbol);
  3115. smalltalk.addMethod(
  3116. "_value_",
  3117. smalltalk.method({
  3118. selector: "value:",
  3119. fn: function (anObject){
  3120. var self=this;
  3121. return smalltalk.withContext(function($ctx1) { var $1;
  3122. $1=_st(anObject)._perform_(self);
  3123. return $1;
  3124. }, function($ctx1) {$ctx1.fill(self,"value:",{anObject:anObject},smalltalk.Symbol)})},
  3125. messageSends: ["perform:"]}),
  3126. smalltalk.Symbol);
  3127. smalltalk.addMethod(
  3128. "_withIndexDo_",
  3129. smalltalk.method({
  3130. selector: "withIndexDo:",
  3131. fn: function (aBlock){
  3132. var self=this;
  3133. return smalltalk.withContext(function($ctx1) { _st(_st(self)._asString())._withIndexDo_(aBlock);
  3134. return self}, function($ctx1) {$ctx1.fill(self,"withIndexDo:",{aBlock:aBlock},smalltalk.Symbol)})},
  3135. messageSends: ["withIndexDo:", "asString"]}),
  3136. smalltalk.Symbol);
  3137. smalltalk.addMethod(
  3138. "_basicNew",
  3139. smalltalk.method({
  3140. selector: "basicNew",
  3141. fn: function (){
  3142. var self=this;
  3143. return smalltalk.withContext(function($ctx1) { _st(self)._shouldNotImplement();
  3144. return self}, function($ctx1) {$ctx1.fill(self,"basicNew",{},smalltalk.Symbol.klass)})},
  3145. messageSends: ["shouldNotImplement"]}),
  3146. smalltalk.Symbol.klass);
  3147. smalltalk.addMethod(
  3148. "_fromString_",
  3149. smalltalk.method({
  3150. selector: "fromString:",
  3151. fn: function (aString){
  3152. var self=this;
  3153. return smalltalk.withContext(function($ctx1) { var $1;
  3154. $1=_st(self)._lookup_(aString);
  3155. return $1;
  3156. }, function($ctx1) {$ctx1.fill(self,"fromString:",{aString:aString},smalltalk.Symbol.klass)})},
  3157. messageSends: ["lookup:"]}),
  3158. smalltalk.Symbol.klass);
  3159. smalltalk.addMethod(
  3160. "_lookup_",
  3161. smalltalk.method({
  3162. selector: "lookup:",
  3163. fn: function (aString){
  3164. var self=this;
  3165. return smalltalk.withContext(function($ctx1) { return smalltalk.symbolFor(aString);;
  3166. return self}, function($ctx1) {$ctx1.fill(self,"lookup:",{aString:aString},smalltalk.Symbol.klass)})},
  3167. messageSends: []}),
  3168. smalltalk.Symbol.klass);
  3169. smalltalk.addClass('Set', smalltalk.Collection, ['elements'], 'Kernel-Collections');
  3170. smalltalk.addMethod(
  3171. "__eq",
  3172. smalltalk.method({
  3173. selector: "=",
  3174. fn: function (aCollection){
  3175. var self=this;
  3176. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  3177. var $early={};
  3178. try {
  3179. $1=_st(_st(self)._class()).__eq(_st(aCollection)._class());
  3180. if(! smalltalk.assert($1)){
  3181. return false;
  3182. };
  3183. $2=_st(_st(self)._size()).__eq(_st(aCollection)._size());
  3184. if(! smalltalk.assert($2)){
  3185. return false;
  3186. };
  3187. _st(self)._do_((function(each){
  3188. return smalltalk.withContext(function($ctx2) { $3=_st(aCollection)._includes_(each);
  3189. if(! smalltalk.assert($3)){
  3190. throw $early=[false];
  3191. };
  3192. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3193. return true;
  3194. }
  3195. catch(e) {if(e===$early)return e[0]; throw e}
  3196. }, function($ctx1) {$ctx1.fill(self,"=",{aCollection:aCollection},smalltalk.Set)})},
  3197. messageSends: ["ifFalse:", "=", "class", "size", "do:", "includes:"]}),
  3198. smalltalk.Set);
  3199. smalltalk.addMethod(
  3200. "_add_",
  3201. smalltalk.method({
  3202. selector: "add:",
  3203. fn: function (anObject){
  3204. var self=this;
  3205. return smalltalk.withContext(function($ctx1) {
  3206. var found;
  3207. for(var i=0; i < self['@elements'].length; i++) {
  3208. if(anObject == self['@elements'][i]) {
  3209. found = true;
  3210. break;
  3211. }
  3212. }
  3213. if(!found) {self['@elements'].push(anObject)}
  3214. ;
  3215. return self}, function($ctx1) {$ctx1.fill(self,"add:",{anObject:anObject},smalltalk.Set)})},
  3216. messageSends: []}),
  3217. smalltalk.Set);
  3218. smalltalk.addMethod(
  3219. "_asArray",
  3220. smalltalk.method({
  3221. selector: "asArray",
  3222. fn: function (){
  3223. var self=this;
  3224. return smalltalk.withContext(function($ctx1) { var $1;
  3225. $1=_st(self["@elements"])._copy();
  3226. return $1;
  3227. }, function($ctx1) {$ctx1.fill(self,"asArray",{},smalltalk.Set)})},
  3228. messageSends: ["copy"]}),
  3229. smalltalk.Set);
  3230. smalltalk.addMethod(
  3231. "_collect_",
  3232. smalltalk.method({
  3233. selector: "collect:",
  3234. fn: function (aBlock){
  3235. var self=this;
  3236. return smalltalk.withContext(function($ctx1) { var $1;
  3237. $1=_st(_st(self)._class())._withAll_(_st(self["@elements"])._collect_(aBlock));
  3238. return $1;
  3239. }, function($ctx1) {$ctx1.fill(self,"collect:",{aBlock:aBlock},smalltalk.Set)})},
  3240. messageSends: ["withAll:", "collect:", "class"]}),
  3241. smalltalk.Set);
  3242. smalltalk.addMethod(
  3243. "_detect_ifNone_",
  3244. smalltalk.method({
  3245. selector: "detect:ifNone:",
  3246. fn: function (aBlock,anotherBlock){
  3247. var self=this;
  3248. return smalltalk.withContext(function($ctx1) { var $1;
  3249. $1=_st(self["@elements"])._detect_ifNone_(aBlock,anotherBlock);
  3250. return $1;
  3251. }, function($ctx1) {$ctx1.fill(self,"detect:ifNone:",{aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.Set)})},
  3252. messageSends: ["detect:ifNone:"]}),
  3253. smalltalk.Set);
  3254. smalltalk.addMethod(
  3255. "_do_",
  3256. smalltalk.method({
  3257. selector: "do:",
  3258. fn: function (aBlock){
  3259. var self=this;
  3260. return smalltalk.withContext(function($ctx1) { _st(self["@elements"])._do_(aBlock);
  3261. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.Set)})},
  3262. messageSends: ["do:"]}),
  3263. smalltalk.Set);
  3264. smalltalk.addMethod(
  3265. "_includes_",
  3266. smalltalk.method({
  3267. selector: "includes:",
  3268. fn: function (anObject){
  3269. var self=this;
  3270. return smalltalk.withContext(function($ctx1) { var $1;
  3271. $1=_st(self["@elements"])._includes_(anObject);
  3272. return $1;
  3273. }, function($ctx1) {$ctx1.fill(self,"includes:",{anObject:anObject},smalltalk.Set)})},
  3274. messageSends: ["includes:"]}),
  3275. smalltalk.Set);
  3276. smalltalk.addMethod(
  3277. "_initialize",
  3278. smalltalk.method({
  3279. selector: "initialize",
  3280. fn: function (){
  3281. var self=this;
  3282. return smalltalk.withContext(function($ctx1) { smalltalk.Collection.fn.prototype._initialize.apply(_st(self), []);
  3283. self["@elements"]=[];
  3284. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Set)})},
  3285. messageSends: ["initialize"]}),
  3286. smalltalk.Set);
  3287. smalltalk.addMethod(
  3288. "_printOn_",
  3289. smalltalk.method({
  3290. selector: "printOn:",
  3291. fn: function (aStream){
  3292. var self=this;
  3293. return smalltalk.withContext(function($ctx1) { smalltalk.Collection.fn.prototype._printOn_.apply(_st(self), [aStream]);
  3294. _st(aStream)._nextPutAll_(" (");
  3295. _st(self)._do_separatedBy_((function(each){
  3296. return smalltalk.withContext(function($ctx2) { return _st(each)._printOn_(aStream);
  3297. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  3298. return smalltalk.withContext(function($ctx2) { return _st(aStream)._nextPutAll_(" ");
  3299. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3300. _st(aStream)._nextPutAll_(")");
  3301. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Set)})},
  3302. messageSends: ["printOn:", "nextPutAll:", "do:separatedBy:"]}),
  3303. smalltalk.Set);
  3304. smalltalk.addMethod(
  3305. "_remove_",
  3306. smalltalk.method({
  3307. selector: "remove:",
  3308. fn: function (anObject){
  3309. var self=this;
  3310. return smalltalk.withContext(function($ctx1) { _st(self["@elements"])._remove_(anObject);
  3311. return self}, function($ctx1) {$ctx1.fill(self,"remove:",{anObject:anObject},smalltalk.Set)})},
  3312. messageSends: ["remove:"]}),
  3313. smalltalk.Set);
  3314. smalltalk.addMethod(
  3315. "_select_",
  3316. smalltalk.method({
  3317. selector: "select:",
  3318. fn: function (aBlock){
  3319. var self=this;
  3320. var collection;
  3321. return smalltalk.withContext(function($ctx1) { var $1,$2;
  3322. collection=_st(_st(self)._class())._new();
  3323. _st(self)._do_((function(each){
  3324. return smalltalk.withContext(function($ctx2) { $1=_st(aBlock)._value_(each);
  3325. if(smalltalk.assert($1)){
  3326. return _st(collection)._add_(each);
  3327. };
  3328. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3329. $2=collection;
  3330. return $2;
  3331. }, function($ctx1) {$ctx1.fill(self,"select:",{aBlock:aBlock,collection:collection},smalltalk.Set)})},
  3332. messageSends: ["new", "class", "do:", "ifTrue:", "add:", "value:"]}),
  3333. smalltalk.Set);
  3334. smalltalk.addMethod(
  3335. "_size",
  3336. smalltalk.method({
  3337. selector: "size",
  3338. fn: function (){
  3339. var self=this;
  3340. return smalltalk.withContext(function($ctx1) { var $1;
  3341. $1=_st(self["@elements"])._size();
  3342. return $1;
  3343. }, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.Set)})},
  3344. messageSends: ["size"]}),
  3345. smalltalk.Set);
  3346. smalltalk.addClass('Queue', smalltalk.Object, ['read', 'readIndex', 'write'], 'Kernel-Collections');
  3347. smalltalk.addMethod(
  3348. "_back_",
  3349. smalltalk.method({
  3350. selector: "back:",
  3351. fn: function (anObject){
  3352. var self=this;
  3353. return smalltalk.withContext(function($ctx1) { _st(self["@write"])._add_(anObject);
  3354. return self}, function($ctx1) {$ctx1.fill(self,"back:",{anObject:anObject},smalltalk.Queue)})},
  3355. messageSends: ["add:"]}),
  3356. smalltalk.Queue);
  3357. smalltalk.addMethod(
  3358. "_front",
  3359. smalltalk.method({
  3360. selector: "front",
  3361. fn: function (){
  3362. var self=this;
  3363. return smalltalk.withContext(function($ctx1) { var $1;
  3364. $1=_st(self)._frontIfAbsent_((function(){
  3365. return smalltalk.withContext(function($ctx2) { return _st(self)._error_("Cannot read from empty Queue.");
  3366. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3367. return $1;
  3368. }, function($ctx1) {$ctx1.fill(self,"front",{},smalltalk.Queue)})},
  3369. messageSends: ["frontIfAbsent:", "error:"]}),
  3370. smalltalk.Queue);
  3371. smalltalk.addMethod(
  3372. "_frontIfAbsent_",
  3373. smalltalk.method({
  3374. selector: "frontIfAbsent:",
  3375. fn: function (aBlock){
  3376. var self=this;
  3377. var result;
  3378. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  3379. var $early={};
  3380. try {
  3381. result=_st(self["@read"])._at_ifAbsent_(self["@readIndex"],(function(){
  3382. return smalltalk.withContext(function($ctx2) { $1=_st(self["@write"])._isEmpty();
  3383. if(smalltalk.assert($1)){
  3384. $2=_st(self["@readIndex"]).__gt((1));
  3385. if(smalltalk.assert($2)){
  3386. self["@read"]=[];
  3387. self["@read"];
  3388. self["@readIndex"]=(1);
  3389. self["@readIndex"];
  3390. };
  3391. $3=_st(aBlock)._value();
  3392. throw $early=[$3];
  3393. };
  3394. self["@read"]=self["@write"];
  3395. self["@read"];
  3396. self["@readIndex"]=(1);
  3397. self["@readIndex"];
  3398. self["@write"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  3399. self["@write"];
  3400. return _st(self["@read"])._first();
  3401. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3402. _st(self["@read"])._at_put_(self["@readIndex"],nil);
  3403. self["@readIndex"]=_st(self["@readIndex"]).__plus((1));
  3404. $4=result;
  3405. return $4;
  3406. }
  3407. catch(e) {if(e===$early)return e[0]; throw e}
  3408. }, function($ctx1) {$ctx1.fill(self,"frontIfAbsent:",{aBlock:aBlock,result:result},smalltalk.Queue)})},
  3409. messageSends: ["at:ifAbsent:", "ifTrue:", ">", "value", "isEmpty", "new", "first", "at:put:", "+"]}),
  3410. smalltalk.Queue);
  3411. smalltalk.addMethod(
  3412. "_initialize",
  3413. smalltalk.method({
  3414. selector: "initialize",
  3415. fn: function (){
  3416. var self=this;
  3417. return smalltalk.withContext(function($ctx1) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  3418. self["@read"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  3419. self["@write"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  3420. self["@readIndex"]=(1);
  3421. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Queue)})},
  3422. messageSends: ["initialize", "new"]}),
  3423. smalltalk.Queue);
  3424. smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel-Collections');
  3425. smalltalk.addMethod(
  3426. "_compile_",
  3427. smalltalk.method({
  3428. selector: "compile:",
  3429. fn: function (aString){
  3430. var self=this;
  3431. return smalltalk.withContext(function($ctx1) { return self.compile(aString);
  3432. return self}, function($ctx1) {$ctx1.fill(self,"compile:",{aString:aString},smalltalk.RegularExpression)})},
  3433. messageSends: []}),
  3434. smalltalk.RegularExpression);
  3435. smalltalk.addMethod(
  3436. "_exec_",
  3437. smalltalk.method({
  3438. selector: "exec:",
  3439. fn: function (aString){
  3440. var self=this;
  3441. return smalltalk.withContext(function($ctx1) { return self.exec(aString) || nil;
  3442. return self}, function($ctx1) {$ctx1.fill(self,"exec:",{aString:aString},smalltalk.RegularExpression)})},
  3443. messageSends: []}),
  3444. smalltalk.RegularExpression);
  3445. smalltalk.addMethod(
  3446. "_test_",
  3447. smalltalk.method({
  3448. selector: "test:",
  3449. fn: function (aString){
  3450. var self=this;
  3451. return smalltalk.withContext(function($ctx1) { return self.test(aString);
  3452. return self}, function($ctx1) {$ctx1.fill(self,"test:",{aString:aString},smalltalk.RegularExpression)})},
  3453. messageSends: []}),
  3454. smalltalk.RegularExpression);
  3455. smalltalk.addMethod(
  3456. "_fromString_",
  3457. smalltalk.method({
  3458. selector: "fromString:",
  3459. fn: function (aString){
  3460. var self=this;
  3461. return smalltalk.withContext(function($ctx1) { var $1;
  3462. $1=_st(self)._fromString_flag_(aString,"");
  3463. return $1;
  3464. }, function($ctx1) {$ctx1.fill(self,"fromString:",{aString:aString},smalltalk.RegularExpression.klass)})},
  3465. messageSends: ["fromString:flag:"]}),
  3466. smalltalk.RegularExpression.klass);
  3467. smalltalk.addMethod(
  3468. "_fromString_flag_",
  3469. smalltalk.method({
  3470. selector: "fromString:flag:",
  3471. fn: function (aString,anotherString){
  3472. var self=this;
  3473. return smalltalk.withContext(function($ctx1) { return new RegExp(aString, anotherString);
  3474. return self}, function($ctx1) {$ctx1.fill(self,"fromString:flag:",{aString:aString,anotherString:anotherString},smalltalk.RegularExpression.klass)})},
  3475. messageSends: []}),
  3476. smalltalk.RegularExpression.klass);
  3477. smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel-Collections');
  3478. smalltalk.addMethod(
  3479. "_atEnd",
  3480. smalltalk.method({
  3481. selector: "atEnd",
  3482. fn: function (){
  3483. var self=this;
  3484. return smalltalk.withContext(function($ctx1) { var $1;
  3485. $1=_st(_st(self)._position()).__eq(_st(self)._size());
  3486. return $1;
  3487. }, function($ctx1) {$ctx1.fill(self,"atEnd",{},smalltalk.Stream)})},
  3488. messageSends: ["=", "size", "position"]}),
  3489. smalltalk.Stream);
  3490. smalltalk.addMethod(
  3491. "_atStart",
  3492. smalltalk.method({
  3493. selector: "atStart",
  3494. fn: function (){
  3495. var self=this;
  3496. return smalltalk.withContext(function($ctx1) { var $1;
  3497. $1=_st(_st(self)._position()).__eq((0));
  3498. return $1;
  3499. }, function($ctx1) {$ctx1.fill(self,"atStart",{},smalltalk.Stream)})},
  3500. messageSends: ["=", "position"]}),
  3501. smalltalk.Stream);
  3502. smalltalk.addMethod(
  3503. "_close",
  3504. smalltalk.method({
  3505. selector: "close",
  3506. fn: function (){
  3507. var self=this;
  3508. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"close",{},smalltalk.Stream)})},
  3509. messageSends: []}),
  3510. smalltalk.Stream);
  3511. smalltalk.addMethod(
  3512. "_collection",
  3513. smalltalk.method({
  3514. selector: "collection",
  3515. fn: function (){
  3516. var self=this;
  3517. return smalltalk.withContext(function($ctx1) { var $1;
  3518. $1=self["@collection"];
  3519. return $1;
  3520. }, function($ctx1) {$ctx1.fill(self,"collection",{},smalltalk.Stream)})},
  3521. messageSends: []}),
  3522. smalltalk.Stream);
  3523. smalltalk.addMethod(
  3524. "_contents",
  3525. smalltalk.method({
  3526. selector: "contents",
  3527. fn: function (){
  3528. var self=this;
  3529. return smalltalk.withContext(function($ctx1) { var $1;
  3530. $1=_st(_st(self)._collection())._copyFrom_to_((1),_st(self)._streamSize());
  3531. return $1;
  3532. }, function($ctx1) {$ctx1.fill(self,"contents",{},smalltalk.Stream)})},
  3533. messageSends: ["copyFrom:to:", "streamSize", "collection"]}),
  3534. smalltalk.Stream);
  3535. smalltalk.addMethod(
  3536. "_do_",
  3537. smalltalk.method({
  3538. selector: "do:",
  3539. fn: function (aBlock){
  3540. var self=this;
  3541. return smalltalk.withContext(function($ctx1) { _st((function(){
  3542. return smalltalk.withContext(function($ctx2) { return _st(self)._atEnd();
  3543. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  3544. return smalltalk.withContext(function($ctx2) { return _st(aBlock)._value_(_st(self)._next());
  3545. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3546. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.Stream)})},
  3547. messageSends: ["whileFalse:", "value:", "next", "atEnd"]}),
  3548. smalltalk.Stream);
  3549. smalltalk.addMethod(
  3550. "_flush",
  3551. smalltalk.method({
  3552. selector: "flush",
  3553. fn: function (){
  3554. var self=this;
  3555. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"flush",{},smalltalk.Stream)})},
  3556. messageSends: []}),
  3557. smalltalk.Stream);
  3558. smalltalk.addMethod(
  3559. "_isEmpty",
  3560. smalltalk.method({
  3561. selector: "isEmpty",
  3562. fn: function (){
  3563. var self=this;
  3564. return smalltalk.withContext(function($ctx1) { var $1;
  3565. $1=_st(_st(self)._size()).__eq((0));
  3566. return $1;
  3567. }, function($ctx1) {$ctx1.fill(self,"isEmpty",{},smalltalk.Stream)})},
  3568. messageSends: ["=", "size"]}),
  3569. smalltalk.Stream);
  3570. smalltalk.addMethod(
  3571. "_next",
  3572. smalltalk.method({
  3573. selector: "next",
  3574. fn: function (){
  3575. var self=this;
  3576. return smalltalk.withContext(function($ctx1) { var $2,$1;
  3577. $2=_st(self)._atEnd();
  3578. if(smalltalk.assert($2)){
  3579. $1=nil;
  3580. } else {
  3581. _st(self)._position_(_st(_st(self)._position()).__plus((1)));
  3582. $1=_st(self["@collection"])._at_(_st(self)._position());
  3583. };
  3584. return $1;
  3585. }, function($ctx1) {$ctx1.fill(self,"next",{},smalltalk.Stream)})},
  3586. messageSends: ["ifTrue:ifFalse:", "position:", "+", "position", "at:", "atEnd"]}),
  3587. smalltalk.Stream);
  3588. smalltalk.addMethod(
  3589. "_next_",
  3590. smalltalk.method({
  3591. selector: "next:",
  3592. fn: function (anInteger){
  3593. var self=this;
  3594. var tempCollection;
  3595. return smalltalk.withContext(function($ctx1) { var $1,$2;
  3596. tempCollection=_st(_st(_st(self)._collection())._class())._new();
  3597. _st(anInteger)._timesRepeat_((function(){
  3598. return smalltalk.withContext(function($ctx2) { $1=_st(self)._atEnd();
  3599. if(! smalltalk.assert($1)){
  3600. return _st(tempCollection)._add_(_st(self)._next());
  3601. };
  3602. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3603. $2=tempCollection;
  3604. return $2;
  3605. }, function($ctx1) {$ctx1.fill(self,"next:",{anInteger:anInteger,tempCollection:tempCollection},smalltalk.Stream)})},
  3606. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", "add:", "next", "atEnd"]}),
  3607. smalltalk.Stream);
  3608. smalltalk.addMethod(
  3609. "_nextPut_",
  3610. smalltalk.method({
  3611. selector: "nextPut:",
  3612. fn: function (anObject){
  3613. var self=this;
  3614. return smalltalk.withContext(function($ctx1) { _st(self)._position_(_st(_st(self)._position()).__plus((1)));
  3615. _st(_st(self)._collection())._at_put_(_st(self)._position(),anObject);
  3616. _st(self)._setStreamSize_(_st(_st(self)._streamSize())._max_(_st(self)._position()));
  3617. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{anObject:anObject},smalltalk.Stream)})},
  3618. messageSends: ["position:", "+", "position", "at:put:", "collection", "setStreamSize:", "max:", "streamSize"]}),
  3619. smalltalk.Stream);
  3620. smalltalk.addMethod(
  3621. "_nextPutAll_",
  3622. smalltalk.method({
  3623. selector: "nextPutAll:",
  3624. fn: function (aCollection){
  3625. var self=this;
  3626. return smalltalk.withContext(function($ctx1) { _st(aCollection)._do_((function(each){
  3627. return smalltalk.withContext(function($ctx2) { return _st(self)._nextPut_(each);
  3628. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3629. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAll:",{aCollection:aCollection},smalltalk.Stream)})},
  3630. messageSends: ["do:", "nextPut:"]}),
  3631. smalltalk.Stream);
  3632. smalltalk.addMethod(
  3633. "_peek",
  3634. smalltalk.method({
  3635. selector: "peek",
  3636. fn: function (){
  3637. var self=this;
  3638. return smalltalk.withContext(function($ctx1) { var $2,$1;
  3639. $2=_st(self)._atEnd();
  3640. if(! smalltalk.assert($2)){
  3641. $1=_st(_st(self)._collection())._at_(_st(_st(self)._position()).__plus((1)));
  3642. };
  3643. return $1;
  3644. }, function($ctx1) {$ctx1.fill(self,"peek",{},smalltalk.Stream)})},
  3645. messageSends: ["ifFalse:", "at:", "+", "position", "collection", "atEnd"]}),
  3646. smalltalk.Stream);
  3647. smalltalk.addMethod(
  3648. "_position",
  3649. smalltalk.method({
  3650. selector: "position",
  3651. fn: function (){
  3652. var self=this;
  3653. return smalltalk.withContext(function($ctx1) { var $2,$1;
  3654. $2=self["@position"];
  3655. if(($receiver = $2) == nil || $receiver == undefined){
  3656. self["@position"]=(0);
  3657. $1=self["@position"];
  3658. } else {
  3659. $1=$2;
  3660. };
  3661. return $1;
  3662. }, function($ctx1) {$ctx1.fill(self,"position",{},smalltalk.Stream)})},
  3663. messageSends: ["ifNil:"]}),
  3664. smalltalk.Stream);
  3665. smalltalk.addMethod(
  3666. "_position_",
  3667. smalltalk.method({
  3668. selector: "position:",
  3669. fn: function (anInteger){
  3670. var self=this;
  3671. return smalltalk.withContext(function($ctx1) { self["@position"]=anInteger;
  3672. return self}, function($ctx1) {$ctx1.fill(self,"position:",{anInteger:anInteger},smalltalk.Stream)})},
  3673. messageSends: []}),
  3674. smalltalk.Stream);
  3675. smalltalk.addMethod(
  3676. "_reset",
  3677. smalltalk.method({
  3678. selector: "reset",
  3679. fn: function (){
  3680. var self=this;
  3681. return smalltalk.withContext(function($ctx1) { _st(self)._position_((0));
  3682. return self}, function($ctx1) {$ctx1.fill(self,"reset",{},smalltalk.Stream)})},
  3683. messageSends: ["position:"]}),
  3684. smalltalk.Stream);
  3685. smalltalk.addMethod(
  3686. "_resetContents",
  3687. smalltalk.method({
  3688. selector: "resetContents",
  3689. fn: function (){
  3690. var self=this;
  3691. return smalltalk.withContext(function($ctx1) { _st(self)._reset();
  3692. _st(self)._setStreamSize_((0));
  3693. return self}, function($ctx1) {$ctx1.fill(self,"resetContents",{},smalltalk.Stream)})},
  3694. messageSends: ["reset", "setStreamSize:"]}),
  3695. smalltalk.Stream);
  3696. smalltalk.addMethod(
  3697. "_setCollection_",
  3698. smalltalk.method({
  3699. selector: "setCollection:",
  3700. fn: function (aCollection){
  3701. var self=this;
  3702. return smalltalk.withContext(function($ctx1) { self["@collection"]=aCollection;
  3703. return self}, function($ctx1) {$ctx1.fill(self,"setCollection:",{aCollection:aCollection},smalltalk.Stream)})},
  3704. messageSends: []}),
  3705. smalltalk.Stream);
  3706. smalltalk.addMethod(
  3707. "_setStreamSize_",
  3708. smalltalk.method({
  3709. selector: "setStreamSize:",
  3710. fn: function (anInteger){
  3711. var self=this;
  3712. return smalltalk.withContext(function($ctx1) { self["@streamSize"]=anInteger;
  3713. return self}, function($ctx1) {$ctx1.fill(self,"setStreamSize:",{anInteger:anInteger},smalltalk.Stream)})},
  3714. messageSends: []}),
  3715. smalltalk.Stream);
  3716. smalltalk.addMethod(
  3717. "_setToEnd",
  3718. smalltalk.method({
  3719. selector: "setToEnd",
  3720. fn: function (){
  3721. var self=this;
  3722. return smalltalk.withContext(function($ctx1) { _st(self)._position_(_st(self)._size());
  3723. return self}, function($ctx1) {$ctx1.fill(self,"setToEnd",{},smalltalk.Stream)})},
  3724. messageSends: ["position:", "size"]}),
  3725. smalltalk.Stream);
  3726. smalltalk.addMethod(
  3727. "_size",
  3728. smalltalk.method({
  3729. selector: "size",
  3730. fn: function (){
  3731. var self=this;
  3732. return smalltalk.withContext(function($ctx1) { var $1;
  3733. $1=_st(self)._streamSize();
  3734. return $1;
  3735. }, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.Stream)})},
  3736. messageSends: ["streamSize"]}),
  3737. smalltalk.Stream);
  3738. smalltalk.addMethod(
  3739. "_skip_",
  3740. smalltalk.method({
  3741. selector: "skip:",
  3742. fn: function (anInteger){
  3743. var self=this;
  3744. return smalltalk.withContext(function($ctx1) { _st(self)._position_(_st(_st(_st(self)._position()).__plus(anInteger))._min_max_(_st(self)._size(),(0)));
  3745. return self}, function($ctx1) {$ctx1.fill(self,"skip:",{anInteger:anInteger},smalltalk.Stream)})},
  3746. messageSends: ["position:", "min:max:", "size", "+", "position"]}),
  3747. smalltalk.Stream);
  3748. smalltalk.addMethod(
  3749. "_streamSize",
  3750. smalltalk.method({
  3751. selector: "streamSize",
  3752. fn: function (){
  3753. var self=this;
  3754. return smalltalk.withContext(function($ctx1) { var $1;
  3755. $1=self["@streamSize"];
  3756. return $1;
  3757. }, function($ctx1) {$ctx1.fill(self,"streamSize",{},smalltalk.Stream)})},
  3758. messageSends: []}),
  3759. smalltalk.Stream);
  3760. smalltalk.addMethod(
  3761. "_on_",
  3762. smalltalk.method({
  3763. selector: "on:",
  3764. fn: function (aCollection){
  3765. var self=this;
  3766. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  3767. $2=_st(self)._new();
  3768. _st($2)._setCollection_(aCollection);
  3769. _st($2)._setStreamSize_(_st(aCollection)._size());
  3770. $3=_st($2)._yourself();
  3771. $1=$3;
  3772. return $1;
  3773. }, function($ctx1) {$ctx1.fill(self,"on:",{aCollection:aCollection},smalltalk.Stream.klass)})},
  3774. messageSends: ["setCollection:", "new", "setStreamSize:", "size", "yourself"]}),
  3775. smalltalk.Stream.klass);
  3776. smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel-Collections');
  3777. smalltalk.addMethod(
  3778. "_cr",
  3779. smalltalk.method({
  3780. selector: "cr",
  3781. fn: function (){
  3782. var self=this;
  3783. return smalltalk.withContext(function($ctx1) { var $1;
  3784. $1=_st(self)._nextPutAll_(_st((smalltalk.String || String))._cr());
  3785. return $1;
  3786. }, function($ctx1) {$ctx1.fill(self,"cr",{},smalltalk.StringStream)})},
  3787. messageSends: ["nextPutAll:", "cr"]}),
  3788. smalltalk.StringStream);
  3789. smalltalk.addMethod(
  3790. "_crlf",
  3791. smalltalk.method({
  3792. selector: "crlf",
  3793. fn: function (){
  3794. var self=this;
  3795. return smalltalk.withContext(function($ctx1) { var $1;
  3796. $1=_st(self)._nextPutAll_(_st((smalltalk.String || String))._crlf());
  3797. return $1;
  3798. }, function($ctx1) {$ctx1.fill(self,"crlf",{},smalltalk.StringStream)})},
  3799. messageSends: ["nextPutAll:", "crlf"]}),
  3800. smalltalk.StringStream);
  3801. smalltalk.addMethod(
  3802. "_lf",
  3803. smalltalk.method({
  3804. selector: "lf",
  3805. fn: function (){
  3806. var self=this;
  3807. return smalltalk.withContext(function($ctx1) { var $1;
  3808. $1=_st(self)._nextPutAll_(_st((smalltalk.String || String))._lf());
  3809. return $1;
  3810. }, function($ctx1) {$ctx1.fill(self,"lf",{},smalltalk.StringStream)})},
  3811. messageSends: ["nextPutAll:", "lf"]}),
  3812. smalltalk.StringStream);
  3813. smalltalk.addMethod(
  3814. "_next_",
  3815. smalltalk.method({
  3816. selector: "next:",
  3817. fn: function (anInteger){
  3818. var self=this;
  3819. var tempCollection;
  3820. return smalltalk.withContext(function($ctx1) { var $1,$2;
  3821. tempCollection=_st(_st(_st(self)._collection())._class())._new();
  3822. _st(anInteger)._timesRepeat_((function(){
  3823. return smalltalk.withContext(function($ctx2) { $1=_st(self)._atEnd();
  3824. if(! smalltalk.assert($1)){
  3825. tempCollection=_st(tempCollection).__comma(_st(self)._next());
  3826. return tempCollection;
  3827. };
  3828. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3829. $2=tempCollection;
  3830. return $2;
  3831. }, function($ctx1) {$ctx1.fill(self,"next:",{anInteger:anInteger,tempCollection:tempCollection},smalltalk.StringStream)})},
  3832. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", ",", "next", "atEnd"]}),
  3833. smalltalk.StringStream);
  3834. smalltalk.addMethod(
  3835. "_nextPut_",
  3836. smalltalk.method({
  3837. selector: "nextPut:",
  3838. fn: function (aString){
  3839. var self=this;
  3840. return smalltalk.withContext(function($ctx1) { _st(self)._nextPutAll_(aString);
  3841. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{aString:aString},smalltalk.StringStream)})},
  3842. messageSends: ["nextPutAll:"]}),
  3843. smalltalk.StringStream);
  3844. smalltalk.addMethod(
  3845. "_nextPutAll_",
  3846. smalltalk.method({
  3847. selector: "nextPutAll:",
  3848. fn: function (aString){
  3849. var self=this;
  3850. var pre,post;
  3851. return smalltalk.withContext(function($ctx1) { var $1;
  3852. $1=_st(self)._atEnd();
  3853. if(smalltalk.assert($1)){
  3854. _st(self)._setCollection_(_st(_st(self)._collection()).__comma(aString));
  3855. } else {
  3856. pre=_st(_st(self)._collection())._copyFrom_to_((1),_st(self)._position());
  3857. pre;
  3858. post=_st(_st(self)._collection())._copyFrom_to_(_st(_st(_st(self)._position()).__plus((1))).__plus(_st(aString)._size()),_st(_st(self)._collection())._size());
  3859. post;
  3860. _st(self)._setCollection_(_st(_st(pre).__comma(aString)).__comma(post));
  3861. };
  3862. _st(self)._position_(_st(_st(self)._position()).__plus(_st(aString)._size()));
  3863. _st(self)._setStreamSize_(_st(_st(self)._streamSize())._max_(_st(self)._position()));
  3864. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAll:",{aString:aString,pre:pre,post:post},smalltalk.StringStream)})},
  3865. messageSends: ["ifTrue:ifFalse:", "setCollection:", ",", "collection", "copyFrom:to:", "position", "+", "size", "atEnd", "position:", "setStreamSize:", "max:", "streamSize"]}),
  3866. smalltalk.StringStream);
  3867. smalltalk.addMethod(
  3868. "_space",
  3869. smalltalk.method({
  3870. selector: "space",
  3871. fn: function (){
  3872. var self=this;
  3873. return smalltalk.withContext(function($ctx1) { _st(self)._nextPut_(" ");
  3874. return self}, function($ctx1) {$ctx1.fill(self,"space",{},smalltalk.StringStream)})},
  3875. messageSends: ["nextPut:"]}),
  3876. smalltalk.StringStream);
  3877. smalltalk.addMethod(
  3878. "_tab",
  3879. smalltalk.method({
  3880. selector: "tab",
  3881. fn: function (){
  3882. var self=this;
  3883. return smalltalk.withContext(function($ctx1) { var $1;
  3884. $1=_st(self)._nextPutAll_(_st((smalltalk.String || String))._tab());
  3885. return $1;
  3886. }, function($ctx1) {$ctx1.fill(self,"tab",{},smalltalk.StringStream)})},
  3887. messageSends: ["nextPutAll:", "tab"]}),
  3888. smalltalk.StringStream);