Kernel-Collections.deploy.js 89 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099
  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. var keys = [];
  701. for(var i in self) {
  702. if(self.hasOwnProperty(i)) {
  703. keys.push(i);
  704. }
  705. };
  706. return keys;
  707. ;
  708. return self;}
  709. }),
  710. smalltalk.HashedCollection);
  711. smalltalk.addMethod(
  712. unescape('_keysAndValuesDo_'),
  713. smalltalk.method({
  714. selector: unescape('keysAndValuesDo%3A'),
  715. fn: function (aBlock) {
  716. var self=this;
  717. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(aBlock, "_value_value_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  718. return self;}
  719. }),
  720. smalltalk.HashedCollection);
  721. smalltalk.addMethod(
  722. unescape('_printString'),
  723. smalltalk.method({
  724. selector: unescape('printString'),
  725. fn: function () {
  726. var self=this;
  727. 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")]);})]);
  728. return self;}
  729. }),
  730. smalltalk.HashedCollection);
  731. smalltalk.addMethod(
  732. unescape('_remove_ifAbsent_'),
  733. smalltalk.method({
  734. selector: unescape('remove%3AifAbsent%3A'),
  735. fn: function (aKey, aBlock) {
  736. var self=this;
  737. return smalltalk.send(self, "_removeKey_ifAbsent_", [aKey, aBlock]);
  738. return self;}
  739. }),
  740. smalltalk.HashedCollection);
  741. smalltalk.addMethod(
  742. unescape('_removeKey_'),
  743. smalltalk.method({
  744. selector: unescape('removeKey%3A'),
  745. fn: function (aKey) {
  746. var self=this;
  747. return smalltalk.send(self, "_remove_", [aKey]);
  748. return self;}
  749. }),
  750. smalltalk.HashedCollection);
  751. smalltalk.addMethod(
  752. unescape('_removeKey_ifAbsent_'),
  753. smalltalk.method({
  754. selector: unescape('removeKey%3AifAbsent%3A'),
  755. fn: function (aKey, aBlock) {
  756. var self=this;
  757. 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]);})]));
  758. return self;}
  759. }),
  760. smalltalk.HashedCollection);
  761. smalltalk.addMethod(
  762. unescape('_select_'),
  763. smalltalk.method({
  764. selector: unescape('select%3A'),
  765. fn: function (aBlock) {
  766. var self=this;
  767. var newDict=nil;
  768. (newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
  769. 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]);})]));})]);
  770. return newDict;
  771. return self;}
  772. }),
  773. smalltalk.HashedCollection);
  774. smalltalk.addMethod(
  775. unescape('_shallowCopy'),
  776. smalltalk.method({
  777. selector: unescape('shallowCopy'),
  778. fn: function () {
  779. var self=this;
  780. var copy=nil;
  781. (copy=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
  782. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(copy, "_at_put_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  783. return copy;
  784. return self;}
  785. }),
  786. smalltalk.HashedCollection);
  787. smalltalk.addMethod(
  788. unescape('_size'),
  789. smalltalk.method({
  790. selector: unescape('size'),
  791. fn: function () {
  792. var self=this;
  793. return smalltalk.send(smalltalk.send(self, "_keys", []), "_size", []);
  794. return self;}
  795. }),
  796. smalltalk.HashedCollection);
  797. smalltalk.addMethod(
  798. unescape('_storeOn_'),
  799. smalltalk.method({
  800. selector: unescape('storeOn%3A'),
  801. fn: function (aStream) {
  802. var self=this;
  803. smalltalk.send(aStream, "_nextPutAll_", [unescape("%23%7B")]);
  804. smalltalk.send(smalltalk.send(self, "_associations", []), "_do_separatedBy_", [(function(each){return smalltalk.send(each, "_storeOn_", [aStream]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [". "]);})]);
  805. smalltalk.send(aStream, "_nextPutAll_", [unescape("%7D")]);
  806. return self;}
  807. }),
  808. smalltalk.HashedCollection);
  809. smalltalk.addMethod(
  810. unescape('_values'),
  811. smalltalk.method({
  812. selector: unescape('values'),
  813. fn: function () {
  814. var self=this;
  815. return smalltalk.send(smalltalk.send(self, "_keys", []), "_collect_", [(function(each){return smalltalk.send(self, "_at_", [each]);})]);
  816. return self;}
  817. }),
  818. smalltalk.HashedCollection);
  819. smalltalk.addMethod(
  820. unescape('_fromPairs_'),
  821. smalltalk.method({
  822. selector: unescape('fromPairs%3A'),
  823. fn: function (aCollection) {
  824. var self=this;
  825. var dict=nil;
  826. (dict=smalltalk.send(self, "_new", []));
  827. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(dict, "_add_", [each]);})]);
  828. return dict;
  829. return self;}
  830. }),
  831. smalltalk.HashedCollection.klass);
  832. smalltalk.addClass('Dictionary', smalltalk.HashedCollection, ['keys', 'values'], 'Kernel-Collections');
  833. smalltalk.addMethod(
  834. unescape('_asHashedCollection'),
  835. smalltalk.method({
  836. selector: unescape('asHashedCollection'),
  837. fn: function () {
  838. var self=this;
  839. return smalltalk.send((smalltalk.HashedCollection || HashedCollection), "_fromPairs_", [smalltalk.send(self, "_associations", [])]);
  840. return self;}
  841. }),
  842. smalltalk.Dictionary);
  843. smalltalk.addMethod(
  844. unescape('_asJSON'),
  845. smalltalk.method({
  846. selector: unescape('asJSON'),
  847. fn: function () {
  848. var self=this;
  849. return smalltalk.send(smalltalk.send(self, "_asHashedCollection", []), "_asJSON", []);
  850. return self;}
  851. }),
  852. smalltalk.Dictionary);
  853. smalltalk.addMethod(
  854. unescape('_at_ifAbsent_'),
  855. smalltalk.method({
  856. selector: unescape('at%3AifAbsent%3A'),
  857. fn: function (aKey, aBlock) {
  858. var self=this;
  859. var index;
  860. for(var i=0;i<self['@keys'].length;i++){
  861. if(self['@keys'][i].__eq(aKey)) {index = i;}
  862. };
  863. if(typeof index === 'undefined') {
  864. return aBlock();
  865. } else {
  866. return self['@values'][index];
  867. }
  868. ;
  869. return self;}
  870. }),
  871. smalltalk.Dictionary);
  872. smalltalk.addMethod(
  873. unescape('_at_put_'),
  874. smalltalk.method({
  875. selector: unescape('at%3Aput%3A'),
  876. fn: function (aKey, aValue) {
  877. var self=this;
  878. var index = self['@keys'].indexOf(aKey);
  879. if(index === -1) {
  880. self['@values'].push(aValue);
  881. self['@keys'].push(aKey);
  882. } else {
  883. self['@values'][index] = aValue;
  884. };
  885. return aValue;
  886. ;
  887. return self;}
  888. }),
  889. smalltalk.Dictionary);
  890. smalltalk.addMethod(
  891. unescape('_includesKey_'),
  892. smalltalk.method({
  893. selector: unescape('includesKey%3A'),
  894. fn: function (aKey) {
  895. var self=this;
  896. return smalltalk.send(self['@keys'], "_includes_", [aKey]);
  897. return self;}
  898. }),
  899. smalltalk.Dictionary);
  900. smalltalk.addMethod(
  901. unescape('_initialize'),
  902. smalltalk.method({
  903. selector: unescape('initialize'),
  904. fn: function () {
  905. var self=this;
  906. smalltalk.send(self, "_initialize", [], smalltalk.HashedCollection);
  907. (self['@keys']=[]);
  908. (self['@values']=[]);
  909. return self;}
  910. }),
  911. smalltalk.Dictionary);
  912. smalltalk.addMethod(
  913. unescape('_keys'),
  914. smalltalk.method({
  915. selector: unescape('keys'),
  916. fn: function () {
  917. var self=this;
  918. return smalltalk.send(self['@keys'], "_copy", []);
  919. return self;}
  920. }),
  921. smalltalk.Dictionary);
  922. smalltalk.addMethod(
  923. unescape('_removeKey_ifAbsent_'),
  924. smalltalk.method({
  925. selector: unescape('removeKey%3AifAbsent%3A'),
  926. fn: function (aKey, aBlock) {
  927. var self=this;
  928. var index = self['@keys'].indexOf(aKey);
  929. if(index === -1) {
  930. return aBlock()
  931. } else {
  932. var value;
  933. self['@keys'].splice(index, 1);
  934. value = self['@values'].splice(index, 1);
  935. return value[0];
  936. };
  937. ;
  938. return self;}
  939. }),
  940. smalltalk.Dictionary);
  941. smalltalk.addMethod(
  942. unescape('_values'),
  943. smalltalk.method({
  944. selector: unescape('values'),
  945. fn: function () {
  946. var self=this;
  947. return smalltalk.send(self['@values'], "_copy", []);
  948. return self;}
  949. }),
  950. smalltalk.Dictionary);
  951. smalltalk.addClass('SequenceableCollection', smalltalk.Collection, [], 'Kernel-Collections');
  952. smalltalk.addMethod(
  953. unescape('__eq'),
  954. smalltalk.method({
  955. selector: unescape('%3D'),
  956. fn: function (aCollection) {
  957. var self=this;
  958. 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}})})();})]));
  959. 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}})})();})]));})]);
  960. (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return true}})})();
  961. return self;
  962. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  963. }),
  964. smalltalk.SequenceableCollection);
  965. smalltalk.addMethod(
  966. unescape('_addLast_'),
  967. smalltalk.method({
  968. selector: unescape('addLast%3A'),
  969. fn: function (anObject) {
  970. var self=this;
  971. smalltalk.send(self, "_add_", [anObject]);
  972. return self;}
  973. }),
  974. smalltalk.SequenceableCollection);
  975. smalltalk.addMethod(
  976. unescape('_allButFirst'),
  977. smalltalk.method({
  978. selector: unescape('allButFirst'),
  979. fn: function () {
  980. var self=this;
  981. return smalltalk.send(self, "_copyFrom_to_", [(2), smalltalk.send(self, "_size", [])]);
  982. return self;}
  983. }),
  984. smalltalk.SequenceableCollection);
  985. smalltalk.addMethod(
  986. unescape('_allButLast'),
  987. smalltalk.method({
  988. selector: unescape('allButLast'),
  989. fn: function () {
  990. var self=this;
  991. return smalltalk.send(self, "_copyFrom_to_", [(1), ((($receiver = smalltalk.send(self, "_size", [])).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]))]);
  992. return self;}
  993. }),
  994. smalltalk.SequenceableCollection);
  995. smalltalk.addMethod(
  996. unescape('_at_'),
  997. smalltalk.method({
  998. selector: unescape('at%3A'),
  999. fn: function (anIndex) {
  1000. var self=this;
  1001. return smalltalk.send(self, "_at_ifAbsent_", [anIndex, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  1002. return self;}
  1003. }),
  1004. smalltalk.SequenceableCollection);
  1005. smalltalk.addMethod(
  1006. unescape('_at_ifAbsent_'),
  1007. smalltalk.method({
  1008. selector: unescape('at%3AifAbsent%3A'),
  1009. fn: function (anIndex, aBlock) {
  1010. var self=this;
  1011. smalltalk.send(self, "_subclassResponsibility", []);
  1012. return self;}
  1013. }),
  1014. smalltalk.SequenceableCollection);
  1015. smalltalk.addMethod(
  1016. unescape('_at_put_'),
  1017. smalltalk.method({
  1018. selector: unescape('at%3Aput%3A'),
  1019. fn: function (anIndex, anObject) {
  1020. var self=this;
  1021. smalltalk.send(self, "_subclassResponsibility", []);
  1022. return self;}
  1023. }),
  1024. smalltalk.SequenceableCollection);
  1025. smalltalk.addMethod(
  1026. unescape('_atRandom'),
  1027. smalltalk.method({
  1028. selector: unescape('atRandom'),
  1029. fn: function () {
  1030. var self=this;
  1031. return smalltalk.send(self, "_at_", [smalltalk.send(smalltalk.send(self, "_size", []), "_atRandom", [])]);
  1032. return self;}
  1033. }),
  1034. smalltalk.SequenceableCollection);
  1035. smalltalk.addMethod(
  1036. unescape('_copyFrom_to_'),
  1037. smalltalk.method({
  1038. selector: unescape('copyFrom%3Ato%3A'),
  1039. fn: function (anIndex, anotherIndex) {
  1040. var self=this;
  1041. var range=nil;
  1042. var newCollection=nil;
  1043. (range=smalltalk.send(anIndex, "_to_", [anotherIndex]));
  1044. (newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new_", [smalltalk.send(range, "_size", [])]));
  1045. smalltalk.send(range, "_withIndexDo_", [(function(each, i){return smalltalk.send(newCollection, "_at_put_", [i, smalltalk.send(self, "_at_", [each])]);})]);
  1046. return newCollection;
  1047. return self;}
  1048. }),
  1049. smalltalk.SequenceableCollection);
  1050. smalltalk.addMethod(
  1051. unescape('_deepCopy'),
  1052. smalltalk.method({
  1053. selector: unescape('deepCopy'),
  1054. fn: function () {
  1055. var self=this;
  1056. var newCollection=nil;
  1057. (newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new_", [smalltalk.send(self, "_size", [])]));
  1058. smalltalk.send(self, "_withIndexDo_", [(function(each, index){return smalltalk.send(newCollection, "_at_put_", [index, smalltalk.send(each, "_deepCopy", [])]);})]);
  1059. return newCollection;
  1060. return self;}
  1061. }),
  1062. smalltalk.SequenceableCollection);
  1063. smalltalk.addMethod(
  1064. unescape('_first'),
  1065. smalltalk.method({
  1066. selector: unescape('first'),
  1067. fn: function () {
  1068. var self=this;
  1069. return smalltalk.send(self, "_at_", [(1)]);
  1070. return self;}
  1071. }),
  1072. smalltalk.SequenceableCollection);
  1073. smalltalk.addMethod(
  1074. unescape('_first_'),
  1075. smalltalk.method({
  1076. selector: unescape('first%3A'),
  1077. fn: function (n) {
  1078. var self=this;
  1079. return smalltalk.send(self, "_copyFrom_to_", [(1), n]);
  1080. return self;}
  1081. }),
  1082. smalltalk.SequenceableCollection);
  1083. smalltalk.addMethod(
  1084. unescape('_fourth'),
  1085. smalltalk.method({
  1086. selector: unescape('fourth'),
  1087. fn: function () {
  1088. var self=this;
  1089. return smalltalk.send(self, "_at_", [(4)]);
  1090. return self;}
  1091. }),
  1092. smalltalk.SequenceableCollection);
  1093. smalltalk.addMethod(
  1094. unescape('_indexOf_'),
  1095. smalltalk.method({
  1096. selector: unescape('indexOf%3A'),
  1097. fn: function (anObject) {
  1098. var self=this;
  1099. return smalltalk.send(self, "_indexOf_ifAbsent_", [anObject, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  1100. return self;}
  1101. }),
  1102. smalltalk.SequenceableCollection);
  1103. smalltalk.addMethod(
  1104. unescape('_indexOf_ifAbsent_'),
  1105. smalltalk.method({
  1106. selector: unescape('indexOf%3AifAbsent%3A'),
  1107. fn: function (anObject, aBlock) {
  1108. var self=this;
  1109. for(var i=0;i<self.length;i++){
  1110. if(self[i].__eq(anObject)) {return i+1}
  1111. }
  1112. return aBlock();
  1113. ;
  1114. return self;}
  1115. }),
  1116. smalltalk.SequenceableCollection);
  1117. smalltalk.addMethod(
  1118. unescape('_indexOf_startingAt_'),
  1119. smalltalk.method({
  1120. selector: unescape('indexOf%3AstartingAt%3A'),
  1121. fn: function (anObject, start) {
  1122. var self=this;
  1123. return smalltalk.send(self, "_indexOf_startingAt_ifAbsent_", [anObject, start, (function(){return (0);})]);
  1124. return self;}
  1125. }),
  1126. smalltalk.SequenceableCollection);
  1127. smalltalk.addMethod(
  1128. unescape('_indexOf_startingAt_ifAbsent_'),
  1129. smalltalk.method({
  1130. selector: unescape('indexOf%3AstartingAt%3AifAbsent%3A'),
  1131. fn: function (anObject, start, aBlock) {
  1132. var self=this;
  1133. for(var i=start-1;i<self.length;i++){
  1134. if(self[i].__eq(anObject)) {return i+1}
  1135. }
  1136. return aBlock();
  1137. ;
  1138. return self;}
  1139. }),
  1140. smalltalk.SequenceableCollection);
  1141. smalltalk.addMethod(
  1142. unescape('_last'),
  1143. smalltalk.method({
  1144. selector: unescape('last'),
  1145. fn: function () {
  1146. var self=this;
  1147. return smalltalk.send(self, "_at_", [smalltalk.send(self, "_size", [])]);
  1148. return self;}
  1149. }),
  1150. smalltalk.SequenceableCollection);
  1151. smalltalk.addMethod(
  1152. unescape('_printString'),
  1153. smalltalk.method({
  1154. selector: unescape('printString'),
  1155. fn: function () {
  1156. var self=this;
  1157. var str=nil;
  1158. (str=smalltalk.send("", "_writeStream", []));
  1159. smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.Collection), "__comma", [unescape("%20%28")])]);
  1160. smalltalk.send(self, "_do_separatedBy_", [(function(each){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(each, "_printString", [])]);}), (function(){return smalltalk.send(str, "_nextPutAll_", [" "]);})]);
  1161. smalltalk.send(str, "_nextPutAll_", [unescape("%29")]);
  1162. return smalltalk.send(str, "_contents", []);
  1163. return self;}
  1164. }),
  1165. smalltalk.SequenceableCollection);
  1166. smalltalk.addMethod(
  1167. unescape('_removeLast'),
  1168. smalltalk.method({
  1169. selector: unescape('removeLast'),
  1170. fn: function () {
  1171. var self=this;
  1172. smalltalk.send(self, "_remove_", [smalltalk.send(self, "_last", [])]);
  1173. return self;}
  1174. }),
  1175. smalltalk.SequenceableCollection);
  1176. smalltalk.addMethod(
  1177. unescape('_reversed'),
  1178. smalltalk.method({
  1179. selector: unescape('reversed'),
  1180. fn: function () {
  1181. var self=this;
  1182. smalltalk.send(self, "_subclassResponsibility", []);
  1183. return self;}
  1184. }),
  1185. smalltalk.SequenceableCollection);
  1186. smalltalk.addMethod(
  1187. unescape('_second'),
  1188. smalltalk.method({
  1189. selector: unescape('second'),
  1190. fn: function () {
  1191. var self=this;
  1192. return smalltalk.send(self, "_at_", [(2)]);
  1193. return self;}
  1194. }),
  1195. smalltalk.SequenceableCollection);
  1196. smalltalk.addMethod(
  1197. unescape('_shallowCopy'),
  1198. smalltalk.method({
  1199. selector: unescape('shallowCopy'),
  1200. fn: function () {
  1201. var self=this;
  1202. var newCollection=nil;
  1203. (newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new_", [smalltalk.send(self, "_size", [])]));
  1204. smalltalk.send(self, "_withIndexDo_", [(function(each, index){return smalltalk.send(newCollection, "_at_put_", [index, each]);})]);
  1205. return newCollection;
  1206. return self;}
  1207. }),
  1208. smalltalk.SequenceableCollection);
  1209. smalltalk.addMethod(
  1210. unescape('_third'),
  1211. smalltalk.method({
  1212. selector: unescape('third'),
  1213. fn: function () {
  1214. var self=this;
  1215. return smalltalk.send(self, "_at_", [(3)]);
  1216. return self;}
  1217. }),
  1218. smalltalk.SequenceableCollection);
  1219. smalltalk.addMethod(
  1220. unescape('_withIndexDo_'),
  1221. smalltalk.method({
  1222. selector: unescape('withIndexDo%3A'),
  1223. fn: function (aBlock) {
  1224. var self=this;
  1225. for(var i=0;i<self.length;i++){aBlock(self[i], i+1);};
  1226. return self;}
  1227. }),
  1228. smalltalk.SequenceableCollection);
  1229. smalltalk.addClass('Array', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
  1230. smalltalk.addMethod(
  1231. unescape('_add_'),
  1232. smalltalk.method({
  1233. selector: unescape('add%3A'),
  1234. fn: function (anObject) {
  1235. var self=this;
  1236. self.push(anObject); return anObject;;
  1237. return self;}
  1238. }),
  1239. smalltalk.Array);
  1240. smalltalk.addMethod(
  1241. unescape('_asJavascript'),
  1242. smalltalk.method({
  1243. selector: unescape('asJavascript'),
  1244. fn: function () {
  1245. var self=this;
  1246. 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")]);
  1247. return self;}
  1248. }),
  1249. smalltalk.Array);
  1250. smalltalk.addMethod(
  1251. unescape('_at_ifAbsent_'),
  1252. smalltalk.method({
  1253. selector: unescape('at%3AifAbsent%3A'),
  1254. fn: function (anIndex, aBlock) {
  1255. var self=this;
  1256. var value = self[anIndex - 1];
  1257. if(value === undefined) {
  1258. return aBlock();
  1259. } else {
  1260. return value;
  1261. }
  1262. ;
  1263. return self;}
  1264. }),
  1265. smalltalk.Array);
  1266. smalltalk.addMethod(
  1267. unescape('_at_put_'),
  1268. smalltalk.method({
  1269. selector: unescape('at%3Aput%3A'),
  1270. fn: function (anIndex, anObject) {
  1271. var self=this;
  1272. return self[anIndex - 1] = anObject;
  1273. return self;}
  1274. }),
  1275. smalltalk.Array);
  1276. smalltalk.addMethod(
  1277. unescape('_join_'),
  1278. smalltalk.method({
  1279. selector: unescape('join%3A'),
  1280. fn: function (aString) {
  1281. var self=this;
  1282. return self.join(aString);
  1283. return self;}
  1284. }),
  1285. smalltalk.Array);
  1286. smalltalk.addMethod(
  1287. unescape('_remove_'),
  1288. smalltalk.method({
  1289. selector: unescape('remove%3A'),
  1290. fn: function (anObject) {
  1291. var self=this;
  1292. for(var i=0;i<self.length;i++) {
  1293. if(self[i] == anObject) {
  1294. self.splice(i,1);
  1295. break;
  1296. }
  1297. }
  1298. ;
  1299. return self;}
  1300. }),
  1301. smalltalk.Array);
  1302. smalltalk.addMethod(
  1303. unescape('_removeFrom_to_'),
  1304. smalltalk.method({
  1305. selector: unescape('removeFrom%3Ato%3A'),
  1306. fn: function (aNumber, anotherNumber) {
  1307. var self=this;
  1308. self.splice(aNumber - 1,anotherNumber - 1);
  1309. return self;}
  1310. }),
  1311. smalltalk.Array);
  1312. smalltalk.addMethod(
  1313. unescape('_reversed'),
  1314. smalltalk.method({
  1315. selector: unescape('reversed'),
  1316. fn: function () {
  1317. var self=this;
  1318. return self._copy().reverse();
  1319. return self;}
  1320. }),
  1321. smalltalk.Array);
  1322. smalltalk.addMethod(
  1323. unescape('_size'),
  1324. smalltalk.method({
  1325. selector: unescape('size'),
  1326. fn: function () {
  1327. var self=this;
  1328. return self.length;
  1329. return self;}
  1330. }),
  1331. smalltalk.Array);
  1332. smalltalk.addMethod(
  1333. unescape('_sort'),
  1334. smalltalk.method({
  1335. selector: unescape('sort'),
  1336. fn: function () {
  1337. var self=this;
  1338. return smalltalk.send(self, "_basicPerform_", ["sort"]);
  1339. return self;}
  1340. }),
  1341. smalltalk.Array);
  1342. smalltalk.addMethod(
  1343. unescape('_sort_'),
  1344. smalltalk.method({
  1345. selector: unescape('sort%3A'),
  1346. fn: function (aBlock) {
  1347. var self=this;
  1348. return self.sort(function(a, b) {
  1349. if(aBlock(a,b)) {return -1} else {return 1}
  1350. })
  1351. ;
  1352. return self;}
  1353. }),
  1354. smalltalk.Array);
  1355. smalltalk.addMethod(
  1356. unescape('_sorted'),
  1357. smalltalk.method({
  1358. selector: unescape('sorted'),
  1359. fn: function () {
  1360. var self=this;
  1361. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort", []);
  1362. return self;}
  1363. }),
  1364. smalltalk.Array);
  1365. smalltalk.addMethod(
  1366. unescape('_sorted_'),
  1367. smalltalk.method({
  1368. selector: unescape('sorted%3A'),
  1369. fn: function (aBlock) {
  1370. var self=this;
  1371. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort_", [aBlock]);
  1372. return self;}
  1373. }),
  1374. smalltalk.Array);
  1375. smalltalk.addMethod(
  1376. unescape('_new_'),
  1377. smalltalk.method({
  1378. selector: unescape('new%3A'),
  1379. fn: function (anInteger) {
  1380. var self=this;
  1381. return new Array(anInteger);
  1382. return self;}
  1383. }),
  1384. smalltalk.Array.klass);
  1385. smalltalk.addMethod(
  1386. unescape('_with_'),
  1387. smalltalk.method({
  1388. selector: unescape('with%3A'),
  1389. fn: function (anObject) {
  1390. var self=this;
  1391. return (function($rec){smalltalk.send($rec, "_at_put_", [(1), anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new_", [(1)]));
  1392. return self;}
  1393. }),
  1394. smalltalk.Array.klass);
  1395. smalltalk.addMethod(
  1396. unescape('_with_with_'),
  1397. smalltalk.method({
  1398. selector: unescape('with%3Awith%3A'),
  1399. fn: function (anObject, anObject2) {
  1400. var self=this;
  1401. 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)]));
  1402. return self;}
  1403. }),
  1404. smalltalk.Array.klass);
  1405. smalltalk.addMethod(
  1406. unescape('_with_with_with_'),
  1407. smalltalk.method({
  1408. selector: unescape('with%3Awith%3Awith%3A'),
  1409. fn: function (anObject, anObject2, anObject3) {
  1410. var self=this;
  1411. 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)]));
  1412. return self;}
  1413. }),
  1414. smalltalk.Array.klass);
  1415. smalltalk.addMethod(
  1416. unescape('_withAll_'),
  1417. smalltalk.method({
  1418. selector: unescape('withAll%3A'),
  1419. fn: function (aCollection) {
  1420. var self=this;
  1421. var instance=nil;
  1422. (instance=smalltalk.send(self, "_new_", [smalltalk.send(aCollection, "_size", [])]));
  1423. smalltalk.send(aCollection, "_withIndexDo_", [(function(each, index){return smalltalk.send(instance, "_at_put_", [index, each]);})]);
  1424. return instance;
  1425. return self;}
  1426. }),
  1427. smalltalk.Array.klass);
  1428. smalltalk.addClass('CharacterArray', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
  1429. smalltalk.addMethod(
  1430. unescape('__comma'),
  1431. smalltalk.method({
  1432. selector: unescape('%2C'),
  1433. fn: function (aString) {
  1434. var self=this;
  1435. return smalltalk.send(smalltalk.send(self, "_asString", []), "__comma", [smalltalk.send(aString, "_asString", [])]);
  1436. return self;}
  1437. }),
  1438. smalltalk.CharacterArray);
  1439. smalltalk.addMethod(
  1440. unescape('_add_'),
  1441. smalltalk.method({
  1442. selector: unescape('add%3A'),
  1443. fn: function (anObject) {
  1444. var self=this;
  1445. smalltalk.send(self, "_errorReadOnly", []);
  1446. return self;}
  1447. }),
  1448. smalltalk.CharacterArray);
  1449. smalltalk.addMethod(
  1450. unescape('_asLowercase'),
  1451. smalltalk.method({
  1452. selector: unescape('asLowercase'),
  1453. fn: function () {
  1454. var self=this;
  1455. return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [smalltalk.send(smalltalk.send(self, "_asString", []), "_asLowercase", [])]);
  1456. return self;}
  1457. }),
  1458. smalltalk.CharacterArray);
  1459. smalltalk.addMethod(
  1460. unescape('_asNumber'),
  1461. smalltalk.method({
  1462. selector: unescape('asNumber'),
  1463. fn: function () {
  1464. var self=this;
  1465. return smalltalk.send(smalltalk.send(self, "_asString", []), "_asNumber", []);
  1466. return self;}
  1467. }),
  1468. smalltalk.CharacterArray);
  1469. smalltalk.addMethod(
  1470. unescape('_asString'),
  1471. smalltalk.method({
  1472. selector: unescape('asString'),
  1473. fn: function () {
  1474. var self=this;
  1475. return smalltalk.send(self, "_subclassResponsibility", []);
  1476. return self;}
  1477. }),
  1478. smalltalk.CharacterArray);
  1479. smalltalk.addMethod(
  1480. unescape('_asSymbol'),
  1481. smalltalk.method({
  1482. selector: unescape('asSymbol'),
  1483. fn: function () {
  1484. var self=this;
  1485. return smalltalk.send(self, "_subclassResponsibility", []);
  1486. return self;}
  1487. }),
  1488. smalltalk.CharacterArray);
  1489. smalltalk.addMethod(
  1490. unescape('_asUppercase'),
  1491. smalltalk.method({
  1492. selector: unescape('asUppercase'),
  1493. fn: function () {
  1494. var self=this;
  1495. return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [smalltalk.send(smalltalk.send(self, "_asString", []), "_asUppercase", [])]);
  1496. return self;}
  1497. }),
  1498. smalltalk.CharacterArray);
  1499. smalltalk.addMethod(
  1500. unescape('_at_put_'),
  1501. smalltalk.method({
  1502. selector: unescape('at%3Aput%3A'),
  1503. fn: function (anIndex, anObject) {
  1504. var self=this;
  1505. smalltalk.send(self, "_errorReadOnly", []);
  1506. return self;}
  1507. }),
  1508. smalltalk.CharacterArray);
  1509. smalltalk.addMethod(
  1510. unescape('_errorReadOnly'),
  1511. smalltalk.method({
  1512. selector: unescape('errorReadOnly'),
  1513. fn: function () {
  1514. var self=this;
  1515. smalltalk.send(self, "_error_", [unescape("Object%20is%20read-only")]);
  1516. return self;}
  1517. }),
  1518. smalltalk.CharacterArray);
  1519. smalltalk.addMethod(
  1520. unescape('_printString'),
  1521. smalltalk.method({
  1522. selector: unescape('printString'),
  1523. fn: function () {
  1524. var self=this;
  1525. return smalltalk.send(smalltalk.send(self, "_asString", []), "_printString", []);
  1526. return self;}
  1527. }),
  1528. smalltalk.CharacterArray);
  1529. smalltalk.addMethod(
  1530. unescape('_remove_'),
  1531. smalltalk.method({
  1532. selector: unescape('remove%3A'),
  1533. fn: function (anObject) {
  1534. var self=this;
  1535. smalltalk.send(self, "_errorReadOnly", []);
  1536. return self;}
  1537. }),
  1538. smalltalk.CharacterArray);
  1539. smalltalk.addMethod(
  1540. unescape('_fromString_'),
  1541. smalltalk.method({
  1542. selector: unescape('fromString%3A'),
  1543. fn: function (aString) {
  1544. var self=this;
  1545. smalltalk.send(self, "_subclassResponsibility", []);
  1546. return self;}
  1547. }),
  1548. smalltalk.CharacterArray.klass);
  1549. smalltalk.addClass('String', smalltalk.CharacterArray, [], 'Kernel-Collections');
  1550. smalltalk.addMethod(
  1551. unescape('__comma'),
  1552. smalltalk.method({
  1553. selector: unescape('%2C'),
  1554. fn: function (aString) {
  1555. var self=this;
  1556. return self + aString;
  1557. return self;}
  1558. }),
  1559. smalltalk.String);
  1560. smalltalk.addMethod(
  1561. unescape('__lt'),
  1562. smalltalk.method({
  1563. selector: unescape('%3C'),
  1564. fn: function (aString) {
  1565. var self=this;
  1566. return String(self) < aString._asString();
  1567. return self;}
  1568. }),
  1569. smalltalk.String);
  1570. smalltalk.addMethod(
  1571. unescape('__lt_eq'),
  1572. smalltalk.method({
  1573. selector: unescape('%3C%3D'),
  1574. fn: function (aString) {
  1575. var self=this;
  1576. return String(self) <= aString._asString();
  1577. return self;}
  1578. }),
  1579. smalltalk.String);
  1580. smalltalk.addMethod(
  1581. unescape('__eq'),
  1582. smalltalk.method({
  1583. selector: unescape('%3D'),
  1584. fn: function (aString) {
  1585. var self=this;
  1586. 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}})})();})]));
  1587. return String(self) === String(aString);
  1588. return self;
  1589. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  1590. }),
  1591. smalltalk.String);
  1592. smalltalk.addMethod(
  1593. unescape('__gt'),
  1594. smalltalk.method({
  1595. selector: unescape('%3E'),
  1596. fn: function (aString) {
  1597. var self=this;
  1598. return String(self) > aString._asString();
  1599. return self;}
  1600. }),
  1601. smalltalk.String);
  1602. smalltalk.addMethod(
  1603. unescape('__gt_eq'),
  1604. smalltalk.method({
  1605. selector: unescape('%3E%3D'),
  1606. fn: function (aString) {
  1607. var self=this;
  1608. return String(self) >= aString._asString();
  1609. return self;}
  1610. }),
  1611. smalltalk.String);
  1612. smalltalk.addMethod(
  1613. unescape('_asJSON'),
  1614. smalltalk.method({
  1615. selector: unescape('asJSON'),
  1616. fn: function () {
  1617. var self=this;
  1618. return self;
  1619. return self;}
  1620. }),
  1621. smalltalk.String);
  1622. smalltalk.addMethod(
  1623. unescape('_asJavaScriptSelector'),
  1624. smalltalk.method({
  1625. selector: unescape('asJavaScriptSelector'),
  1626. fn: function () {
  1627. var self=this;
  1628. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_asSelector", []), "_replace_with_", [unescape("%5E_"), ""]), "_replace_with_", [unescape("_.*"), ""]);
  1629. return self;}
  1630. }),
  1631. smalltalk.String);
  1632. smalltalk.addMethod(
  1633. unescape('_asJavascript'),
  1634. smalltalk.method({
  1635. selector: unescape('asJavascript'),
  1636. fn: function () {
  1637. var self=this;
  1638. if(self.search(/^[a-zA-Z0-9_:.$ ]*$/) == -1)
  1639. return "unescape(\"" + escape(self) + "\")";
  1640. else
  1641. return "\"" + self + "\"";
  1642. ;
  1643. return self;}
  1644. }),
  1645. smalltalk.String);
  1646. smalltalk.addMethod(
  1647. unescape('_asLowercase'),
  1648. smalltalk.method({
  1649. selector: unescape('asLowercase'),
  1650. fn: function () {
  1651. var self=this;
  1652. return self.toLowerCase();
  1653. return self;}
  1654. }),
  1655. smalltalk.String);
  1656. smalltalk.addMethod(
  1657. unescape('_asNumber'),
  1658. smalltalk.method({
  1659. selector: unescape('asNumber'),
  1660. fn: function () {
  1661. var self=this;
  1662. return Number(self);
  1663. return self;}
  1664. }),
  1665. smalltalk.String);
  1666. smalltalk.addMethod(
  1667. unescape('_asSelector'),
  1668. smalltalk.method({
  1669. selector: unescape('asSelector'),
  1670. fn: function () {
  1671. var self=this;
  1672. var selector=nil;
  1673. (selector=smalltalk.send("_", "__comma", [self]));
  1674. (selector=smalltalk.send(selector, "_replace_with_", [":", "_"]));
  1675. (selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B+%5D"), "_plus"]));
  1676. (selector=smalltalk.send(selector, "_replace_with_", [unescape("-"), "_minus"]));
  1677. (selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B*%5D"), "_star"]));
  1678. (selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B/%5D"), "_slash"]));
  1679. (selector=smalltalk.send(selector, "_replace_with_", [unescape("%3E"), "_gt"]));
  1680. (selector=smalltalk.send(selector, "_replace_with_", [unescape("%3C"), "_lt"]));
  1681. (selector=smalltalk.send(selector, "_replace_with_", [unescape("%3D"), "_eq"]));
  1682. (selector=smalltalk.send(selector, "_replace_with_", [unescape("%2C"), "_comma"]));
  1683. (selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B@%5D"), "_at"]));
  1684. return selector;
  1685. return self;}
  1686. }),
  1687. smalltalk.String);
  1688. smalltalk.addMethod(
  1689. unescape('_asString'),
  1690. smalltalk.method({
  1691. selector: unescape('asString'),
  1692. fn: function () {
  1693. var self=this;
  1694. return self;
  1695. return self;}
  1696. }),
  1697. smalltalk.String);
  1698. smalltalk.addMethod(
  1699. unescape('_asSymbol'),
  1700. smalltalk.method({
  1701. selector: unescape('asSymbol'),
  1702. fn: function () {
  1703. var self=this;
  1704. return smalltalk.send((smalltalk.Symbol || Symbol), "_lookup_", [self]);
  1705. return self;}
  1706. }),
  1707. smalltalk.String);
  1708. smalltalk.addMethod(
  1709. unescape('_asUppercase'),
  1710. smalltalk.method({
  1711. selector: unescape('asUppercase'),
  1712. fn: function () {
  1713. var self=this;
  1714. return self.toUpperCase();
  1715. return self;}
  1716. }),
  1717. smalltalk.String);
  1718. smalltalk.addMethod(
  1719. unescape('_asciiValue'),
  1720. smalltalk.method({
  1721. selector: unescape('asciiValue'),
  1722. fn: function () {
  1723. var self=this;
  1724. return self.charCodeAt(0);;
  1725. return self;}
  1726. }),
  1727. smalltalk.String);
  1728. smalltalk.addMethod(
  1729. unescape('_at_ifAbsent_'),
  1730. smalltalk.method({
  1731. selector: unescape('at%3AifAbsent%3A'),
  1732. fn: function (anIndex, aBlock) {
  1733. var self=this;
  1734. return self[anIndex - 1] || aBlock();
  1735. return self;}
  1736. }),
  1737. smalltalk.String);
  1738. smalltalk.addMethod(
  1739. unescape('_copyFrom_to_'),
  1740. smalltalk.method({
  1741. selector: unescape('copyFrom%3Ato%3A'),
  1742. fn: function (anIndex, anotherIndex) {
  1743. var self=this;
  1744. return self.substring(anIndex - 1, anotherIndex);
  1745. return self;}
  1746. }),
  1747. smalltalk.String);
  1748. smalltalk.addMethod(
  1749. unescape('_deepCopy'),
  1750. smalltalk.method({
  1751. selector: unescape('deepCopy'),
  1752. fn: function () {
  1753. var self=this;
  1754. return smalltalk.send(self, "_shallowCopy", []);
  1755. return self;}
  1756. }),
  1757. smalltalk.String);
  1758. smalltalk.addMethod(
  1759. unescape('_escaped'),
  1760. smalltalk.method({
  1761. selector: unescape('escaped'),
  1762. fn: function () {
  1763. var self=this;
  1764. return escape(self);
  1765. return self;}
  1766. }),
  1767. smalltalk.String);
  1768. smalltalk.addMethod(
  1769. unescape('_includesSubString_'),
  1770. smalltalk.method({
  1771. selector: unescape('includesSubString%3A'),
  1772. fn: function (subString) {
  1773. var self=this;
  1774. return self.indexOf(subString) != -1 ;
  1775. return self;}
  1776. }),
  1777. smalltalk.String);
  1778. smalltalk.addMethod(
  1779. unescape('_isString'),
  1780. smalltalk.method({
  1781. selector: unescape('isString'),
  1782. fn: function () {
  1783. var self=this;
  1784. return true;
  1785. return self;}
  1786. }),
  1787. smalltalk.String);
  1788. smalltalk.addMethod(
  1789. unescape('_join_'),
  1790. smalltalk.method({
  1791. selector: unescape('join%3A'),
  1792. fn: function (aCollection) {
  1793. var self=this;
  1794. 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]);})]);})]);
  1795. return self;}
  1796. }),
  1797. smalltalk.String);
  1798. smalltalk.addMethod(
  1799. unescape('_lineIndicesDo_'),
  1800. smalltalk.method({
  1801. selector: unescape('lineIndicesDo%3A'),
  1802. fn: function (aBlock) {
  1803. var self=this;
  1804. try{var cr=nil;
  1805. var lf=nil;
  1806. var start=nil;
  1807. var sz=nil;
  1808. var nextLF=nil;
  1809. var nextCR=nil;
  1810. (start=(1));
  1811. (sz=smalltalk.send(self, "_size", []));
  1812. (cr=smalltalk.send((smalltalk.String || String), "_cr", []));
  1813. (nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, (1)]));
  1814. (lf=smalltalk.send((smalltalk.String || String), "_lf", []));
  1815. (nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, (1)]));
  1816. (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]));})]));})]));})()}})();
  1817. return self;
  1818. } catch(e) {if(e.name === 'stReturn' && e.selector === '_lineIndicesDo_'){return e.fn()} throw(e)}}
  1819. }),
  1820. smalltalk.String);
  1821. smalltalk.addMethod(
  1822. unescape('_lineNumber_'),
  1823. smalltalk.method({
  1824. selector: unescape('lineNumber%3A'),
  1825. fn: function (anIndex) {
  1826. var self=this;
  1827. try{var lineCount=nil;
  1828. (lineCount=(0));
  1829. 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])}})})();})]));})]);
  1830. (function(){throw({name: 'stReturn', selector: '_lineNumber_', fn: function(){return nil}})})();
  1831. return self;
  1832. } catch(e) {if(e.name === 'stReturn' && e.selector === '_lineNumber_'){return e.fn()} throw(e)}}
  1833. }),
  1834. smalltalk.String);
  1835. smalltalk.addMethod(
  1836. unescape('_lines'),
  1837. smalltalk.method({
  1838. selector: unescape('lines'),
  1839. fn: function () {
  1840. var self=this;
  1841. var lines=nil;
  1842. (lines=smalltalk.send((smalltalk.Array || Array), "_new", []));
  1843. smalltalk.send(self, "_linesDo_", [(function(aLine){return smalltalk.send(lines, "_add_", [aLine]);})]);
  1844. return lines;
  1845. return self;}
  1846. }),
  1847. smalltalk.String);
  1848. smalltalk.addMethod(
  1849. unescape('_linesDo_'),
  1850. smalltalk.method({
  1851. selector: unescape('linesDo%3A'),
  1852. fn: function (aBlock) {
  1853. var self=this;
  1854. smalltalk.send(self, "_lineIndicesDo_", [(function(start, endWithoutDelimiters, end){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_copyFrom_to_", [start, endWithoutDelimiters])]);})]);
  1855. return self;}
  1856. }),
  1857. smalltalk.String);
  1858. smalltalk.addMethod(
  1859. unescape('_match_'),
  1860. smalltalk.method({
  1861. selector: unescape('match%3A'),
  1862. fn: function (aRegexp) {
  1863. var self=this;
  1864. return self.search(aRegexp) != -1;
  1865. return self;}
  1866. }),
  1867. smalltalk.String);
  1868. smalltalk.addMethod(
  1869. unescape('_printNl'),
  1870. smalltalk.method({
  1871. selector: unescape('printNl'),
  1872. fn: function () {
  1873. var self=this;
  1874. console.log(self);
  1875. return self;}
  1876. }),
  1877. smalltalk.String);
  1878. smalltalk.addMethod(
  1879. unescape('_printString'),
  1880. smalltalk.method({
  1881. selector: unescape('printString'),
  1882. fn: function () {
  1883. var self=this;
  1884. return smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [self]), "__comma", [unescape("%27")]);
  1885. return self;}
  1886. }),
  1887. smalltalk.String);
  1888. smalltalk.addMethod(
  1889. unescape('_replace_with_'),
  1890. smalltalk.method({
  1891. selector: unescape('replace%3Awith%3A'),
  1892. fn: function (aString, anotherString) {
  1893. var self=this;
  1894. return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send((smalltalk.RegularExpression || RegularExpression), "_fromString_flag_", [aString, "g"]), anotherString]);
  1895. return self;}
  1896. }),
  1897. smalltalk.String);
  1898. smalltalk.addMethod(
  1899. unescape('_replaceRegexp_with_'),
  1900. smalltalk.method({
  1901. selector: unescape('replaceRegexp%3Awith%3A'),
  1902. fn: function (aRegexp, aString) {
  1903. var self=this;
  1904. return self.replace(aRegexp, aString);
  1905. return self;}
  1906. }),
  1907. smalltalk.String);
  1908. smalltalk.addMethod(
  1909. unescape('_reversed'),
  1910. smalltalk.method({
  1911. selector: unescape('reversed'),
  1912. fn: function () {
  1913. var self=this;
  1914. return self.split("").reverse().join("");
  1915. return self;}
  1916. }),
  1917. smalltalk.String);
  1918. smalltalk.addMethod(
  1919. unescape('_shallowCopy'),
  1920. smalltalk.method({
  1921. selector: unescape('shallowCopy'),
  1922. fn: function () {
  1923. var self=this;
  1924. return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [self]);
  1925. return self;}
  1926. }),
  1927. smalltalk.String);
  1928. smalltalk.addMethod(
  1929. unescape('_size'),
  1930. smalltalk.method({
  1931. selector: unescape('size'),
  1932. fn: function () {
  1933. var self=this;
  1934. return self.length;
  1935. return self;}
  1936. }),
  1937. smalltalk.String);
  1938. smalltalk.addMethod(
  1939. unescape('_tokenize_'),
  1940. smalltalk.method({
  1941. selector: unescape('tokenize%3A'),
  1942. fn: function (aString) {
  1943. var self=this;
  1944. return self.split(aString);
  1945. return self;}
  1946. }),
  1947. smalltalk.String);
  1948. smalltalk.addMethod(
  1949. unescape('_trimBoth'),
  1950. smalltalk.method({
  1951. selector: unescape('trimBoth'),
  1952. fn: function () {
  1953. var self=this;
  1954. return smalltalk.send(self, "_trimBoth_", [unescape("%5Cs")]);
  1955. return self;}
  1956. }),
  1957. smalltalk.String);
  1958. smalltalk.addMethod(
  1959. unescape('_trimBoth_'),
  1960. smalltalk.method({
  1961. selector: unescape('trimBoth%3A'),
  1962. fn: function (separators) {
  1963. var self=this;
  1964. return smalltalk.send(smalltalk.send(self, "_trimLeft_", [separators]), "_trimRight_", [separators]);
  1965. return self;}
  1966. }),
  1967. smalltalk.String);
  1968. smalltalk.addMethod(
  1969. unescape('_trimLeft'),
  1970. smalltalk.method({
  1971. selector: unescape('trimLeft'),
  1972. fn: function () {
  1973. var self=this;
  1974. return smalltalk.send(self, "_trimLeft_", [unescape("%5Cs")]);
  1975. return self;}
  1976. }),
  1977. smalltalk.String);
  1978. smalltalk.addMethod(
  1979. unescape('_trimLeft_'),
  1980. smalltalk.method({
  1981. selector: unescape('trimLeft%3A'),
  1982. fn: function (separators) {
  1983. var self=this;
  1984. 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"]), ""]);
  1985. return self;}
  1986. }),
  1987. smalltalk.String);
  1988. smalltalk.addMethod(
  1989. unescape('_trimRight'),
  1990. smalltalk.method({
  1991. selector: unescape('trimRight'),
  1992. fn: function () {
  1993. var self=this;
  1994. return smalltalk.send(self, "_trimRight_", [unescape("%5Cs")]);
  1995. return self;}
  1996. }),
  1997. smalltalk.String);
  1998. smalltalk.addMethod(
  1999. unescape('_trimRight_'),
  2000. smalltalk.method({
  2001. selector: unescape('trimRight%3A'),
  2002. fn: function (separators) {
  2003. var self=this;
  2004. 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"]), ""]);
  2005. return self;}
  2006. }),
  2007. smalltalk.String);
  2008. smalltalk.addMethod(
  2009. unescape('_unescaped'),
  2010. smalltalk.method({
  2011. selector: unescape('unescaped'),
  2012. fn: function () {
  2013. var self=this;
  2014. return unescape(self);
  2015. return self;}
  2016. }),
  2017. smalltalk.String);
  2018. smalltalk.addMethod(
  2019. unescape('_cr'),
  2020. smalltalk.method({
  2021. selector: unescape('cr'),
  2022. fn: function () {
  2023. var self=this;
  2024. return '\r';
  2025. return self;}
  2026. }),
  2027. smalltalk.String.klass);
  2028. smalltalk.addMethod(
  2029. unescape('_crlf'),
  2030. smalltalk.method({
  2031. selector: unescape('crlf'),
  2032. fn: function () {
  2033. var self=this;
  2034. return '\r\n';
  2035. return self;}
  2036. }),
  2037. smalltalk.String.klass);
  2038. smalltalk.addMethod(
  2039. unescape('_fromString_'),
  2040. smalltalk.method({
  2041. selector: unescape('fromString%3A'),
  2042. fn: function (aString) {
  2043. var self=this;
  2044. return new self.fn(aString);
  2045. return self;}
  2046. }),
  2047. smalltalk.String.klass);
  2048. smalltalk.addMethod(
  2049. unescape('_lf'),
  2050. smalltalk.method({
  2051. selector: unescape('lf'),
  2052. fn: function () {
  2053. var self=this;
  2054. return '\n';
  2055. return self;}
  2056. }),
  2057. smalltalk.String.klass);
  2058. smalltalk.addMethod(
  2059. unescape('_space'),
  2060. smalltalk.method({
  2061. selector: unescape('space'),
  2062. fn: function () {
  2063. var self=this;
  2064. return ' ';
  2065. return self;}
  2066. }),
  2067. smalltalk.String.klass);
  2068. smalltalk.addMethod(
  2069. unescape('_streamClass'),
  2070. smalltalk.method({
  2071. selector: unescape('streamClass'),
  2072. fn: function () {
  2073. var self=this;
  2074. return (smalltalk.StringStream || StringStream);
  2075. return self;}
  2076. }),
  2077. smalltalk.String.klass);
  2078. smalltalk.addMethod(
  2079. unescape('_streamContents_'),
  2080. smalltalk.method({
  2081. selector: unescape('streamContents%3A'),
  2082. fn: function (blockWithArg) {
  2083. var self=this;
  2084. var stream=nil;
  2085. (stream=smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [smalltalk.send((smalltalk.String || String), "_new", [])]));
  2086. smalltalk.send(blockWithArg, "_value_", [stream]);
  2087. return smalltalk.send(stream, "_contents", []);
  2088. return self;}
  2089. }),
  2090. smalltalk.String.klass);
  2091. smalltalk.addMethod(
  2092. unescape('_tab'),
  2093. smalltalk.method({
  2094. selector: unescape('tab'),
  2095. fn: function () {
  2096. var self=this;
  2097. return '\t';
  2098. return self;}
  2099. }),
  2100. smalltalk.String.klass);
  2101. smalltalk.addMethod(
  2102. unescape('_value_'),
  2103. smalltalk.method({
  2104. selector: unescape('value%3A'),
  2105. fn: function (aUTFCharCode) {
  2106. var self=this;
  2107. return String.fromCharCode(aUTFCharCode);;
  2108. return self;}
  2109. }),
  2110. smalltalk.String.klass);
  2111. smalltalk.addClass('Symbol', smalltalk.CharacterArray, [], 'Kernel-Collections');
  2112. smalltalk.addMethod(
  2113. unescape('__lt'),
  2114. smalltalk.method({
  2115. selector: unescape('%3C'),
  2116. fn: function (aSymbol) {
  2117. var self=this;
  2118. return ((($receiver = smalltalk.send(self, "_asString", [])).klass === smalltalk.Number) ? $receiver <smalltalk.send(aSymbol, "_asString", []) : smalltalk.send($receiver, "__lt", [smalltalk.send(aSymbol, "_asString", [])]));
  2119. return self;}
  2120. }),
  2121. smalltalk.Symbol);
  2122. smalltalk.addMethod(
  2123. unescape('__lt_eq'),
  2124. smalltalk.method({
  2125. selector: unescape('%3C%3D'),
  2126. fn: function (aSymbol) {
  2127. var self=this;
  2128. return ((($receiver = smalltalk.send(self, "_asString", [])).klass === smalltalk.Number) ? $receiver <=smalltalk.send(aSymbol, "_asString", []) : smalltalk.send($receiver, "__lt_eq", [smalltalk.send(aSymbol, "_asString", [])]));
  2129. return self;}
  2130. }),
  2131. smalltalk.Symbol);
  2132. smalltalk.addMethod(
  2133. unescape('__eq'),
  2134. smalltalk.method({
  2135. selector: unescape('%3D'),
  2136. fn: function (aSymbol) {
  2137. var self=this;
  2138. 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}})})();})]));
  2139. (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return smalltalk.send(smalltalk.send(self, "_asString", []), "__eq", [smalltalk.send(aSymbol, "_asString", [])])}})})();
  2140. return self;
  2141. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  2142. }),
  2143. smalltalk.Symbol);
  2144. smalltalk.addMethod(
  2145. unescape('__gt'),
  2146. smalltalk.method({
  2147. selector: unescape('%3E'),
  2148. fn: function (aSymbol) {
  2149. var self=this;
  2150. return ((($receiver = smalltalk.send(self, "_asString", [])).klass === smalltalk.Number) ? $receiver >smalltalk.send(aSymbol, "_asString", []) : smalltalk.send($receiver, "__gt", [smalltalk.send(aSymbol, "_asString", [])]));
  2151. return self;}
  2152. }),
  2153. smalltalk.Symbol);
  2154. smalltalk.addMethod(
  2155. unescape('__gt_eq'),
  2156. smalltalk.method({
  2157. selector: unescape('%3E%3D'),
  2158. fn: function (aSymbol) {
  2159. var self=this;
  2160. return ((($receiver = smalltalk.send(self, "_asString", [])).klass === smalltalk.Number) ? $receiver >=smalltalk.send(aSymbol, "_asString", []) : smalltalk.send($receiver, "__gt_eq", [smalltalk.send(aSymbol, "_asString", [])]));
  2161. return self;}
  2162. }),
  2163. smalltalk.Symbol);
  2164. smalltalk.addMethod(
  2165. unescape('_asJSON'),
  2166. smalltalk.method({
  2167. selector: unescape('asJSON'),
  2168. fn: function () {
  2169. var self=this;
  2170. return smalltalk.send(smalltalk.send(self, "_asString", []), "_asJSON", []);
  2171. return self;}
  2172. }),
  2173. smalltalk.Symbol);
  2174. smalltalk.addMethod(
  2175. unescape('_asJavascript'),
  2176. smalltalk.method({
  2177. selector: unescape('asJavascript'),
  2178. fn: function () {
  2179. var self=this;
  2180. return smalltalk.send(smalltalk.send(unescape("smalltalk.symbolFor%28%22"), "__comma", [smalltalk.send(self, "_asString", [])]), "__comma", [unescape("%22%29")]);
  2181. return self;}
  2182. }),
  2183. smalltalk.Symbol);
  2184. smalltalk.addMethod(
  2185. unescape('_asSelector'),
  2186. smalltalk.method({
  2187. selector: unescape('asSelector'),
  2188. fn: function () {
  2189. var self=this;
  2190. return smalltalk.send(smalltalk.send(self, "_asString", []), "_asSelector", []);
  2191. return self;}
  2192. }),
  2193. smalltalk.Symbol);
  2194. smalltalk.addMethod(
  2195. unescape('_asString'),
  2196. smalltalk.method({
  2197. selector: unescape('asString'),
  2198. fn: function () {
  2199. var self=this;
  2200. return self.value;
  2201. return self;}
  2202. }),
  2203. smalltalk.Symbol);
  2204. smalltalk.addMethod(
  2205. unescape('_asSymbol'),
  2206. smalltalk.method({
  2207. selector: unescape('asSymbol'),
  2208. fn: function () {
  2209. var self=this;
  2210. return self;
  2211. return self;}
  2212. }),
  2213. smalltalk.Symbol);
  2214. smalltalk.addMethod(
  2215. unescape('_at_ifAbsent_'),
  2216. smalltalk.method({
  2217. selector: unescape('at%3AifAbsent%3A'),
  2218. fn: function (anIndex, aBlock) {
  2219. var self=this;
  2220. return smalltalk.send(smalltalk.send(self, "_asString", []), "_at_ifAbsent_", [anIndex, aBlock]);
  2221. return self;}
  2222. }),
  2223. smalltalk.Symbol);
  2224. smalltalk.addMethod(
  2225. unescape('_copyFrom_to_'),
  2226. smalltalk.method({
  2227. selector: unescape('copyFrom%3Ato%3A'),
  2228. fn: function (anIndex, anotherIndex) {
  2229. var self=this;
  2230. return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [smalltalk.send(smalltalk.send(self, "_asString", []), "_copyFrom_to_", [anIndex, anotherIndex])]);
  2231. return self;}
  2232. }),
  2233. smalltalk.Symbol);
  2234. smalltalk.addMethod(
  2235. unescape('_deepCopy'),
  2236. smalltalk.method({
  2237. selector: unescape('deepCopy'),
  2238. fn: function () {
  2239. var self=this;
  2240. return self;
  2241. return self;}
  2242. }),
  2243. smalltalk.Symbol);
  2244. smalltalk.addMethod(
  2245. unescape('_isSymbol'),
  2246. smalltalk.method({
  2247. selector: unescape('isSymbol'),
  2248. fn: function () {
  2249. var self=this;
  2250. return true;
  2251. return self;}
  2252. }),
  2253. smalltalk.Symbol);
  2254. smalltalk.addMethod(
  2255. unescape('_printString'),
  2256. smalltalk.method({
  2257. selector: unescape('printString'),
  2258. fn: function () {
  2259. var self=this;
  2260. return smalltalk.send(unescape("%23"), "__comma", [smalltalk.send(self, "_asString", [])]);
  2261. return self;}
  2262. }),
  2263. smalltalk.Symbol);
  2264. smalltalk.addMethod(
  2265. unescape('_shallowCopy'),
  2266. smalltalk.method({
  2267. selector: unescape('shallowCopy'),
  2268. fn: function () {
  2269. var self=this;
  2270. return self;
  2271. return self;}
  2272. }),
  2273. smalltalk.Symbol);
  2274. smalltalk.addMethod(
  2275. unescape('_size'),
  2276. smalltalk.method({
  2277. selector: unescape('size'),
  2278. fn: function () {
  2279. var self=this;
  2280. return smalltalk.send(smalltalk.send(self, "_asString", []), "_size", []);
  2281. return self;}
  2282. }),
  2283. smalltalk.Symbol);
  2284. smalltalk.addMethod(
  2285. unescape('_basicNew'),
  2286. smalltalk.method({
  2287. selector: unescape('basicNew'),
  2288. fn: function () {
  2289. var self=this;
  2290. smalltalk.send(self, "_shouldNotImplement", []);
  2291. return self;}
  2292. }),
  2293. smalltalk.Symbol.klass);
  2294. smalltalk.addMethod(
  2295. unescape('_fromString_'),
  2296. smalltalk.method({
  2297. selector: unescape('fromString%3A'),
  2298. fn: function (aString) {
  2299. var self=this;
  2300. return smalltalk.send(self, "_lookup_", [aString]);
  2301. return self;}
  2302. }),
  2303. smalltalk.Symbol.klass);
  2304. smalltalk.addMethod(
  2305. unescape('_lookup_'),
  2306. smalltalk.method({
  2307. selector: unescape('lookup%3A'),
  2308. fn: function (aString) {
  2309. var self=this;
  2310. return smalltalk.symbolFor(aString);;
  2311. return self;}
  2312. }),
  2313. smalltalk.Symbol.klass);
  2314. smalltalk.addClass('Set', smalltalk.Collection, ['elements'], 'Kernel-Collections');
  2315. smalltalk.addMethod(
  2316. unescape('__eq'),
  2317. smalltalk.method({
  2318. selector: unescape('%3D'),
  2319. fn: function (aCollection) {
  2320. var self=this;
  2321. 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", [])]);})]);
  2322. return self;}
  2323. }),
  2324. smalltalk.Set);
  2325. smalltalk.addMethod(
  2326. unescape('_add_'),
  2327. smalltalk.method({
  2328. selector: unescape('add%3A'),
  2329. fn: function (anObject) {
  2330. var self=this;
  2331. var found;
  2332. for(var i=0; i < self['@elements'].length; i++) {
  2333. if(anObject == self['@elements'][i]) {
  2334. found = true;
  2335. break;
  2336. }
  2337. }
  2338. if(!found) {self['@elements'].push(anObject)}
  2339. ;
  2340. return self;}
  2341. }),
  2342. smalltalk.Set);
  2343. smalltalk.addMethod(
  2344. unescape('_asArray'),
  2345. smalltalk.method({
  2346. selector: unescape('asArray'),
  2347. fn: function () {
  2348. var self=this;
  2349. return smalltalk.send(self['@elements'], "_copy", []);
  2350. return self;}
  2351. }),
  2352. smalltalk.Set);
  2353. smalltalk.addMethod(
  2354. unescape('_detect_ifNone_'),
  2355. smalltalk.method({
  2356. selector: unescape('detect%3AifNone%3A'),
  2357. fn: function (aBlock, anotherBlock) {
  2358. var self=this;
  2359. return smalltalk.send(self['@elements'], "_detect_ifNone_", [aBlock, anotherBlock]);
  2360. return self;}
  2361. }),
  2362. smalltalk.Set);
  2363. smalltalk.addMethod(
  2364. unescape('_do_'),
  2365. smalltalk.method({
  2366. selector: unescape('do%3A'),
  2367. fn: function (aBlock) {
  2368. var self=this;
  2369. smalltalk.send(self['@elements'], "_do_", [aBlock]);
  2370. return self;}
  2371. }),
  2372. smalltalk.Set);
  2373. smalltalk.addMethod(
  2374. unescape('_includes_'),
  2375. smalltalk.method({
  2376. selector: unescape('includes%3A'),
  2377. fn: function (anObject) {
  2378. var self=this;
  2379. return smalltalk.send(self['@elements'], "_includes_", [anObject]);
  2380. return self;}
  2381. }),
  2382. smalltalk.Set);
  2383. smalltalk.addMethod(
  2384. unescape('_initialize'),
  2385. smalltalk.method({
  2386. selector: unescape('initialize'),
  2387. fn: function () {
  2388. var self=this;
  2389. smalltalk.send(self, "_initialize", [], smalltalk.Collection);
  2390. (self['@elements']=[]);
  2391. return self;}
  2392. }),
  2393. smalltalk.Set);
  2394. smalltalk.addMethod(
  2395. unescape('_remove_'),
  2396. smalltalk.method({
  2397. selector: unescape('remove%3A'),
  2398. fn: function (anObject) {
  2399. var self=this;
  2400. smalltalk.send(self['@elements'], "_remove_", [anObject]);
  2401. return self;}
  2402. }),
  2403. smalltalk.Set);
  2404. smalltalk.addMethod(
  2405. unescape('_select_'),
  2406. smalltalk.method({
  2407. selector: unescape('select%3A'),
  2408. fn: function (aBlock) {
  2409. var self=this;
  2410. var collection=nil;
  2411. (collection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
  2412. 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]);})]));})]);
  2413. return collection;
  2414. return self;}
  2415. }),
  2416. smalltalk.Set);
  2417. smalltalk.addMethod(
  2418. unescape('_size'),
  2419. smalltalk.method({
  2420. selector: unescape('size'),
  2421. fn: function () {
  2422. var self=this;
  2423. return smalltalk.send(self['@elements'], "_size", []);
  2424. return self;}
  2425. }),
  2426. smalltalk.Set);
  2427. smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel-Collections');
  2428. smalltalk.addMethod(
  2429. unescape('_compile_'),
  2430. smalltalk.method({
  2431. selector: unescape('compile%3A'),
  2432. fn: function (aString) {
  2433. var self=this;
  2434. return self.compile(aString);
  2435. return self;}
  2436. }),
  2437. smalltalk.RegularExpression);
  2438. smalltalk.addMethod(
  2439. unescape('_exec_'),
  2440. smalltalk.method({
  2441. selector: unescape('exec%3A'),
  2442. fn: function (aString) {
  2443. var self=this;
  2444. return self.exec(aString) || nil;
  2445. return self;}
  2446. }),
  2447. smalltalk.RegularExpression);
  2448. smalltalk.addMethod(
  2449. unescape('_test_'),
  2450. smalltalk.method({
  2451. selector: unescape('test%3A'),
  2452. fn: function (aString) {
  2453. var self=this;
  2454. return self.test(aString);
  2455. return self;}
  2456. }),
  2457. smalltalk.RegularExpression);
  2458. smalltalk.addMethod(
  2459. unescape('_fromString_'),
  2460. smalltalk.method({
  2461. selector: unescape('fromString%3A'),
  2462. fn: function (aString) {
  2463. var self=this;
  2464. return smalltalk.send(self, "_fromString_flag_", [aString, ""]);
  2465. return self;}
  2466. }),
  2467. smalltalk.RegularExpression.klass);
  2468. smalltalk.addMethod(
  2469. unescape('_fromString_flag_'),
  2470. smalltalk.method({
  2471. selector: unescape('fromString%3Aflag%3A'),
  2472. fn: function (aString, anotherString) {
  2473. var self=this;
  2474. return new RegExp(aString, anotherString);
  2475. return self;}
  2476. }),
  2477. smalltalk.RegularExpression.klass);
  2478. smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel-Collections');
  2479. smalltalk.addMethod(
  2480. unescape('_atEnd'),
  2481. smalltalk.method({
  2482. selector: unescape('atEnd'),
  2483. fn: function () {
  2484. var self=this;
  2485. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [smalltalk.send(self, "_size", [])]);
  2486. return self;}
  2487. }),
  2488. smalltalk.Stream);
  2489. smalltalk.addMethod(
  2490. unescape('_atStart'),
  2491. smalltalk.method({
  2492. selector: unescape('atStart'),
  2493. fn: function () {
  2494. var self=this;
  2495. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [(0)]);
  2496. return self;}
  2497. }),
  2498. smalltalk.Stream);
  2499. smalltalk.addMethod(
  2500. unescape('_close'),
  2501. smalltalk.method({
  2502. selector: unescape('close'),
  2503. fn: function () {
  2504. var self=this;
  2505. return self;}
  2506. }),
  2507. smalltalk.Stream);
  2508. smalltalk.addMethod(
  2509. unescape('_collection'),
  2510. smalltalk.method({
  2511. selector: unescape('collection'),
  2512. fn: function () {
  2513. var self=this;
  2514. return self['@collection'];
  2515. return self;}
  2516. }),
  2517. smalltalk.Stream);
  2518. smalltalk.addMethod(
  2519. unescape('_contents'),
  2520. smalltalk.method({
  2521. selector: unescape('contents'),
  2522. fn: function () {
  2523. var self=this;
  2524. return smalltalk.send(smalltalk.send(self, "_collection", []), "_copyFrom_to_", [(1), smalltalk.send(self, "_streamSize", [])]);
  2525. return self;}
  2526. }),
  2527. smalltalk.Stream);
  2528. smalltalk.addMethod(
  2529. unescape('_do_'),
  2530. smalltalk.method({
  2531. selector: unescape('do%3A'),
  2532. fn: function (aBlock) {
  2533. var self=this;
  2534. (function(){while(!(function(){return smalltalk.send(self, "_atEnd", []);})()) {(function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_next", [])]);})()}})();
  2535. return self;}
  2536. }),
  2537. smalltalk.Stream);
  2538. smalltalk.addMethod(
  2539. unescape('_flush'),
  2540. smalltalk.method({
  2541. selector: unescape('flush'),
  2542. fn: function () {
  2543. var self=this;
  2544. return self;}
  2545. }),
  2546. smalltalk.Stream);
  2547. smalltalk.addMethod(
  2548. unescape('_isEmpty'),
  2549. smalltalk.method({
  2550. selector: unescape('isEmpty'),
  2551. fn: function () {
  2552. var self=this;
  2553. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
  2554. return self;}
  2555. }),
  2556. smalltalk.Stream);
  2557. smalltalk.addMethod(
  2558. unescape('_next'),
  2559. smalltalk.method({
  2560. selector: unescape('next'),
  2561. fn: function () {
  2562. var self=this;
  2563. 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", [])]);})]));
  2564. return self;}
  2565. }),
  2566. smalltalk.Stream);
  2567. smalltalk.addMethod(
  2568. unescape('_next_'),
  2569. smalltalk.method({
  2570. selector: unescape('next%3A'),
  2571. fn: function (anInteger) {
  2572. var self=this;
  2573. var tempCollection=nil;
  2574. (tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []));
  2575. 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", [])]);})]));})]);
  2576. return tempCollection;
  2577. return self;}
  2578. }),
  2579. smalltalk.Stream);
  2580. smalltalk.addMethod(
  2581. unescape('_nextPut_'),
  2582. smalltalk.method({
  2583. selector: unescape('nextPut%3A'),
  2584. fn: function (anObject) {
  2585. var self=this;
  2586. smalltalk.send(self, "_position_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);
  2587. smalltalk.send(smalltalk.send(self, "_collection", []), "_at_put_", [smalltalk.send(self, "_position", []), anObject]);
  2588. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  2589. return self;}
  2590. }),
  2591. smalltalk.Stream);
  2592. smalltalk.addMethod(
  2593. unescape('_nextPutAll_'),
  2594. smalltalk.method({
  2595. selector: unescape('nextPutAll%3A'),
  2596. fn: function (aCollection) {
  2597. var self=this;
  2598. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_nextPut_", [each]);})]);
  2599. return self;}
  2600. }),
  2601. smalltalk.Stream);
  2602. smalltalk.addMethod(
  2603. unescape('_peek'),
  2604. smalltalk.method({
  2605. selector: unescape('peek'),
  2606. fn: function () {
  2607. var self=this;
  2608. 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)]))]);})]));
  2609. return self;}
  2610. }),
  2611. smalltalk.Stream);
  2612. smalltalk.addMethod(
  2613. unescape('_position'),
  2614. smalltalk.method({
  2615. selector: unescape('position'),
  2616. fn: function () {
  2617. var self=this;
  2618. return (($receiver = self['@position']) == nil || $receiver == undefined) ? (function(){return (self['@position']=(0));})() : $receiver;
  2619. return self;}
  2620. }),
  2621. smalltalk.Stream);
  2622. smalltalk.addMethod(
  2623. unescape('_position_'),
  2624. smalltalk.method({
  2625. selector: unescape('position%3A'),
  2626. fn: function (anInteger) {
  2627. var self=this;
  2628. (self['@position']=anInteger);
  2629. return self;}
  2630. }),
  2631. smalltalk.Stream);
  2632. smalltalk.addMethod(
  2633. unescape('_reset'),
  2634. smalltalk.method({
  2635. selector: unescape('reset'),
  2636. fn: function () {
  2637. var self=this;
  2638. smalltalk.send(self, "_position_", [(0)]);
  2639. return self;}
  2640. }),
  2641. smalltalk.Stream);
  2642. smalltalk.addMethod(
  2643. unescape('_resetContents'),
  2644. smalltalk.method({
  2645. selector: unescape('resetContents'),
  2646. fn: function () {
  2647. var self=this;
  2648. smalltalk.send(self, "_reset", []);
  2649. smalltalk.send(self, "_setStreamSize_", [(0)]);
  2650. return self;}
  2651. }),
  2652. smalltalk.Stream);
  2653. smalltalk.addMethod(
  2654. unescape('_setCollection_'),
  2655. smalltalk.method({
  2656. selector: unescape('setCollection%3A'),
  2657. fn: function (aCollection) {
  2658. var self=this;
  2659. (self['@collection']=aCollection);
  2660. return self;}
  2661. }),
  2662. smalltalk.Stream);
  2663. smalltalk.addMethod(
  2664. unescape('_setStreamSize_'),
  2665. smalltalk.method({
  2666. selector: unescape('setStreamSize%3A'),
  2667. fn: function (anInteger) {
  2668. var self=this;
  2669. (self['@streamSize']=anInteger);
  2670. return self;}
  2671. }),
  2672. smalltalk.Stream);
  2673. smalltalk.addMethod(
  2674. unescape('_setToEnd'),
  2675. smalltalk.method({
  2676. selector: unescape('setToEnd'),
  2677. fn: function () {
  2678. var self=this;
  2679. smalltalk.send(self, "_position_", [smalltalk.send(self, "_size", [])]);
  2680. return self;}
  2681. }),
  2682. smalltalk.Stream);
  2683. smalltalk.addMethod(
  2684. unescape('_size'),
  2685. smalltalk.method({
  2686. selector: unescape('size'),
  2687. fn: function () {
  2688. var self=this;
  2689. return smalltalk.send(self, "_streamSize", []);
  2690. return self;}
  2691. }),
  2692. smalltalk.Stream);
  2693. smalltalk.addMethod(
  2694. unescape('_skip_'),
  2695. smalltalk.method({
  2696. selector: unescape('skip%3A'),
  2697. fn: function (anInteger) {
  2698. var self=this;
  2699. 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)])]);
  2700. return self;}
  2701. }),
  2702. smalltalk.Stream);
  2703. smalltalk.addMethod(
  2704. unescape('_streamSize'),
  2705. smalltalk.method({
  2706. selector: unescape('streamSize'),
  2707. fn: function () {
  2708. var self=this;
  2709. return self['@streamSize'];
  2710. return self;}
  2711. }),
  2712. smalltalk.Stream);
  2713. smalltalk.addMethod(
  2714. unescape('_on_'),
  2715. smalltalk.method({
  2716. selector: unescape('on%3A'),
  2717. fn: function (aCollection) {
  2718. var self=this;
  2719. 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", []));
  2720. return self;}
  2721. }),
  2722. smalltalk.Stream.klass);
  2723. smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel-Collections');
  2724. smalltalk.addMethod(
  2725. unescape('_cr'),
  2726. smalltalk.method({
  2727. selector: unescape('cr'),
  2728. fn: function () {
  2729. var self=this;
  2730. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_cr", [])]);
  2731. return self;}
  2732. }),
  2733. smalltalk.StringStream);
  2734. smalltalk.addMethod(
  2735. unescape('_crlf'),
  2736. smalltalk.method({
  2737. selector: unescape('crlf'),
  2738. fn: function () {
  2739. var self=this;
  2740. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_crlf", [])]);
  2741. return self;}
  2742. }),
  2743. smalltalk.StringStream);
  2744. smalltalk.addMethod(
  2745. unescape('_lf'),
  2746. smalltalk.method({
  2747. selector: unescape('lf'),
  2748. fn: function () {
  2749. var self=this;
  2750. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_lf", [])]);
  2751. return self;}
  2752. }),
  2753. smalltalk.StringStream);
  2754. smalltalk.addMethod(
  2755. unescape('_next_'),
  2756. smalltalk.method({
  2757. selector: unescape('next%3A'),
  2758. fn: function (anInteger) {
  2759. var self=this;
  2760. var tempCollection=nil;
  2761. (tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []));
  2762. 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", [])]));})]));})]);
  2763. return tempCollection;
  2764. return self;}
  2765. }),
  2766. smalltalk.StringStream);
  2767. smalltalk.addMethod(
  2768. unescape('_nextPut_'),
  2769. smalltalk.method({
  2770. selector: unescape('nextPut%3A'),
  2771. fn: function (aString) {
  2772. var self=this;
  2773. smalltalk.send(self, "_nextPutAll_", [aString]);
  2774. return self;}
  2775. }),
  2776. smalltalk.StringStream);
  2777. smalltalk.addMethod(
  2778. unescape('_nextPutAll_'),
  2779. smalltalk.method({
  2780. selector: unescape('nextPutAll%3A'),
  2781. fn: function (aString) {
  2782. var self=this;
  2783. 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", [])])])]);
  2784. 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", [])]))]);
  2785. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  2786. return self;}
  2787. }),
  2788. smalltalk.StringStream);
  2789. smalltalk.addMethod(
  2790. unescape('_space'),
  2791. smalltalk.method({
  2792. selector: unescape('space'),
  2793. fn: function () {
  2794. var self=this;
  2795. smalltalk.send(self, "_nextPut_", [" "]);
  2796. return self;}
  2797. }),
  2798. smalltalk.StringStream);