Kernel-Collections.deploy.js 129 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264
  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(self._class()).__eq(_st(anAssociation)._class()))._and_((function(){
  11. return smalltalk.withContext(function($ctx2) {
  12. return _st(_st(self._key()).__eq(_st(anAssociation)._key()))._and_((function(){
  13. return smalltalk.withContext(function($ctx3) {
  14. return _st(self._value()).__eq(_st(anAssociation)._value());
  15. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  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(self._key())._printOn_(aStream);
  50. _st(aStream)._nextPutAll_(" -> ");
  51. _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=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=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. 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 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(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=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(self._class())._new())._writeStream();
  197. 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. 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=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=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=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=self._detect_ifNone_(aBlock,(function(){
  281. return smalltalk.withContext(function($ctx2) {
  282. return 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. 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. 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. 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. 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=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=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(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. 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=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({},$ctx2)})}));
  424. if(smalltalk.assert($1)){
  425. return _st(outputSet)._add_(each);
  426. };
  427. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  428. $2=_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(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(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. 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. 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=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=self._remove_ifAbsent_(anObject,(function(){
  515. return smalltalk.withContext(function($ctx2) {
  516. return 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. 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(self._class())._new())._writeStream();
  541. 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. 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=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=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=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=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=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=self._at_ifAbsent_(anIndex,(function(){
  657. return smalltalk.withContext(function($ctx2) {
  658. return 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. 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=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. 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. 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=self._indexOf_ifAbsent_(anObject,(function(){
  717. return smalltalk.withContext(function($ctx2) {
  718. return 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. 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. 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. 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. 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(self._class()).__eq(_st(aHashedCollection)._class());
  776. if(! smalltalk.assert($1)){
  777. return false;
  778. };
  779. $2=_st(self._size()).__eq(_st(aHashedCollection)._size());
  780. if(! smalltalk.assert($2)){
  781. return false;
  782. };
  783. $3=_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. 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.HashedCollection.superclass.fn.prototype._addAll_.apply(_st(self), [_st(aHashedCollection)._associations()]);
  806. $1=aHashedCollection;
  807. return $1;
  808. }, function($ctx1) {$ctx1.fill(self,"addAll:",{aHashedCollection:aHashedCollection},smalltalk.HashedCollection)})},
  809. messageSends: ["addAll:", "associations"]}),
  810. smalltalk.HashedCollection);
  811. smalltalk.addMethod(
  812. smalltalk.method({
  813. selector: "asDictionary",
  814. fn: function (){
  815. var self=this;
  816. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  817. return smalltalk.withContext(function($ctx1) {
  818. var $1;
  819. $1=_st($Dictionary())._from_(self._associations());
  820. return $1;
  821. }, function($ctx1) {$ctx1.fill(self,"asDictionary",{},smalltalk.HashedCollection)})},
  822. messageSends: ["from:", "associations"]}),
  823. smalltalk.HashedCollection);
  824. smalltalk.addMethod(
  825. smalltalk.method({
  826. selector: "asJSON",
  827. fn: function (){
  828. var self=this;
  829. var c;
  830. return smalltalk.withContext(function($ctx1) {
  831. var $1;
  832. c=_st(self._class())._new();
  833. 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. 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. 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=self._includesKey_(aKey);
  882. $1=_st($2)._ifTrue_ifFalse_((function(){
  883. return smalltalk.withContext(function($ctx2) {
  884. return 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=self._at_ifAbsent_(aKey,(function(){
  898. return smalltalk.withContext(function($ctx2) {
  899. return 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=self._includesKey_(aKey);
  913. $1=_st($2)._ifTrue_ifFalse_((function(){
  914. return smalltalk.withContext(function($ctx2) {
  915. return _st(aBlock)._value_(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=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(self._class())._new();
  942. 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(self._class())._new();
  960. 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(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. 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(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(self._keys())._detect_ifNone_((function(each){
  1021. return smalltalk.withContext(function($ctx2) {
  1022. return _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: "keyAtValue:",
  1031. fn: function (anObject){
  1032. var self=this;
  1033. return smalltalk.withContext(function($ctx1) {
  1034. var $1;
  1035. $1=self._keyAtValue_ifAbsent_(anObject,(function(){
  1036. return smalltalk.withContext(function($ctx2) {
  1037. return self._errorNotFound();
  1038. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1039. return $1;
  1040. }, function($ctx1) {$ctx1.fill(self,"keyAtValue:",{anObject:anObject},smalltalk.HashedCollection)})},
  1041. messageSends: ["keyAtValue:ifAbsent:", "errorNotFound"]}),
  1042. smalltalk.HashedCollection);
  1043. smalltalk.addMethod(
  1044. smalltalk.method({
  1045. selector: "keyAtValue:ifAbsent:",
  1046. fn: function (anObject,aBlock){
  1047. var self=this;
  1048. return smalltalk.withContext(function($ctx1) {
  1049. var $1;
  1050. $1=self._indexOf_ifAbsent_(anObject,aBlock);
  1051. return $1;
  1052. }, function($ctx1) {$ctx1.fill(self,"keyAtValue:ifAbsent:",{anObject:anObject,aBlock:aBlock},smalltalk.HashedCollection)})},
  1053. messageSends: ["indexOf:ifAbsent:"]}),
  1054. smalltalk.HashedCollection);
  1055. smalltalk.addMethod(
  1056. smalltalk.method({
  1057. selector: "keys",
  1058. fn: function (){
  1059. var self=this;
  1060. return smalltalk.withContext(function($ctx1) {
  1061. if ('function'===typeof Object.keys) return Object.keys(self);
  1062. var keys = [];
  1063. for(var i in self) {
  1064. if(self.hasOwnProperty(i)) {
  1065. keys.push(i);
  1066. }
  1067. };
  1068. return keys;
  1069. ;
  1070. return self}, function($ctx1) {$ctx1.fill(self,"keys",{},smalltalk.HashedCollection)})},
  1071. messageSends: []}),
  1072. smalltalk.HashedCollection);
  1073. smalltalk.addMethod(
  1074. smalltalk.method({
  1075. selector: "keysAndValuesDo:",
  1076. fn: function (aBlock){
  1077. var self=this;
  1078. return smalltalk.withContext(function($ctx1) {
  1079. self._keysDo_((function(each){
  1080. return smalltalk.withContext(function($ctx2) {
  1081. return _st(aBlock)._value_value_(each,self._at_(each));
  1082. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1083. return self}, function($ctx1) {$ctx1.fill(self,"keysAndValuesDo:",{aBlock:aBlock},smalltalk.HashedCollection)})},
  1084. messageSends: ["keysDo:", "value:value:", "at:"]}),
  1085. smalltalk.HashedCollection);
  1086. smalltalk.addMethod(
  1087. smalltalk.method({
  1088. selector: "keysDo:",
  1089. fn: function (aBlock){
  1090. var self=this;
  1091. return smalltalk.withContext(function($ctx1) {
  1092. _st(self._keys())._do_(aBlock);
  1093. return self}, function($ctx1) {$ctx1.fill(self,"keysDo:",{aBlock:aBlock},smalltalk.HashedCollection)})},
  1094. messageSends: ["do:", "keys"]}),
  1095. smalltalk.HashedCollection);
  1096. smalltalk.addMethod(
  1097. smalltalk.method({
  1098. selector: "printOn:",
  1099. fn: function (aStream){
  1100. var self=this;
  1101. return smalltalk.withContext(function($ctx1) {
  1102. smalltalk.HashedCollection.superclass.fn.prototype._printOn_.apply(_st(self), [aStream]);
  1103. _st(aStream)._nextPutAll_(" (");
  1104. _st(self._associations())._do_separatedBy_((function(each){
  1105. return smalltalk.withContext(function($ctx2) {
  1106. return _st(each)._printOn_(aStream);
  1107. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  1108. return smalltalk.withContext(function($ctx2) {
  1109. return _st(aStream)._nextPutAll_(" , ");
  1110. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1111. _st(aStream)._nextPutAll_(")");
  1112. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.HashedCollection)})},
  1113. messageSends: ["printOn:", "nextPutAll:", "do:separatedBy:", "associations"]}),
  1114. smalltalk.HashedCollection);
  1115. smalltalk.addMethod(
  1116. smalltalk.method({
  1117. selector: "remove:ifAbsent:",
  1118. fn: function (aKey,aBlock){
  1119. var self=this;
  1120. return smalltalk.withContext(function($ctx1) {
  1121. var $1;
  1122. $1=self._removeKey_ifAbsent_(aKey,aBlock);
  1123. return $1;
  1124. }, function($ctx1) {$ctx1.fill(self,"remove:ifAbsent:",{aKey:aKey,aBlock:aBlock},smalltalk.HashedCollection)})},
  1125. messageSends: ["removeKey:ifAbsent:"]}),
  1126. smalltalk.HashedCollection);
  1127. smalltalk.addMethod(
  1128. smalltalk.method({
  1129. selector: "removeKey:",
  1130. fn: function (aKey){
  1131. var self=this;
  1132. return smalltalk.withContext(function($ctx1) {
  1133. var $1;
  1134. $1=self._remove_(aKey);
  1135. return $1;
  1136. }, function($ctx1) {$ctx1.fill(self,"removeKey:",{aKey:aKey},smalltalk.HashedCollection)})},
  1137. messageSends: ["remove:"]}),
  1138. smalltalk.HashedCollection);
  1139. smalltalk.addMethod(
  1140. smalltalk.method({
  1141. selector: "removeKey:ifAbsent:",
  1142. fn: function (aKey,aBlock){
  1143. var self=this;
  1144. return smalltalk.withContext(function($ctx1) {
  1145. var $2,$1;
  1146. $2=self._includesKey_(aKey);
  1147. if(smalltalk.assert($2)){
  1148. $1=self._basicDelete_(aKey);
  1149. } else {
  1150. $1=_st(aBlock)._value();
  1151. };
  1152. return $1;
  1153. }, function($ctx1) {$ctx1.fill(self,"removeKey:ifAbsent:",{aKey:aKey,aBlock:aBlock},smalltalk.HashedCollection)})},
  1154. messageSends: ["ifFalse:ifTrue:", "value", "basicDelete:", "includesKey:"]}),
  1155. smalltalk.HashedCollection);
  1156. smalltalk.addMethod(
  1157. smalltalk.method({
  1158. selector: "select:",
  1159. fn: function (aBlock){
  1160. var self=this;
  1161. var newDict;
  1162. return smalltalk.withContext(function($ctx1) {
  1163. var $1,$2;
  1164. newDict=_st(self._class())._new();
  1165. self._keysAndValuesDo_((function(key,value){
  1166. return smalltalk.withContext(function($ctx2) {
  1167. $1=_st(aBlock)._value_(value);
  1168. if(smalltalk.assert($1)){
  1169. return _st(newDict)._at_put_(key,value);
  1170. };
  1171. }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1)})}));
  1172. $2=newDict;
  1173. return $2;
  1174. }, function($ctx1) {$ctx1.fill(self,"select:",{aBlock:aBlock,newDict:newDict},smalltalk.HashedCollection)})},
  1175. messageSends: ["new", "class", "keysAndValuesDo:", "ifTrue:", "at:put:", "value:"]}),
  1176. smalltalk.HashedCollection);
  1177. smalltalk.addMethod(
  1178. smalltalk.method({
  1179. selector: "shallowCopy",
  1180. fn: function (){
  1181. var self=this;
  1182. var copy;
  1183. return smalltalk.withContext(function($ctx1) {
  1184. var $1;
  1185. copy=_st(self._class())._new();
  1186. self._keysAndValuesDo_((function(key,value){
  1187. return smalltalk.withContext(function($ctx2) {
  1188. return _st(copy)._at_put_(key,value);
  1189. }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1)})}));
  1190. $1=copy;
  1191. return $1;
  1192. }, function($ctx1) {$ctx1.fill(self,"shallowCopy",{copy:copy},smalltalk.HashedCollection)})},
  1193. messageSends: ["new", "class", "keysAndValuesDo:", "at:put:"]}),
  1194. smalltalk.HashedCollection);
  1195. smalltalk.addMethod(
  1196. smalltalk.method({
  1197. selector: "size",
  1198. fn: function (){
  1199. var self=this;
  1200. return smalltalk.withContext(function($ctx1) {
  1201. var $1;
  1202. $1=_st(self._keys())._size();
  1203. return $1;
  1204. }, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.HashedCollection)})},
  1205. messageSends: ["size", "keys"]}),
  1206. smalltalk.HashedCollection);
  1207. smalltalk.addMethod(
  1208. smalltalk.method({
  1209. selector: "values",
  1210. fn: function (){
  1211. var self=this;
  1212. return smalltalk.withContext(function($ctx1) {
  1213. var $1;
  1214. $1=_st(self._keys())._collect_((function(each){
  1215. return smalltalk.withContext(function($ctx2) {
  1216. return self._at_(each);
  1217. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1218. return $1;
  1219. }, function($ctx1) {$ctx1.fill(self,"values",{},smalltalk.HashedCollection)})},
  1220. messageSends: ["collect:", "at:", "keys"]}),
  1221. smalltalk.HashedCollection);
  1222. smalltalk.addMethod(
  1223. smalltalk.method({
  1224. selector: "valuesDo:",
  1225. fn: function (aBlock){
  1226. var self=this;
  1227. return smalltalk.withContext(function($ctx1) {
  1228. self._keysAndValuesDo_((function(key,value){
  1229. return smalltalk.withContext(function($ctx2) {
  1230. return _st(aBlock)._value_(value);
  1231. }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1)})}));
  1232. return self}, function($ctx1) {$ctx1.fill(self,"valuesDo:",{aBlock:aBlock},smalltalk.HashedCollection)})},
  1233. messageSends: ["keysAndValuesDo:", "value:"]}),
  1234. smalltalk.HashedCollection);
  1235. smalltalk.addMethod(
  1236. smalltalk.method({
  1237. selector: "withIndexDo:",
  1238. fn: function (aBlock){
  1239. var self=this;
  1240. return smalltalk.withContext(function($ctx1) {
  1241. self._keysAndValuesDo_((function(key,value){
  1242. return smalltalk.withContext(function($ctx2) {
  1243. return _st(aBlock)._value_value_(value,key);
  1244. }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1)})}));
  1245. return self}, function($ctx1) {$ctx1.fill(self,"withIndexDo:",{aBlock:aBlock},smalltalk.HashedCollection)})},
  1246. messageSends: ["keysAndValuesDo:", "value:value:"]}),
  1247. smalltalk.HashedCollection);
  1248. smalltalk.addMethod(
  1249. smalltalk.method({
  1250. selector: "from:",
  1251. fn: function (aCollection){
  1252. var self=this;
  1253. var newCollection;
  1254. return smalltalk.withContext(function($ctx1) {
  1255. var $1;
  1256. newCollection=self._new();
  1257. _st(aCollection)._do_((function(each){
  1258. return smalltalk.withContext(function($ctx2) {
  1259. return _st(newCollection)._add_(each);
  1260. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1261. $1=newCollection;
  1262. return $1;
  1263. }, function($ctx1) {$ctx1.fill(self,"from:",{aCollection:aCollection,newCollection:newCollection},smalltalk.HashedCollection.klass)})},
  1264. messageSends: ["new", "do:", "add:"]}),
  1265. smalltalk.HashedCollection.klass);
  1266. smalltalk.addMethod(
  1267. smalltalk.method({
  1268. selector: "fromPairs:",
  1269. fn: function (aCollection){
  1270. var self=this;
  1271. return smalltalk.withContext(function($ctx1) {
  1272. var $1;
  1273. $1=self._from_(aCollection);
  1274. return $1;
  1275. }, function($ctx1) {$ctx1.fill(self,"fromPairs:",{aCollection:aCollection},smalltalk.HashedCollection.klass)})},
  1276. messageSends: ["from:"]}),
  1277. smalltalk.HashedCollection.klass);
  1278. smalltalk.addMethod(
  1279. smalltalk.method({
  1280. selector: "newFromPairs:",
  1281. fn: function (aCollection){
  1282. var self=this;
  1283. var newCollection;
  1284. return smalltalk.withContext(function($ctx1) {
  1285. var $1,$2;
  1286. $1=_st(_st(aCollection)._size())._even();
  1287. if(! smalltalk.assert($1)){
  1288. self._error_("#newFromPairs only accepts arrays of an even length");
  1289. };
  1290. newCollection=self._new();
  1291. _st((1)._to_by_(_st(aCollection)._size(),(2)))._do_((function(each){
  1292. return smalltalk.withContext(function($ctx2) {
  1293. return _st(newCollection)._at_put_(_st(aCollection)._at_(each),_st(aCollection)._at_(_st(each).__plus((1))));
  1294. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1295. $2=newCollection;
  1296. return $2;
  1297. }, function($ctx1) {$ctx1.fill(self,"newFromPairs:",{aCollection:aCollection,newCollection:newCollection},smalltalk.HashedCollection.klass)})},
  1298. messageSends: ["ifFalse:", "error:", "even", "size", "new", "do:", "at:put:", "at:", "+", "to:by:"]}),
  1299. smalltalk.HashedCollection.klass);
  1300. smalltalk.addClass('Dictionary', smalltalk.HashedCollection, ['keys', 'values'], 'Kernel-Collections');
  1301. smalltalk.addMethod(
  1302. smalltalk.method({
  1303. selector: "asHashedCollection",
  1304. fn: function (){
  1305. var self=this;
  1306. function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  1307. return smalltalk.withContext(function($ctx1) {
  1308. var $1;
  1309. $1=_st($HashedCollection())._from_(self._associations());
  1310. return $1;
  1311. }, function($ctx1) {$ctx1.fill(self,"asHashedCollection",{},smalltalk.Dictionary)})},
  1312. messageSends: ["from:", "associations"]}),
  1313. smalltalk.Dictionary);
  1314. smalltalk.addMethod(
  1315. smalltalk.method({
  1316. selector: "asJSON",
  1317. fn: function (){
  1318. var self=this;
  1319. return smalltalk.withContext(function($ctx1) {
  1320. var $1;
  1321. $1=_st(self._asHashedCollection())._asJSON();
  1322. return $1;
  1323. }, function($ctx1) {$ctx1.fill(self,"asJSON",{},smalltalk.Dictionary)})},
  1324. messageSends: ["asJSON", "asHashedCollection"]}),
  1325. smalltalk.Dictionary);
  1326. smalltalk.addMethod(
  1327. smalltalk.method({
  1328. selector: "at:ifAbsent:",
  1329. fn: function (aKey,aBlock){
  1330. var self=this;
  1331. return smalltalk.withContext(function($ctx1) {
  1332. var index = self._positionOfKey_(aKey);
  1333. return index >=0 ? self['@values'][index] : aBlock._value();
  1334. ;
  1335. return self}, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{aKey:aKey,aBlock:aBlock},smalltalk.Dictionary)})},
  1336. messageSends: []}),
  1337. smalltalk.Dictionary);
  1338. smalltalk.addMethod(
  1339. smalltalk.method({
  1340. selector: "at:put:",
  1341. fn: function (aKey,aValue){
  1342. var self=this;
  1343. return smalltalk.withContext(function($ctx1) {
  1344. var index = self._positionOfKey_(aKey);
  1345. if(index === -1) {
  1346. var keys = self['@keys'];
  1347. index = keys.length;
  1348. keys.push(aKey);
  1349. }
  1350. return self['@values'][index] = aValue;
  1351. ;
  1352. return self}, function($ctx1) {$ctx1.fill(self,"at:put:",{aKey:aKey,aValue:aValue},smalltalk.Dictionary)})},
  1353. messageSends: []}),
  1354. smalltalk.Dictionary);
  1355. smalltalk.addMethod(
  1356. smalltalk.method({
  1357. selector: "includesKey:",
  1358. fn: function (aKey){
  1359. var self=this;
  1360. return smalltalk.withContext(function($ctx1) {
  1361. return self._positionOfKey_(aKey) >= 0; ;
  1362. return self}, function($ctx1) {$ctx1.fill(self,"includesKey:",{aKey:aKey},smalltalk.Dictionary)})},
  1363. messageSends: []}),
  1364. smalltalk.Dictionary);
  1365. smalltalk.addMethod(
  1366. smalltalk.method({
  1367. selector: "indexOf:ifAbsent:",
  1368. fn: function (anObject,aBlock){
  1369. var self=this;
  1370. var index;
  1371. return smalltalk.withContext(function($ctx1) {
  1372. var $2,$1;
  1373. index=_st(self["@values"])._indexOf_ifAbsent_(anObject,(function(){
  1374. return smalltalk.withContext(function($ctx2) {
  1375. return (0);
  1376. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1377. $2=_st(index).__eq((0));
  1378. if(smalltalk.assert($2)){
  1379. $1=_st(aBlock)._value();
  1380. } else {
  1381. $1=_st(self["@keys"])._at_(index);
  1382. };
  1383. return $1;
  1384. }, function($ctx1) {$ctx1.fill(self,"indexOf:ifAbsent:",{anObject:anObject,aBlock:aBlock,index:index},smalltalk.Dictionary)})},
  1385. messageSends: ["indexOf:ifAbsent:", "ifTrue:ifFalse:", "value", "at:", "="]}),
  1386. smalltalk.Dictionary);
  1387. smalltalk.addMethod(
  1388. smalltalk.method({
  1389. selector: "initialize",
  1390. fn: function (){
  1391. var self=this;
  1392. return smalltalk.withContext(function($ctx1) {
  1393. smalltalk.Dictionary.superclass.fn.prototype._initialize.apply(_st(self), []);
  1394. self["@keys"]=[];
  1395. self["@values"]=[];
  1396. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Dictionary)})},
  1397. messageSends: ["initialize"]}),
  1398. smalltalk.Dictionary);
  1399. smalltalk.addMethod(
  1400. smalltalk.method({
  1401. selector: "keys",
  1402. fn: function (){
  1403. var self=this;
  1404. return smalltalk.withContext(function($ctx1) {
  1405. var $1;
  1406. $1=_st(self["@keys"])._copy();
  1407. return $1;
  1408. }, function($ctx1) {$ctx1.fill(self,"keys",{},smalltalk.Dictionary)})},
  1409. messageSends: ["copy"]}),
  1410. smalltalk.Dictionary);
  1411. smalltalk.addMethod(
  1412. smalltalk.method({
  1413. selector: "keysAndValuesDo:",
  1414. fn: function (aBlock){
  1415. var self=this;
  1416. return smalltalk.withContext(function($ctx1) {
  1417. var $1;
  1418. $1=_st(self["@keys"])._with_do_(self["@values"],aBlock);
  1419. return $1;
  1420. }, function($ctx1) {$ctx1.fill(self,"keysAndValuesDo:",{aBlock:aBlock},smalltalk.Dictionary)})},
  1421. messageSends: ["with:do:"]}),
  1422. smalltalk.Dictionary);
  1423. smalltalk.addMethod(
  1424. smalltalk.method({
  1425. selector: "keysDo:",
  1426. fn: function (aBlock){
  1427. var self=this;
  1428. return smalltalk.withContext(function($ctx1) {
  1429. var $1;
  1430. $1=_st(self["@keys"])._do_(aBlock);
  1431. return $1;
  1432. }, function($ctx1) {$ctx1.fill(self,"keysDo:",{aBlock:aBlock},smalltalk.Dictionary)})},
  1433. messageSends: ["do:"]}),
  1434. smalltalk.Dictionary);
  1435. smalltalk.addMethod(
  1436. smalltalk.method({
  1437. selector: "positionOfKey:",
  1438. fn: function (anObject){
  1439. var self=this;
  1440. return smalltalk.withContext(function($ctx1) {
  1441. var keys = self['@keys'];
  1442. for(var i=0;i<keys.length;i++){
  1443. if(keys[i].__eq(anObject)) { return i;}
  1444. }
  1445. return -1;
  1446. ;
  1447. return self}, function($ctx1) {$ctx1.fill(self,"positionOfKey:",{anObject:anObject},smalltalk.Dictionary)})},
  1448. messageSends: []}),
  1449. smalltalk.Dictionary);
  1450. smalltalk.addMethod(
  1451. smalltalk.method({
  1452. selector: "removeKey:ifAbsent:",
  1453. fn: function (aKey,aBlock){
  1454. var self=this;
  1455. return smalltalk.withContext(function($ctx1) {
  1456. var index = self._positionOfKey_(aKey);
  1457. if(index === -1) {
  1458. return aBlock._value()
  1459. } else {
  1460. var keys = self['@keys'], values = self['@values'];
  1461. var value = values[index], l = keys.length;
  1462. keys[index] = keys[l-1];
  1463. keys.pop();
  1464. values[index] = values[l-1];
  1465. values.pop();
  1466. return value;
  1467. }
  1468. ;
  1469. return self}, function($ctx1) {$ctx1.fill(self,"removeKey:ifAbsent:",{aKey:aKey,aBlock:aBlock},smalltalk.Dictionary)})},
  1470. messageSends: []}),
  1471. smalltalk.Dictionary);
  1472. smalltalk.addMethod(
  1473. smalltalk.method({
  1474. selector: "values",
  1475. fn: function (){
  1476. var self=this;
  1477. return smalltalk.withContext(function($ctx1) {
  1478. var $1;
  1479. $1=_st(self["@values"])._copy();
  1480. return $1;
  1481. }, function($ctx1) {$ctx1.fill(self,"values",{},smalltalk.Dictionary)})},
  1482. messageSends: ["copy"]}),
  1483. smalltalk.Dictionary);
  1484. smalltalk.addMethod(
  1485. smalltalk.method({
  1486. selector: "valuesDo:",
  1487. fn: function (aBlock){
  1488. var self=this;
  1489. return smalltalk.withContext(function($ctx1) {
  1490. var $1;
  1491. $1=_st(self["@values"])._do_(aBlock);
  1492. return $1;
  1493. }, function($ctx1) {$ctx1.fill(self,"valuesDo:",{aBlock:aBlock},smalltalk.Dictionary)})},
  1494. messageSends: ["do:"]}),
  1495. smalltalk.Dictionary);
  1496. smalltalk.addClass('SequenceableCollection', smalltalk.IndexableCollection, [], 'Kernel-Collections');
  1497. smalltalk.addMethod(
  1498. smalltalk.method({
  1499. selector: "=",
  1500. fn: function (aCollection){
  1501. var self=this;
  1502. return smalltalk.withContext(function($ctx1) {
  1503. var $1,$2;
  1504. var $early={};
  1505. try {
  1506. $1=_st(_st(self._class()).__eq(_st(aCollection)._class()))._and_((function(){
  1507. return smalltalk.withContext(function($ctx2) {
  1508. return _st(self._size()).__eq(_st(aCollection)._size());
  1509. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1510. if(! smalltalk.assert($1)){
  1511. return false;
  1512. };
  1513. self._withIndexDo_((function(each,i){
  1514. return smalltalk.withContext(function($ctx2) {
  1515. $2=_st(_st(aCollection)._at_(i)).__eq(each);
  1516. if(! smalltalk.assert($2)){
  1517. throw $early=[false];
  1518. };
  1519. }, function($ctx2) {$ctx2.fillBlock({each:each,i:i},$ctx1)})}));
  1520. return true;
  1521. }
  1522. catch(e) {if(e===$early)return e[0]; throw e}
  1523. }, function($ctx1) {$ctx1.fill(self,"=",{aCollection:aCollection},smalltalk.SequenceableCollection)})},
  1524. messageSends: ["ifFalse:", "and:", "=", "size", "class", "withIndexDo:", "at:"]}),
  1525. smalltalk.SequenceableCollection);
  1526. smalltalk.addMethod(
  1527. smalltalk.method({
  1528. selector: "addLast:",
  1529. fn: function (anObject){
  1530. var self=this;
  1531. return smalltalk.withContext(function($ctx1) {
  1532. self._add_(anObject);
  1533. return self}, function($ctx1) {$ctx1.fill(self,"addLast:",{anObject:anObject},smalltalk.SequenceableCollection)})},
  1534. messageSends: ["add:"]}),
  1535. smalltalk.SequenceableCollection);
  1536. smalltalk.addMethod(
  1537. smalltalk.method({
  1538. selector: "allButFirst",
  1539. fn: function (){
  1540. var self=this;
  1541. return smalltalk.withContext(function($ctx1) {
  1542. var $1;
  1543. $1=self._copyFrom_to_((2),self._size());
  1544. return $1;
  1545. }, function($ctx1) {$ctx1.fill(self,"allButFirst",{},smalltalk.SequenceableCollection)})},
  1546. messageSends: ["copyFrom:to:", "size"]}),
  1547. smalltalk.SequenceableCollection);
  1548. smalltalk.addMethod(
  1549. smalltalk.method({
  1550. selector: "allButLast",
  1551. fn: function (){
  1552. var self=this;
  1553. return smalltalk.withContext(function($ctx1) {
  1554. var $1;
  1555. $1=self._copyFrom_to_((1),_st(self._size()).__minus((1)));
  1556. return $1;
  1557. }, function($ctx1) {$ctx1.fill(self,"allButLast",{},smalltalk.SequenceableCollection)})},
  1558. messageSends: ["copyFrom:to:", "-", "size"]}),
  1559. smalltalk.SequenceableCollection);
  1560. smalltalk.addMethod(
  1561. smalltalk.method({
  1562. selector: "atRandom",
  1563. fn: function (){
  1564. var self=this;
  1565. return smalltalk.withContext(function($ctx1) {
  1566. var $1;
  1567. $1=self._at_(_st(self._size())._atRandom());
  1568. return $1;
  1569. }, function($ctx1) {$ctx1.fill(self,"atRandom",{},smalltalk.SequenceableCollection)})},
  1570. messageSends: ["at:", "atRandom", "size"]}),
  1571. smalltalk.SequenceableCollection);
  1572. smalltalk.addMethod(
  1573. smalltalk.method({
  1574. selector: "copyFrom:to:",
  1575. fn: function (anIndex,anotherIndex){
  1576. var self=this;
  1577. var range,newCollection;
  1578. return smalltalk.withContext(function($ctx1) {
  1579. var $1;
  1580. range=_st(anIndex)._to_(anotherIndex);
  1581. newCollection=_st(self._class())._new_(_st(range)._size());
  1582. _st(range)._withIndexDo_((function(each,i){
  1583. return smalltalk.withContext(function($ctx2) {
  1584. return _st(newCollection)._at_put_(i,self._at_(each));
  1585. }, function($ctx2) {$ctx2.fillBlock({each:each,i:i},$ctx1)})}));
  1586. $1=newCollection;
  1587. return $1;
  1588. }, function($ctx1) {$ctx1.fill(self,"copyFrom:to:",{anIndex:anIndex,anotherIndex:anotherIndex,range:range,newCollection:newCollection},smalltalk.SequenceableCollection)})},
  1589. messageSends: ["to:", "new:", "size", "class", "withIndexDo:", "at:put:", "at:"]}),
  1590. smalltalk.SequenceableCollection);
  1591. smalltalk.addMethod(
  1592. smalltalk.method({
  1593. selector: "deepCopy",
  1594. fn: function (){
  1595. var self=this;
  1596. var newCollection;
  1597. return smalltalk.withContext(function($ctx1) {
  1598. var $1;
  1599. newCollection=_st(self._class())._new_(self._size());
  1600. self._withIndexDo_((function(each,index){
  1601. return smalltalk.withContext(function($ctx2) {
  1602. return _st(newCollection)._at_put_(index,_st(each)._deepCopy());
  1603. }, function($ctx2) {$ctx2.fillBlock({each:each,index:index},$ctx1)})}));
  1604. $1=newCollection;
  1605. return $1;
  1606. }, function($ctx1) {$ctx1.fill(self,"deepCopy",{newCollection:newCollection},smalltalk.SequenceableCollection)})},
  1607. messageSends: ["new:", "size", "class", "withIndexDo:", "at:put:", "deepCopy"]}),
  1608. smalltalk.SequenceableCollection);
  1609. smalltalk.addMethod(
  1610. smalltalk.method({
  1611. selector: "detect:ifNone:",
  1612. fn: function (aBlock,anotherBlock){
  1613. var self=this;
  1614. return smalltalk.withContext(function($ctx1) {
  1615. for(var i = 0; i < self.length; i++)
  1616. if(aBlock._value_(self[i]))
  1617. return self[i];
  1618. return anotherBlock._value();
  1619. ;
  1620. return self}, function($ctx1) {$ctx1.fill(self,"detect:ifNone:",{aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.SequenceableCollection)})},
  1621. messageSends: []}),
  1622. smalltalk.SequenceableCollection);
  1623. smalltalk.addMethod(
  1624. smalltalk.method({
  1625. selector: "do:",
  1626. fn: function (aBlock){
  1627. var self=this;
  1628. return smalltalk.withContext(function($ctx1) {
  1629. for(var i=0;i<self.length;i++){aBlock._value_(self[i]);};
  1630. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.SequenceableCollection)})},
  1631. messageSends: []}),
  1632. smalltalk.SequenceableCollection);
  1633. smalltalk.addMethod(
  1634. smalltalk.method({
  1635. selector: "do:displayingProgress:",
  1636. fn: function (aBlock,aString){
  1637. var self=this;
  1638. function $ProgressHandler(){return smalltalk.ProgressHandler||(typeof ProgressHandler=="undefined"?nil:ProgressHandler)}
  1639. return smalltalk.withContext(function($ctx1) {
  1640. _st(_st($ProgressHandler())._current())._do_on_displaying_(aBlock,self,aString);
  1641. return self}, function($ctx1) {$ctx1.fill(self,"do:displayingProgress:",{aBlock:aBlock,aString:aString},smalltalk.SequenceableCollection)})},
  1642. messageSends: ["do:on:displaying:", "current"]}),
  1643. smalltalk.SequenceableCollection);
  1644. smalltalk.addMethod(
  1645. smalltalk.method({
  1646. selector: "first",
  1647. fn: function (){
  1648. var self=this;
  1649. return smalltalk.withContext(function($ctx1) {
  1650. var $1;
  1651. $1=self._at_((1));
  1652. return $1;
  1653. }, function($ctx1) {$ctx1.fill(self,"first",{},smalltalk.SequenceableCollection)})},
  1654. messageSends: ["at:"]}),
  1655. smalltalk.SequenceableCollection);
  1656. smalltalk.addMethod(
  1657. smalltalk.method({
  1658. selector: "first:",
  1659. fn: function (n){
  1660. var self=this;
  1661. return smalltalk.withContext(function($ctx1) {
  1662. var $1;
  1663. $1=self._copyFrom_to_((1),n);
  1664. return $1;
  1665. }, function($ctx1) {$ctx1.fill(self,"first:",{n:n},smalltalk.SequenceableCollection)})},
  1666. messageSends: ["copyFrom:to:"]}),
  1667. smalltalk.SequenceableCollection);
  1668. smalltalk.addMethod(
  1669. smalltalk.method({
  1670. selector: "fourth",
  1671. fn: function (){
  1672. var self=this;
  1673. return smalltalk.withContext(function($ctx1) {
  1674. var $1;
  1675. $1=self._at_((4));
  1676. return $1;
  1677. }, function($ctx1) {$ctx1.fill(self,"fourth",{},smalltalk.SequenceableCollection)})},
  1678. messageSends: ["at:"]}),
  1679. smalltalk.SequenceableCollection);
  1680. smalltalk.addMethod(
  1681. smalltalk.method({
  1682. selector: "includes:",
  1683. fn: function (anObject){
  1684. var self=this;
  1685. return smalltalk.withContext(function($ctx1) {
  1686. var $1;
  1687. $1=_st(self._indexOf_ifAbsent_(anObject,(function(){
  1688. return smalltalk.withContext(function($ctx2) {
  1689. return nil;
  1690. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._notNil();
  1691. return $1;
  1692. }, function($ctx1) {$ctx1.fill(self,"includes:",{anObject:anObject},smalltalk.SequenceableCollection)})},
  1693. messageSends: ["notNil", "indexOf:ifAbsent:"]}),
  1694. smalltalk.SequenceableCollection);
  1695. smalltalk.addMethod(
  1696. smalltalk.method({
  1697. selector: "indexOf:ifAbsent:",
  1698. fn: function (anObject,aBlock){
  1699. var self=this;
  1700. return smalltalk.withContext(function($ctx1) {
  1701. for(var i=0;i<self.length;i++) {
  1702. if(self[i].__eq(anObject)) {return i+1}
  1703. };
  1704. return aBlock._value();
  1705. ;
  1706. return self}, function($ctx1) {$ctx1.fill(self,"indexOf:ifAbsent:",{anObject:anObject,aBlock:aBlock},smalltalk.SequenceableCollection)})},
  1707. messageSends: []}),
  1708. smalltalk.SequenceableCollection);
  1709. smalltalk.addMethod(
  1710. smalltalk.method({
  1711. selector: "indexOf:startingAt:",
  1712. fn: function (anObject,start){
  1713. var self=this;
  1714. return smalltalk.withContext(function($ctx1) {
  1715. var $1;
  1716. $1=self._indexOf_startingAt_ifAbsent_(anObject,start,(function(){
  1717. return smalltalk.withContext(function($ctx2) {
  1718. return (0);
  1719. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1720. return $1;
  1721. }, function($ctx1) {$ctx1.fill(self,"indexOf:startingAt:",{anObject:anObject,start:start},smalltalk.SequenceableCollection)})},
  1722. messageSends: ["indexOf:startingAt:ifAbsent:"]}),
  1723. smalltalk.SequenceableCollection);
  1724. smalltalk.addMethod(
  1725. smalltalk.method({
  1726. selector: "indexOf:startingAt:ifAbsent:",
  1727. fn: function (anObject,start,aBlock){
  1728. var self=this;
  1729. return smalltalk.withContext(function($ctx1) {
  1730. for(var i=start-1;i<self.length;i++){
  1731. if(self[i].__eq(anObject)) {return i+1}
  1732. }
  1733. return aBlock._value();
  1734. ;
  1735. return self}, function($ctx1) {$ctx1.fill(self,"indexOf:startingAt:ifAbsent:",{anObject:anObject,start:start,aBlock:aBlock},smalltalk.SequenceableCollection)})},
  1736. messageSends: []}),
  1737. smalltalk.SequenceableCollection);
  1738. smalltalk.addMethod(
  1739. smalltalk.method({
  1740. selector: "last",
  1741. fn: function (){
  1742. var self=this;
  1743. return smalltalk.withContext(function($ctx1) {
  1744. var $1;
  1745. $1=self._at_(self._size());
  1746. return $1;
  1747. }, function($ctx1) {$ctx1.fill(self,"last",{},smalltalk.SequenceableCollection)})},
  1748. messageSends: ["at:", "size"]}),
  1749. smalltalk.SequenceableCollection);
  1750. smalltalk.addMethod(
  1751. smalltalk.method({
  1752. selector: "newStream",
  1753. fn: function (){
  1754. var self=this;
  1755. return smalltalk.withContext(function($ctx1) {
  1756. var $1;
  1757. $1=_st(self._streamClass())._on_(self);
  1758. return $1;
  1759. }, function($ctx1) {$ctx1.fill(self,"newStream",{},smalltalk.SequenceableCollection)})},
  1760. messageSends: ["on:", "streamClass"]}),
  1761. smalltalk.SequenceableCollection);
  1762. smalltalk.addMethod(
  1763. smalltalk.method({
  1764. selector: "readStream",
  1765. fn: function (){
  1766. var self=this;
  1767. return smalltalk.withContext(function($ctx1) {
  1768. var $1;
  1769. $1=self._stream();
  1770. return $1;
  1771. }, function($ctx1) {$ctx1.fill(self,"readStream",{},smalltalk.SequenceableCollection)})},
  1772. messageSends: ["stream"]}),
  1773. smalltalk.SequenceableCollection);
  1774. smalltalk.addMethod(
  1775. smalltalk.method({
  1776. selector: "removeLast",
  1777. fn: function (){
  1778. var self=this;
  1779. return smalltalk.withContext(function($ctx1) {
  1780. self._remove_(self._last());
  1781. return self}, function($ctx1) {$ctx1.fill(self,"removeLast",{},smalltalk.SequenceableCollection)})},
  1782. messageSends: ["remove:", "last"]}),
  1783. smalltalk.SequenceableCollection);
  1784. smalltalk.addMethod(
  1785. smalltalk.method({
  1786. selector: "reversed",
  1787. fn: function (){
  1788. var self=this;
  1789. return smalltalk.withContext(function($ctx1) {
  1790. self._subclassResponsibility();
  1791. return self}, function($ctx1) {$ctx1.fill(self,"reversed",{},smalltalk.SequenceableCollection)})},
  1792. messageSends: ["subclassResponsibility"]}),
  1793. smalltalk.SequenceableCollection);
  1794. smalltalk.addMethod(
  1795. smalltalk.method({
  1796. selector: "second",
  1797. fn: function (){
  1798. var self=this;
  1799. return smalltalk.withContext(function($ctx1) {
  1800. var $1;
  1801. $1=self._at_((2));
  1802. return $1;
  1803. }, function($ctx1) {$ctx1.fill(self,"second",{},smalltalk.SequenceableCollection)})},
  1804. messageSends: ["at:"]}),
  1805. smalltalk.SequenceableCollection);
  1806. smalltalk.addMethod(
  1807. smalltalk.method({
  1808. selector: "shallowCopy",
  1809. fn: function (){
  1810. var self=this;
  1811. var newCollection;
  1812. return smalltalk.withContext(function($ctx1) {
  1813. var $1;
  1814. newCollection=_st(self._class())._new_(self._size());
  1815. self._withIndexDo_((function(each,index){
  1816. return smalltalk.withContext(function($ctx2) {
  1817. return _st(newCollection)._at_put_(index,each);
  1818. }, function($ctx2) {$ctx2.fillBlock({each:each,index:index},$ctx1)})}));
  1819. $1=newCollection;
  1820. return $1;
  1821. }, function($ctx1) {$ctx1.fill(self,"shallowCopy",{newCollection:newCollection},smalltalk.SequenceableCollection)})},
  1822. messageSends: ["new:", "size", "class", "withIndexDo:", "at:put:"]}),
  1823. smalltalk.SequenceableCollection);
  1824. smalltalk.addMethod(
  1825. smalltalk.method({
  1826. selector: "stream",
  1827. fn: function (){
  1828. var self=this;
  1829. return smalltalk.withContext(function($ctx1) {
  1830. var $1;
  1831. $1=self._newStream();
  1832. return $1;
  1833. }, function($ctx1) {$ctx1.fill(self,"stream",{},smalltalk.SequenceableCollection)})},
  1834. messageSends: ["newStream"]}),
  1835. smalltalk.SequenceableCollection);
  1836. smalltalk.addMethod(
  1837. smalltalk.method({
  1838. selector: "streamClass",
  1839. fn: function (){
  1840. var self=this;
  1841. return smalltalk.withContext(function($ctx1) {
  1842. var $1;
  1843. $1=_st(self._class())._streamClass();
  1844. return $1;
  1845. }, function($ctx1) {$ctx1.fill(self,"streamClass",{},smalltalk.SequenceableCollection)})},
  1846. messageSends: ["streamClass", "class"]}),
  1847. smalltalk.SequenceableCollection);
  1848. smalltalk.addMethod(
  1849. smalltalk.method({
  1850. selector: "third",
  1851. fn: function (){
  1852. var self=this;
  1853. return smalltalk.withContext(function($ctx1) {
  1854. var $1;
  1855. $1=self._at_((3));
  1856. return $1;
  1857. }, function($ctx1) {$ctx1.fill(self,"third",{},smalltalk.SequenceableCollection)})},
  1858. messageSends: ["at:"]}),
  1859. smalltalk.SequenceableCollection);
  1860. smalltalk.addMethod(
  1861. smalltalk.method({
  1862. selector: "with:do:",
  1863. fn: function (anotherCollection,aBlock){
  1864. var self=this;
  1865. return smalltalk.withContext(function($ctx1) {
  1866. for(var i=0;i<self.length;i++){aBlock._value_value_(self[i], anotherCollection[i]);};
  1867. return self}, function($ctx1) {$ctx1.fill(self,"with:do:",{anotherCollection:anotherCollection,aBlock:aBlock},smalltalk.SequenceableCollection)})},
  1868. messageSends: []}),
  1869. smalltalk.SequenceableCollection);
  1870. smalltalk.addMethod(
  1871. smalltalk.method({
  1872. selector: "withIndexDo:",
  1873. fn: function (aBlock){
  1874. var self=this;
  1875. return smalltalk.withContext(function($ctx1) {
  1876. for(var i=0;i<self.length;i++){aBlock._value_value_(self[i], i+1);};
  1877. return self}, function($ctx1) {$ctx1.fill(self,"withIndexDo:",{aBlock:aBlock},smalltalk.SequenceableCollection)})},
  1878. messageSends: []}),
  1879. smalltalk.SequenceableCollection);
  1880. smalltalk.addMethod(
  1881. smalltalk.method({
  1882. selector: "writeStream",
  1883. fn: function (){
  1884. var self=this;
  1885. return smalltalk.withContext(function($ctx1) {
  1886. var $1;
  1887. $1=self._stream();
  1888. return $1;
  1889. }, function($ctx1) {$ctx1.fill(self,"writeStream",{},smalltalk.SequenceableCollection)})},
  1890. messageSends: ["stream"]}),
  1891. smalltalk.SequenceableCollection);
  1892. smalltalk.addMethod(
  1893. smalltalk.method({
  1894. selector: "streamClass",
  1895. fn: function (){
  1896. var self=this;
  1897. function $Stream(){return smalltalk.Stream||(typeof Stream=="undefined"?nil:Stream)}
  1898. return smalltalk.withContext(function($ctx1) {
  1899. var $1;
  1900. $1=$Stream();
  1901. return $1;
  1902. }, function($ctx1) {$ctx1.fill(self,"streamClass",{},smalltalk.SequenceableCollection.klass)})},
  1903. messageSends: []}),
  1904. smalltalk.SequenceableCollection.klass);
  1905. smalltalk.addMethod(
  1906. smalltalk.method({
  1907. selector: "streamContents:",
  1908. fn: function (aBlock){
  1909. var self=this;
  1910. var stream;
  1911. return smalltalk.withContext(function($ctx1) {
  1912. var $1;
  1913. stream=_st(self._streamClass())._on_(self._new());
  1914. _st(aBlock)._value_(stream);
  1915. $1=_st(stream)._contents();
  1916. return $1;
  1917. }, function($ctx1) {$ctx1.fill(self,"streamContents:",{aBlock:aBlock,stream:stream},smalltalk.SequenceableCollection.klass)})},
  1918. messageSends: ["on:", "new", "streamClass", "value:", "contents"]}),
  1919. smalltalk.SequenceableCollection.klass);
  1920. smalltalk.addClass('Array', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
  1921. smalltalk.addMethod(
  1922. smalltalk.method({
  1923. selector: "add:",
  1924. fn: function (anObject){
  1925. var self=this;
  1926. return smalltalk.withContext(function($ctx1) {
  1927. self.push(anObject); return anObject;;
  1928. return self}, function($ctx1) {$ctx1.fill(self,"add:",{anObject:anObject},smalltalk.Array)})},
  1929. messageSends: []}),
  1930. smalltalk.Array);
  1931. smalltalk.addMethod(
  1932. smalltalk.method({
  1933. selector: "asJavascript",
  1934. fn: function (){
  1935. var self=this;
  1936. return smalltalk.withContext(function($ctx1) {
  1937. var $1;
  1938. $1=_st("[".__comma(_st(self._collect_((function(each){
  1939. return smalltalk.withContext(function($ctx2) {
  1940. return _st(each)._asJavascript();
  1941. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._join_(", "))).__comma("]");
  1942. return $1;
  1943. }, function($ctx1) {$ctx1.fill(self,"asJavascript",{},smalltalk.Array)})},
  1944. messageSends: [",", "join:", "collect:", "asJavascript"]}),
  1945. smalltalk.Array);
  1946. smalltalk.addMethod(
  1947. smalltalk.method({
  1948. selector: "at:ifAbsent:",
  1949. fn: function (anIndex,aBlock){
  1950. var self=this;
  1951. return smalltalk.withContext(function($ctx1) {
  1952. if((anIndex < 1) || (self.length < anIndex)) {return aBlock._value()};
  1953. return self[anIndex - 1];
  1954. ;
  1955. return self}, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{anIndex:anIndex,aBlock:aBlock},smalltalk.Array)})},
  1956. messageSends: []}),
  1957. smalltalk.Array);
  1958. smalltalk.addMethod(
  1959. smalltalk.method({
  1960. selector: "at:ifPresent:ifAbsent:",
  1961. fn: function (anIndex,aBlock,anotherBlock){
  1962. var self=this;
  1963. return smalltalk.withContext(function($ctx1) {
  1964. return anIndex < 1 || self.length < anIndex ? anotherBlock._value() : aBlock._value_(self[anIndex - 1]);;
  1965. return self}, function($ctx1) {$ctx1.fill(self,"at:ifPresent:ifAbsent:",{anIndex:anIndex,aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.Array)})},
  1966. messageSends: []}),
  1967. smalltalk.Array);
  1968. smalltalk.addMethod(
  1969. smalltalk.method({
  1970. selector: "at:put:",
  1971. fn: function (anIndex,anObject){
  1972. var self=this;
  1973. return smalltalk.withContext(function($ctx1) {
  1974. return self[anIndex - 1] = anObject;
  1975. return self}, function($ctx1) {$ctx1.fill(self,"at:put:",{anIndex:anIndex,anObject:anObject},smalltalk.Array)})},
  1976. messageSends: []}),
  1977. smalltalk.Array);
  1978. smalltalk.addMethod(
  1979. smalltalk.method({
  1980. selector: "join:",
  1981. fn: function (aString){
  1982. var self=this;
  1983. return smalltalk.withContext(function($ctx1) {
  1984. return self.join(aString);
  1985. return self}, function($ctx1) {$ctx1.fill(self,"join:",{aString:aString},smalltalk.Array)})},
  1986. messageSends: []}),
  1987. smalltalk.Array);
  1988. smalltalk.addMethod(
  1989. smalltalk.method({
  1990. selector: "printOn:",
  1991. fn: function (aStream){
  1992. var self=this;
  1993. return smalltalk.withContext(function($ctx1) {
  1994. smalltalk.Array.superclass.fn.prototype._printOn_.apply(_st(self), [aStream]);
  1995. _st(aStream)._nextPutAll_(" (");
  1996. self._do_separatedBy_((function(each){
  1997. return smalltalk.withContext(function($ctx2) {
  1998. return _st(each)._printOn_(aStream);
  1999. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2000. return smalltalk.withContext(function($ctx2) {
  2001. return _st(aStream)._nextPutAll_(" ");
  2002. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2003. _st(aStream)._nextPutAll_(")");
  2004. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Array)})},
  2005. messageSends: ["printOn:", "nextPutAll:", "do:separatedBy:"]}),
  2006. smalltalk.Array);
  2007. smalltalk.addMethod(
  2008. smalltalk.method({
  2009. selector: "remove:ifAbsent:",
  2010. fn: function (anObject,aBlock){
  2011. var self=this;
  2012. return smalltalk.withContext(function($ctx1) {
  2013. for(var i=0;i<self.length;i++) {
  2014. if(_st(self[i]).__eq(anObject)) {
  2015. self.splice(i,1);
  2016. return self;
  2017. }
  2018. };
  2019. aBlock._value();
  2020. ;
  2021. return self}, function($ctx1) {$ctx1.fill(self,"remove:ifAbsent:",{anObject:anObject,aBlock:aBlock},smalltalk.Array)})},
  2022. messageSends: []}),
  2023. smalltalk.Array);
  2024. smalltalk.addMethod(
  2025. smalltalk.method({
  2026. selector: "removeFrom:to:",
  2027. fn: function (aNumber,anotherNumber){
  2028. var self=this;
  2029. return smalltalk.withContext(function($ctx1) {
  2030. self.splice(aNumber -1, anotherNumber - aNumber + 1);
  2031. return self}, function($ctx1) {$ctx1.fill(self,"removeFrom:to:",{aNumber:aNumber,anotherNumber:anotherNumber},smalltalk.Array)})},
  2032. messageSends: []}),
  2033. smalltalk.Array);
  2034. smalltalk.addMethod(
  2035. smalltalk.method({
  2036. selector: "removeIndex:",
  2037. fn: function (anInteger){
  2038. var self=this;
  2039. return smalltalk.withContext(function($ctx1) {
  2040. self.splice(anInteger - 1, 1);
  2041. return self}, function($ctx1) {$ctx1.fill(self,"removeIndex:",{anInteger:anInteger},smalltalk.Array)})},
  2042. messageSends: []}),
  2043. smalltalk.Array);
  2044. smalltalk.addMethod(
  2045. smalltalk.method({
  2046. selector: "reversed",
  2047. fn: function (){
  2048. var self=this;
  2049. return smalltalk.withContext(function($ctx1) {
  2050. return self._copy().reverse();
  2051. return self}, function($ctx1) {$ctx1.fill(self,"reversed",{},smalltalk.Array)})},
  2052. messageSends: []}),
  2053. smalltalk.Array);
  2054. smalltalk.addMethod(
  2055. smalltalk.method({
  2056. selector: "size",
  2057. fn: function (){
  2058. var self=this;
  2059. return smalltalk.withContext(function($ctx1) {
  2060. return self.length;
  2061. return self}, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.Array)})},
  2062. messageSends: []}),
  2063. smalltalk.Array);
  2064. smalltalk.addMethod(
  2065. smalltalk.method({
  2066. selector: "sort",
  2067. fn: function (){
  2068. var self=this;
  2069. return smalltalk.withContext(function($ctx1) {
  2070. var $1;
  2071. $1=self._basicPerform_("sort");
  2072. return $1;
  2073. }, function($ctx1) {$ctx1.fill(self,"sort",{},smalltalk.Array)})},
  2074. messageSends: ["basicPerform:"]}),
  2075. smalltalk.Array);
  2076. smalltalk.addMethod(
  2077. smalltalk.method({
  2078. selector: "sort:",
  2079. fn: function (aBlock){
  2080. var self=this;
  2081. return smalltalk.withContext(function($ctx1) {
  2082. return self.sort(function(a, b) {
  2083. if(aBlock._value_value_(a,b)) {return -1} else {return 1}
  2084. })
  2085. ;
  2086. return self}, function($ctx1) {$ctx1.fill(self,"sort:",{aBlock:aBlock},smalltalk.Array)})},
  2087. messageSends: []}),
  2088. smalltalk.Array);
  2089. smalltalk.addMethod(
  2090. smalltalk.method({
  2091. selector: "sorted",
  2092. fn: function (){
  2093. var self=this;
  2094. return smalltalk.withContext(function($ctx1) {
  2095. var $1;
  2096. $1=_st(self._copy())._sort();
  2097. return $1;
  2098. }, function($ctx1) {$ctx1.fill(self,"sorted",{},smalltalk.Array)})},
  2099. messageSends: ["sort", "copy"]}),
  2100. smalltalk.Array);
  2101. smalltalk.addMethod(
  2102. smalltalk.method({
  2103. selector: "sorted:",
  2104. fn: function (aBlock){
  2105. var self=this;
  2106. return smalltalk.withContext(function($ctx1) {
  2107. var $1;
  2108. $1=_st(self._copy())._sort_(aBlock);
  2109. return $1;
  2110. }, function($ctx1) {$ctx1.fill(self,"sorted:",{aBlock:aBlock},smalltalk.Array)})},
  2111. messageSends: ["sort:", "copy"]}),
  2112. smalltalk.Array);
  2113. smalltalk.addMethod(
  2114. smalltalk.method({
  2115. selector: "new:",
  2116. fn: function (anInteger){
  2117. var self=this;
  2118. return smalltalk.withContext(function($ctx1) {
  2119. return new Array(anInteger);
  2120. return self}, function($ctx1) {$ctx1.fill(self,"new:",{anInteger:anInteger},smalltalk.Array.klass)})},
  2121. messageSends: []}),
  2122. smalltalk.Array.klass);
  2123. smalltalk.addMethod(
  2124. smalltalk.method({
  2125. selector: "with:",
  2126. fn: function (anObject){
  2127. var self=this;
  2128. return smalltalk.withContext(function($ctx1) {
  2129. var $2,$3,$1;
  2130. $2=self._new_((1));
  2131. _st($2)._at_put_((1),anObject);
  2132. $3=_st($2)._yourself();
  2133. $1=$3;
  2134. return $1;
  2135. }, function($ctx1) {$ctx1.fill(self,"with:",{anObject:anObject},smalltalk.Array.klass)})},
  2136. messageSends: ["at:put:", "new:", "yourself"]}),
  2137. smalltalk.Array.klass);
  2138. smalltalk.addMethod(
  2139. smalltalk.method({
  2140. selector: "with:with:",
  2141. fn: function (anObject,anObject2){
  2142. var self=this;
  2143. return smalltalk.withContext(function($ctx1) {
  2144. var $2,$3,$1;
  2145. $2=self._new_((2));
  2146. _st($2)._at_put_((1),anObject);
  2147. _st($2)._at_put_((2),anObject2);
  2148. $3=_st($2)._yourself();
  2149. $1=$3;
  2150. return $1;
  2151. }, function($ctx1) {$ctx1.fill(self,"with:with:",{anObject:anObject,anObject2:anObject2},smalltalk.Array.klass)})},
  2152. messageSends: ["at:put:", "new:", "yourself"]}),
  2153. smalltalk.Array.klass);
  2154. smalltalk.addMethod(
  2155. smalltalk.method({
  2156. selector: "with:with:with:",
  2157. fn: function (anObject,anObject2,anObject3){
  2158. var self=this;
  2159. return smalltalk.withContext(function($ctx1) {
  2160. var $2,$3,$1;
  2161. $2=self._new_((3));
  2162. _st($2)._at_put_((1),anObject);
  2163. _st($2)._at_put_((2),anObject2);
  2164. _st($2)._at_put_((3),anObject3);
  2165. $3=_st($2)._yourself();
  2166. $1=$3;
  2167. return $1;
  2168. }, function($ctx1) {$ctx1.fill(self,"with:with:with:",{anObject:anObject,anObject2:anObject2,anObject3:anObject3},smalltalk.Array.klass)})},
  2169. messageSends: ["at:put:", "new:", "yourself"]}),
  2170. smalltalk.Array.klass);
  2171. smalltalk.addMethod(
  2172. smalltalk.method({
  2173. selector: "withAll:",
  2174. fn: function (aCollection){
  2175. var self=this;
  2176. var instance,index;
  2177. return smalltalk.withContext(function($ctx1) {
  2178. var $1;
  2179. index=(1);
  2180. instance=self._new_(_st(aCollection)._size());
  2181. _st(aCollection)._do_((function(each){
  2182. return smalltalk.withContext(function($ctx2) {
  2183. _st(instance)._at_put_(index,each);
  2184. index=_st(index).__plus((1));
  2185. return index;
  2186. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  2187. $1=instance;
  2188. return $1;
  2189. }, function($ctx1) {$ctx1.fill(self,"withAll:",{aCollection:aCollection,instance:instance,index:index},smalltalk.Array.klass)})},
  2190. messageSends: ["new:", "size", "do:", "at:put:", "+"]}),
  2191. smalltalk.Array.klass);
  2192. smalltalk.addClass('CharacterArray', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
  2193. smalltalk.addMethod(
  2194. smalltalk.method({
  2195. selector: ",",
  2196. fn: function (aString){
  2197. var self=this;
  2198. return smalltalk.withContext(function($ctx1) {
  2199. var $1;
  2200. $1=_st(self._asString()).__comma(_st(aString)._asString());
  2201. return $1;
  2202. }, function($ctx1) {$ctx1.fill(self,",",{aString:aString},smalltalk.CharacterArray)})},
  2203. messageSends: [",", "asString"]}),
  2204. smalltalk.CharacterArray);
  2205. smalltalk.addMethod(
  2206. smalltalk.method({
  2207. selector: "add:",
  2208. fn: function (anObject){
  2209. var self=this;
  2210. return smalltalk.withContext(function($ctx1) {
  2211. self._errorReadOnly();
  2212. return self}, function($ctx1) {$ctx1.fill(self,"add:",{anObject:anObject},smalltalk.CharacterArray)})},
  2213. messageSends: ["errorReadOnly"]}),
  2214. smalltalk.CharacterArray);
  2215. smalltalk.addMethod(
  2216. smalltalk.method({
  2217. selector: "asLowercase",
  2218. fn: function (){
  2219. var self=this;
  2220. return smalltalk.withContext(function($ctx1) {
  2221. var $1;
  2222. $1=_st(self._class())._fromString_(_st(self._asString())._asLowercase());
  2223. return $1;
  2224. }, function($ctx1) {$ctx1.fill(self,"asLowercase",{},smalltalk.CharacterArray)})},
  2225. messageSends: ["fromString:", "asLowercase", "asString", "class"]}),
  2226. smalltalk.CharacterArray);
  2227. smalltalk.addMethod(
  2228. smalltalk.method({
  2229. selector: "asNumber",
  2230. fn: function (){
  2231. var self=this;
  2232. return smalltalk.withContext(function($ctx1) {
  2233. var $1;
  2234. $1=_st(self._asString())._asNumber();
  2235. return $1;
  2236. }, function($ctx1) {$ctx1.fill(self,"asNumber",{},smalltalk.CharacterArray)})},
  2237. messageSends: ["asNumber", "asString"]}),
  2238. smalltalk.CharacterArray);
  2239. smalltalk.addMethod(
  2240. smalltalk.method({
  2241. selector: "asString",
  2242. fn: function (){
  2243. var self=this;
  2244. return smalltalk.withContext(function($ctx1) {
  2245. var $1;
  2246. $1=self._subclassResponsibility();
  2247. return $1;
  2248. }, function($ctx1) {$ctx1.fill(self,"asString",{},smalltalk.CharacterArray)})},
  2249. messageSends: ["subclassResponsibility"]}),
  2250. smalltalk.CharacterArray);
  2251. smalltalk.addMethod(
  2252. smalltalk.method({
  2253. selector: "asSymbol",
  2254. fn: function (){
  2255. var self=this;
  2256. return smalltalk.withContext(function($ctx1) {
  2257. var $1;
  2258. $1=self._asString();
  2259. return $1;
  2260. }, function($ctx1) {$ctx1.fill(self,"asSymbol",{},smalltalk.CharacterArray)})},
  2261. messageSends: ["asString"]}),
  2262. smalltalk.CharacterArray);
  2263. smalltalk.addMethod(
  2264. smalltalk.method({
  2265. selector: "asUppercase",
  2266. fn: function (){
  2267. var self=this;
  2268. return smalltalk.withContext(function($ctx1) {
  2269. var $1;
  2270. $1=_st(self._class())._fromString_(_st(self._asString())._asUppercase());
  2271. return $1;
  2272. }, function($ctx1) {$ctx1.fill(self,"asUppercase",{},smalltalk.CharacterArray)})},
  2273. messageSends: ["fromString:", "asUppercase", "asString", "class"]}),
  2274. smalltalk.CharacterArray);
  2275. smalltalk.addMethod(
  2276. smalltalk.method({
  2277. selector: "at:put:",
  2278. fn: function (anIndex,anObject){
  2279. var self=this;
  2280. return smalltalk.withContext(function($ctx1) {
  2281. self._errorReadOnly();
  2282. return self}, function($ctx1) {$ctx1.fill(self,"at:put:",{anIndex:anIndex,anObject:anObject},smalltalk.CharacterArray)})},
  2283. messageSends: ["errorReadOnly"]}),
  2284. smalltalk.CharacterArray);
  2285. smalltalk.addMethod(
  2286. smalltalk.method({
  2287. selector: "errorReadOnly",
  2288. fn: function (){
  2289. var self=this;
  2290. return smalltalk.withContext(function($ctx1) {
  2291. self._error_("Object is read-only");
  2292. return self}, function($ctx1) {$ctx1.fill(self,"errorReadOnly",{},smalltalk.CharacterArray)})},
  2293. messageSends: ["error:"]}),
  2294. smalltalk.CharacterArray);
  2295. smalltalk.addMethod(
  2296. smalltalk.method({
  2297. selector: "printOn:",
  2298. fn: function (aStream){
  2299. var self=this;
  2300. return smalltalk.withContext(function($ctx1) {
  2301. _st(self._asString())._printOn_(aStream);
  2302. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.CharacterArray)})},
  2303. messageSends: ["printOn:", "asString"]}),
  2304. smalltalk.CharacterArray);
  2305. smalltalk.addMethod(
  2306. smalltalk.method({
  2307. selector: "putOn:",
  2308. fn: function (aStream){
  2309. var self=this;
  2310. return smalltalk.withContext(function($ctx1) {
  2311. _st(aStream)._nextPutString_(self);
  2312. return self}, function($ctx1) {$ctx1.fill(self,"putOn:",{aStream:aStream},smalltalk.CharacterArray)})},
  2313. messageSends: ["nextPutString:"]}),
  2314. smalltalk.CharacterArray);
  2315. smalltalk.addMethod(
  2316. smalltalk.method({
  2317. selector: "remove:",
  2318. fn: function (anObject){
  2319. var self=this;
  2320. return smalltalk.withContext(function($ctx1) {
  2321. self._errorReadOnly();
  2322. return self}, function($ctx1) {$ctx1.fill(self,"remove:",{anObject:anObject},smalltalk.CharacterArray)})},
  2323. messageSends: ["errorReadOnly"]}),
  2324. smalltalk.CharacterArray);
  2325. smalltalk.addMethod(
  2326. smalltalk.method({
  2327. selector: "fromString:",
  2328. fn: function (aString){
  2329. var self=this;
  2330. return smalltalk.withContext(function($ctx1) {
  2331. self._subclassResponsibility();
  2332. return self}, function($ctx1) {$ctx1.fill(self,"fromString:",{aString:aString},smalltalk.CharacterArray.klass)})},
  2333. messageSends: ["subclassResponsibility"]}),
  2334. smalltalk.CharacterArray.klass);
  2335. smalltalk.addClass('String', smalltalk.CharacterArray, [], 'Kernel-Collections');
  2336. smalltalk.addMethod(
  2337. smalltalk.method({
  2338. selector: ",",
  2339. fn: function (aString){
  2340. var self=this;
  2341. return smalltalk.withContext(function($ctx1) {
  2342. return self + aString;
  2343. return self}, function($ctx1) {$ctx1.fill(self,",",{aString:aString},smalltalk.String)})},
  2344. messageSends: []}),
  2345. smalltalk.String);
  2346. smalltalk.addMethod(
  2347. smalltalk.method({
  2348. selector: "<",
  2349. fn: function (aString){
  2350. var self=this;
  2351. return smalltalk.withContext(function($ctx1) {
  2352. return String(self) < aString._asString();
  2353. return self}, function($ctx1) {$ctx1.fill(self,"<",{aString:aString},smalltalk.String)})},
  2354. messageSends: []}),
  2355. smalltalk.String);
  2356. smalltalk.addMethod(
  2357. smalltalk.method({
  2358. selector: "<=",
  2359. fn: function (aString){
  2360. var self=this;
  2361. return smalltalk.withContext(function($ctx1) {
  2362. return String(self) <= aString._asString();
  2363. return self}, function($ctx1) {$ctx1.fill(self,"<=",{aString:aString},smalltalk.String)})},
  2364. messageSends: []}),
  2365. smalltalk.String);
  2366. smalltalk.addMethod(
  2367. smalltalk.method({
  2368. selector: "=",
  2369. fn: function (aString){
  2370. var self=this;
  2371. return smalltalk.withContext(function($ctx1) {
  2372. if(typeof aString === 'undefined') { return false }
  2373. if(!aString._isString || ! aString._isString()) {
  2374. return false;
  2375. }
  2376. return String(self) === String(aString)
  2377. ;
  2378. return self}, function($ctx1) {$ctx1.fill(self,"=",{aString:aString},smalltalk.String)})},
  2379. messageSends: []}),
  2380. smalltalk.String);
  2381. smalltalk.addMethod(
  2382. smalltalk.method({
  2383. selector: "==",
  2384. fn: function (aString){
  2385. var self=this;
  2386. return smalltalk.withContext(function($ctx1) {
  2387. var $1;
  2388. $1=self.__eq(aString);
  2389. return $1;
  2390. }, function($ctx1) {$ctx1.fill(self,"==",{aString:aString},smalltalk.String)})},
  2391. messageSends: ["="]}),
  2392. smalltalk.String);
  2393. smalltalk.addMethod(
  2394. smalltalk.method({
  2395. selector: ">",
  2396. fn: function (aString){
  2397. var self=this;
  2398. return smalltalk.withContext(function($ctx1) {
  2399. return String(self) > aString._asString();
  2400. return self}, function($ctx1) {$ctx1.fill(self,">",{aString:aString},smalltalk.String)})},
  2401. messageSends: []}),
  2402. smalltalk.String);
  2403. smalltalk.addMethod(
  2404. smalltalk.method({
  2405. selector: ">=",
  2406. fn: function (aString){
  2407. var self=this;
  2408. return smalltalk.withContext(function($ctx1) {
  2409. return String(self) >= aString._asString();
  2410. return self}, function($ctx1) {$ctx1.fill(self,">=",{aString:aString},smalltalk.String)})},
  2411. messageSends: []}),
  2412. smalltalk.String);
  2413. smalltalk.addMethod(
  2414. smalltalk.method({
  2415. selector: "asJSON",
  2416. fn: function (){
  2417. var self=this;
  2418. return smalltalk.withContext(function($ctx1) {
  2419. var $1;
  2420. $1=self;
  2421. return $1;
  2422. }, function($ctx1) {$ctx1.fill(self,"asJSON",{},smalltalk.String)})},
  2423. messageSends: []}),
  2424. smalltalk.String);
  2425. smalltalk.addMethod(
  2426. smalltalk.method({
  2427. selector: "asJavascript",
  2428. fn: function (){
  2429. var self=this;
  2430. return smalltalk.withContext(function($ctx1) {
  2431. if(self.search(/^[a-zA-Z0-9_:.$ ]*$/) == -1)
  2432. return "\"" + self.replace(/[\x00-\x1f"\\\x7f-\x9f]/g, function(ch){var c=ch.charCodeAt(0);return "\\x"+("0"+c.toString(16)).slice(-2)}) + "\"";
  2433. else
  2434. return "\"" + self + "\"";
  2435. ;
  2436. return self}, function($ctx1) {$ctx1.fill(self,"asJavascript",{},smalltalk.String)})},
  2437. messageSends: []}),
  2438. smalltalk.String);
  2439. smalltalk.addMethod(
  2440. smalltalk.method({
  2441. selector: "asLowercase",
  2442. fn: function (){
  2443. var self=this;
  2444. return smalltalk.withContext(function($ctx1) {
  2445. return self.toLowerCase();
  2446. return self}, function($ctx1) {$ctx1.fill(self,"asLowercase",{},smalltalk.String)})},
  2447. messageSends: []}),
  2448. smalltalk.String);
  2449. smalltalk.addMethod(
  2450. smalltalk.method({
  2451. selector: "asNumber",
  2452. fn: function (){
  2453. var self=this;
  2454. return smalltalk.withContext(function($ctx1) {
  2455. return Number(self);
  2456. return self}, function($ctx1) {$ctx1.fill(self,"asNumber",{},smalltalk.String)})},
  2457. messageSends: []}),
  2458. smalltalk.String);
  2459. smalltalk.addMethod(
  2460. smalltalk.method({
  2461. selector: "asRegexp",
  2462. fn: function (){
  2463. var self=this;
  2464. function $RegularExpression(){return smalltalk.RegularExpression||(typeof RegularExpression=="undefined"?nil:RegularExpression)}
  2465. return smalltalk.withContext(function($ctx1) {
  2466. var $1;
  2467. $1=_st($RegularExpression())._fromString_(self);
  2468. return $1;
  2469. }, function($ctx1) {$ctx1.fill(self,"asRegexp",{},smalltalk.String)})},
  2470. messageSends: ["fromString:"]}),
  2471. smalltalk.String);
  2472. smalltalk.addMethod(
  2473. smalltalk.method({
  2474. selector: "asSelector",
  2475. fn: function (){
  2476. var self=this;
  2477. return smalltalk.withContext(function($ctx1) {
  2478. return smalltalk.selector(self);
  2479. return self}, function($ctx1) {$ctx1.fill(self,"asSelector",{},smalltalk.String)})},
  2480. messageSends: []}),
  2481. smalltalk.String);
  2482. smalltalk.addMethod(
  2483. smalltalk.method({
  2484. selector: "asString",
  2485. fn: function (){
  2486. var self=this;
  2487. return smalltalk.withContext(function($ctx1) {
  2488. var $1;
  2489. $1=self;
  2490. return $1;
  2491. }, function($ctx1) {$ctx1.fill(self,"asString",{},smalltalk.String)})},
  2492. messageSends: []}),
  2493. smalltalk.String);
  2494. smalltalk.addMethod(
  2495. smalltalk.method({
  2496. selector: "asSymbol",
  2497. fn: function (){
  2498. var self=this;
  2499. return smalltalk.withContext(function($ctx1) {
  2500. var $1;
  2501. $1=self;
  2502. return $1;
  2503. }, function($ctx1) {$ctx1.fill(self,"asSymbol",{},smalltalk.String)})},
  2504. messageSends: []}),
  2505. smalltalk.String);
  2506. smalltalk.addMethod(
  2507. smalltalk.method({
  2508. selector: "asUppercase",
  2509. fn: function (){
  2510. var self=this;
  2511. return smalltalk.withContext(function($ctx1) {
  2512. return self.toUpperCase();
  2513. return self}, function($ctx1) {$ctx1.fill(self,"asUppercase",{},smalltalk.String)})},
  2514. messageSends: []}),
  2515. smalltalk.String);
  2516. smalltalk.addMethod(
  2517. smalltalk.method({
  2518. selector: "asciiValue",
  2519. fn: function (){
  2520. var self=this;
  2521. return smalltalk.withContext(function($ctx1) {
  2522. return self.charCodeAt(0);;
  2523. return self}, function($ctx1) {$ctx1.fill(self,"asciiValue",{},smalltalk.String)})},
  2524. messageSends: []}),
  2525. smalltalk.String);
  2526. smalltalk.addMethod(
  2527. smalltalk.method({
  2528. selector: "at:ifAbsent:",
  2529. fn: function (anIndex,aBlock){
  2530. var self=this;
  2531. return smalltalk.withContext(function($ctx1) {
  2532. return String(self).charAt(anIndex - 1) || aBlock._value();
  2533. return self}, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{anIndex:anIndex,aBlock:aBlock},smalltalk.String)})},
  2534. messageSends: []}),
  2535. smalltalk.String);
  2536. smalltalk.addMethod(
  2537. smalltalk.method({
  2538. selector: "at:ifPresent:ifAbsent:",
  2539. fn: function (anIndex,aBlock,anotherBlock){
  2540. var self=this;
  2541. return smalltalk.withContext(function($ctx1) {
  2542. var result = String(self).charAt(anIndex - 1);
  2543. return result ? aBlock._value_(result) : anotherBlock._value();
  2544. ;
  2545. return self}, function($ctx1) {$ctx1.fill(self,"at:ifPresent:ifAbsent:",{anIndex:anIndex,aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.String)})},
  2546. messageSends: []}),
  2547. smalltalk.String);
  2548. smalltalk.addMethod(
  2549. smalltalk.method({
  2550. selector: "charCodeAt:",
  2551. fn: function (anInteger){
  2552. var self=this;
  2553. return smalltalk.withContext(function($ctx1) {
  2554. return self.charCodeAt(anInteger - 1) ;
  2555. return self}, function($ctx1) {$ctx1.fill(self,"charCodeAt:",{anInteger:anInteger},smalltalk.String)})},
  2556. messageSends: []}),
  2557. smalltalk.String);
  2558. smalltalk.addMethod(
  2559. smalltalk.method({
  2560. selector: "copyFrom:to:",
  2561. fn: function (anIndex,anotherIndex){
  2562. var self=this;
  2563. return smalltalk.withContext(function($ctx1) {
  2564. return self.substring(anIndex - 1, anotherIndex);
  2565. return self}, function($ctx1) {$ctx1.fill(self,"copyFrom:to:",{anIndex:anIndex,anotherIndex:anotherIndex},smalltalk.String)})},
  2566. messageSends: []}),
  2567. smalltalk.String);
  2568. smalltalk.addMethod(
  2569. smalltalk.method({
  2570. selector: "crlfSanitized",
  2571. fn: function (){
  2572. var self=this;
  2573. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  2574. return smalltalk.withContext(function($ctx1) {
  2575. var $1;
  2576. $1=_st(self._lines())._join_(_st($String())._lf());
  2577. return $1;
  2578. }, function($ctx1) {$ctx1.fill(self,"crlfSanitized",{},smalltalk.String)})},
  2579. messageSends: ["join:", "lf", "lines"]}),
  2580. smalltalk.String);
  2581. smalltalk.addMethod(
  2582. smalltalk.method({
  2583. selector: "deepCopy",
  2584. fn: function (){
  2585. var self=this;
  2586. return smalltalk.withContext(function($ctx1) {
  2587. var $1;
  2588. $1=self._shallowCopy();
  2589. return $1;
  2590. }, function($ctx1) {$ctx1.fill(self,"deepCopy",{},smalltalk.String)})},
  2591. messageSends: ["shallowCopy"]}),
  2592. smalltalk.String);
  2593. smalltalk.addMethod(
  2594. smalltalk.method({
  2595. selector: "do:",
  2596. fn: function (aBlock){
  2597. var self=this;
  2598. return smalltalk.withContext(function($ctx1) {
  2599. for(var i=0;i<self.length;i++){aBlock._value_(self.charAt(i));};
  2600. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.String)})},
  2601. messageSends: []}),
  2602. smalltalk.String);
  2603. smalltalk.addMethod(
  2604. smalltalk.method({
  2605. selector: "escaped",
  2606. fn: function (){
  2607. var self=this;
  2608. return smalltalk.withContext(function($ctx1) {
  2609. return escape(self);
  2610. return self}, function($ctx1) {$ctx1.fill(self,"escaped",{},smalltalk.String)})},
  2611. messageSends: []}),
  2612. smalltalk.String);
  2613. smalltalk.addMethod(
  2614. smalltalk.method({
  2615. selector: "includesSubString:",
  2616. fn: function (subString){
  2617. var self=this;
  2618. return smalltalk.withContext(function($ctx1) {
  2619. return self.indexOf(subString) != -1 ;
  2620. return self}, function($ctx1) {$ctx1.fill(self,"includesSubString:",{subString:subString},smalltalk.String)})},
  2621. messageSends: []}),
  2622. smalltalk.String);
  2623. smalltalk.addMethod(
  2624. smalltalk.method({
  2625. selector: "isImmutable",
  2626. fn: function (){
  2627. var self=this;
  2628. return smalltalk.withContext(function($ctx1) {
  2629. return true;
  2630. }, function($ctx1) {$ctx1.fill(self,"isImmutable",{},smalltalk.String)})},
  2631. messageSends: []}),
  2632. smalltalk.String);
  2633. smalltalk.addMethod(
  2634. smalltalk.method({
  2635. selector: "isString",
  2636. fn: function (){
  2637. var self=this;
  2638. return smalltalk.withContext(function($ctx1) {
  2639. return true;
  2640. }, function($ctx1) {$ctx1.fill(self,"isString",{},smalltalk.String)})},
  2641. messageSends: []}),
  2642. smalltalk.String);
  2643. smalltalk.addMethod(
  2644. smalltalk.method({
  2645. selector: "isVowel",
  2646. fn: function (){
  2647. var self=this;
  2648. return smalltalk.withContext(function($ctx1) {
  2649. var $1;
  2650. $1=_st(_st(self._size()).__eq((1)))._and_((function(){
  2651. return smalltalk.withContext(function($ctx2) {
  2652. return "aeiou"._includes_(self._asLowercase());
  2653. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2654. return $1;
  2655. }, function($ctx1) {$ctx1.fill(self,"isVowel",{},smalltalk.String)})},
  2656. messageSends: ["and:", "includes:", "asLowercase", "=", "size"]}),
  2657. smalltalk.String);
  2658. smalltalk.addMethod(
  2659. smalltalk.method({
  2660. selector: "join:",
  2661. fn: function (aCollection){
  2662. var self=this;
  2663. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  2664. return smalltalk.withContext(function($ctx1) {
  2665. var $1;
  2666. $1=_st($String())._streamContents_((function(stream){
  2667. return smalltalk.withContext(function($ctx2) {
  2668. return _st(aCollection)._do_separatedBy_((function(each){
  2669. return smalltalk.withContext(function($ctx3) {
  2670. return _st(stream)._nextPutAll_(_st(each)._asString());
  2671. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2)})}),(function(){
  2672. return smalltalk.withContext(function($ctx3) {
  2673. return _st(stream)._nextPutAll_(self);
  2674. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2675. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
  2676. return $1;
  2677. }, function($ctx1) {$ctx1.fill(self,"join:",{aCollection:aCollection},smalltalk.String)})},
  2678. messageSends: ["streamContents:", "do:separatedBy:", "nextPutAll:", "asString"]}),
  2679. smalltalk.String);
  2680. smalltalk.addMethod(
  2681. smalltalk.method({
  2682. selector: "lineIndicesDo:",
  2683. fn: function (aBlock){
  2684. var self=this;
  2685. var cr,lf,start,sz,nextLF,nextCR;
  2686. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  2687. return smalltalk.withContext(function($ctx1) {
  2688. var $1,$2,$3,$4;
  2689. var $early={};
  2690. try {
  2691. start=(1);
  2692. sz=self._size();
  2693. cr=_st($String())._cr();
  2694. nextCR=self._indexOf_startingAt_(cr,(1));
  2695. lf=_st($String())._lf();
  2696. nextLF=self._indexOf_startingAt_(lf,(1));
  2697. _st((function(){
  2698. return smalltalk.withContext(function($ctx2) {
  2699. return _st(start).__lt_eq(sz);
  2700. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  2701. return smalltalk.withContext(function($ctx2) {
  2702. $1=_st(_st(nextLF).__eq((0)))._and_((function(){
  2703. return smalltalk.withContext(function($ctx3) {
  2704. return _st(nextCR).__eq((0));
  2705. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2706. if(smalltalk.assert($1)){
  2707. _st(aBlock)._value_value_value_(start,sz,sz);
  2708. $2=self;
  2709. throw $early=[$2];
  2710. };
  2711. $3=_st(_st(nextCR).__eq((0)))._or_((function(){
  2712. return smalltalk.withContext(function($ctx3) {
  2713. return _st((0).__lt(nextLF))._and_((function(){
  2714. return smalltalk.withContext(function($ctx4) {
  2715. return _st(nextLF).__lt(nextCR);
  2716. }, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
  2717. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2718. if(smalltalk.assert($3)){
  2719. _st(aBlock)._value_value_value_(start,_st(nextLF).__minus((1)),nextLF);
  2720. start=(1).__plus(nextLF);
  2721. start;
  2722. nextLF=self._indexOf_startingAt_(lf,start);
  2723. return nextLF;
  2724. } else {
  2725. $4=_st((1).__plus(nextCR)).__eq(nextLF);
  2726. if(smalltalk.assert($4)){
  2727. _st(aBlock)._value_value_value_(start,_st(nextCR).__minus((1)),nextLF);
  2728. start=(1).__plus(nextLF);
  2729. start;
  2730. nextCR=self._indexOf_startingAt_(cr,start);
  2731. nextCR;
  2732. nextLF=self._indexOf_startingAt_(lf,start);
  2733. return nextLF;
  2734. } else {
  2735. _st(aBlock)._value_value_value_(start,_st(nextCR).__minus((1)),nextCR);
  2736. start=(1).__plus(nextCR);
  2737. start;
  2738. nextCR=self._indexOf_startingAt_(cr,start);
  2739. return nextCR;
  2740. };
  2741. };
  2742. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2743. return self}
  2744. catch(e) {if(e===$early)return e[0]; throw e}
  2745. }, function($ctx1) {$ctx1.fill(self,"lineIndicesDo:",{aBlock:aBlock,cr:cr,lf:lf,start:start,sz:sz,nextLF:nextLF,nextCR:nextCR},smalltalk.String)})},
  2746. messageSends: ["size", "cr", "indexOf:startingAt:", "lf", "whileTrue:", "ifTrue:", "value:value:value:", "and:", "=", "ifTrue:ifFalse:", "-", "+", "or:", "<", "<="]}),
  2747. smalltalk.String);
  2748. smalltalk.addMethod(
  2749. smalltalk.method({
  2750. selector: "lineNumber:",
  2751. fn: function (anIndex){
  2752. var self=this;
  2753. var lineCount;
  2754. return smalltalk.withContext(function($ctx1) {
  2755. var $1,$2;
  2756. var $early={};
  2757. try {
  2758. lineCount=(0);
  2759. self._lineIndicesDo_((function(start,endWithoutDelimiters,end){
  2760. return smalltalk.withContext(function($ctx2) {
  2761. lineCount=_st(lineCount).__plus((1));
  2762. $1=_st(lineCount).__eq(anIndex);
  2763. if(smalltalk.assert($1)){
  2764. $2=self._copyFrom_to_(start,endWithoutDelimiters);
  2765. throw $early=[$2];
  2766. };
  2767. }, function($ctx2) {$ctx2.fillBlock({start:start,endWithoutDelimiters:endWithoutDelimiters,end:end},$ctx1)})}));
  2768. return nil;
  2769. }
  2770. catch(e) {if(e===$early)return e[0]; throw e}
  2771. }, function($ctx1) {$ctx1.fill(self,"lineNumber:",{anIndex:anIndex,lineCount:lineCount},smalltalk.String)})},
  2772. messageSends: ["lineIndicesDo:", "ifTrue:", "copyFrom:to:", "=", "+"]}),
  2773. smalltalk.String);
  2774. smalltalk.addMethod(
  2775. smalltalk.method({
  2776. selector: "lines",
  2777. fn: function (){
  2778. var self=this;
  2779. var lines;
  2780. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  2781. return smalltalk.withContext(function($ctx1) {
  2782. var $1;
  2783. lines=_st($Array())._new();
  2784. self._linesDo_((function(aLine){
  2785. return smalltalk.withContext(function($ctx2) {
  2786. return _st(lines)._add_(aLine);
  2787. }, function($ctx2) {$ctx2.fillBlock({aLine:aLine},$ctx1)})}));
  2788. $1=lines;
  2789. return $1;
  2790. }, function($ctx1) {$ctx1.fill(self,"lines",{lines:lines},smalltalk.String)})},
  2791. messageSends: ["new", "linesDo:", "add:"]}),
  2792. smalltalk.String);
  2793. smalltalk.addMethod(
  2794. smalltalk.method({
  2795. selector: "linesDo:",
  2796. fn: function (aBlock){
  2797. var self=this;
  2798. return smalltalk.withContext(function($ctx1) {
  2799. self._lineIndicesDo_((function(start,endWithoutDelimiters,end){
  2800. return smalltalk.withContext(function($ctx2) {
  2801. return _st(aBlock)._value_(self._copyFrom_to_(start,endWithoutDelimiters));
  2802. }, function($ctx2) {$ctx2.fillBlock({start:start,endWithoutDelimiters:endWithoutDelimiters,end:end},$ctx1)})}));
  2803. return self}, function($ctx1) {$ctx1.fill(self,"linesDo:",{aBlock:aBlock},smalltalk.String)})},
  2804. messageSends: ["lineIndicesDo:", "value:", "copyFrom:to:"]}),
  2805. smalltalk.String);
  2806. smalltalk.addMethod(
  2807. smalltalk.method({
  2808. selector: "match:",
  2809. fn: function (aRegexp){
  2810. var self=this;
  2811. return smalltalk.withContext(function($ctx1) {
  2812. return self.search(aRegexp) != -1;
  2813. return self}, function($ctx1) {$ctx1.fill(self,"match:",{aRegexp:aRegexp},smalltalk.String)})},
  2814. messageSends: []}),
  2815. smalltalk.String);
  2816. smalltalk.addMethod(
  2817. smalltalk.method({
  2818. selector: "matchesOf:",
  2819. fn: function (aRegularExpression){
  2820. var self=this;
  2821. return smalltalk.withContext(function($ctx1) {
  2822. return self.match(aRegularExpression);
  2823. return self}, function($ctx1) {$ctx1.fill(self,"matchesOf:",{aRegularExpression:aRegularExpression},smalltalk.String)})},
  2824. messageSends: []}),
  2825. smalltalk.String);
  2826. smalltalk.addMethod(
  2827. smalltalk.method({
  2828. selector: "printNl",
  2829. fn: function (){
  2830. var self=this;
  2831. return smalltalk.withContext(function($ctx1) {
  2832. console.log(self);
  2833. return self}, function($ctx1) {$ctx1.fill(self,"printNl",{},smalltalk.String)})},
  2834. messageSends: []}),
  2835. smalltalk.String);
  2836. smalltalk.addMethod(
  2837. smalltalk.method({
  2838. selector: "printOn:",
  2839. fn: function (aStream){
  2840. var self=this;
  2841. return smalltalk.withContext(function($ctx1) {
  2842. var $1,$2;
  2843. $1=aStream;
  2844. _st($1)._nextPutAll_("'");
  2845. _st($1)._nextPutAll_(self);
  2846. $2=_st($1)._nextPutAll_("'");
  2847. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.String)})},
  2848. messageSends: ["nextPutAll:"]}),
  2849. smalltalk.String);
  2850. smalltalk.addMethod(
  2851. smalltalk.method({
  2852. selector: "replace:with:",
  2853. fn: function (aString,anotherString){
  2854. var self=this;
  2855. function $RegularExpression(){return smalltalk.RegularExpression||(typeof RegularExpression=="undefined"?nil:RegularExpression)}
  2856. return smalltalk.withContext(function($ctx1) {
  2857. var $1;
  2858. $1=self._replaceRegexp_with_(_st($RegularExpression())._fromString_flag_(aString,"g"),anotherString);
  2859. return $1;
  2860. }, function($ctx1) {$ctx1.fill(self,"replace:with:",{aString:aString,anotherString:anotherString},smalltalk.String)})},
  2861. messageSends: ["replaceRegexp:with:", "fromString:flag:"]}),
  2862. smalltalk.String);
  2863. smalltalk.addMethod(
  2864. smalltalk.method({
  2865. selector: "replaceRegexp:with:",
  2866. fn: function (aRegexp,aString){
  2867. var self=this;
  2868. return smalltalk.withContext(function($ctx1) {
  2869. return self.replace(aRegexp, aString);
  2870. return self}, function($ctx1) {$ctx1.fill(self,"replaceRegexp:with:",{aRegexp:aRegexp,aString:aString},smalltalk.String)})},
  2871. messageSends: []}),
  2872. smalltalk.String);
  2873. smalltalk.addMethod(
  2874. smalltalk.method({
  2875. selector: "reversed",
  2876. fn: function (){
  2877. var self=this;
  2878. return smalltalk.withContext(function($ctx1) {
  2879. return self.split("").reverse().join("");
  2880. return self}, function($ctx1) {$ctx1.fill(self,"reversed",{},smalltalk.String)})},
  2881. messageSends: []}),
  2882. smalltalk.String);
  2883. smalltalk.addMethod(
  2884. smalltalk.method({
  2885. selector: "shallowCopy",
  2886. fn: function (){
  2887. var self=this;
  2888. return smalltalk.withContext(function($ctx1) {
  2889. var $1;
  2890. $1=_st(self._class())._fromString_(self);
  2891. return $1;
  2892. }, function($ctx1) {$ctx1.fill(self,"shallowCopy",{},smalltalk.String)})},
  2893. messageSends: ["fromString:", "class"]}),
  2894. smalltalk.String);
  2895. smalltalk.addMethod(
  2896. smalltalk.method({
  2897. selector: "size",
  2898. fn: function (){
  2899. var self=this;
  2900. return smalltalk.withContext(function($ctx1) {
  2901. return self.length;
  2902. return self}, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.String)})},
  2903. messageSends: []}),
  2904. smalltalk.String);
  2905. smalltalk.addMethod(
  2906. smalltalk.method({
  2907. selector: "subStrings:",
  2908. fn: function (aString){
  2909. var self=this;
  2910. return smalltalk.withContext(function($ctx1) {
  2911. var $1;
  2912. $1=self._tokenize_(aString);
  2913. return $1;
  2914. }, function($ctx1) {$ctx1.fill(self,"subStrings:",{aString:aString},smalltalk.String)})},
  2915. messageSends: ["tokenize:"]}),
  2916. smalltalk.String);
  2917. smalltalk.addMethod(
  2918. smalltalk.method({
  2919. selector: "tokenize:",
  2920. fn: function (aString){
  2921. var self=this;
  2922. return smalltalk.withContext(function($ctx1) {
  2923. return self.split(aString);
  2924. return self}, function($ctx1) {$ctx1.fill(self,"tokenize:",{aString:aString},smalltalk.String)})},
  2925. messageSends: []}),
  2926. smalltalk.String);
  2927. smalltalk.addMethod(
  2928. smalltalk.method({
  2929. selector: "trimBoth",
  2930. fn: function (){
  2931. var self=this;
  2932. return smalltalk.withContext(function($ctx1) {
  2933. var $1;
  2934. $1=self._trimBoth_("\x5cs");
  2935. return $1;
  2936. }, function($ctx1) {$ctx1.fill(self,"trimBoth",{},smalltalk.String)})},
  2937. messageSends: ["trimBoth:"]}),
  2938. smalltalk.String);
  2939. smalltalk.addMethod(
  2940. smalltalk.method({
  2941. selector: "trimBoth:",
  2942. fn: function (separators){
  2943. var self=this;
  2944. return smalltalk.withContext(function($ctx1) {
  2945. var $1;
  2946. $1=_st(self._trimLeft_(separators))._trimRight_(separators);
  2947. return $1;
  2948. }, function($ctx1) {$ctx1.fill(self,"trimBoth:",{separators:separators},smalltalk.String)})},
  2949. messageSends: ["trimRight:", "trimLeft:"]}),
  2950. smalltalk.String);
  2951. smalltalk.addMethod(
  2952. smalltalk.method({
  2953. selector: "trimLeft",
  2954. fn: function (){
  2955. var self=this;
  2956. return smalltalk.withContext(function($ctx1) {
  2957. var $1;
  2958. $1=self._trimLeft_("\x5cs");
  2959. return $1;
  2960. }, function($ctx1) {$ctx1.fill(self,"trimLeft",{},smalltalk.String)})},
  2961. messageSends: ["trimLeft:"]}),
  2962. smalltalk.String);
  2963. smalltalk.addMethod(
  2964. smalltalk.method({
  2965. selector: "trimLeft:",
  2966. fn: function (separators){
  2967. var self=this;
  2968. function $RegularExpression(){return smalltalk.RegularExpression||(typeof RegularExpression=="undefined"?nil:RegularExpression)}
  2969. return smalltalk.withContext(function($ctx1) {
  2970. var $1;
  2971. $1=self._replaceRegexp_with_(_st($RegularExpression())._fromString_flag_(_st("^[".__comma(separators)).__comma("]+"),"g"),"");
  2972. return $1;
  2973. }, function($ctx1) {$ctx1.fill(self,"trimLeft:",{separators:separators},smalltalk.String)})},
  2974. messageSends: ["replaceRegexp:with:", "fromString:flag:", ","]}),
  2975. smalltalk.String);
  2976. smalltalk.addMethod(
  2977. smalltalk.method({
  2978. selector: "trimRight",
  2979. fn: function (){
  2980. var self=this;
  2981. return smalltalk.withContext(function($ctx1) {
  2982. var $1;
  2983. $1=self._trimRight_("\x5cs");
  2984. return $1;
  2985. }, function($ctx1) {$ctx1.fill(self,"trimRight",{},smalltalk.String)})},
  2986. messageSends: ["trimRight:"]}),
  2987. smalltalk.String);
  2988. smalltalk.addMethod(
  2989. smalltalk.method({
  2990. selector: "trimRight:",
  2991. fn: function (separators){
  2992. var self=this;
  2993. function $RegularExpression(){return smalltalk.RegularExpression||(typeof RegularExpression=="undefined"?nil:RegularExpression)}
  2994. return smalltalk.withContext(function($ctx1) {
  2995. var $1;
  2996. $1=self._replaceRegexp_with_(_st($RegularExpression())._fromString_flag_(_st("[".__comma(separators)).__comma("]+$"),"g"),"");
  2997. return $1;
  2998. }, function($ctx1) {$ctx1.fill(self,"trimRight:",{separators:separators},smalltalk.String)})},
  2999. messageSends: ["replaceRegexp:with:", "fromString:flag:", ","]}),
  3000. smalltalk.String);
  3001. smalltalk.addMethod(
  3002. smalltalk.method({
  3003. selector: "unescaped",
  3004. fn: function (){
  3005. var self=this;
  3006. return smalltalk.withContext(function($ctx1) {
  3007. return unescape(self);
  3008. return self}, function($ctx1) {$ctx1.fill(self,"unescaped",{},smalltalk.String)})},
  3009. messageSends: []}),
  3010. smalltalk.String);
  3011. smalltalk.addMethod(
  3012. smalltalk.method({
  3013. selector: "withIndexDo:",
  3014. fn: function (aBlock){
  3015. var self=this;
  3016. return smalltalk.withContext(function($ctx1) {
  3017. for(var i=0;i<self.length;i++){aBlock._value_value_(self.charAt(i), i+1);};
  3018. return self}, function($ctx1) {$ctx1.fill(self,"withIndexDo:",{aBlock:aBlock},smalltalk.String)})},
  3019. messageSends: []}),
  3020. smalltalk.String);
  3021. smalltalk.addMethod(
  3022. smalltalk.method({
  3023. selector: "cr",
  3024. fn: function (){
  3025. var self=this;
  3026. return smalltalk.withContext(function($ctx1) {
  3027. return '\r';
  3028. return self}, function($ctx1) {$ctx1.fill(self,"cr",{},smalltalk.String.klass)})},
  3029. messageSends: []}),
  3030. smalltalk.String.klass);
  3031. smalltalk.addMethod(
  3032. smalltalk.method({
  3033. selector: "crlf",
  3034. fn: function (){
  3035. var self=this;
  3036. return smalltalk.withContext(function($ctx1) {
  3037. return '\r\n';
  3038. return self}, function($ctx1) {$ctx1.fill(self,"crlf",{},smalltalk.String.klass)})},
  3039. messageSends: []}),
  3040. smalltalk.String.klass);
  3041. smalltalk.addMethod(
  3042. smalltalk.method({
  3043. selector: "fromCharCode:",
  3044. fn: function (anInteger){
  3045. var self=this;
  3046. return smalltalk.withContext(function($ctx1) {
  3047. return String.fromCharCode(anInteger);
  3048. return self}, function($ctx1) {$ctx1.fill(self,"fromCharCode:",{anInteger:anInteger},smalltalk.String.klass)})},
  3049. messageSends: []}),
  3050. smalltalk.String.klass);
  3051. smalltalk.addMethod(
  3052. smalltalk.method({
  3053. selector: "fromString:",
  3054. fn: function (aString){
  3055. var self=this;
  3056. return smalltalk.withContext(function($ctx1) {
  3057. return String(aString);
  3058. return self}, function($ctx1) {$ctx1.fill(self,"fromString:",{aString:aString},smalltalk.String.klass)})},
  3059. messageSends: []}),
  3060. smalltalk.String.klass);
  3061. smalltalk.addMethod(
  3062. smalltalk.method({
  3063. selector: "lf",
  3064. fn: function (){
  3065. var self=this;
  3066. return smalltalk.withContext(function($ctx1) {
  3067. return '\n';
  3068. return self}, function($ctx1) {$ctx1.fill(self,"lf",{},smalltalk.String.klass)})},
  3069. messageSends: []}),
  3070. smalltalk.String.klass);
  3071. smalltalk.addMethod(
  3072. smalltalk.method({
  3073. selector: "random",
  3074. fn: function (){
  3075. var self=this;
  3076. return smalltalk.withContext(function($ctx1) {
  3077. return (Math.random()*(22/32)+(10/32)).toString(32).slice(2);;
  3078. return self}, function($ctx1) {$ctx1.fill(self,"random",{},smalltalk.String.klass)})},
  3079. messageSends: []}),
  3080. smalltalk.String.klass);
  3081. smalltalk.addMethod(
  3082. smalltalk.method({
  3083. selector: "randomNotIn:",
  3084. fn: function (aString){
  3085. var self=this;
  3086. var result;
  3087. return smalltalk.withContext(function($ctx1) {
  3088. var $1;
  3089. _st((function(){
  3090. return smalltalk.withContext(function($ctx2) {
  3091. result=self._random();
  3092. result;
  3093. return _st(aString)._includesSubString_(result);
  3094. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue();
  3095. $1=result;
  3096. return $1;
  3097. }, function($ctx1) {$ctx1.fill(self,"randomNotIn:",{aString:aString,result:result},smalltalk.String.klass)})},
  3098. messageSends: ["whileTrue", "random", "includesSubString:"]}),
  3099. smalltalk.String.klass);
  3100. smalltalk.addMethod(
  3101. smalltalk.method({
  3102. selector: "space",
  3103. fn: function (){
  3104. var self=this;
  3105. return smalltalk.withContext(function($ctx1) {
  3106. return ' ';
  3107. return self}, function($ctx1) {$ctx1.fill(self,"space",{},smalltalk.String.klass)})},
  3108. messageSends: []}),
  3109. smalltalk.String.klass);
  3110. smalltalk.addMethod(
  3111. smalltalk.method({
  3112. selector: "streamClass",
  3113. fn: function (){
  3114. var self=this;
  3115. function $StringStream(){return smalltalk.StringStream||(typeof StringStream=="undefined"?nil:StringStream)}
  3116. return smalltalk.withContext(function($ctx1) {
  3117. var $1;
  3118. $1=$StringStream();
  3119. return $1;
  3120. }, function($ctx1) {$ctx1.fill(self,"streamClass",{},smalltalk.String.klass)})},
  3121. messageSends: []}),
  3122. smalltalk.String.klass);
  3123. smalltalk.addMethod(
  3124. smalltalk.method({
  3125. selector: "tab",
  3126. fn: function (){
  3127. var self=this;
  3128. return smalltalk.withContext(function($ctx1) {
  3129. return '\t';
  3130. return self}, function($ctx1) {$ctx1.fill(self,"tab",{},smalltalk.String.klass)})},
  3131. messageSends: []}),
  3132. smalltalk.String.klass);
  3133. smalltalk.addMethod(
  3134. smalltalk.method({
  3135. selector: "value:",
  3136. fn: function (aUTFCharCode){
  3137. var self=this;
  3138. return smalltalk.withContext(function($ctx1) {
  3139. return String.fromCharCode(aUTFCharCode);;
  3140. return self}, function($ctx1) {$ctx1.fill(self,"value:",{aUTFCharCode:aUTFCharCode},smalltalk.String.klass)})},
  3141. messageSends: []}),
  3142. smalltalk.String.klass);
  3143. smalltalk.addClass('Set', smalltalk.Collection, ['elements'], 'Kernel-Collections');
  3144. smalltalk.addMethod(
  3145. smalltalk.method({
  3146. selector: "=",
  3147. fn: function (aCollection){
  3148. var self=this;
  3149. return smalltalk.withContext(function($ctx1) {
  3150. var $1,$2,$3;
  3151. var $early={};
  3152. try {
  3153. $1=_st(self._class()).__eq(_st(aCollection)._class());
  3154. if(! smalltalk.assert($1)){
  3155. return false;
  3156. };
  3157. $2=_st(self._size()).__eq(_st(aCollection)._size());
  3158. if(! smalltalk.assert($2)){
  3159. return false;
  3160. };
  3161. self._do_((function(each){
  3162. return smalltalk.withContext(function($ctx2) {
  3163. $3=_st(aCollection)._includes_(each);
  3164. if(! smalltalk.assert($3)){
  3165. throw $early=[false];
  3166. };
  3167. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3168. return true;
  3169. }
  3170. catch(e) {if(e===$early)return e[0]; throw e}
  3171. }, function($ctx1) {$ctx1.fill(self,"=",{aCollection:aCollection},smalltalk.Set)})},
  3172. messageSends: ["ifFalse:", "=", "class", "size", "do:", "includes:"]}),
  3173. smalltalk.Set);
  3174. smalltalk.addMethod(
  3175. smalltalk.method({
  3176. selector: "add:",
  3177. fn: function (anObject){
  3178. var self=this;
  3179. return smalltalk.withContext(function($ctx1) {
  3180. var found;
  3181. for(var i=0; i < self['@elements'].length; i++) {
  3182. if(_st(anObject).__eq(self['@elements'][i])) {
  3183. found = true;
  3184. break;
  3185. }
  3186. }
  3187. if(!found) {self['@elements'].push(anObject)}
  3188. ;
  3189. return self}, function($ctx1) {$ctx1.fill(self,"add:",{anObject:anObject},smalltalk.Set)})},
  3190. messageSends: []}),
  3191. smalltalk.Set);
  3192. smalltalk.addMethod(
  3193. smalltalk.method({
  3194. selector: "asArray",
  3195. fn: function (){
  3196. var self=this;
  3197. return smalltalk.withContext(function($ctx1) {
  3198. var $1;
  3199. $1=_st(self["@elements"])._copy();
  3200. return $1;
  3201. }, function($ctx1) {$ctx1.fill(self,"asArray",{},smalltalk.Set)})},
  3202. messageSends: ["copy"]}),
  3203. smalltalk.Set);
  3204. smalltalk.addMethod(
  3205. smalltalk.method({
  3206. selector: "collect:",
  3207. fn: function (aBlock){
  3208. var self=this;
  3209. return smalltalk.withContext(function($ctx1) {
  3210. var $1;
  3211. $1=_st(self._class())._withAll_(_st(self["@elements"])._collect_(aBlock));
  3212. return $1;
  3213. }, function($ctx1) {$ctx1.fill(self,"collect:",{aBlock:aBlock},smalltalk.Set)})},
  3214. messageSends: ["withAll:", "collect:", "class"]}),
  3215. smalltalk.Set);
  3216. smalltalk.addMethod(
  3217. smalltalk.method({
  3218. selector: "detect:ifNone:",
  3219. fn: function (aBlock,anotherBlock){
  3220. var self=this;
  3221. return smalltalk.withContext(function($ctx1) {
  3222. var $1;
  3223. $1=_st(self["@elements"])._detect_ifNone_(aBlock,anotherBlock);
  3224. return $1;
  3225. }, function($ctx1) {$ctx1.fill(self,"detect:ifNone:",{aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.Set)})},
  3226. messageSends: ["detect:ifNone:"]}),
  3227. smalltalk.Set);
  3228. smalltalk.addMethod(
  3229. smalltalk.method({
  3230. selector: "do:",
  3231. fn: function (aBlock){
  3232. var self=this;
  3233. return smalltalk.withContext(function($ctx1) {
  3234. _st(self["@elements"])._do_(aBlock);
  3235. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.Set)})},
  3236. messageSends: ["do:"]}),
  3237. smalltalk.Set);
  3238. smalltalk.addMethod(
  3239. smalltalk.method({
  3240. selector: "includes:",
  3241. fn: function (anObject){
  3242. var self=this;
  3243. return smalltalk.withContext(function($ctx1) {
  3244. var $1;
  3245. $1=_st(self["@elements"])._includes_(anObject);
  3246. return $1;
  3247. }, function($ctx1) {$ctx1.fill(self,"includes:",{anObject:anObject},smalltalk.Set)})},
  3248. messageSends: ["includes:"]}),
  3249. smalltalk.Set);
  3250. smalltalk.addMethod(
  3251. smalltalk.method({
  3252. selector: "initialize",
  3253. fn: function (){
  3254. var self=this;
  3255. return smalltalk.withContext(function($ctx1) {
  3256. smalltalk.Set.superclass.fn.prototype._initialize.apply(_st(self), []);
  3257. self["@elements"]=[];
  3258. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Set)})},
  3259. messageSends: ["initialize"]}),
  3260. smalltalk.Set);
  3261. smalltalk.addMethod(
  3262. smalltalk.method({
  3263. selector: "printOn:",
  3264. fn: function (aStream){
  3265. var self=this;
  3266. return smalltalk.withContext(function($ctx1) {
  3267. smalltalk.Set.superclass.fn.prototype._printOn_.apply(_st(self), [aStream]);
  3268. _st(aStream)._nextPutAll_(" (");
  3269. self._do_separatedBy_((function(each){
  3270. return smalltalk.withContext(function($ctx2) {
  3271. return _st(each)._printOn_(aStream);
  3272. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  3273. return smalltalk.withContext(function($ctx2) {
  3274. return _st(aStream)._nextPutAll_(" ");
  3275. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3276. _st(aStream)._nextPutAll_(")");
  3277. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Set)})},
  3278. messageSends: ["printOn:", "nextPutAll:", "do:separatedBy:"]}),
  3279. smalltalk.Set);
  3280. smalltalk.addMethod(
  3281. smalltalk.method({
  3282. selector: "remove:",
  3283. fn: function (anObject){
  3284. var self=this;
  3285. return smalltalk.withContext(function($ctx1) {
  3286. _st(self["@elements"])._remove_(anObject);
  3287. return self}, function($ctx1) {$ctx1.fill(self,"remove:",{anObject:anObject},smalltalk.Set)})},
  3288. messageSends: ["remove:"]}),
  3289. smalltalk.Set);
  3290. smalltalk.addMethod(
  3291. smalltalk.method({
  3292. selector: "remove:ifAbsent:",
  3293. fn: function (anObject,aBlock){
  3294. var self=this;
  3295. return smalltalk.withContext(function($ctx1) {
  3296. _st(self["@elements"])._remove_ifAbsent_(anObject,aBlock);
  3297. return self}, function($ctx1) {$ctx1.fill(self,"remove:ifAbsent:",{anObject:anObject,aBlock:aBlock},smalltalk.Set)})},
  3298. messageSends: ["remove:ifAbsent:"]}),
  3299. smalltalk.Set);
  3300. smalltalk.addMethod(
  3301. smalltalk.method({
  3302. selector: "select:",
  3303. fn: function (aBlock){
  3304. var self=this;
  3305. var collection;
  3306. return smalltalk.withContext(function($ctx1) {
  3307. var $1,$2;
  3308. collection=_st(self._class())._new();
  3309. self._do_((function(each){
  3310. return smalltalk.withContext(function($ctx2) {
  3311. $1=_st(aBlock)._value_(each);
  3312. if(smalltalk.assert($1)){
  3313. return _st(collection)._add_(each);
  3314. };
  3315. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3316. $2=collection;
  3317. return $2;
  3318. }, function($ctx1) {$ctx1.fill(self,"select:",{aBlock:aBlock,collection:collection},smalltalk.Set)})},
  3319. messageSends: ["new", "class", "do:", "ifTrue:", "add:", "value:"]}),
  3320. smalltalk.Set);
  3321. smalltalk.addMethod(
  3322. smalltalk.method({
  3323. selector: "size",
  3324. fn: function (){
  3325. var self=this;
  3326. return smalltalk.withContext(function($ctx1) {
  3327. var $1;
  3328. $1=_st(self["@elements"])._size();
  3329. return $1;
  3330. }, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.Set)})},
  3331. messageSends: ["size"]}),
  3332. smalltalk.Set);
  3333. smalltalk.addClass('Queue', smalltalk.Object, ['read', 'readIndex', 'write'], 'Kernel-Collections');
  3334. smalltalk.addMethod(
  3335. smalltalk.method({
  3336. selector: "initialize",
  3337. fn: function (){
  3338. var self=this;
  3339. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  3340. return smalltalk.withContext(function($ctx1) {
  3341. smalltalk.Queue.superclass.fn.prototype._initialize.apply(_st(self), []);
  3342. self["@read"]=_st($OrderedCollection())._new();
  3343. self["@write"]=_st($OrderedCollection())._new();
  3344. self["@readIndex"]=(1);
  3345. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Queue)})},
  3346. messageSends: ["initialize", "new"]}),
  3347. smalltalk.Queue);
  3348. smalltalk.addMethod(
  3349. smalltalk.method({
  3350. selector: "next",
  3351. fn: function (){
  3352. var self=this;
  3353. return smalltalk.withContext(function($ctx1) {
  3354. var $1;
  3355. $1=self._nextIfAbsent_((function(){
  3356. return smalltalk.withContext(function($ctx2) {
  3357. return self._error_("Cannot read from empty Queue.");
  3358. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3359. return $1;
  3360. }, function($ctx1) {$ctx1.fill(self,"next",{},smalltalk.Queue)})},
  3361. messageSends: ["nextIfAbsent:", "error:"]}),
  3362. smalltalk.Queue);
  3363. smalltalk.addMethod(
  3364. smalltalk.method({
  3365. selector: "nextIfAbsent:",
  3366. fn: function (aBlock){
  3367. var self=this;
  3368. var result;
  3369. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  3370. return smalltalk.withContext(function($ctx1) {
  3371. var $1,$2,$3,$4;
  3372. var $early={};
  3373. try {
  3374. result=_st(self["@read"])._at_ifAbsent_(self["@readIndex"],(function(){
  3375. return smalltalk.withContext(function($ctx2) {
  3376. $1=_st(self["@write"])._isEmpty();
  3377. if(smalltalk.assert($1)){
  3378. $2=_st(self["@readIndex"]).__gt((1));
  3379. if(smalltalk.assert($2)){
  3380. self["@read"]=[];
  3381. self["@read"];
  3382. self["@readIndex"]=(1);
  3383. self["@readIndex"];
  3384. };
  3385. $3=_st(aBlock)._value();
  3386. throw $early=[$3];
  3387. };
  3388. self["@read"]=self["@write"];
  3389. self["@read"];
  3390. self["@readIndex"]=(1);
  3391. self["@readIndex"];
  3392. self["@write"]=_st($OrderedCollection())._new();
  3393. self["@write"];
  3394. return _st(self["@read"])._first();
  3395. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3396. _st(self["@read"])._at_put_(self["@readIndex"],nil);
  3397. self["@readIndex"]=_st(self["@readIndex"]).__plus((1));
  3398. $4=result;
  3399. return $4;
  3400. }
  3401. catch(e) {if(e===$early)return e[0]; throw e}
  3402. }, function($ctx1) {$ctx1.fill(self,"nextIfAbsent:",{aBlock:aBlock,result:result},smalltalk.Queue)})},
  3403. messageSends: ["at:ifAbsent:", "ifTrue:", ">", "value", "isEmpty", "new", "first", "at:put:", "+"]}),
  3404. smalltalk.Queue);
  3405. smalltalk.addMethod(
  3406. smalltalk.method({
  3407. selector: "nextPut:",
  3408. fn: function (anObject){
  3409. var self=this;
  3410. return smalltalk.withContext(function($ctx1) {
  3411. _st(self["@write"])._add_(anObject);
  3412. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{anObject:anObject},smalltalk.Queue)})},
  3413. messageSends: ["add:"]}),
  3414. smalltalk.Queue);
  3415. smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel-Collections');
  3416. smalltalk.addMethod(
  3417. smalltalk.method({
  3418. selector: "compile:",
  3419. fn: function (aString){
  3420. var self=this;
  3421. return smalltalk.withContext(function($ctx1) {
  3422. return self.compile(aString);
  3423. return self}, function($ctx1) {$ctx1.fill(self,"compile:",{aString:aString},smalltalk.RegularExpression)})},
  3424. messageSends: []}),
  3425. smalltalk.RegularExpression);
  3426. smalltalk.addMethod(
  3427. smalltalk.method({
  3428. selector: "exec:",
  3429. fn: function (aString){
  3430. var self=this;
  3431. return smalltalk.withContext(function($ctx1) {
  3432. return self.exec(aString) || nil;
  3433. return self}, function($ctx1) {$ctx1.fill(self,"exec:",{aString:aString},smalltalk.RegularExpression)})},
  3434. messageSends: []}),
  3435. smalltalk.RegularExpression);
  3436. smalltalk.addMethod(
  3437. smalltalk.method({
  3438. selector: "test:",
  3439. fn: function (aString){
  3440. var self=this;
  3441. return smalltalk.withContext(function($ctx1) {
  3442. return self.test(aString);
  3443. return self}, function($ctx1) {$ctx1.fill(self,"test:",{aString:aString},smalltalk.RegularExpression)})},
  3444. messageSends: []}),
  3445. smalltalk.RegularExpression);
  3446. smalltalk.addMethod(
  3447. smalltalk.method({
  3448. selector: "fromString:",
  3449. fn: function (aString){
  3450. var self=this;
  3451. return smalltalk.withContext(function($ctx1) {
  3452. var $1;
  3453. $1=self._fromString_flag_(aString,"");
  3454. return $1;
  3455. }, function($ctx1) {$ctx1.fill(self,"fromString:",{aString:aString},smalltalk.RegularExpression.klass)})},
  3456. messageSends: ["fromString:flag:"]}),
  3457. smalltalk.RegularExpression.klass);
  3458. smalltalk.addMethod(
  3459. smalltalk.method({
  3460. selector: "fromString:flag:",
  3461. fn: function (aString,anotherString){
  3462. var self=this;
  3463. return smalltalk.withContext(function($ctx1) {
  3464. return new RegExp(aString, anotherString);
  3465. return self}, function($ctx1) {$ctx1.fill(self,"fromString:flag:",{aString:aString,anotherString:anotherString},smalltalk.RegularExpression.klass)})},
  3466. messageSends: []}),
  3467. smalltalk.RegularExpression.klass);
  3468. smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel-Collections');
  3469. smalltalk.addMethod(
  3470. smalltalk.method({
  3471. selector: "<<",
  3472. fn: function (anObject){
  3473. var self=this;
  3474. return smalltalk.withContext(function($ctx1) {
  3475. self._write_(anObject);
  3476. return self}, function($ctx1) {$ctx1.fill(self,"<<",{anObject:anObject},smalltalk.Stream)})},
  3477. messageSends: ["write:"]}),
  3478. smalltalk.Stream);
  3479. smalltalk.addMethod(
  3480. smalltalk.method({
  3481. selector: "atEnd",
  3482. fn: function (){
  3483. var self=this;
  3484. return smalltalk.withContext(function($ctx1) {
  3485. var $1;
  3486. $1=_st(self._position()).__eq(self._size());
  3487. return $1;
  3488. }, function($ctx1) {$ctx1.fill(self,"atEnd",{},smalltalk.Stream)})},
  3489. messageSends: ["=", "size", "position"]}),
  3490. smalltalk.Stream);
  3491. smalltalk.addMethod(
  3492. smalltalk.method({
  3493. selector: "atStart",
  3494. fn: function (){
  3495. var self=this;
  3496. return smalltalk.withContext(function($ctx1) {
  3497. var $1;
  3498. $1=_st(self._position()).__eq((0));
  3499. return $1;
  3500. }, function($ctx1) {$ctx1.fill(self,"atStart",{},smalltalk.Stream)})},
  3501. messageSends: ["=", "position"]}),
  3502. smalltalk.Stream);
  3503. smalltalk.addMethod(
  3504. smalltalk.method({
  3505. selector: "close",
  3506. fn: function (){
  3507. var self=this;
  3508. return smalltalk.withContext(function($ctx1) {
  3509. return self}, function($ctx1) {$ctx1.fill(self,"close",{},smalltalk.Stream)})},
  3510. messageSends: []}),
  3511. smalltalk.Stream);
  3512. smalltalk.addMethod(
  3513. smalltalk.method({
  3514. selector: "collection",
  3515. fn: function (){
  3516. var self=this;
  3517. return smalltalk.withContext(function($ctx1) {
  3518. var $1;
  3519. $1=self["@collection"];
  3520. return $1;
  3521. }, function($ctx1) {$ctx1.fill(self,"collection",{},smalltalk.Stream)})},
  3522. messageSends: []}),
  3523. smalltalk.Stream);
  3524. smalltalk.addMethod(
  3525. smalltalk.method({
  3526. selector: "contents",
  3527. fn: function (){
  3528. var self=this;
  3529. return smalltalk.withContext(function($ctx1) {
  3530. var $1;
  3531. $1=_st(self._collection())._copyFrom_to_((1),self._streamSize());
  3532. return $1;
  3533. }, function($ctx1) {$ctx1.fill(self,"contents",{},smalltalk.Stream)})},
  3534. messageSends: ["copyFrom:to:", "streamSize", "collection"]}),
  3535. smalltalk.Stream);
  3536. smalltalk.addMethod(
  3537. smalltalk.method({
  3538. selector: "do:",
  3539. fn: function (aBlock){
  3540. var self=this;
  3541. return smalltalk.withContext(function($ctx1) {
  3542. _st((function(){
  3543. return smalltalk.withContext(function($ctx2) {
  3544. return self._atEnd();
  3545. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  3546. return smalltalk.withContext(function($ctx2) {
  3547. return _st(aBlock)._value_(self._next());
  3548. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3549. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.Stream)})},
  3550. messageSends: ["whileFalse:", "value:", "next", "atEnd"]}),
  3551. smalltalk.Stream);
  3552. smalltalk.addMethod(
  3553. smalltalk.method({
  3554. selector: "flush",
  3555. fn: function (){
  3556. var self=this;
  3557. return smalltalk.withContext(function($ctx1) {
  3558. return self}, function($ctx1) {$ctx1.fill(self,"flush",{},smalltalk.Stream)})},
  3559. messageSends: []}),
  3560. smalltalk.Stream);
  3561. smalltalk.addMethod(
  3562. smalltalk.method({
  3563. selector: "isEmpty",
  3564. fn: function (){
  3565. var self=this;
  3566. return smalltalk.withContext(function($ctx1) {
  3567. var $1;
  3568. $1=_st(self._size()).__eq((0));
  3569. return $1;
  3570. }, function($ctx1) {$ctx1.fill(self,"isEmpty",{},smalltalk.Stream)})},
  3571. messageSends: ["=", "size"]}),
  3572. smalltalk.Stream);
  3573. smalltalk.addMethod(
  3574. smalltalk.method({
  3575. selector: "next",
  3576. fn: function (){
  3577. var self=this;
  3578. return smalltalk.withContext(function($ctx1) {
  3579. var $2,$1;
  3580. $2=self._atEnd();
  3581. if(smalltalk.assert($2)){
  3582. $1=nil;
  3583. } else {
  3584. self._position_(_st(self._position()).__plus((1)));
  3585. $1=_st(self["@collection"])._at_(self._position());
  3586. };
  3587. return $1;
  3588. }, function($ctx1) {$ctx1.fill(self,"next",{},smalltalk.Stream)})},
  3589. messageSends: ["ifTrue:ifFalse:", "position:", "+", "position", "at:", "atEnd"]}),
  3590. smalltalk.Stream);
  3591. smalltalk.addMethod(
  3592. smalltalk.method({
  3593. selector: "next:",
  3594. fn: function (anInteger){
  3595. var self=this;
  3596. var tempCollection;
  3597. return smalltalk.withContext(function($ctx1) {
  3598. var $1,$2;
  3599. tempCollection=_st(_st(self._collection())._class())._new();
  3600. _st(anInteger)._timesRepeat_((function(){
  3601. return smalltalk.withContext(function($ctx2) {
  3602. $1=self._atEnd();
  3603. if(! smalltalk.assert($1)){
  3604. return _st(tempCollection)._add_(self._next());
  3605. };
  3606. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3607. $2=tempCollection;
  3608. return $2;
  3609. }, function($ctx1) {$ctx1.fill(self,"next:",{anInteger:anInteger,tempCollection:tempCollection},smalltalk.Stream)})},
  3610. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", "add:", "next", "atEnd"]}),
  3611. smalltalk.Stream);
  3612. smalltalk.addMethod(
  3613. smalltalk.method({
  3614. selector: "nextPut:",
  3615. fn: function (anObject){
  3616. var self=this;
  3617. return smalltalk.withContext(function($ctx1) {
  3618. self._position_(_st(self._position()).__plus((1)));
  3619. _st(self._collection())._at_put_(self._position(),anObject);
  3620. self._setStreamSize_(_st(self._streamSize())._max_(self._position()));
  3621. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{anObject:anObject},smalltalk.Stream)})},
  3622. messageSends: ["position:", "+", "position", "at:put:", "collection", "setStreamSize:", "max:", "streamSize"]}),
  3623. smalltalk.Stream);
  3624. smalltalk.addMethod(
  3625. smalltalk.method({
  3626. selector: "nextPutAll:",
  3627. fn: function (aCollection){
  3628. var self=this;
  3629. return smalltalk.withContext(function($ctx1) {
  3630. _st(aCollection)._do_((function(each){
  3631. return smalltalk.withContext(function($ctx2) {
  3632. return self._nextPut_(each);
  3633. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3634. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAll:",{aCollection:aCollection},smalltalk.Stream)})},
  3635. messageSends: ["do:", "nextPut:"]}),
  3636. smalltalk.Stream);
  3637. smalltalk.addMethod(
  3638. smalltalk.method({
  3639. selector: "nextPutString:",
  3640. fn: function (aString){
  3641. var self=this;
  3642. return smalltalk.withContext(function($ctx1) {
  3643. self._nextPut_(aString);
  3644. return self}, function($ctx1) {$ctx1.fill(self,"nextPutString:",{aString:aString},smalltalk.Stream)})},
  3645. messageSends: ["nextPut:"]}),
  3646. smalltalk.Stream);
  3647. smalltalk.addMethod(
  3648. smalltalk.method({
  3649. selector: "peek",
  3650. fn: function (){
  3651. var self=this;
  3652. return smalltalk.withContext(function($ctx1) {
  3653. var $2,$1;
  3654. $2=self._atEnd();
  3655. if(! smalltalk.assert($2)){
  3656. $1=_st(self._collection())._at_(_st(self._position()).__plus((1)));
  3657. };
  3658. return $1;
  3659. }, function($ctx1) {$ctx1.fill(self,"peek",{},smalltalk.Stream)})},
  3660. messageSends: ["ifFalse:", "at:", "+", "position", "collection", "atEnd"]}),
  3661. smalltalk.Stream);
  3662. smalltalk.addMethod(
  3663. smalltalk.method({
  3664. selector: "position",
  3665. fn: function (){
  3666. var self=this;
  3667. return smalltalk.withContext(function($ctx1) {
  3668. var $2,$1;
  3669. $2=self["@position"];
  3670. if(($receiver = $2) == nil || $receiver == undefined){
  3671. self["@position"]=(0);
  3672. $1=self["@position"];
  3673. } else {
  3674. $1=$2;
  3675. };
  3676. return $1;
  3677. }, function($ctx1) {$ctx1.fill(self,"position",{},smalltalk.Stream)})},
  3678. messageSends: ["ifNil:"]}),
  3679. smalltalk.Stream);
  3680. smalltalk.addMethod(
  3681. smalltalk.method({
  3682. selector: "position:",
  3683. fn: function (anInteger){
  3684. var self=this;
  3685. return smalltalk.withContext(function($ctx1) {
  3686. self["@position"]=anInteger;
  3687. return self}, function($ctx1) {$ctx1.fill(self,"position:",{anInteger:anInteger},smalltalk.Stream)})},
  3688. messageSends: []}),
  3689. smalltalk.Stream);
  3690. smalltalk.addMethod(
  3691. smalltalk.method({
  3692. selector: "reset",
  3693. fn: function (){
  3694. var self=this;
  3695. return smalltalk.withContext(function($ctx1) {
  3696. self._position_((0));
  3697. return self}, function($ctx1) {$ctx1.fill(self,"reset",{},smalltalk.Stream)})},
  3698. messageSends: ["position:"]}),
  3699. smalltalk.Stream);
  3700. smalltalk.addMethod(
  3701. smalltalk.method({
  3702. selector: "resetContents",
  3703. fn: function (){
  3704. var self=this;
  3705. return smalltalk.withContext(function($ctx1) {
  3706. self._reset();
  3707. self._setStreamSize_((0));
  3708. return self}, function($ctx1) {$ctx1.fill(self,"resetContents",{},smalltalk.Stream)})},
  3709. messageSends: ["reset", "setStreamSize:"]}),
  3710. smalltalk.Stream);
  3711. smalltalk.addMethod(
  3712. smalltalk.method({
  3713. selector: "setCollection:",
  3714. fn: function (aCollection){
  3715. var self=this;
  3716. return smalltalk.withContext(function($ctx1) {
  3717. self["@collection"]=aCollection;
  3718. return self}, function($ctx1) {$ctx1.fill(self,"setCollection:",{aCollection:aCollection},smalltalk.Stream)})},
  3719. messageSends: []}),
  3720. smalltalk.Stream);
  3721. smalltalk.addMethod(
  3722. smalltalk.method({
  3723. selector: "setStreamSize:",
  3724. fn: function (anInteger){
  3725. var self=this;
  3726. return smalltalk.withContext(function($ctx1) {
  3727. self["@streamSize"]=anInteger;
  3728. return self}, function($ctx1) {$ctx1.fill(self,"setStreamSize:",{anInteger:anInteger},smalltalk.Stream)})},
  3729. messageSends: []}),
  3730. smalltalk.Stream);
  3731. smalltalk.addMethod(
  3732. smalltalk.method({
  3733. selector: "setToEnd",
  3734. fn: function (){
  3735. var self=this;
  3736. return smalltalk.withContext(function($ctx1) {
  3737. self._position_(self._size());
  3738. return self}, function($ctx1) {$ctx1.fill(self,"setToEnd",{},smalltalk.Stream)})},
  3739. messageSends: ["position:", "size"]}),
  3740. smalltalk.Stream);
  3741. smalltalk.addMethod(
  3742. smalltalk.method({
  3743. selector: "size",
  3744. fn: function (){
  3745. var self=this;
  3746. return smalltalk.withContext(function($ctx1) {
  3747. var $1;
  3748. $1=self._streamSize();
  3749. return $1;
  3750. }, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.Stream)})},
  3751. messageSends: ["streamSize"]}),
  3752. smalltalk.Stream);
  3753. smalltalk.addMethod(
  3754. smalltalk.method({
  3755. selector: "skip:",
  3756. fn: function (anInteger){
  3757. var self=this;
  3758. return smalltalk.withContext(function($ctx1) {
  3759. self._position_(_st(_st(self._position()).__plus(anInteger))._min_max_(self._size(),(0)));
  3760. return self}, function($ctx1) {$ctx1.fill(self,"skip:",{anInteger:anInteger},smalltalk.Stream)})},
  3761. messageSends: ["position:", "min:max:", "size", "+", "position"]}),
  3762. smalltalk.Stream);
  3763. smalltalk.addMethod(
  3764. smalltalk.method({
  3765. selector: "streamSize",
  3766. fn: function (){
  3767. var self=this;
  3768. return smalltalk.withContext(function($ctx1) {
  3769. var $1;
  3770. $1=self["@streamSize"];
  3771. return $1;
  3772. }, function($ctx1) {$ctx1.fill(self,"streamSize",{},smalltalk.Stream)})},
  3773. messageSends: []}),
  3774. smalltalk.Stream);
  3775. smalltalk.addMethod(
  3776. smalltalk.method({
  3777. selector: "write:",
  3778. fn: function (anObject){
  3779. var self=this;
  3780. return smalltalk.withContext(function($ctx1) {
  3781. _st(anObject)._putOn_(self);
  3782. return self}, function($ctx1) {$ctx1.fill(self,"write:",{anObject:anObject},smalltalk.Stream)})},
  3783. messageSends: ["putOn:"]}),
  3784. smalltalk.Stream);
  3785. smalltalk.addMethod(
  3786. smalltalk.method({
  3787. selector: "on:",
  3788. fn: function (aCollection){
  3789. var self=this;
  3790. return smalltalk.withContext(function($ctx1) {
  3791. var $2,$3,$1;
  3792. $2=self._new();
  3793. _st($2)._setCollection_(aCollection);
  3794. _st($2)._setStreamSize_(_st(aCollection)._size());
  3795. $3=_st($2)._yourself();
  3796. $1=$3;
  3797. return $1;
  3798. }, function($ctx1) {$ctx1.fill(self,"on:",{aCollection:aCollection},smalltalk.Stream.klass)})},
  3799. messageSends: ["setCollection:", "new", "setStreamSize:", "size", "yourself"]}),
  3800. smalltalk.Stream.klass);
  3801. smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel-Collections');
  3802. smalltalk.addMethod(
  3803. smalltalk.method({
  3804. selector: "cr",
  3805. fn: function (){
  3806. var self=this;
  3807. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  3808. return smalltalk.withContext(function($ctx1) {
  3809. var $1;
  3810. $1=self._nextPutAll_(_st($String())._cr());
  3811. return $1;
  3812. }, function($ctx1) {$ctx1.fill(self,"cr",{},smalltalk.StringStream)})},
  3813. messageSends: ["nextPutAll:", "cr"]}),
  3814. smalltalk.StringStream);
  3815. smalltalk.addMethod(
  3816. smalltalk.method({
  3817. selector: "crlf",
  3818. fn: function (){
  3819. var self=this;
  3820. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  3821. return smalltalk.withContext(function($ctx1) {
  3822. var $1;
  3823. $1=self._nextPutAll_(_st($String())._crlf());
  3824. return $1;
  3825. }, function($ctx1) {$ctx1.fill(self,"crlf",{},smalltalk.StringStream)})},
  3826. messageSends: ["nextPutAll:", "crlf"]}),
  3827. smalltalk.StringStream);
  3828. smalltalk.addMethod(
  3829. smalltalk.method({
  3830. selector: "lf",
  3831. fn: function (){
  3832. var self=this;
  3833. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  3834. return smalltalk.withContext(function($ctx1) {
  3835. var $1;
  3836. $1=self._nextPutAll_(_st($String())._lf());
  3837. return $1;
  3838. }, function($ctx1) {$ctx1.fill(self,"lf",{},smalltalk.StringStream)})},
  3839. messageSends: ["nextPutAll:", "lf"]}),
  3840. smalltalk.StringStream);
  3841. smalltalk.addMethod(
  3842. smalltalk.method({
  3843. selector: "next:",
  3844. fn: function (anInteger){
  3845. var self=this;
  3846. var tempCollection;
  3847. return smalltalk.withContext(function($ctx1) {
  3848. var $1,$2;
  3849. tempCollection=_st(_st(self._collection())._class())._new();
  3850. _st(anInteger)._timesRepeat_((function(){
  3851. return smalltalk.withContext(function($ctx2) {
  3852. $1=self._atEnd();
  3853. if(! smalltalk.assert($1)){
  3854. tempCollection=_st(tempCollection).__comma(self._next());
  3855. return tempCollection;
  3856. };
  3857. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3858. $2=tempCollection;
  3859. return $2;
  3860. }, function($ctx1) {$ctx1.fill(self,"next:",{anInteger:anInteger,tempCollection:tempCollection},smalltalk.StringStream)})},
  3861. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", ",", "next", "atEnd"]}),
  3862. smalltalk.StringStream);
  3863. smalltalk.addMethod(
  3864. smalltalk.method({
  3865. selector: "nextPut:",
  3866. fn: function (aString){
  3867. var self=this;
  3868. return smalltalk.withContext(function($ctx1) {
  3869. self._nextPutAll_(aString);
  3870. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{aString:aString},smalltalk.StringStream)})},
  3871. messageSends: ["nextPutAll:"]}),
  3872. smalltalk.StringStream);
  3873. smalltalk.addMethod(
  3874. smalltalk.method({
  3875. selector: "nextPutAll:",
  3876. fn: function (aString){
  3877. var self=this;
  3878. var pre,post;
  3879. return smalltalk.withContext(function($ctx1) {
  3880. var $1;
  3881. $1=self._atEnd();
  3882. if(smalltalk.assert($1)){
  3883. self._setCollection_(_st(self._collection()).__comma(aString));
  3884. } else {
  3885. pre=_st(self._collection())._copyFrom_to_((1),self._position());
  3886. pre;
  3887. post=_st(self._collection())._copyFrom_to_(_st(_st(self._position()).__plus((1))).__plus(_st(aString)._size()),_st(self._collection())._size());
  3888. post;
  3889. self._setCollection_(_st(_st(pre).__comma(aString)).__comma(post));
  3890. };
  3891. self._position_(_st(self._position()).__plus(_st(aString)._size()));
  3892. self._setStreamSize_(_st(self._streamSize())._max_(self._position()));
  3893. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAll:",{aString:aString,pre:pre,post:post},smalltalk.StringStream)})},
  3894. messageSends: ["ifTrue:ifFalse:", "setCollection:", ",", "collection", "copyFrom:to:", "position", "+", "size", "atEnd", "position:", "setStreamSize:", "max:", "streamSize"]}),
  3895. smalltalk.StringStream);
  3896. smalltalk.addMethod(
  3897. smalltalk.method({
  3898. selector: "nextPutString:",
  3899. fn: function (aString){
  3900. var self=this;
  3901. return smalltalk.withContext(function($ctx1) {
  3902. self._nextPutAll_(aString);
  3903. return self}, function($ctx1) {$ctx1.fill(self,"nextPutString:",{aString:aString},smalltalk.StringStream)})},
  3904. messageSends: ["nextPutAll:"]}),
  3905. smalltalk.StringStream);
  3906. smalltalk.addMethod(
  3907. smalltalk.method({
  3908. selector: "space",
  3909. fn: function (){
  3910. var self=this;
  3911. return smalltalk.withContext(function($ctx1) {
  3912. self._nextPut_(" ");
  3913. return self}, function($ctx1) {$ctx1.fill(self,"space",{},smalltalk.StringStream)})},
  3914. messageSends: ["nextPut:"]}),
  3915. smalltalk.StringStream);
  3916. smalltalk.addMethod(
  3917. smalltalk.method({
  3918. selector: "tab",
  3919. fn: function (){
  3920. var self=this;
  3921. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  3922. return smalltalk.withContext(function($ctx1) {
  3923. var $1;
  3924. $1=self._nextPutAll_(_st($String())._tab());
  3925. return $1;
  3926. }, function($ctx1) {$ctx1.fill(self,"tab",{},smalltalk.StringStream)})},
  3927. messageSends: ["nextPutAll:", "tab"]}),
  3928. smalltalk.StringStream);