Kernel-Collections.deploy.js 129 KB

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