1
0

Kernel-Collections.deploy.js 134 KB

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