Kernel-Collections.deploy.js 94 KB

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