Kernel-Collections.deploy.js 94 KB

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