Kernel-Collections.js 133 KB

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