Kernel-Collections.deploy.js 127 KB

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