Kernel-Collections.deploy.js 93 KB

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