1
0

Kernel-Collections.deploy.js 89 KB

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