Kernel-Collections.deploy.js 130 KB

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