1
0

Kernel-Collections.deploy.js 116 KB

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