Kernel-Collections.deploy.js 129 KB

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