Kernel-Collections.deploy.js 128 KB

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