Kernel-Collections.deploy.js 130 KB

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