Kernel-Collections.deploy.js 127 KB

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