Kernel.deploy.js 115 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271
  1. smalltalk.addClass('Object', smalltalk.nil, [], 'Kernel');
  2. smalltalk.addMethod(
  3. '__eq',
  4. smalltalk.method({
  5. selector: '=',
  6. fn: function (anObject){
  7. var self=this;
  8. return self == anObject;
  9. return self;}
  10. }),
  11. smalltalk.Object);
  12. smalltalk.addMethod(
  13. '_~_eq',
  14. smalltalk.method({
  15. selector: '~=',
  16. fn: function (anObject){
  17. var self=this;
  18. return (($receiver = (($receiver = self).klass === smalltalk.Number) ? $receiver ==anObject : smalltalk.send($receiver, "__eq", [anObject])).klass === smalltalk.Number) ? $receiver ==false : smalltalk.send($receiver, "__eq", [false]);
  19. return self;}
  20. }),
  21. smalltalk.Object);
  22. smalltalk.addMethod(
  23. '_initialize',
  24. smalltalk.method({
  25. selector: 'initialize',
  26. fn: function (){
  27. var self=this;
  28. return self;}
  29. }),
  30. smalltalk.Object);
  31. smalltalk.addMethod(
  32. '_yourself',
  33. smalltalk.method({
  34. selector: 'yourself',
  35. fn: function (){
  36. var self=this;
  37. return self;
  38. return self;}
  39. }),
  40. smalltalk.Object);
  41. smalltalk.addMethod(
  42. '_class',
  43. smalltalk.method({
  44. selector: 'class',
  45. fn: function (){
  46. var self=this;
  47. return self.klass;
  48. return self;}
  49. }),
  50. smalltalk.Object);
  51. smalltalk.addMethod(
  52. '_size',
  53. smalltalk.method({
  54. selector: 'size',
  55. fn: function (){
  56. var self=this;
  57. smalltalk.send(self, "_error_", ["Object not indexable"]);
  58. return self;}
  59. }),
  60. smalltalk.Object);
  61. smalltalk.addMethod(
  62. '_copy',
  63. smalltalk.method({
  64. selector: 'copy',
  65. fn: function (){
  66. var self=this;
  67. return smalltalk.send(smalltalk.send(self, "_shallowCopy", []), "_postCopy", []);
  68. return self;}
  69. }),
  70. smalltalk.Object);
  71. smalltalk.addMethod(
  72. '_shallowCopy',
  73. smalltalk.method({
  74. selector: 'shallowCopy',
  75. fn: function (){
  76. var self=this;
  77. var copy = self.klass._new();
  78. for(var i in self) {
  79. if(/^@.+/.test(i)) {
  80. copy[i] = self[i];
  81. }
  82. }
  83. return copy;
  84. ;
  85. return self;}
  86. }),
  87. smalltalk.Object);
  88. smalltalk.addMethod(
  89. '_deepCopy',
  90. smalltalk.method({
  91. selector: 'deepCopy',
  92. fn: function (){
  93. var self=this;
  94. var copy = self.klass._new();
  95. for(var i in self) {
  96. if(/^@.+/.test(i)) {
  97. copy[i] = self[i]._deepCopy();
  98. }
  99. }
  100. return copy;
  101. ;
  102. return self;}
  103. }),
  104. smalltalk.Object);
  105. smalltalk.addMethod(
  106. '_postCopy',
  107. smalltalk.method({
  108. selector: 'postCopy',
  109. fn: function (){
  110. var self=this;
  111. return self;}
  112. }),
  113. smalltalk.Object);
  114. smalltalk.addMethod(
  115. '__minus_gt',
  116. smalltalk.method({
  117. selector: '->',
  118. fn: function (anObject){
  119. var self=this;
  120. return smalltalk.send(smalltalk.Association, "_key_value_", [self, anObject]);
  121. return self;}
  122. }),
  123. smalltalk.Object);
  124. smalltalk.addMethod(
  125. '_asString',
  126. smalltalk.method({
  127. selector: 'asString',
  128. fn: function (){
  129. var self=this;
  130. return smalltalk.send(self, "_printString", []);
  131. return self;}
  132. }),
  133. smalltalk.Object);
  134. smalltalk.addMethod(
  135. '_asJavascript',
  136. smalltalk.method({
  137. selector: 'asJavascript',
  138. fn: function (){
  139. var self=this;
  140. return smalltalk.send(self, "_asString", []);
  141. return self;}
  142. }),
  143. smalltalk.Object);
  144. smalltalk.addMethod(
  145. '_perform_',
  146. smalltalk.method({
  147. selector: 'perform:',
  148. fn: function (aSymbol){
  149. var self=this;
  150. return smalltalk.send(self, "_perform_withArguments_", [aSymbol, []]);
  151. return self;}
  152. }),
  153. smalltalk.Object);
  154. smalltalk.addMethod(
  155. '_perform_withArguments_',
  156. smalltalk.method({
  157. selector: 'perform:withArguments:',
  158. fn: function (aSymbol, aCollection){
  159. var self=this;
  160. return smalltalk.send(self, "_basicPerform_withArguments_", [smalltalk.send(aSymbol, "_asSelector", []), aCollection]);
  161. return self;}
  162. }),
  163. smalltalk.Object);
  164. smalltalk.addMethod(
  165. '_instVarAt_',
  166. smalltalk.method({
  167. selector: 'instVarAt:',
  168. fn: function (aString){
  169. var self=this;
  170. return self['@'+aString];
  171. return self;}
  172. }),
  173. smalltalk.Object);
  174. smalltalk.addMethod(
  175. '_instVarAt_put_',
  176. smalltalk.method({
  177. selector: 'instVarAt:put:',
  178. fn: function (aString, anObject){
  179. var self=this;
  180. self['@' + aString] = anObject;
  181. return self;}
  182. }),
  183. smalltalk.Object);
  184. smalltalk.addMethod(
  185. '_basicAt_',
  186. smalltalk.method({
  187. selector: 'basicAt:',
  188. fn: function (aString){
  189. var self=this;
  190. return self[aString];
  191. return self;}
  192. }),
  193. smalltalk.Object);
  194. smalltalk.addMethod(
  195. '_basicAt_put_',
  196. smalltalk.method({
  197. selector: 'basicAt:put:',
  198. fn: function (aString, anObject){
  199. var self=this;
  200. return self[aString] = anObject;
  201. return self;}
  202. }),
  203. smalltalk.Object);
  204. smalltalk.addMethod(
  205. '_error_',
  206. smalltalk.method({
  207. selector: 'error:',
  208. fn: function (aString){
  209. var self=this;
  210. smalltalk.send(smalltalk.Error, "_signal_", [aString]);
  211. return self;}
  212. }),
  213. smalltalk.Object);
  214. smalltalk.addMethod(
  215. '_subclassResponsibility',
  216. smalltalk.method({
  217. selector: 'subclassResponsibility',
  218. fn: function (){
  219. var self=this;
  220. smalltalk.send(self, "_error_", ["This method is a responsibility of a subclass"]);
  221. return self;}
  222. }),
  223. smalltalk.Object);
  224. smalltalk.addMethod(
  225. '_shouldNotImplement',
  226. smalltalk.method({
  227. selector: 'shouldNotImplement',
  228. fn: function (){
  229. var self=this;
  230. smalltalk.send(self, "_error_", [smalltalk.send("This method should not be implemented in ", "__comma", [smalltalk.send(smalltalk.send(self, "_class", []), "_name", [])])]);
  231. return self;}
  232. }),
  233. smalltalk.Object);
  234. smalltalk.addMethod(
  235. '_try_catch_',
  236. smalltalk.method({
  237. selector: 'try:catch:',
  238. fn: function (aBlock, anotherBlock){
  239. var self=this;
  240. try{aBlock()} catch(e) {anotherBlock(e)};
  241. return self;}
  242. }),
  243. smalltalk.Object);
  244. smalltalk.addMethod(
  245. '_printString',
  246. smalltalk.method({
  247. selector: 'printString',
  248. fn: function (){
  249. var self=this;
  250. return smalltalk.send("a ", "__comma", [smalltalk.send(smalltalk.send(self, "_class", []), "_name", [])]);
  251. return self;}
  252. }),
  253. smalltalk.Object);
  254. smalltalk.addMethod(
  255. '_printNl',
  256. smalltalk.method({
  257. selector: 'printNl',
  258. fn: function (){
  259. var self=this;
  260. console.log(self);
  261. return self;}
  262. }),
  263. smalltalk.Object);
  264. smalltalk.addMethod(
  265. '_isKindOf_',
  266. smalltalk.method({
  267. selector: 'isKindOf:',
  268. fn: function (aClass){
  269. var self=this;
  270. return smalltalk.send(smalltalk.send(self, "_isMemberOf_", [aClass]), "_ifTrue_ifFalse_", [(function(){return true;}), (function(){return smalltalk.send(smalltalk.send(self, "_class", []), "_inheritsFrom_", [aClass]);})]);
  271. return self;}
  272. }),
  273. smalltalk.Object);
  274. smalltalk.addMethod(
  275. '_isMemberOf_',
  276. smalltalk.method({
  277. selector: 'isMemberOf:',
  278. fn: function (aClass){
  279. var self=this;
  280. return smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [aClass]);
  281. return self;}
  282. }),
  283. smalltalk.Object);
  284. smalltalk.addMethod(
  285. '_ifNil_',
  286. smalltalk.method({
  287. selector: 'ifNil:',
  288. fn: function (aBlock){
  289. var self=this;
  290. return self;
  291. return self;}
  292. }),
  293. smalltalk.Object);
  294. smalltalk.addMethod(
  295. '_ifNil_ifNotNil_',
  296. smalltalk.method({
  297. selector: 'ifNil:ifNotNil:',
  298. fn: function (aBlock, anotherBlock){
  299. var self=this;
  300. return smalltalk.send(anotherBlock, "_value", []);
  301. return self;}
  302. }),
  303. smalltalk.Object);
  304. smalltalk.addMethod(
  305. '_ifNotNil_',
  306. smalltalk.method({
  307. selector: 'ifNotNil:',
  308. fn: function (aBlock){
  309. var self=this;
  310. return smalltalk.send(aBlock, "_value", []);
  311. return self;}
  312. }),
  313. smalltalk.Object);
  314. smalltalk.addMethod(
  315. '_ifNotNil_ifNil_',
  316. smalltalk.method({
  317. selector: 'ifNotNil:ifNil:',
  318. fn: function (aBlock, anotherBlock){
  319. var self=this;
  320. return smalltalk.send(aBlock, "_value", []);
  321. return self;}
  322. }),
  323. smalltalk.Object);
  324. smalltalk.addMethod(
  325. '_isNil',
  326. smalltalk.method({
  327. selector: 'isNil',
  328. fn: function (){
  329. var self=this;
  330. return false;
  331. return self;}
  332. }),
  333. smalltalk.Object);
  334. smalltalk.addMethod(
  335. '_notNil',
  336. smalltalk.method({
  337. selector: 'notNil',
  338. fn: function (){
  339. var self=this;
  340. return smalltalk.send(smalltalk.send(self, "_isNil", []), "_not", []);
  341. return self;}
  342. }),
  343. smalltalk.Object);
  344. smalltalk.addMethod(
  345. '_isClass',
  346. smalltalk.method({
  347. selector: 'isClass',
  348. fn: function (){
  349. var self=this;
  350. return false;
  351. return self;}
  352. }),
  353. smalltalk.Object);
  354. smalltalk.addMethod(
  355. '_isMetaclass',
  356. smalltalk.method({
  357. selector: 'isMetaclass',
  358. fn: function (){
  359. var self=this;
  360. return false;
  361. return self;}
  362. }),
  363. smalltalk.Object);
  364. smalltalk.addMethod(
  365. '_isNumber',
  366. smalltalk.method({
  367. selector: 'isNumber',
  368. fn: function (){
  369. var self=this;
  370. return false;
  371. return self;}
  372. }),
  373. smalltalk.Object);
  374. smalltalk.addMethod(
  375. '_isString',
  376. smalltalk.method({
  377. selector: 'isString',
  378. fn: function (){
  379. var self=this;
  380. return false;
  381. return self;}
  382. }),
  383. smalltalk.Object);
  384. smalltalk.addMethod(
  385. '_isParseFailure',
  386. smalltalk.method({
  387. selector: 'isParseFailure',
  388. fn: function (){
  389. var self=this;
  390. return false;
  391. return self;}
  392. }),
  393. smalltalk.Object);
  394. smalltalk.addMethod(
  395. '_basicPerform_',
  396. smalltalk.method({
  397. selector: 'basicPerform:',
  398. fn: function (aSymbol){
  399. var self=this;
  400. return smalltalk.send(self, "_basicPerform_withArguments_", [aSymbol, []]);
  401. return self;}
  402. }),
  403. smalltalk.Object);
  404. smalltalk.addMethod(
  405. '_basicPerform_withArguments_',
  406. smalltalk.method({
  407. selector: 'basicPerform:withArguments:',
  408. fn: function (aSymbol, aCollection){
  409. var self=this;
  410. return self[aSymbol].apply(self, aCollection);;
  411. return self;}
  412. }),
  413. smalltalk.Object);
  414. smalltalk.addMethod(
  415. '_basicDelete_',
  416. smalltalk.method({
  417. selector: 'basicDelete:',
  418. fn: function (aString){
  419. var self=this;
  420. delete self[aString];
  421. return self;}
  422. }),
  423. smalltalk.Object);
  424. smalltalk.addMethod(
  425. '_doesNotUnderstand_',
  426. smalltalk.method({
  427. selector: 'doesNotUnderstand:',
  428. fn: function (aMessage){
  429. var self=this;
  430. (function($rec){smalltalk.send($rec, "_receiver_", [self]);smalltalk.send($rec, "_message_", [aMessage]);return smalltalk.send($rec, "_signal", []);})(smalltalk.send(smalltalk.MessageNotUnderstood, "_new", []));
  431. return self;}
  432. }),
  433. smalltalk.Object);
  434. smalltalk.addMethod(
  435. '_asJSON',
  436. smalltalk.method({
  437. selector: 'asJSON',
  438. fn: function (){
  439. var self=this;
  440. return JSON.stringify(self._asJSONObject());
  441. return self;}
  442. }),
  443. smalltalk.Object);
  444. smalltalk.addMethod(
  445. '_asJSONObject',
  446. smalltalk.method({
  447. selector: 'asJSONObject',
  448. fn: function (){
  449. var self=this;
  450. var object=nil;
  451. object=smalltalk.send(smalltalk.Object, "_new", []);
  452. smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_instanceVariableNames", []), "_do_", [(function(each){return smalltalk.send(object, "_basicAt_put_", [each, smalltalk.send(smalltalk.send(self, "_instVarAt_", [each]), "_asJSONObject", [])]);})]);
  453. return object;
  454. return self;}
  455. }),
  456. smalltalk.Object);
  457. smalltalk.addMethod(
  458. '_halt',
  459. smalltalk.method({
  460. selector: 'halt',
  461. fn: function (){
  462. var self=this;
  463. smalltalk.send(self, "_error_", ["Halt encountered"]);
  464. return self;}
  465. }),
  466. smalltalk.Object);
  467. smalltalk.addMethod(
  468. '_initialize',
  469. smalltalk.method({
  470. selector: 'initialize',
  471. fn: function (){
  472. var self=this;
  473. return self;}
  474. }),
  475. smalltalk.Object.klass);
  476. smalltalk.addClass('Smalltalk', smalltalk.Object, [], 'Kernel');
  477. smalltalk.addMethod(
  478. '_classes',
  479. smalltalk.method({
  480. selector: 'classes',
  481. fn: function (){
  482. var self=this;
  483. return self.classes();
  484. return self;}
  485. }),
  486. smalltalk.Smalltalk);
  487. smalltalk.addMethod(
  488. '_readJSON_',
  489. smalltalk.method({
  490. selector: 'readJSON:',
  491. fn: function (anObject){
  492. var self=this;
  493. return self.readJSObject(anObject);
  494. return self;}
  495. }),
  496. smalltalk.Smalltalk);
  497. smalltalk.addMethod(
  498. '_at_',
  499. smalltalk.method({
  500. selector: 'at:',
  501. fn: function (aString){
  502. var self=this;
  503. return self[aString];
  504. return self;}
  505. }),
  506. smalltalk.Smalltalk);
  507. smalltalk.addMethod(
  508. '_removeClass_',
  509. smalltalk.method({
  510. selector: 'removeClass:',
  511. fn: function (aClass){
  512. var self=this;
  513. smalltalk.send(smalltalk.send(aClass, "_isMetaclass", []), "_ifTrue_", [(function(){return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_asString", []), "__comma", [unescape("%20is%20a%20Metaclass%20and%20cannot%20be%20removed%21")])]);})]);
  514. smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_values", []), "_do_", [(function(each){return smalltalk.send(aClass, "_removeCompiledMethod_", [each]);})]);
  515. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_methodDictionary", []), "_values", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(aClass, "_class", []), "_removeCompiledMethod_", [each]);})]);
  516. smalltalk.send(self, "_basicDelete_", [smalltalk.send(aClass, "_name", [])]);
  517. return self;}
  518. }),
  519. smalltalk.Smalltalk);
  520. smalltalk.Smalltalk.klass.iVarNames = ['current'];
  521. smalltalk.addMethod(
  522. '_current',
  523. smalltalk.method({
  524. selector: 'current',
  525. fn: function (){
  526. var self=this;
  527. return smalltalk;
  528. return self;}
  529. }),
  530. smalltalk.Smalltalk.klass);
  531. smalltalk.addClass('Behavior', smalltalk.Object, [], 'Kernel');
  532. smalltalk.addMethod(
  533. '_new',
  534. smalltalk.method({
  535. selector: 'new',
  536. fn: function (){
  537. var self=this;
  538. return smalltalk.send(smalltalk.send(self, "_basicNew", []), "_initialize", []);
  539. return self;}
  540. }),
  541. smalltalk.Behavior);
  542. smalltalk.addMethod(
  543. '_basicNew',
  544. smalltalk.method({
  545. selector: 'basicNew',
  546. fn: function (){
  547. var self=this;
  548. return new self.fn();
  549. return self;}
  550. }),
  551. smalltalk.Behavior);
  552. smalltalk.addMethod(
  553. '_name',
  554. smalltalk.method({
  555. selector: 'name',
  556. fn: function (){
  557. var self=this;
  558. return self.className || nil;
  559. return self;}
  560. }),
  561. smalltalk.Behavior);
  562. smalltalk.addMethod(
  563. '_superclass',
  564. smalltalk.method({
  565. selector: 'superclass',
  566. fn: function (){
  567. var self=this;
  568. return self.superclass || nil;
  569. return self;}
  570. }),
  571. smalltalk.Behavior);
  572. smalltalk.addMethod(
  573. '_subclasses',
  574. smalltalk.method({
  575. selector: 'subclasses',
  576. fn: function (){
  577. var self=this;
  578. return smalltalk.subclasses(self);
  579. return self;}
  580. }),
  581. smalltalk.Behavior);
  582. smalltalk.addMethod(
  583. '_allSubclasses',
  584. smalltalk.method({
  585. selector: 'allSubclasses',
  586. fn: function (){
  587. var self=this;
  588. var result=nil;
  589. result=smalltalk.send(self, "_subclasses", []);
  590. smalltalk.send(smalltalk.send(self, "_subclasses", []), "_do_", [(function(each){return smalltalk.send(result, "_addAll_", [smalltalk.send(each, "_allSubclasses", [])]);})]);
  591. return result;
  592. return self;}
  593. }),
  594. smalltalk.Behavior);
  595. smalltalk.addMethod(
  596. '_withAllSubclasses',
  597. smalltalk.method({
  598. selector: 'withAllSubclasses',
  599. fn: function (){
  600. var self=this;
  601. return (function($rec){smalltalk.send($rec, "_addAll_", [smalltalk.send(self, "_allSubclasses", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.Array, "_with_", [self]));
  602. return self;}
  603. }),
  604. smalltalk.Behavior);
  605. smalltalk.addMethod(
  606. '_prototype',
  607. smalltalk.method({
  608. selector: 'prototype',
  609. fn: function (){
  610. var self=this;
  611. return self.fn.prototype;
  612. return self;}
  613. }),
  614. smalltalk.Behavior);
  615. smalltalk.addMethod(
  616. '_methodDictionary',
  617. smalltalk.method({
  618. selector: 'methodDictionary',
  619. fn: function (){
  620. var self=this;
  621. var dict = smalltalk.Dictionary._new();
  622. var methods = self.fn.prototype.methods;
  623. for(var i in methods) {
  624. if(methods[i].selector) {
  625. dict._at_put_(methods[i].selector, methods[i]);
  626. }
  627. };
  628. return dict;
  629. return self;}
  630. }),
  631. smalltalk.Behavior);
  632. smalltalk.addMethod(
  633. '_methodsFor_',
  634. smalltalk.method({
  635. selector: 'methodsFor:',
  636. fn: function (aString){
  637. var self=this;
  638. return (function($rec){smalltalk.send($rec, "_class_category_", [self, aString]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.ClassCategoryReader, "_new", []));
  639. return self;}
  640. }),
  641. smalltalk.Behavior);
  642. smalltalk.addMethod(
  643. '_addCompiledMethod_',
  644. smalltalk.method({
  645. selector: 'addCompiledMethod:',
  646. fn: function (aMethod){
  647. var self=this;
  648. smalltalk.addMethod(aMethod.selector._asSelector(), aMethod, self);
  649. return self;}
  650. }),
  651. smalltalk.Behavior);
  652. smalltalk.addMethod(
  653. '_instanceVariableNames',
  654. smalltalk.method({
  655. selector: 'instanceVariableNames',
  656. fn: function (){
  657. var self=this;
  658. return self.iVarNames;
  659. return self;}
  660. }),
  661. smalltalk.Behavior);
  662. smalltalk.addMethod(
  663. '_comment',
  664. smalltalk.method({
  665. selector: 'comment',
  666. fn: function (){
  667. var self=this;
  668. return smalltalk.send(smalltalk.send(self, "_basicAt_", ["comment"]), "_ifNil_", [(function(){return "";})]);
  669. return self;}
  670. }),
  671. smalltalk.Behavior);
  672. smalltalk.addMethod(
  673. '_comment_',
  674. smalltalk.method({
  675. selector: 'comment:',
  676. fn: function (aString){
  677. var self=this;
  678. smalltalk.send(self, "_basicAt_put_", ["comment", aString]);
  679. return self;}
  680. }),
  681. smalltalk.Behavior);
  682. smalltalk.addMethod(
  683. '_commentStamp',
  684. smalltalk.method({
  685. selector: 'commentStamp',
  686. fn: function (){
  687. var self=this;
  688. return (function($rec){smalltalk.send($rec, "_class_", [self]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.ClassCommentReader, "_new", []));
  689. return self;}
  690. }),
  691. smalltalk.Behavior);
  692. smalltalk.addMethod(
  693. '_removeCompiledMethod_',
  694. smalltalk.method({
  695. selector: 'removeCompiledMethod:',
  696. fn: function (aMethod){
  697. var self=this;
  698. delete self.fn.prototype[aMethod.selector._asSelector()];
  699. delete self.fn.prototype.methods[aMethod.selector];
  700. smalltalk.init(self);;
  701. return self;}
  702. }),
  703. smalltalk.Behavior);
  704. smalltalk.addMethod(
  705. '_inheritsFrom_',
  706. smalltalk.method({
  707. selector: 'inheritsFrom:',
  708. fn: function (aClass){
  709. var self=this;
  710. return smalltalk.send(smalltalk.send(aClass, "_allSubclasses", []), "_includes_", [self]);
  711. return self;}
  712. }),
  713. smalltalk.Behavior);
  714. smalltalk.addMethod(
  715. '_protocols',
  716. smalltalk.method({
  717. selector: 'protocols',
  718. fn: function (){
  719. var self=this;
  720. var protocols=nil;
  721. protocols=smalltalk.send(smalltalk.Array, "_new", []);
  722. smalltalk.send(smalltalk.send(self, "_methodDictionary", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(protocols, "_includes_", [smalltalk.send(each, "_category", [])]), "_ifFalse_", [(function(){return smalltalk.send(protocols, "_add_", [smalltalk.send(each, "_category", [])]);})]);})]);
  723. return smalltalk.send(protocols, "_sort", []);
  724. return self;}
  725. }),
  726. smalltalk.Behavior);
  727. smalltalk.addMethod(
  728. '_protocolsDo_',
  729. smalltalk.method({
  730. selector: 'protocolsDo:',
  731. fn: function (aBlock){
  732. var self=this;
  733. var methodsByCategory=nil;
  734. methodsByCategory=smalltalk.send(smalltalk.Dictionary, "_new", []);
  735. smalltalk.send(smalltalk.send(smalltalk.send(self, "_methodDictionary", []), "_values", []), "_do_", [(function(m){return smalltalk.send(smalltalk.send(methodsByCategory, "_at_ifAbsentPut_", [smalltalk.send(m, "_category", []), (function(){return smalltalk.send(smalltalk.Array, "_new", []);})]), "_add_", [m]);})]);
  736. smalltalk.send(smalltalk.send(self, "_protocols", []), "_do_", [(function(category){return smalltalk.send(aBlock, "_value_value_", [category, smalltalk.send(methodsByCategory, "_at_", [category])]);})]);
  737. return self;}
  738. }),
  739. smalltalk.Behavior);
  740. smalltalk.addMethod(
  741. '_allInstanceVariableNames',
  742. smalltalk.method({
  743. selector: 'allInstanceVariableNames',
  744. fn: function (){
  745. var self=this;
  746. var result=nil;
  747. result=smalltalk.send(smalltalk.send(self, "_instanceVariableNames", []), "_copy", []);
  748. smalltalk.send(smalltalk.send(self, "_superclass", []), "_ifNotNil_", [(function(){return smalltalk.send(result, "_addAll_", [smalltalk.send(smalltalk.send(self, "_superclass", []), "_allInstanceVariableNames", [])]);})]);
  749. return result;
  750. return self;}
  751. }),
  752. smalltalk.Behavior);
  753. smalltalk.addMethod(
  754. '_methodAt_',
  755. smalltalk.method({
  756. selector: 'methodAt:',
  757. fn: function (aString){
  758. var self=this;
  759. return smalltalk.methods(self)[aString];
  760. return self;}
  761. }),
  762. smalltalk.Behavior);
  763. smalltalk.addMethod(
  764. '_methodsFor_stamp_',
  765. smalltalk.method({
  766. selector: 'methodsFor:stamp:',
  767. fn: function (aString, aStamp){
  768. var self=this;
  769. return smalltalk.send(self, "_methodsFor_", [aString]);
  770. return self;}
  771. }),
  772. smalltalk.Behavior);
  773. smalltalk.addMethod(
  774. '_commentStamp_prior_',
  775. smalltalk.method({
  776. selector: 'commentStamp:prior:',
  777. fn: function (aStamp, prior){
  778. var self=this;
  779. return smalltalk.send(self, "_commentStamp", []);
  780. return self;}
  781. }),
  782. smalltalk.Behavior);
  783. smalltalk.addClass('Class', smalltalk.Behavior, [], 'Kernel');
  784. smalltalk.addMethod(
  785. '_category',
  786. smalltalk.method({
  787. selector: 'category',
  788. fn: function (){
  789. var self=this;
  790. return self.category;
  791. return self;}
  792. }),
  793. smalltalk.Class);
  794. smalltalk.addMethod(
  795. '_category_',
  796. smalltalk.method({
  797. selector: 'category:',
  798. fn: function (aString){
  799. var self=this;
  800. self.category = aString;
  801. return self;}
  802. }),
  803. smalltalk.Class);
  804. smalltalk.addMethod(
  805. '_subclass_instanceVariableNames_',
  806. smalltalk.method({
  807. selector: 'subclass:instanceVariableNames:',
  808. fn: function (aString, anotherString){
  809. var self=this;
  810. return smalltalk.send(self, "_subclass_instanceVariableNames_category_", [aString, anotherString, nil]);
  811. return self;}
  812. }),
  813. smalltalk.Class);
  814. smalltalk.addMethod(
  815. '_subclass_instanceVariableNames_category_',
  816. smalltalk.method({
  817. selector: 'subclass:instanceVariableNames:category:',
  818. fn: function (aString, aString2, aString3){
  819. var self=this;
  820. return smalltalk.send(smalltalk.send(smalltalk.ClassBuilder, "_new", []), "_superclass_subclass_instanceVariableNames_category_", [self, aString, aString2, aString3]);
  821. return self;}
  822. }),
  823. smalltalk.Class);
  824. smalltalk.addMethod(
  825. '_isClass',
  826. smalltalk.method({
  827. selector: 'isClass',
  828. fn: function (){
  829. var self=this;
  830. return true;
  831. return self;}
  832. }),
  833. smalltalk.Class);
  834. smalltalk.addMethod(
  835. '_printString',
  836. smalltalk.method({
  837. selector: 'printString',
  838. fn: function (){
  839. var self=this;
  840. return smalltalk.send(self, "_name", []);
  841. return self;}
  842. }),
  843. smalltalk.Class);
  844. smalltalk.addMethod(
  845. '_rename_',
  846. smalltalk.method({
  847. selector: 'rename:',
  848. fn: function (aString){
  849. var self=this;
  850. smalltalk[aString] = self;
  851. delete smalltalk[self.className];
  852. self.className = aString;
  853. ;
  854. return self;}
  855. }),
  856. smalltalk.Class);
  857. smalltalk.addMethod(
  858. '_subclass_instanceVariableNames_classVariableNames_poolDictionaries_category_',
  859. smalltalk.method({
  860. selector: 'subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:',
  861. fn: function (aString, aString2, classVars, pools, aString3){
  862. var self=this;
  863. return smalltalk.send(self, "_subclass_instanceVariableNames_category_", [aString, aString2, aString3]);
  864. return self;}
  865. }),
  866. smalltalk.Class);
  867. smalltalk.addClass('Metaclass', smalltalk.Behavior, [], 'Kernel');
  868. smalltalk.addMethod(
  869. '_instanceClass',
  870. smalltalk.method({
  871. selector: 'instanceClass',
  872. fn: function (){
  873. var self=this;
  874. return self.instanceClass;
  875. return self;}
  876. }),
  877. smalltalk.Metaclass);
  878. smalltalk.addMethod(
  879. '_instanceVariableNames_',
  880. smalltalk.method({
  881. selector: 'instanceVariableNames:',
  882. fn: function (aCollection){
  883. var self=this;
  884. smalltalk.send(smalltalk.send(smalltalk.ClassBuilder, "_new", []), "_class_instanceVariableNames_", [self, aCollection]);
  885. return self;}
  886. }),
  887. smalltalk.Metaclass);
  888. smalltalk.addMethod(
  889. '_isMetaclass',
  890. smalltalk.method({
  891. selector: 'isMetaclass',
  892. fn: function (){
  893. var self=this;
  894. return true;
  895. return self;}
  896. }),
  897. smalltalk.Metaclass);
  898. smalltalk.addMethod(
  899. '_printString',
  900. smalltalk.method({
  901. selector: 'printString',
  902. fn: function (){
  903. var self=this;
  904. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_instanceClass", []), "_name", []), "__comma", [" class"]);
  905. return self;}
  906. }),
  907. smalltalk.Metaclass);
  908. smalltalk.addClass('CompiledMethod', smalltalk.Object, [], 'Kernel');
  909. smalltalk.addMethod(
  910. '_source',
  911. smalltalk.method({
  912. selector: 'source',
  913. fn: function (){
  914. var self=this;
  915. return smalltalk.send(smalltalk.send(self, "_basicAt_", ["source"]), "_ifNil_", [(function(){return "";})]);
  916. return self;}
  917. }),
  918. smalltalk.CompiledMethod);
  919. smalltalk.addMethod(
  920. '_source_',
  921. smalltalk.method({
  922. selector: 'source:',
  923. fn: function (aString){
  924. var self=this;
  925. smalltalk.send(self, "_basicAt_put_", ["source", aString]);
  926. return self;}
  927. }),
  928. smalltalk.CompiledMethod);
  929. smalltalk.addMethod(
  930. '_category',
  931. smalltalk.method({
  932. selector: 'category',
  933. fn: function (){
  934. var self=this;
  935. return smalltalk.send(smalltalk.send(self, "_basicAt_", ["category"]), "_ifNil_", [(function(){return "";})]);
  936. return self;}
  937. }),
  938. smalltalk.CompiledMethod);
  939. smalltalk.addMethod(
  940. '_category_',
  941. smalltalk.method({
  942. selector: 'category:',
  943. fn: function (aString){
  944. var self=this;
  945. smalltalk.send(self, "_basicAt_put_", ["category", aString]);
  946. return self;}
  947. }),
  948. smalltalk.CompiledMethod);
  949. smalltalk.addMethod(
  950. '_selector',
  951. smalltalk.method({
  952. selector: 'selector',
  953. fn: function (){
  954. var self=this;
  955. return smalltalk.send(self, "_basicAt_", ["selector"]);
  956. return self;}
  957. }),
  958. smalltalk.CompiledMethod);
  959. smalltalk.addMethod(
  960. '_selector_',
  961. smalltalk.method({
  962. selector: 'selector:',
  963. fn: function (aString){
  964. var self=this;
  965. smalltalk.send(self, "_basicAt_put_", ["selector", aString]);
  966. return self;}
  967. }),
  968. smalltalk.CompiledMethod);
  969. smalltalk.addMethod(
  970. '_fn',
  971. smalltalk.method({
  972. selector: 'fn',
  973. fn: function (){
  974. var self=this;
  975. return smalltalk.send(self, "_basicAt_", ["fn"]);
  976. return self;}
  977. }),
  978. smalltalk.CompiledMethod);
  979. smalltalk.addMethod(
  980. '_fn_',
  981. smalltalk.method({
  982. selector: 'fn:',
  983. fn: function (aBlock){
  984. var self=this;
  985. smalltalk.send(self, "_basicAt_put_", ["fn", aBlock]);
  986. return self;}
  987. }),
  988. smalltalk.CompiledMethod);
  989. smalltalk.addMethod(
  990. '_messageSends',
  991. smalltalk.method({
  992. selector: 'messageSends',
  993. fn: function (){
  994. var self=this;
  995. return smalltalk.send(self, "_basicAt_", ["messageSends"]);
  996. return self;}
  997. }),
  998. smalltalk.CompiledMethod);
  999. smalltalk.addMethod(
  1000. '_methodClass',
  1001. smalltalk.method({
  1002. selector: 'methodClass',
  1003. fn: function (){
  1004. var self=this;
  1005. return smalltalk.send(self, "_basicAt_", ["methodClass"]);
  1006. return self;}
  1007. }),
  1008. smalltalk.CompiledMethod);
  1009. smalltalk.addMethod(
  1010. '_referencedClasses',
  1011. smalltalk.method({
  1012. selector: 'referencedClasses',
  1013. fn: function (){
  1014. var self=this;
  1015. return smalltalk.send(self, "_basicAt_", ["referencedClasses"]);
  1016. return self;}
  1017. }),
  1018. smalltalk.CompiledMethod);
  1019. smalltalk.addClass('Number', smalltalk.Object, [], 'Kernel');
  1020. smalltalk.addMethod(
  1021. '__eq',
  1022. smalltalk.method({
  1023. selector: '=',
  1024. fn: function (aNumber){
  1025. var self=this;
  1026. return Number(self) == aNumber;
  1027. return self;}
  1028. }),
  1029. smalltalk.Number);
  1030. smalltalk.addMethod(
  1031. '__gt',
  1032. smalltalk.method({
  1033. selector: '>',
  1034. fn: function (aNumber){
  1035. var self=this;
  1036. return self > aNumber;
  1037. return self;}
  1038. }),
  1039. smalltalk.Number);
  1040. smalltalk.addMethod(
  1041. '__lt',
  1042. smalltalk.method({
  1043. selector: '<',
  1044. fn: function (aNumber){
  1045. var self=this;
  1046. return self < aNumber;
  1047. return self;}
  1048. }),
  1049. smalltalk.Number);
  1050. smalltalk.addMethod(
  1051. '__gt_eq',
  1052. smalltalk.method({
  1053. selector: '>=',
  1054. fn: function (aNumber){
  1055. var self=this;
  1056. return self >= aNumber;
  1057. return self;}
  1058. }),
  1059. smalltalk.Number);
  1060. smalltalk.addMethod(
  1061. '__lt_eq',
  1062. smalltalk.method({
  1063. selector: '<=',
  1064. fn: function (aNumber){
  1065. var self=this;
  1066. return self <= aNumber;
  1067. return self;}
  1068. }),
  1069. smalltalk.Number);
  1070. smalltalk.addMethod(
  1071. '__plus',
  1072. smalltalk.method({
  1073. selector: '+',
  1074. fn: function (aNumber){
  1075. var self=this;
  1076. return self + aNumber;
  1077. return self;}
  1078. }),
  1079. smalltalk.Number);
  1080. smalltalk.addMethod(
  1081. '__minus',
  1082. smalltalk.method({
  1083. selector: '-',
  1084. fn: function (aNumber){
  1085. var self=this;
  1086. return self - aNumber;
  1087. return self;}
  1088. }),
  1089. smalltalk.Number);
  1090. smalltalk.addMethod(
  1091. '__star',
  1092. smalltalk.method({
  1093. selector: '*',
  1094. fn: function (aNumber){
  1095. var self=this;
  1096. return self * aNumber;
  1097. return self;}
  1098. }),
  1099. smalltalk.Number);
  1100. smalltalk.addMethod(
  1101. '__slash',
  1102. smalltalk.method({
  1103. selector: '/',
  1104. fn: function (aNumber){
  1105. var self=this;
  1106. return self / aNumber;
  1107. return self;}
  1108. }),
  1109. smalltalk.Number);
  1110. smalltalk.addMethod(
  1111. '_max_',
  1112. smalltalk.method({
  1113. selector: 'max:',
  1114. fn: function (aNumber){
  1115. var self=this;
  1116. return Math.max(self, aNumber);;
  1117. return self;}
  1118. }),
  1119. smalltalk.Number);
  1120. smalltalk.addMethod(
  1121. '_min_',
  1122. smalltalk.method({
  1123. selector: 'min:',
  1124. fn: function (aNumber){
  1125. var self=this;
  1126. return Math.min(self, aNumber);;
  1127. return self;}
  1128. }),
  1129. smalltalk.Number);
  1130. smalltalk.addMethod(
  1131. '_rounded',
  1132. smalltalk.method({
  1133. selector: 'rounded',
  1134. fn: function (){
  1135. var self=this;
  1136. return Math.round(self);;
  1137. return self;}
  1138. }),
  1139. smalltalk.Number);
  1140. smalltalk.addMethod(
  1141. '_truncated',
  1142. smalltalk.method({
  1143. selector: 'truncated',
  1144. fn: function (){
  1145. var self=this;
  1146. return Math.floor(self);;
  1147. return self;}
  1148. }),
  1149. smalltalk.Number);
  1150. smalltalk.addMethod(
  1151. '_to_',
  1152. smalltalk.method({
  1153. selector: 'to:',
  1154. fn: function (aNumber){
  1155. var self=this;
  1156. var array=nil;
  1157. var first=nil;
  1158. var last=nil;
  1159. var count=nil;
  1160. first=smalltalk.send(self, "_truncated", []);
  1161. last=smalltalk.send(smalltalk.send(aNumber, "_truncated", []), "__plus", [(1)]);
  1162. count=(1);
  1163. smalltalk.send(smalltalk.send(first, "__lt_eq", [last]), "_ifFalse_", [(function(){return smalltalk.send(self, "_error_", ["Wrong interval"]);})]);
  1164. array=smalltalk.send(smalltalk.Array, "_new", []);
  1165. smalltalk.send(smalltalk.send(last, "__minus", [first]), "_timesRepeat_", [(function(){smalltalk.send(array, "_at_put_", [count, first]);count=smalltalk.send(count, "__plus", [(1)]);return first=smalltalk.send(first, "__plus", [(1)]);})]);
  1166. return array;
  1167. return self;}
  1168. }),
  1169. smalltalk.Number);
  1170. smalltalk.addMethod(
  1171. '_timesRepeat_',
  1172. smalltalk.method({
  1173. selector: 'timesRepeat:',
  1174. fn: function (aBlock){
  1175. var self=this;
  1176. var integer=nil;
  1177. var count=nil;
  1178. integer=smalltalk.send(self, "_truncated", []);
  1179. count=(1);
  1180. smalltalk.send((function(){return smalltalk.send(count, "__gt", [self]);}), "_whileFalse_", [(function(){smalltalk.send(aBlock, "_value", []);return count=smalltalk.send(count, "__plus", [(1)]);})]);
  1181. return self;}
  1182. }),
  1183. smalltalk.Number);
  1184. smalltalk.addMethod(
  1185. '_to_do_',
  1186. smalltalk.method({
  1187. selector: 'to:do:',
  1188. fn: function (aNumber, aBlock){
  1189. var self=this;
  1190. return smalltalk.send(smalltalk.send(self, "_to_", [aNumber]), "_do_", [aBlock]);
  1191. return self;}
  1192. }),
  1193. smalltalk.Number);
  1194. smalltalk.addMethod(
  1195. '_asString',
  1196. smalltalk.method({
  1197. selector: 'asString',
  1198. fn: function (){
  1199. var self=this;
  1200. return smalltalk.send(self, "_printString", []);
  1201. return self;}
  1202. }),
  1203. smalltalk.Number);
  1204. smalltalk.addMethod(
  1205. '_asJavascript',
  1206. smalltalk.method({
  1207. selector: 'asJavascript',
  1208. fn: function (){
  1209. var self=this;
  1210. return smalltalk.send(smalltalk.send(unescape("%28"), "__comma", [smalltalk.send(self, "_printString", [])]), "__comma", [unescape("%29")]);
  1211. return self;}
  1212. }),
  1213. smalltalk.Number);
  1214. smalltalk.addMethod(
  1215. '_printString',
  1216. smalltalk.method({
  1217. selector: 'printString',
  1218. fn: function (){
  1219. var self=this;
  1220. return String(self);
  1221. return self;}
  1222. }),
  1223. smalltalk.Number);
  1224. smalltalk.addMethod(
  1225. '_isNumber',
  1226. smalltalk.method({
  1227. selector: 'isNumber',
  1228. fn: function (){
  1229. var self=this;
  1230. return true;
  1231. return self;}
  1232. }),
  1233. smalltalk.Number);
  1234. smalltalk.addMethod(
  1235. '_atRandom',
  1236. smalltalk.method({
  1237. selector: 'atRandom',
  1238. fn: function (){
  1239. var self=this;
  1240. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.Random, "_new", []), "_next", []), "__star", [self]), "_truncated", []), "__plus", [(1)]);
  1241. return self;}
  1242. }),
  1243. smalltalk.Number);
  1244. smalltalk.addMethod(
  1245. '__at',
  1246. smalltalk.method({
  1247. selector: '@',
  1248. fn: function (aNumber){
  1249. var self=this;
  1250. return smalltalk.send(smalltalk.Point, "_x_y_", [self, aNumber]);
  1251. return self;}
  1252. }),
  1253. smalltalk.Number);
  1254. smalltalk.addMethod(
  1255. '_asPoint',
  1256. smalltalk.method({
  1257. selector: 'asPoint',
  1258. fn: function (){
  1259. var self=this;
  1260. return smalltalk.send(smalltalk.Point, "_x_y_", [self, self]);
  1261. return self;}
  1262. }),
  1263. smalltalk.Number);
  1264. smalltalk.addMethod(
  1265. '_clearInterval',
  1266. smalltalk.method({
  1267. selector: 'clearInterval',
  1268. fn: function (){
  1269. var self=this;
  1270. clearInterval(Number(self));
  1271. return self;}
  1272. }),
  1273. smalltalk.Number);
  1274. smalltalk.addMethod(
  1275. '_asJSONObject',
  1276. smalltalk.method({
  1277. selector: 'asJSONObject',
  1278. fn: function (){
  1279. var self=this;
  1280. return self;
  1281. return self;}
  1282. }),
  1283. smalltalk.Number);
  1284. smalltalk.addMethod(
  1285. '_clearTimeout',
  1286. smalltalk.method({
  1287. selector: 'clearTimeout',
  1288. fn: function (){
  1289. var self=this;
  1290. clearTimeout(Number(self));
  1291. return self;}
  1292. }),
  1293. smalltalk.Number);
  1294. smalltalk.addMethod(
  1295. '_modulo_',
  1296. smalltalk.method({
  1297. selector: 'modulo:',
  1298. fn: function (aNumber){
  1299. var self=this;
  1300. return self % aNumber;
  1301. return self;}
  1302. }),
  1303. smalltalk.Number);
  1304. smalltalk.addMethod(
  1305. '_even',
  1306. smalltalk.method({
  1307. selector: 'even',
  1308. fn: function (){
  1309. var self=this;
  1310. return smalltalk.send((0), "__eq", [smalltalk.send(self, "_modulo_", [(2)])]);
  1311. return self;}
  1312. }),
  1313. smalltalk.Number);
  1314. smalltalk.addMethod(
  1315. '_odd',
  1316. smalltalk.method({
  1317. selector: 'odd',
  1318. fn: function (){
  1319. var self=this;
  1320. return smalltalk.send(smalltalk.send(self, "_even", []), "_not", []);
  1321. return self;}
  1322. }),
  1323. smalltalk.Number);
  1324. smalltalk.addMethod(
  1325. '_negated',
  1326. smalltalk.method({
  1327. selector: 'negated',
  1328. fn: function (){
  1329. var self=this;
  1330. return (0) - self;
  1331. return self;}
  1332. }),
  1333. smalltalk.Number);
  1334. smalltalk.addMethod(
  1335. '_pi',
  1336. smalltalk.method({
  1337. selector: 'pi',
  1338. fn: function (){
  1339. var self=this;
  1340. return Math.PI;
  1341. return self;}
  1342. }),
  1343. smalltalk.Number.klass);
  1344. smalltalk.addClass('BlockClosure', smalltalk.Object, [], 'Kernel');
  1345. smalltalk.addMethod(
  1346. '_compiledSource',
  1347. smalltalk.method({
  1348. selector: 'compiledSource',
  1349. fn: function (){
  1350. var self=this;
  1351. return self.toString();
  1352. return self;}
  1353. }),
  1354. smalltalk.BlockClosure);
  1355. smalltalk.addMethod(
  1356. '_whileTrue_',
  1357. smalltalk.method({
  1358. selector: 'whileTrue:',
  1359. fn: function (aBlock){
  1360. var self=this;
  1361. while(self()) {aBlock()};
  1362. return self;}
  1363. }),
  1364. smalltalk.BlockClosure);
  1365. smalltalk.addMethod(
  1366. '_whileFalse_',
  1367. smalltalk.method({
  1368. selector: 'whileFalse:',
  1369. fn: function (aBlock){
  1370. var self=this;
  1371. while(!self()) {aBlock()};
  1372. return self;}
  1373. }),
  1374. smalltalk.BlockClosure);
  1375. smalltalk.addMethod(
  1376. '_value',
  1377. smalltalk.method({
  1378. selector: 'value',
  1379. fn: function (){
  1380. var self=this;
  1381. return self();;
  1382. return self;}
  1383. }),
  1384. smalltalk.BlockClosure);
  1385. smalltalk.addMethod(
  1386. '_value_',
  1387. smalltalk.method({
  1388. selector: 'value:',
  1389. fn: function (anArg){
  1390. var self=this;
  1391. return self(anArg);;
  1392. return self;}
  1393. }),
  1394. smalltalk.BlockClosure);
  1395. smalltalk.addMethod(
  1396. '_value_value_',
  1397. smalltalk.method({
  1398. selector: 'value:value:',
  1399. fn: function (firstArg, secondArg){
  1400. var self=this;
  1401. return self(firstArg, secondArg);;
  1402. return self;}
  1403. }),
  1404. smalltalk.BlockClosure);
  1405. smalltalk.addMethod(
  1406. '_value_value_value_',
  1407. smalltalk.method({
  1408. selector: 'value:value:value:',
  1409. fn: function (firstArg, secondArg, thirdArg){
  1410. var self=this;
  1411. return self(firstArg, secondArg, thirdArg);;
  1412. return self;}
  1413. }),
  1414. smalltalk.BlockClosure);
  1415. smalltalk.addMethod(
  1416. '_valueWithPossibleArguments_',
  1417. smalltalk.method({
  1418. selector: 'valueWithPossibleArguments:',
  1419. fn: function (aCollection){
  1420. var self=this;
  1421. return self.apply(null, aCollection);;
  1422. return self;}
  1423. }),
  1424. smalltalk.BlockClosure);
  1425. smalltalk.addMethod(
  1426. '_on_do_',
  1427. smalltalk.method({
  1428. selector: 'on:do:',
  1429. fn: function (anErrorClass, aBlock){
  1430. var self=this;
  1431. smalltalk.send(self, "_try_catch_", [self, (function(error){return smalltalk.send(smalltalk.send(error, "_isKindOf_", [anErrorClass]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(aBlock, "_value_", [error]);}), (function(){return smalltalk.send(error, "_signal", []);})]);})]);
  1432. return self;}
  1433. }),
  1434. smalltalk.BlockClosure);
  1435. smalltalk.addMethod(
  1436. '_valueWithTimeout_',
  1437. smalltalk.method({
  1438. selector: 'valueWithTimeout:',
  1439. fn: function (aNumber){
  1440. var self=this;
  1441. return setTimeout(self, aNumber);
  1442. return self;}
  1443. }),
  1444. smalltalk.BlockClosure);
  1445. smalltalk.addMethod(
  1446. '_valueWithInterval_',
  1447. smalltalk.method({
  1448. selector: 'valueWithInterval:',
  1449. fn: function (aNumber){
  1450. var self=this;
  1451. return setInterval(self, aNumber);
  1452. return self;}
  1453. }),
  1454. smalltalk.BlockClosure);
  1455. smalltalk.addMethod(
  1456. '_printString',
  1457. smalltalk.method({
  1458. selector: 'printString',
  1459. fn: function (){
  1460. var self=this;
  1461. return smalltalk.send(smalltalk.String, "_streamContents_", [(function(aStream){return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_printString", [], smalltalk.Object)]);smalltalk.send($rec, "_nextPutAll_", [unescape("%28")]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_compiledSource", [])]);smalltalk.send($rec, "_nextPutAll_", [unescape("%29")]);return smalltalk.send($rec, "_cr", []);})(aStream);})]);
  1462. return self;}
  1463. }),
  1464. smalltalk.BlockClosure);
  1465. smalltalk.addMethod(
  1466. '_whileFalse',
  1467. smalltalk.method({
  1468. selector: 'whileFalse',
  1469. fn: function (){
  1470. var self=this;
  1471. smalltalk.send(self, "_whileFalse_", [(function(){return nil;})]);
  1472. return self;}
  1473. }),
  1474. smalltalk.BlockClosure);
  1475. smalltalk.addMethod(
  1476. '_whileTrue',
  1477. smalltalk.method({
  1478. selector: 'whileTrue',
  1479. fn: function (){
  1480. var self=this;
  1481. smalltalk.send(self, "_whileTrue_", [(function(){return nil;})]);
  1482. return self;}
  1483. }),
  1484. smalltalk.BlockClosure);
  1485. smalltalk.addMethod(
  1486. '_new',
  1487. smalltalk.method({
  1488. selector: 'new',
  1489. fn: function (){
  1490. var self=this;
  1491. return new self();
  1492. return self;}
  1493. }),
  1494. smalltalk.BlockClosure);
  1495. smalltalk.addClass('Boolean', smalltalk.Object, [], 'Kernel');
  1496. smalltalk.addMethod(
  1497. '__eq',
  1498. smalltalk.method({
  1499. selector: '=',
  1500. fn: function (aBoolean){
  1501. var self=this;
  1502. return Boolean(self == true) == aBoolean;
  1503. return self;}
  1504. }),
  1505. smalltalk.Boolean);
  1506. smalltalk.addMethod(
  1507. '_shallowCopy',
  1508. smalltalk.method({
  1509. selector: 'shallowCopy',
  1510. fn: function (){
  1511. var self=this;
  1512. return self;
  1513. return self;}
  1514. }),
  1515. smalltalk.Boolean);
  1516. smalltalk.addMethod(
  1517. '_deepCopy',
  1518. smalltalk.method({
  1519. selector: 'deepCopy',
  1520. fn: function (){
  1521. var self=this;
  1522. return self;
  1523. return self;}
  1524. }),
  1525. smalltalk.Boolean);
  1526. smalltalk.addMethod(
  1527. '_ifTrue_',
  1528. smalltalk.method({
  1529. selector: 'ifTrue:',
  1530. fn: function (aBlock){
  1531. var self=this;
  1532. return smalltalk.send(self, "_ifTrue_ifFalse_", [aBlock, (function(){return nil;})]);
  1533. return self;}
  1534. }),
  1535. smalltalk.Boolean);
  1536. smalltalk.addMethod(
  1537. '_ifFalse_',
  1538. smalltalk.method({
  1539. selector: 'ifFalse:',
  1540. fn: function (aBlock){
  1541. var self=this;
  1542. return smalltalk.send(self, "_ifTrue_ifFalse_", [(function(){return nil;}), aBlock]);
  1543. return self;}
  1544. }),
  1545. smalltalk.Boolean);
  1546. smalltalk.addMethod(
  1547. '_ifFalse_ifTrue_',
  1548. smalltalk.method({
  1549. selector: 'ifFalse:ifTrue:',
  1550. fn: function (aBlock, anotherBlock){
  1551. var self=this;
  1552. return smalltalk.send(self, "_ifTrue_ifFalse_", [anotherBlock, aBlock]);
  1553. return self;}
  1554. }),
  1555. smalltalk.Boolean);
  1556. smalltalk.addMethod(
  1557. '_ifTrue_ifFalse_',
  1558. smalltalk.method({
  1559. selector: 'ifTrue:ifFalse:',
  1560. fn: function (aBlock, anotherBlock){
  1561. var self=this;
  1562. if(self == true) {
  1563. return aBlock();
  1564. } else {
  1565. return anotherBlock();
  1566. }
  1567. ;
  1568. return self;}
  1569. }),
  1570. smalltalk.Boolean);
  1571. smalltalk.addMethod(
  1572. '_and_',
  1573. smalltalk.method({
  1574. selector: 'and:',
  1575. fn: function (aBlock){
  1576. var self=this;
  1577. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [aBlock, (function(){return false;})]);
  1578. return self;}
  1579. }),
  1580. smalltalk.Boolean);
  1581. smalltalk.addMethod(
  1582. '_or_',
  1583. smalltalk.method({
  1584. selector: 'or:',
  1585. fn: function (aBlock){
  1586. var self=this;
  1587. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [(function(){return true;}), aBlock]);
  1588. return self;}
  1589. }),
  1590. smalltalk.Boolean);
  1591. smalltalk.addMethod(
  1592. '_not',
  1593. smalltalk.method({
  1594. selector: 'not',
  1595. fn: function (){
  1596. var self=this;
  1597. return smalltalk.send(self, "__eq", [false]);
  1598. return self;}
  1599. }),
  1600. smalltalk.Boolean);
  1601. smalltalk.addMethod(
  1602. '_printString',
  1603. smalltalk.method({
  1604. selector: 'printString',
  1605. fn: function (){
  1606. var self=this;
  1607. return self.toString();
  1608. return self;}
  1609. }),
  1610. smalltalk.Boolean);
  1611. smalltalk.addMethod(
  1612. '_asJSONObject',
  1613. smalltalk.method({
  1614. selector: 'asJSONObject',
  1615. fn: function (){
  1616. var self=this;
  1617. return self;
  1618. return self;}
  1619. }),
  1620. smalltalk.Boolean);
  1621. smalltalk.addMethod(
  1622. '_&',
  1623. smalltalk.method({
  1624. selector: '&',
  1625. fn: function (aBoolean){
  1626. var self=this;
  1627. if(self == true) {
  1628. return aBoolean;
  1629. } else {
  1630. return false;
  1631. }
  1632. ;
  1633. return self;}
  1634. }),
  1635. smalltalk.Boolean);
  1636. smalltalk.addMethod(
  1637. '_|',
  1638. smalltalk.method({
  1639. selector: '|',
  1640. fn: function (aBoolean){
  1641. var self=this;
  1642. if(self == true) {
  1643. return true;
  1644. } else {
  1645. return aBoolean;
  1646. }
  1647. ;
  1648. return self;}
  1649. }),
  1650. smalltalk.Boolean);
  1651. smalltalk.addClass('Date', smalltalk.Object, [], 'Kernel');
  1652. smalltalk.addMethod(
  1653. '_year',
  1654. smalltalk.method({
  1655. selector: 'year',
  1656. fn: function (){
  1657. var self=this;
  1658. return self.getFullYear();
  1659. return self;}
  1660. }),
  1661. smalltalk.Date);
  1662. smalltalk.addMethod(
  1663. '_month',
  1664. smalltalk.method({
  1665. selector: 'month',
  1666. fn: function (){
  1667. var self=this;
  1668. return self.getMonth() + 1;
  1669. return self;}
  1670. }),
  1671. smalltalk.Date);
  1672. smalltalk.addMethod(
  1673. '_month_',
  1674. smalltalk.method({
  1675. selector: 'month:',
  1676. fn: function (aNumber){
  1677. var self=this;
  1678. self.setMonth(aNumber - 1);
  1679. return self;}
  1680. }),
  1681. smalltalk.Date);
  1682. smalltalk.addMethod(
  1683. '_day',
  1684. smalltalk.method({
  1685. selector: 'day',
  1686. fn: function (){
  1687. var self=this;
  1688. return smalltalk.send(self, "_dayOfWeek", []);
  1689. return self;}
  1690. }),
  1691. smalltalk.Date);
  1692. smalltalk.addMethod(
  1693. '_dayOfWeek',
  1694. smalltalk.method({
  1695. selector: 'dayOfWeek',
  1696. fn: function (){
  1697. var self=this;
  1698. return self.getDay() + 1;
  1699. return self;}
  1700. }),
  1701. smalltalk.Date);
  1702. smalltalk.addMethod(
  1703. '_dayOfWeek_',
  1704. smalltalk.method({
  1705. selector: 'dayOfWeek:',
  1706. fn: function (aNumber){
  1707. var self=this;
  1708. return self.setDay(aNumber - 1);
  1709. return self;}
  1710. }),
  1711. smalltalk.Date);
  1712. smalltalk.addMethod(
  1713. '_day_',
  1714. smalltalk.method({
  1715. selector: 'day:',
  1716. fn: function (aNumber){
  1717. var self=this;
  1718. smalltalk.send(self, "_day_", [aNumber]);
  1719. return self;}
  1720. }),
  1721. smalltalk.Date);
  1722. smalltalk.addMethod(
  1723. '_year_',
  1724. smalltalk.method({
  1725. selector: 'year:',
  1726. fn: function (aNumber){
  1727. var self=this;
  1728. self.setFullYear(aNumber);
  1729. return self;}
  1730. }),
  1731. smalltalk.Date);
  1732. smalltalk.addMethod(
  1733. '_dayOfMonth',
  1734. smalltalk.method({
  1735. selector: 'dayOfMonth',
  1736. fn: function (){
  1737. var self=this;
  1738. return self.getDate();
  1739. return self;}
  1740. }),
  1741. smalltalk.Date);
  1742. smalltalk.addMethod(
  1743. '_dayOfMonth_',
  1744. smalltalk.method({
  1745. selector: 'dayOfMonth:',
  1746. fn: function (aNumber){
  1747. var self=this;
  1748. self.setDate(aNumber);
  1749. return self;}
  1750. }),
  1751. smalltalk.Date);
  1752. smalltalk.addMethod(
  1753. '_asString',
  1754. smalltalk.method({
  1755. selector: 'asString',
  1756. fn: function (){
  1757. var self=this;
  1758. return self.toString();
  1759. return self;}
  1760. }),
  1761. smalltalk.Date);
  1762. smalltalk.addMethod(
  1763. '_printString',
  1764. smalltalk.method({
  1765. selector: 'printString',
  1766. fn: function (){
  1767. var self=this;
  1768. return smalltalk.send(self, "_asString", []);
  1769. return self;}
  1770. }),
  1771. smalltalk.Date);
  1772. smalltalk.addMethod(
  1773. '_asMilliseconds',
  1774. smalltalk.method({
  1775. selector: 'asMilliseconds',
  1776. fn: function (){
  1777. var self=this;
  1778. return smalltalk.send(self, "_time", []);
  1779. return self;}
  1780. }),
  1781. smalltalk.Date);
  1782. smalltalk.addMethod(
  1783. '_time',
  1784. smalltalk.method({
  1785. selector: 'time',
  1786. fn: function (){
  1787. var self=this;
  1788. return self.getTime();
  1789. return self;}
  1790. }),
  1791. smalltalk.Date);
  1792. smalltalk.addMethod(
  1793. '_time_',
  1794. smalltalk.method({
  1795. selector: 'time:',
  1796. fn: function (aNumber){
  1797. var self=this;
  1798. self.setTime(aNumber);
  1799. return self;}
  1800. }),
  1801. smalltalk.Date);
  1802. smalltalk.addMethod(
  1803. '_asDateString',
  1804. smalltalk.method({
  1805. selector: 'asDateString',
  1806. fn: function (){
  1807. var self=this;
  1808. return self.toDateString();
  1809. return self;}
  1810. }),
  1811. smalltalk.Date);
  1812. smalltalk.addMethod(
  1813. '_asTimeString',
  1814. smalltalk.method({
  1815. selector: 'asTimeString',
  1816. fn: function (){
  1817. var self=this;
  1818. return self.toTimeString();
  1819. return self;}
  1820. }),
  1821. smalltalk.Date);
  1822. smalltalk.addMethod(
  1823. '_asLocaleString',
  1824. smalltalk.method({
  1825. selector: 'asLocaleString',
  1826. fn: function (){
  1827. var self=this;
  1828. return self.toLocaleString();
  1829. return self;}
  1830. }),
  1831. smalltalk.Date);
  1832. smalltalk.addMethod(
  1833. '_asNumber',
  1834. smalltalk.method({
  1835. selector: 'asNumber',
  1836. fn: function (){
  1837. var self=this;
  1838. return smalltalk.send(self, "_asMilliseconds", []);
  1839. return self;}
  1840. }),
  1841. smalltalk.Date);
  1842. smalltalk.addMethod(
  1843. '_hours_',
  1844. smalltalk.method({
  1845. selector: 'hours:',
  1846. fn: function (aNumber){
  1847. var self=this;
  1848. self.setHours(aNumber);
  1849. return self;}
  1850. }),
  1851. smalltalk.Date);
  1852. smalltalk.addMethod(
  1853. '_minutes_',
  1854. smalltalk.method({
  1855. selector: 'minutes:',
  1856. fn: function (aNumber){
  1857. var self=this;
  1858. self.setMinutes(aNumber);
  1859. return self;}
  1860. }),
  1861. smalltalk.Date);
  1862. smalltalk.addMethod(
  1863. '_seconds_',
  1864. smalltalk.method({
  1865. selector: 'seconds:',
  1866. fn: function (aNumber){
  1867. var self=this;
  1868. self.setSeconds(aNumber);
  1869. return self;}
  1870. }),
  1871. smalltalk.Date);
  1872. smalltalk.addMethod(
  1873. '_milliseconds_',
  1874. smalltalk.method({
  1875. selector: 'milliseconds:',
  1876. fn: function (aNumber){
  1877. var self=this;
  1878. self.setMilliseconds(aNumber);
  1879. return self;}
  1880. }),
  1881. smalltalk.Date);
  1882. smalltalk.addMethod(
  1883. '_hours',
  1884. smalltalk.method({
  1885. selector: 'hours',
  1886. fn: function (){
  1887. var self=this;
  1888. return self.getHours();
  1889. return self;}
  1890. }),
  1891. smalltalk.Date);
  1892. smalltalk.addMethod(
  1893. '_minutes',
  1894. smalltalk.method({
  1895. selector: 'minutes',
  1896. fn: function (){
  1897. var self=this;
  1898. return self.getMinutes();
  1899. return self;}
  1900. }),
  1901. smalltalk.Date);
  1902. smalltalk.addMethod(
  1903. '_seconds',
  1904. smalltalk.method({
  1905. selector: 'seconds',
  1906. fn: function (){
  1907. var self=this;
  1908. return self.getSeconds();
  1909. return self;}
  1910. }),
  1911. smalltalk.Date);
  1912. smalltalk.addMethod(
  1913. '_milliseconds',
  1914. smalltalk.method({
  1915. selector: 'milliseconds',
  1916. fn: function (){
  1917. var self=this;
  1918. return self.getMilliseconds();
  1919. return self;}
  1920. }),
  1921. smalltalk.Date);
  1922. smalltalk.addMethod(
  1923. '__lt',
  1924. smalltalk.method({
  1925. selector: '<',
  1926. fn: function (aDate){
  1927. var self=this;
  1928. return self < aDate;
  1929. return self;}
  1930. }),
  1931. smalltalk.Date);
  1932. smalltalk.addMethod(
  1933. '__gt',
  1934. smalltalk.method({
  1935. selector: '>',
  1936. fn: function (aDate){
  1937. var self=this;
  1938. return self > aDate;
  1939. return self;}
  1940. }),
  1941. smalltalk.Date);
  1942. smalltalk.addMethod(
  1943. '__lt_eq',
  1944. smalltalk.method({
  1945. selector: '<=',
  1946. fn: function (aDate){
  1947. var self=this;
  1948. self <= aDate;
  1949. return self;}
  1950. }),
  1951. smalltalk.Date);
  1952. smalltalk.addMethod(
  1953. '__gt_eq',
  1954. smalltalk.method({
  1955. selector: '>=',
  1956. fn: function (aDate){
  1957. var self=this;
  1958. self >= aDate;
  1959. return self;}
  1960. }),
  1961. smalltalk.Date);
  1962. smalltalk.addMethod(
  1963. '__minus',
  1964. smalltalk.method({
  1965. selector: '-',
  1966. fn: function (aDate){
  1967. var self=this;
  1968. return self - aDate;
  1969. return self;}
  1970. }),
  1971. smalltalk.Date);
  1972. smalltalk.addMethod(
  1973. '__plus',
  1974. smalltalk.method({
  1975. selector: '+',
  1976. fn: function (aDate){
  1977. var self=this;
  1978. return self + aDate;
  1979. return self;}
  1980. }),
  1981. smalltalk.Date);
  1982. smalltalk.addMethod(
  1983. '_asJSONObject',
  1984. smalltalk.method({
  1985. selector: 'asJSONObject',
  1986. fn: function (){
  1987. var self=this;
  1988. return self;
  1989. return self;}
  1990. }),
  1991. smalltalk.Date);
  1992. smalltalk.addMethod(
  1993. '_new_',
  1994. smalltalk.method({
  1995. selector: 'new:',
  1996. fn: function (anObject){
  1997. var self=this;
  1998. return new Date(anObject);
  1999. return self;}
  2000. }),
  2001. smalltalk.Date.klass);
  2002. smalltalk.addMethod(
  2003. '_fromString_',
  2004. smalltalk.method({
  2005. selector: 'fromString:',
  2006. fn: function (aString){
  2007. var self=this;
  2008. return smalltalk.send(self, "_new_", [aString]);
  2009. return self;}
  2010. }),
  2011. smalltalk.Date.klass);
  2012. smalltalk.addMethod(
  2013. '_fromSeconds_',
  2014. smalltalk.method({
  2015. selector: 'fromSeconds:',
  2016. fn: function (aNumber){
  2017. var self=this;
  2018. return smalltalk.send(self, "_fromMilliseconds_", [smalltalk.send(aNumber, "__star", [(1000)])]);
  2019. return self;}
  2020. }),
  2021. smalltalk.Date.klass);
  2022. smalltalk.addMethod(
  2023. '_fromMilliseconds_',
  2024. smalltalk.method({
  2025. selector: 'fromMilliseconds:',
  2026. fn: function (aNumber){
  2027. var self=this;
  2028. return smalltalk.send(self, "_new_", [aNumber]);
  2029. return self;}
  2030. }),
  2031. smalltalk.Date.klass);
  2032. smalltalk.addMethod(
  2033. '_today',
  2034. smalltalk.method({
  2035. selector: 'today',
  2036. fn: function (){
  2037. var self=this;
  2038. return smalltalk.send(self, "_new", []);
  2039. return self;}
  2040. }),
  2041. smalltalk.Date.klass);
  2042. smalltalk.addMethod(
  2043. '_now',
  2044. smalltalk.method({
  2045. selector: 'now',
  2046. fn: function (){
  2047. var self=this;
  2048. return smalltalk.send(self, "_today", []);
  2049. return self;}
  2050. }),
  2051. smalltalk.Date.klass);
  2052. smalltalk.addMethod(
  2053. '_millisecondsToRun_',
  2054. smalltalk.method({
  2055. selector: 'millisecondsToRun:',
  2056. fn: function (aBlock){
  2057. var self=this;
  2058. var t=nil;
  2059. t=smalltalk.send(smalltalk.Date, "_now", []);
  2060. smalltalk.send(aBlock, "_value", []);
  2061. return smalltalk.send(smalltalk.send(smalltalk.Date, "_now", []), "__minus", [t]);
  2062. return self;}
  2063. }),
  2064. smalltalk.Date.klass);
  2065. smalltalk.addClass('UndefinedObject', smalltalk.Object, [], 'Kernel');
  2066. smalltalk.addMethod(
  2067. '_subclass_instanceVariableNames_',
  2068. smalltalk.method({
  2069. selector: 'subclass:instanceVariableNames:',
  2070. fn: function (aString, anotherString){
  2071. var self=this;
  2072. return smalltalk.send(self, "_subclass_instanceVariableNames_category_", [aString, anotherString, nil]);
  2073. return self;}
  2074. }),
  2075. smalltalk.UndefinedObject);
  2076. smalltalk.addMethod(
  2077. '_subclass_instanceVariableNames_category_',
  2078. smalltalk.method({
  2079. selector: 'subclass:instanceVariableNames:category:',
  2080. fn: function (aString, aString2, aString3){
  2081. var self=this;
  2082. return smalltalk.send(smalltalk.send(smalltalk.ClassBuilder, "_new", []), "_superclass_subclass_instanceVariableNames_category_", [self, aString, aString2, aString3]);
  2083. return self;}
  2084. }),
  2085. smalltalk.UndefinedObject);
  2086. smalltalk.addMethod(
  2087. '_shallowCopy',
  2088. smalltalk.method({
  2089. selector: 'shallowCopy',
  2090. fn: function (){
  2091. var self=this;
  2092. return self;
  2093. return self;}
  2094. }),
  2095. smalltalk.UndefinedObject);
  2096. smalltalk.addMethod(
  2097. '_deepCopy',
  2098. smalltalk.method({
  2099. selector: 'deepCopy',
  2100. fn: function (){
  2101. var self=this;
  2102. return self;
  2103. return self;}
  2104. }),
  2105. smalltalk.UndefinedObject);
  2106. smalltalk.addMethod(
  2107. '_ifNil_',
  2108. smalltalk.method({
  2109. selector: 'ifNil:',
  2110. fn: function (aBlock){
  2111. var self=this;
  2112. return smalltalk.send(self, "_ifNil_ifNotNil_", [aBlock, (function(){return nil;})]);
  2113. return self;}
  2114. }),
  2115. smalltalk.UndefinedObject);
  2116. smalltalk.addMethod(
  2117. '_ifNotNil_',
  2118. smalltalk.method({
  2119. selector: 'ifNotNil:',
  2120. fn: function (aBlock){
  2121. var self=this;
  2122. return self;
  2123. return self;}
  2124. }),
  2125. smalltalk.UndefinedObject);
  2126. smalltalk.addMethod(
  2127. '_ifNil_ifNotNil_',
  2128. smalltalk.method({
  2129. selector: 'ifNil:ifNotNil:',
  2130. fn: function (aBlock, anotherBlock){
  2131. var self=this;
  2132. return smalltalk.send(aBlock, "_value", []);
  2133. return self;}
  2134. }),
  2135. smalltalk.UndefinedObject);
  2136. smalltalk.addMethod(
  2137. '_ifNotNil_ifNil_',
  2138. smalltalk.method({
  2139. selector: 'ifNotNil:ifNil:',
  2140. fn: function (aBlock, anotherBlock){
  2141. var self=this;
  2142. return smalltalk.send(anotherBlock, "_value", []);
  2143. return self;}
  2144. }),
  2145. smalltalk.UndefinedObject);
  2146. smalltalk.addMethod(
  2147. '_isNil',
  2148. smalltalk.method({
  2149. selector: 'isNil',
  2150. fn: function (){
  2151. var self=this;
  2152. return true;
  2153. return self;}
  2154. }),
  2155. smalltalk.UndefinedObject);
  2156. smalltalk.addMethod(
  2157. '_notNil',
  2158. smalltalk.method({
  2159. selector: 'notNil',
  2160. fn: function (){
  2161. var self=this;
  2162. return false;
  2163. return self;}
  2164. }),
  2165. smalltalk.UndefinedObject);
  2166. smalltalk.addMethod(
  2167. '_printString',
  2168. smalltalk.method({
  2169. selector: 'printString',
  2170. fn: function (){
  2171. var self=this;
  2172. return "nil";
  2173. return self;}
  2174. }),
  2175. smalltalk.UndefinedObject);
  2176. smalltalk.addMethod(
  2177. '_new',
  2178. smalltalk.method({
  2179. selector: 'new',
  2180. fn: function (){
  2181. var self=this;
  2182. smalltalk.send(self, "_error_", ["You cannot create new instances of UndefinedObject. Use nil"]);
  2183. return self;}
  2184. }),
  2185. smalltalk.UndefinedObject.klass);
  2186. smalltalk.addClass('Collection', smalltalk.Object, [], 'Kernel');
  2187. smalltalk.addMethod(
  2188. '_size',
  2189. smalltalk.method({
  2190. selector: 'size',
  2191. fn: function (){
  2192. var self=this;
  2193. smalltalk.send(self, "_subclassResponsibility", []);
  2194. return self;}
  2195. }),
  2196. smalltalk.Collection);
  2197. smalltalk.addMethod(
  2198. '_readStream',
  2199. smalltalk.method({
  2200. selector: 'readStream',
  2201. fn: function (){
  2202. var self=this;
  2203. return smalltalk.send(self, "_stream", []);
  2204. return self;}
  2205. }),
  2206. smalltalk.Collection);
  2207. smalltalk.addMethod(
  2208. '_writeStream',
  2209. smalltalk.method({
  2210. selector: 'writeStream',
  2211. fn: function (){
  2212. var self=this;
  2213. return smalltalk.send(self, "_stream", []);
  2214. return self;}
  2215. }),
  2216. smalltalk.Collection);
  2217. smalltalk.addMethod(
  2218. '_stream',
  2219. smalltalk.method({
  2220. selector: 'stream',
  2221. fn: function (){
  2222. var self=this;
  2223. return smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [self]);
  2224. return self;}
  2225. }),
  2226. smalltalk.Collection);
  2227. smalltalk.addMethod(
  2228. '_streamClass',
  2229. smalltalk.method({
  2230. selector: 'streamClass',
  2231. fn: function (){
  2232. var self=this;
  2233. return smalltalk.send(smalltalk.send(self, "_class", []), "_streamClass", []);
  2234. return self;}
  2235. }),
  2236. smalltalk.Collection);
  2237. smalltalk.addMethod(
  2238. '_add_',
  2239. smalltalk.method({
  2240. selector: 'add:',
  2241. fn: function (anObject){
  2242. var self=this;
  2243. smalltalk.send(self, "_subclassResponsibility", []);
  2244. return self;}
  2245. }),
  2246. smalltalk.Collection);
  2247. smalltalk.addMethod(
  2248. '_addAll_',
  2249. smalltalk.method({
  2250. selector: 'addAll:',
  2251. fn: function (aCollection){
  2252. var self=this;
  2253. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_add_", [each]);})]);
  2254. return aCollection;
  2255. return self;}
  2256. }),
  2257. smalltalk.Collection);
  2258. smalltalk.addMethod(
  2259. '__comma',
  2260. smalltalk.method({
  2261. selector: ',',
  2262. fn: function (aCollection){
  2263. var self=this;
  2264. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  2265. return self;}
  2266. }),
  2267. smalltalk.Collection);
  2268. smalltalk.addMethod(
  2269. '_copyWith_',
  2270. smalltalk.method({
  2271. selector: 'copyWith:',
  2272. fn: function (anObject){
  2273. var self=this;
  2274. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  2275. return self;}
  2276. }),
  2277. smalltalk.Collection);
  2278. smalltalk.addMethod(
  2279. '_copyWithAll_',
  2280. smalltalk.method({
  2281. selector: 'copyWithAll:',
  2282. fn: function (aCollection){
  2283. var self=this;
  2284. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  2285. return self;}
  2286. }),
  2287. smalltalk.Collection);
  2288. smalltalk.addMethod(
  2289. '_asArray',
  2290. smalltalk.method({
  2291. selector: 'asArray',
  2292. fn: function (){
  2293. var self=this;
  2294. var array=nil;
  2295. var index=nil;
  2296. array=smalltalk.send(smalltalk.Array, "_new", []);
  2297. index=(0);
  2298. smalltalk.send(self, "_do_", [(function(each){index=smalltalk.send(index, "__plus", [(1)]);return smalltalk.send(array, "_at_put_", [index, each]);})]);
  2299. return array;
  2300. return self;}
  2301. }),
  2302. smalltalk.Collection);
  2303. smalltalk.addMethod(
  2304. '_do_',
  2305. smalltalk.method({
  2306. selector: 'do:',
  2307. fn: function (aBlock){
  2308. var self=this;
  2309. for(var i=0;i<self.length;i++){aBlock(self[i]);};
  2310. return self;}
  2311. }),
  2312. smalltalk.Collection);
  2313. smalltalk.addMethod(
  2314. '_collect_',
  2315. smalltalk.method({
  2316. selector: 'collect:',
  2317. fn: function (aBlock){
  2318. var self=this;
  2319. var newCollection=nil;
  2320. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  2321. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [smalltalk.send(aBlock, "_value_", [each])]);})]);
  2322. return newCollection;
  2323. return self;}
  2324. }),
  2325. smalltalk.Collection);
  2326. smalltalk.addMethod(
  2327. '_detect_',
  2328. smalltalk.method({
  2329. selector: 'detect:',
  2330. fn: function (aBlock){
  2331. var self=this;
  2332. return smalltalk.send(self, "_detect_ifNone_", [aBlock, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  2333. return self;}
  2334. }),
  2335. smalltalk.Collection);
  2336. smalltalk.addMethod(
  2337. '_detect_ifNone_',
  2338. smalltalk.method({
  2339. selector: 'detect:ifNone:',
  2340. fn: function (aBlock, anotherBlock){
  2341. var self=this;
  2342. for(var i = 0; i < self.length; i++)
  2343. if(aBlock(self[i]))
  2344. return self[i];
  2345. return anotherBlock();
  2346. ;
  2347. return self;}
  2348. }),
  2349. smalltalk.Collection);
  2350. smalltalk.addMethod(
  2351. '_do_separatedBy_',
  2352. smalltalk.method({
  2353. selector: 'do:separatedBy:',
  2354. fn: function (aBlock, anotherBlock){
  2355. var self=this;
  2356. var first=nil;
  2357. first=true;
  2358. smalltalk.send(self, "_do_", [(function(each){smalltalk.send(first, "_ifTrue_ifFalse_", [(function(){return first=false;}), (function(){return smalltalk.send(anotherBlock, "_value", []);})]);return smalltalk.send(aBlock, "_value_", [each]);})]);
  2359. return self;}
  2360. }),
  2361. smalltalk.Collection);
  2362. smalltalk.addMethod(
  2363. '_inject_into_',
  2364. smalltalk.method({
  2365. selector: 'inject:into:',
  2366. fn: function (anObject, aBlock){
  2367. var self=this;
  2368. var result=nil;
  2369. result=anObject;
  2370. smalltalk.send(self, "_do_", [(function(each){return result=smalltalk.send(aBlock, "_value_value_", [result, each]);})]);
  2371. return result;
  2372. return self;}
  2373. }),
  2374. smalltalk.Collection);
  2375. smalltalk.addMethod(
  2376. '_reject_',
  2377. smalltalk.method({
  2378. selector: 'reject:',
  2379. fn: function (aBlock){
  2380. var self=this;
  2381. return smalltalk.send(self, "_select_", [(function(each){return smalltalk.send(smalltalk.send(aBlock, "_value_", [each]), "__eq", [false]);})]);
  2382. return self;}
  2383. }),
  2384. smalltalk.Collection);
  2385. smalltalk.addMethod(
  2386. '_select_',
  2387. smalltalk.method({
  2388. selector: 'select:',
  2389. fn: function (aBlock){
  2390. var self=this;
  2391. var stream=nil;
  2392. stream=smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_new", []), "_writeStream", []);
  2393. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(smalltalk.send(aBlock, "_value_", [each]), "_ifTrue_", [(function(){return smalltalk.send(stream, "_nextPut_", [each]);})]);})]);
  2394. return smalltalk.send(stream, "_contents", []);
  2395. return self;}
  2396. }),
  2397. smalltalk.Collection);
  2398. smalltalk.addMethod(
  2399. '_errorNotFound',
  2400. smalltalk.method({
  2401. selector: 'errorNotFound',
  2402. fn: function (){
  2403. var self=this;
  2404. smalltalk.send(self, "_error_", ["Object is not in the collection"]);
  2405. return self;}
  2406. }),
  2407. smalltalk.Collection);
  2408. smalltalk.addMethod(
  2409. '_includes_',
  2410. smalltalk.method({
  2411. selector: 'includes:',
  2412. fn: function (anObject){
  2413. var self=this;
  2414. var i = self.length;
  2415. while (i--) {
  2416. if (smalltalk.send(self[i], "__eq", [anObject])) {return true;}
  2417. }
  2418. return false
  2419. ;
  2420. return self;}
  2421. }),
  2422. smalltalk.Collection);
  2423. smalltalk.addMethod(
  2424. '_notEmpty',
  2425. smalltalk.method({
  2426. selector: 'notEmpty',
  2427. fn: function (){
  2428. var self=this;
  2429. return smalltalk.send(smalltalk.send(self, "_isEmpty", []), "_not", []);
  2430. return self;}
  2431. }),
  2432. smalltalk.Collection);
  2433. smalltalk.addMethod(
  2434. '_isEmpty',
  2435. smalltalk.method({
  2436. selector: 'isEmpty',
  2437. fn: function (){
  2438. var self=this;
  2439. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
  2440. return self;}
  2441. }),
  2442. smalltalk.Collection);
  2443. smalltalk.addMethod(
  2444. '_remove_',
  2445. smalltalk.method({
  2446. selector: 'remove:',
  2447. fn: function (anObject){
  2448. var self=this;
  2449. smalltalk.send(self, "_subclassResponsibility", []);
  2450. return self;}
  2451. }),
  2452. smalltalk.Collection);
  2453. smalltalk.addMethod(
  2454. '_streamClass',
  2455. smalltalk.method({
  2456. selector: 'streamClass',
  2457. fn: function (){
  2458. var self=this;
  2459. return smalltalk.Stream;
  2460. return self;}
  2461. }),
  2462. smalltalk.Collection.klass);
  2463. smalltalk.addMethod(
  2464. '_with_',
  2465. smalltalk.method({
  2466. selector: 'with:',
  2467. fn: function (anObject){
  2468. var self=this;
  2469. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  2470. return self;}
  2471. }),
  2472. smalltalk.Collection.klass);
  2473. smalltalk.addMethod(
  2474. '_with_with_',
  2475. smalltalk.method({
  2476. selector: 'with:with:',
  2477. fn: function (anObject, anotherObject){
  2478. var self=this;
  2479. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);smalltalk.send($rec, "_add_", [anotherObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  2480. return self;}
  2481. }),
  2482. smalltalk.Collection.klass);
  2483. smalltalk.addMethod(
  2484. '_with_with_with_',
  2485. smalltalk.method({
  2486. selector: 'with:with:with:',
  2487. fn: function (firstObject, secondObject, thirdObject){
  2488. var self=this;
  2489. 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", []));
  2490. return self;}
  2491. }),
  2492. smalltalk.Collection.klass);
  2493. smalltalk.addMethod(
  2494. '_withAll_',
  2495. smalltalk.method({
  2496. selector: 'withAll:',
  2497. fn: function (aCollection){
  2498. var self=this;
  2499. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  2500. return self;}
  2501. }),
  2502. smalltalk.Collection.klass);
  2503. smalltalk.addClass('SequenceableCollection', smalltalk.Collection, [], 'Kernel');
  2504. smalltalk.addMethod(
  2505. '_at_',
  2506. smalltalk.method({
  2507. selector: 'at:',
  2508. fn: function (anIndex){
  2509. var self=this;
  2510. return smalltalk.send(self, "_at_ifAbsent_", [anIndex, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  2511. return self;}
  2512. }),
  2513. smalltalk.SequenceableCollection);
  2514. smalltalk.addMethod(
  2515. '_at_ifAbsent_',
  2516. smalltalk.method({
  2517. selector: 'at:ifAbsent:',
  2518. fn: function (anIndex, aBlock){
  2519. var self=this;
  2520. smalltalk.send(self, "_subclassResponsibility", []);
  2521. return self;}
  2522. }),
  2523. smalltalk.SequenceableCollection);
  2524. smalltalk.addMethod(
  2525. '_at_put_',
  2526. smalltalk.method({
  2527. selector: 'at:put:',
  2528. fn: function (anIndex, anObject){
  2529. var self=this;
  2530. smalltalk.send(self, "_subclassResponsibility", []);
  2531. return self;}
  2532. }),
  2533. smalltalk.SequenceableCollection);
  2534. smalltalk.addMethod(
  2535. '_copyFrom_to_',
  2536. smalltalk.method({
  2537. selector: 'copyFrom:to:',
  2538. fn: function (anIndex, anotherIndex){
  2539. var self=this;
  2540. smalltalk.send(self, "_subclassResponsibility", []);
  2541. return self;}
  2542. }),
  2543. smalltalk.SequenceableCollection);
  2544. smalltalk.addMethod(
  2545. '_first',
  2546. smalltalk.method({
  2547. selector: 'first',
  2548. fn: function (){
  2549. var self=this;
  2550. return smalltalk.send(self, "_at_", [(1)]);
  2551. return self;}
  2552. }),
  2553. smalltalk.SequenceableCollection);
  2554. smalltalk.addMethod(
  2555. '_fourth',
  2556. smalltalk.method({
  2557. selector: 'fourth',
  2558. fn: function (){
  2559. var self=this;
  2560. return smalltalk.send(self, "_at_", [(4)]);
  2561. return self;}
  2562. }),
  2563. smalltalk.SequenceableCollection);
  2564. smalltalk.addMethod(
  2565. '_last',
  2566. smalltalk.method({
  2567. selector: 'last',
  2568. fn: function (){
  2569. var self=this;
  2570. return smalltalk.send(self, "_at_", [smalltalk.send(self, "_size", [])]);
  2571. return self;}
  2572. }),
  2573. smalltalk.SequenceableCollection);
  2574. smalltalk.addMethod(
  2575. '_second',
  2576. smalltalk.method({
  2577. selector: 'second',
  2578. fn: function (){
  2579. var self=this;
  2580. return smalltalk.send(self, "_at_", [(2)]);
  2581. return self;}
  2582. }),
  2583. smalltalk.SequenceableCollection);
  2584. smalltalk.addMethod(
  2585. '_third',
  2586. smalltalk.method({
  2587. selector: 'third',
  2588. fn: function (){
  2589. var self=this;
  2590. return smalltalk.send(self, "_at_", [(3)]);
  2591. return self;}
  2592. }),
  2593. smalltalk.SequenceableCollection);
  2594. smalltalk.addMethod(
  2595. '_removeLast',
  2596. smalltalk.method({
  2597. selector: 'removeLast',
  2598. fn: function (){
  2599. var self=this;
  2600. smalltalk.send(self, "_remove_", [smalltalk.send(self, "_last", [])]);
  2601. return self;}
  2602. }),
  2603. smalltalk.SequenceableCollection);
  2604. smalltalk.addMethod(
  2605. '_addLast_',
  2606. smalltalk.method({
  2607. selector: 'addLast:',
  2608. fn: function (anObject){
  2609. var self=this;
  2610. smalltalk.send(self, "_add_", [anObject]);
  2611. return self;}
  2612. }),
  2613. smalltalk.SequenceableCollection);
  2614. smalltalk.addMethod(
  2615. '_withIndexDo_',
  2616. smalltalk.method({
  2617. selector: 'withIndexDo:',
  2618. fn: function (aBlock){
  2619. var self=this;
  2620. for(var i=0;i<self.length;i++){aBlock(self[i], i+1);};
  2621. return self;}
  2622. }),
  2623. smalltalk.SequenceableCollection);
  2624. smalltalk.addMethod(
  2625. '_allButFirst',
  2626. smalltalk.method({
  2627. selector: 'allButFirst',
  2628. fn: function (){
  2629. var self=this;
  2630. return smalltalk.send(self, "_copyFrom_to_", [(2), smalltalk.send(self, "_size", [])]);
  2631. return self;}
  2632. }),
  2633. smalltalk.SequenceableCollection);
  2634. smalltalk.addMethod(
  2635. '_allButLast',
  2636. smalltalk.method({
  2637. selector: 'allButLast',
  2638. fn: function (){
  2639. var self=this;
  2640. return smalltalk.send(self, "_copyFrom_to_", [(1), smalltalk.send(smalltalk.send(self, "_size", []), "__minus", [(1)])]);
  2641. return self;}
  2642. }),
  2643. smalltalk.SequenceableCollection);
  2644. smalltalk.addMethod(
  2645. '_indexOf_',
  2646. smalltalk.method({
  2647. selector: 'indexOf:',
  2648. fn: function (anObject){
  2649. var self=this;
  2650. return smalltalk.send(self, "_indexOf_ifAbsent_", [anObject, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  2651. return self;}
  2652. }),
  2653. smalltalk.SequenceableCollection);
  2654. smalltalk.addMethod(
  2655. '_indexOf_ifAbsent_',
  2656. smalltalk.method({
  2657. selector: 'indexOf:ifAbsent:',
  2658. fn: function (anObject, aBlock){
  2659. var self=this;
  2660. for(var i=0;i<self.length;i++){
  2661. if(self[i].__eq(anObject)) {return i+1}
  2662. }
  2663. return aBlock();
  2664. ;
  2665. return self;}
  2666. }),
  2667. smalltalk.SequenceableCollection);
  2668. smalltalk.addClass('String', smalltalk.SequenceableCollection, [], 'Kernel');
  2669. smalltalk.addMethod(
  2670. '__eq',
  2671. smalltalk.method({
  2672. selector: '=',
  2673. fn: function (aString){
  2674. var self=this;
  2675. return String(self) == aString;
  2676. return self;}
  2677. }),
  2678. smalltalk.String);
  2679. smalltalk.addMethod(
  2680. '_size',
  2681. smalltalk.method({
  2682. selector: 'size',
  2683. fn: function (){
  2684. var self=this;
  2685. return self.length;
  2686. return self;}
  2687. }),
  2688. smalltalk.String);
  2689. smalltalk.addMethod(
  2690. '_at_',
  2691. smalltalk.method({
  2692. selector: 'at:',
  2693. fn: function (anIndex){
  2694. var self=this;
  2695. return self[anIndex - 1];
  2696. return self;}
  2697. }),
  2698. smalltalk.String);
  2699. smalltalk.addMethod(
  2700. '_at_put_',
  2701. smalltalk.method({
  2702. selector: 'at:put:',
  2703. fn: function (anIndex, anObject){
  2704. var self=this;
  2705. smalltalk.send(self, "_errorReadOnly", []);
  2706. return self;}
  2707. }),
  2708. smalltalk.String);
  2709. smalltalk.addMethod(
  2710. '_at_ifAbsent_',
  2711. smalltalk.method({
  2712. selector: 'at:ifAbsent:',
  2713. fn: function (anIndex, aBlock){
  2714. var self=this;
  2715. smalltalk.send(smalltalk.send(self, "_at_", [anIndex]), "_ifNil_", [(function(){return aBlock;})]);
  2716. return self;}
  2717. }),
  2718. smalltalk.String);
  2719. smalltalk.addMethod(
  2720. '_escaped',
  2721. smalltalk.method({
  2722. selector: 'escaped',
  2723. fn: function (){
  2724. var self=this;
  2725. return escape(self);
  2726. return self;}
  2727. }),
  2728. smalltalk.String);
  2729. smalltalk.addMethod(
  2730. '_unescaped',
  2731. smalltalk.method({
  2732. selector: 'unescaped',
  2733. fn: function (){
  2734. var self=this;
  2735. return unescape(self);
  2736. return self;}
  2737. }),
  2738. smalltalk.String);
  2739. smalltalk.addMethod(
  2740. '_add_',
  2741. smalltalk.method({
  2742. selector: 'add:',
  2743. fn: function (anObject){
  2744. var self=this;
  2745. smalltalk.send(self, "_errorReadOnly", []);
  2746. return self;}
  2747. }),
  2748. smalltalk.String);
  2749. smalltalk.addMethod(
  2750. '__comma',
  2751. smalltalk.method({
  2752. selector: ',',
  2753. fn: function (aString){
  2754. var self=this;
  2755. return self + aString;
  2756. return self;}
  2757. }),
  2758. smalltalk.String);
  2759. smalltalk.addMethod(
  2760. '_copyFrom_to_',
  2761. smalltalk.method({
  2762. selector: 'copyFrom:to:',
  2763. fn: function (anIndex, anotherIndex){
  2764. var self=this;
  2765. return self.substring(anIndex - 1, anotherIndex);
  2766. return self;}
  2767. }),
  2768. smalltalk.String);
  2769. smalltalk.addMethod(
  2770. '_shallowCopy',
  2771. smalltalk.method({
  2772. selector: 'shallowCopy',
  2773. fn: function (){
  2774. var self=this;
  2775. return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [self]);
  2776. return self;}
  2777. }),
  2778. smalltalk.String);
  2779. smalltalk.addMethod(
  2780. '_deepCopy',
  2781. smalltalk.method({
  2782. selector: 'deepCopy',
  2783. fn: function (){
  2784. var self=this;
  2785. return smalltalk.send(self, "_shallowCopy", []);
  2786. return self;}
  2787. }),
  2788. smalltalk.String);
  2789. smalltalk.addMethod(
  2790. '_asSelector',
  2791. smalltalk.method({
  2792. selector: 'asSelector',
  2793. fn: function (){
  2794. var self=this;
  2795. var selector=nil;
  2796. selector=smalltalk.send("_", "__comma", [self]);
  2797. selector=smalltalk.send(selector, "_replace_with_", [":", "_"]);
  2798. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B+%5D"), "_plus"]);
  2799. selector=smalltalk.send(selector, "_replace_with_", [unescape("-"), "_minus"]);
  2800. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B*%5D"), "_star"]);
  2801. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B/%5D"), "_slash"]);
  2802. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3E"), "_gt"]);
  2803. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3C"), "_lt"]);
  2804. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3D"), "_eq"]);
  2805. selector=smalltalk.send(selector, "_replace_with_", [unescape("%2C"), "_comma"]);
  2806. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B@%5D"), "_at"]);
  2807. return selector;
  2808. return self;}
  2809. }),
  2810. smalltalk.String);
  2811. smalltalk.addMethod(
  2812. '_asJavascript',
  2813. smalltalk.method({
  2814. selector: 'asJavascript',
  2815. fn: function (){
  2816. var self=this;
  2817. if(self.search(/^[a-zA-Z0-9_:.$ ]*$/) == -1)
  2818. return "unescape(\"" + escape(self) + "\")";
  2819. else
  2820. return "\"" + self + "\"";
  2821. ;
  2822. return self;}
  2823. }),
  2824. smalltalk.String);
  2825. smalltalk.addMethod(
  2826. '_replace_with_',
  2827. smalltalk.method({
  2828. selector: 'replace:with:',
  2829. fn: function (aString, anotherString){
  2830. var self=this;
  2831. return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send(smalltalk.RegularExpression, "_fromString_flag_", [aString, "g"]), anotherString]);
  2832. return self;}
  2833. }),
  2834. smalltalk.String);
  2835. smalltalk.addMethod(
  2836. '_replaceRegexp_with_',
  2837. smalltalk.method({
  2838. selector: 'replaceRegexp:with:',
  2839. fn: function (aRegexp, aString){
  2840. var self=this;
  2841. return self.replace(aRegexp, aString);
  2842. return self;}
  2843. }),
  2844. smalltalk.String);
  2845. smalltalk.addMethod(
  2846. '_tokenize_',
  2847. smalltalk.method({
  2848. selector: 'tokenize:',
  2849. fn: function (aString){
  2850. var self=this;
  2851. return self.split(aString);
  2852. return self;}
  2853. }),
  2854. smalltalk.String);
  2855. smalltalk.addMethod(
  2856. '_match_',
  2857. smalltalk.method({
  2858. selector: 'match:',
  2859. fn: function (aRegexp){
  2860. var self=this;
  2861. return self.search(aRegexp) != -1;
  2862. return self;}
  2863. }),
  2864. smalltalk.String);
  2865. smalltalk.addMethod(
  2866. '_asString',
  2867. smalltalk.method({
  2868. selector: 'asString',
  2869. fn: function (){
  2870. var self=this;
  2871. return self;
  2872. return self;}
  2873. }),
  2874. smalltalk.String);
  2875. smalltalk.addMethod(
  2876. '_asNumber',
  2877. smalltalk.method({
  2878. selector: 'asNumber',
  2879. fn: function (){
  2880. var self=this;
  2881. return Number(self);
  2882. return self;}
  2883. }),
  2884. smalltalk.String);
  2885. smalltalk.addMethod(
  2886. '_asParser',
  2887. smalltalk.method({
  2888. selector: 'asParser',
  2889. fn: function (){
  2890. var self=this;
  2891. return smalltalk.send(smalltalk.send(smalltalk.PPStringParser, "_new", []), "_string_", [self]);
  2892. return self;}
  2893. }),
  2894. smalltalk.String);
  2895. smalltalk.addMethod(
  2896. '_asChoiceParser',
  2897. smalltalk.method({
  2898. selector: 'asChoiceParser',
  2899. fn: function (){
  2900. var self=this;
  2901. return smalltalk.send(smalltalk.PPChoiceParser, "_withAll_", [smalltalk.send(smalltalk.send(self, "_asArray", []), "_collect_", [(function(each){return smalltalk.send(each, "_asParser", []);})])]);
  2902. return self;}
  2903. }),
  2904. smalltalk.String);
  2905. smalltalk.addMethod(
  2906. '_asCharacterParser',
  2907. smalltalk.method({
  2908. selector: 'asCharacterParser',
  2909. fn: function (){
  2910. var self=this;
  2911. return smalltalk.send(smalltalk.send(smalltalk.PPCharacterParser, "_new", []), "_string_", [self]);
  2912. return self;}
  2913. }),
  2914. smalltalk.String);
  2915. smalltalk.addMethod(
  2916. '_errorReadOnly',
  2917. smalltalk.method({
  2918. selector: 'errorReadOnly',
  2919. fn: function (){
  2920. var self=this;
  2921. smalltalk.send(self, "_error_", [unescape("Object%20is%20read-only")]);
  2922. return self;}
  2923. }),
  2924. smalltalk.String);
  2925. smalltalk.addMethod(
  2926. '_printString',
  2927. smalltalk.method({
  2928. selector: 'printString',
  2929. fn: function (){
  2930. var self=this;
  2931. return smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [self]), "__comma", [unescape("%27")]);
  2932. return self;}
  2933. }),
  2934. smalltalk.String);
  2935. smalltalk.addMethod(
  2936. '_printNl',
  2937. smalltalk.method({
  2938. selector: 'printNl',
  2939. fn: function (){
  2940. var self=this;
  2941. console.log(self);
  2942. return self;}
  2943. }),
  2944. smalltalk.String);
  2945. smalltalk.addMethod(
  2946. '_isString',
  2947. smalltalk.method({
  2948. selector: 'isString',
  2949. fn: function (){
  2950. var self=this;
  2951. return true;
  2952. return self;}
  2953. }),
  2954. smalltalk.String);
  2955. smalltalk.addMethod(
  2956. '__gt',
  2957. smalltalk.method({
  2958. selector: '>',
  2959. fn: function (aString){
  2960. var self=this;
  2961. return String(self) > aString;
  2962. return self;}
  2963. }),
  2964. smalltalk.String);
  2965. smalltalk.addMethod(
  2966. '__lt',
  2967. smalltalk.method({
  2968. selector: '<',
  2969. fn: function (aString){
  2970. var self=this;
  2971. return String(self) < aString;
  2972. return self;}
  2973. }),
  2974. smalltalk.String);
  2975. smalltalk.addMethod(
  2976. '__gt_eq',
  2977. smalltalk.method({
  2978. selector: '>=',
  2979. fn: function (aString){
  2980. var self=this;
  2981. return String(self) >= aString;
  2982. return self;}
  2983. }),
  2984. smalltalk.String);
  2985. smalltalk.addMethod(
  2986. '__lt_eq',
  2987. smalltalk.method({
  2988. selector: '<=',
  2989. fn: function (aString){
  2990. var self=this;
  2991. return String(self) <= aString;
  2992. return self;}
  2993. }),
  2994. smalltalk.String);
  2995. smalltalk.addMethod(
  2996. '_remove_',
  2997. smalltalk.method({
  2998. selector: 'remove:',
  2999. fn: function (anObject){
  3000. var self=this;
  3001. smalltalk.send(self, "_errorReadOnly", []);
  3002. return self;}
  3003. }),
  3004. smalltalk.String);
  3005. smalltalk.addMethod(
  3006. '_asJSONObject',
  3007. smalltalk.method({
  3008. selector: 'asJSONObject',
  3009. fn: function (){
  3010. var self=this;
  3011. return self;
  3012. return self;}
  3013. }),
  3014. smalltalk.String);
  3015. smalltalk.addMethod(
  3016. '_trimLeft_',
  3017. smalltalk.method({
  3018. selector: 'trimLeft:',
  3019. fn: function (separators){
  3020. var self=this;
  3021. return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send(smalltalk.RegularExpression, "_fromString_flag_", [smalltalk.send(smalltalk.send(unescape("%5E%5B"), "__comma", [separators]), "__comma", [unescape("%5D+")]), "g"]), ""]);
  3022. return self;}
  3023. }),
  3024. smalltalk.String);
  3025. smalltalk.addMethod(
  3026. '_trimRight_',
  3027. smalltalk.method({
  3028. selector: 'trimRight:',
  3029. fn: function (separators){
  3030. var self=this;
  3031. return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send(smalltalk.RegularExpression, "_fromString_flag_", [smalltalk.send(smalltalk.send(unescape("%5B"), "__comma", [separators]), "__comma", [unescape("%5D+%24")]), "g"]), ""]);
  3032. return self;}
  3033. }),
  3034. smalltalk.String);
  3035. smalltalk.addMethod(
  3036. '_trimLeft',
  3037. smalltalk.method({
  3038. selector: 'trimLeft',
  3039. fn: function (){
  3040. var self=this;
  3041. return smalltalk.send(self, "_trimLeft_", [unescape("%5Cs")]);
  3042. return self;}
  3043. }),
  3044. smalltalk.String);
  3045. smalltalk.addMethod(
  3046. '_trimRight',
  3047. smalltalk.method({
  3048. selector: 'trimRight',
  3049. fn: function (){
  3050. var self=this;
  3051. return smalltalk.send(self, "_trimRight_", [unescape("%5Cs")]);
  3052. return self;}
  3053. }),
  3054. smalltalk.String);
  3055. smalltalk.addMethod(
  3056. '_trimBoth',
  3057. smalltalk.method({
  3058. selector: 'trimBoth',
  3059. fn: function (){
  3060. var self=this;
  3061. return smalltalk.send(self, "_trimBoth_", [unescape("%5Cs")]);
  3062. return self;}
  3063. }),
  3064. smalltalk.String);
  3065. smalltalk.addMethod(
  3066. '_trimBoth_',
  3067. smalltalk.method({
  3068. selector: 'trimBoth:',
  3069. fn: function (separators){
  3070. var self=this;
  3071. return smalltalk.send(smalltalk.send(self, "_trimLeft_", [separators]), "_trimRight_", [separators]);
  3072. return self;}
  3073. }),
  3074. smalltalk.String);
  3075. smalltalk.addMethod(
  3076. '_asLowercase',
  3077. smalltalk.method({
  3078. selector: 'asLowercase',
  3079. fn: function (){
  3080. var self=this;
  3081. return self.toLowerCase();
  3082. return self;}
  3083. }),
  3084. smalltalk.String);
  3085. smalltalk.addMethod(
  3086. '_asUppercase',
  3087. smalltalk.method({
  3088. selector: 'asUppercase',
  3089. fn: function (){
  3090. var self=this;
  3091. return self.toUpperCase();
  3092. return self;}
  3093. }),
  3094. smalltalk.String);
  3095. smalltalk.addMethod(
  3096. '_join_',
  3097. smalltalk.method({
  3098. selector: 'join:',
  3099. fn: function (aCollection){
  3100. var self=this;
  3101. return smalltalk.send(smalltalk.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]);})]);})]);
  3102. return self;}
  3103. }),
  3104. smalltalk.String);
  3105. smalltalk.addMethod(
  3106. '_includesSubString_',
  3107. smalltalk.method({
  3108. selector: 'includesSubString:',
  3109. fn: function (subString){
  3110. var self=this;
  3111. return self.indexOf(subString) != -1 ;
  3112. return self;}
  3113. }),
  3114. smalltalk.String);
  3115. smalltalk.addMethod(
  3116. '_asciiValue',
  3117. smalltalk.method({
  3118. selector: 'asciiValue',
  3119. fn: function (){
  3120. var self=this;
  3121. return self.charCodeAt(0);;
  3122. return self;}
  3123. }),
  3124. smalltalk.String);
  3125. smalltalk.addMethod(
  3126. '_streamClass',
  3127. smalltalk.method({
  3128. selector: 'streamClass',
  3129. fn: function (){
  3130. var self=this;
  3131. return smalltalk.StringStream;
  3132. return self;}
  3133. }),
  3134. smalltalk.String.klass);
  3135. smalltalk.addMethod(
  3136. '_fromString_',
  3137. smalltalk.method({
  3138. selector: 'fromString:',
  3139. fn: function (aString){
  3140. var self=this;
  3141. return new self.fn(aString);
  3142. return self;}
  3143. }),
  3144. smalltalk.String.klass);
  3145. smalltalk.addMethod(
  3146. '_cr',
  3147. smalltalk.method({
  3148. selector: 'cr',
  3149. fn: function (){
  3150. var self=this;
  3151. return '\r';
  3152. return self;}
  3153. }),
  3154. smalltalk.String.klass);
  3155. smalltalk.addMethod(
  3156. '_lf',
  3157. smalltalk.method({
  3158. selector: 'lf',
  3159. fn: function (){
  3160. var self=this;
  3161. return '\n';
  3162. return self;}
  3163. }),
  3164. smalltalk.String.klass);
  3165. smalltalk.addMethod(
  3166. '_space',
  3167. smalltalk.method({
  3168. selector: 'space',
  3169. fn: function (){
  3170. var self=this;
  3171. return ' ';
  3172. return self;}
  3173. }),
  3174. smalltalk.String.klass);
  3175. smalltalk.addMethod(
  3176. '_tab',
  3177. smalltalk.method({
  3178. selector: 'tab',
  3179. fn: function (){
  3180. var self=this;
  3181. return '\t';
  3182. return self;}
  3183. }),
  3184. smalltalk.String.klass);
  3185. smalltalk.addMethod(
  3186. '_crlf',
  3187. smalltalk.method({
  3188. selector: 'crlf',
  3189. fn: function (){
  3190. var self=this;
  3191. return '\r\n';
  3192. return self;}
  3193. }),
  3194. smalltalk.String.klass);
  3195. smalltalk.addMethod(
  3196. '_streamContents_',
  3197. smalltalk.method({
  3198. selector: 'streamContents:',
  3199. fn: function (blockWithArg){
  3200. var self=this;
  3201. var stream=nil;
  3202. stream=smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [smalltalk.send(smalltalk.String, "_new", [])]);
  3203. smalltalk.send(blockWithArg, "_value_", [stream]);
  3204. return smalltalk.send(stream, "_contents", []);
  3205. return self;}
  3206. }),
  3207. smalltalk.String.klass);
  3208. smalltalk.addMethod(
  3209. '_value_',
  3210. smalltalk.method({
  3211. selector: 'value:',
  3212. fn: function (aUTFCharCode){
  3213. var self=this;
  3214. return String.fromCharCode(aUTFCharCode);;
  3215. return self;}
  3216. }),
  3217. smalltalk.String.klass);
  3218. smalltalk.addClass('Array', smalltalk.SequenceableCollection, [], 'Kernel');
  3219. smalltalk.addMethod(
  3220. '_size',
  3221. smalltalk.method({
  3222. selector: 'size',
  3223. fn: function (){
  3224. var self=this;
  3225. return self.length;
  3226. return self;}
  3227. }),
  3228. smalltalk.Array);
  3229. smalltalk.addMethod(
  3230. '_at_put_',
  3231. smalltalk.method({
  3232. selector: 'at:put:',
  3233. fn: function (anIndex, anObject){
  3234. var self=this;
  3235. return self[anIndex - 1] = anObject;
  3236. return self;}
  3237. }),
  3238. smalltalk.Array);
  3239. smalltalk.addMethod(
  3240. '_at_ifAbsent_',
  3241. smalltalk.method({
  3242. selector: 'at:ifAbsent:',
  3243. fn: function (anIndex, aBlock){
  3244. var self=this;
  3245. var value = self[anIndex - 1];
  3246. if(value === undefined) {
  3247. return aBlock();
  3248. } else {
  3249. return value;
  3250. }
  3251. ;
  3252. return self;}
  3253. }),
  3254. smalltalk.Array);
  3255. smalltalk.addMethod(
  3256. '_add_',
  3257. smalltalk.method({
  3258. selector: 'add:',
  3259. fn: function (anObject){
  3260. var self=this;
  3261. self.push(anObject); return anObject;;
  3262. return self;}
  3263. }),
  3264. smalltalk.Array);
  3265. smalltalk.addMethod(
  3266. '_shallowCopy',
  3267. smalltalk.method({
  3268. selector: 'shallowCopy',
  3269. fn: function (){
  3270. var self=this;
  3271. var newCollection=nil;
  3272. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  3273. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [each]);})]);
  3274. return newCollection;
  3275. return self;}
  3276. }),
  3277. smalltalk.Array);
  3278. smalltalk.addMethod(
  3279. '_deepCopy',
  3280. smalltalk.method({
  3281. selector: 'deepCopy',
  3282. fn: function (){
  3283. var self=this;
  3284. var newCollection=nil;
  3285. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  3286. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [smalltalk.send(each, "_deepCopy", [])]);})]);
  3287. return newCollection;
  3288. return self;}
  3289. }),
  3290. smalltalk.Array);
  3291. smalltalk.addMethod(
  3292. '_copyFrom_to_',
  3293. smalltalk.method({
  3294. selector: 'copyFrom:to:',
  3295. fn: function (anIndex, anotherIndex){
  3296. var self=this;
  3297. var array=nil;
  3298. array=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  3299. smalltalk.send(anIndex, "_to_do_", [anotherIndex, (function(each){return smalltalk.send(array, "_add_", [smalltalk.send(self, "_at_", [each])]);})]);
  3300. return array;
  3301. return self;}
  3302. }),
  3303. smalltalk.Array);
  3304. smalltalk.addMethod(
  3305. '_join_',
  3306. smalltalk.method({
  3307. selector: 'join:',
  3308. fn: function (aString){
  3309. var self=this;
  3310. return self.join(aString);
  3311. return self;}
  3312. }),
  3313. smalltalk.Array);
  3314. smalltalk.addMethod(
  3315. '_asJavascript',
  3316. smalltalk.method({
  3317. selector: 'asJavascript',
  3318. fn: function (){
  3319. var self=this;
  3320. 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")]);
  3321. return self;}
  3322. }),
  3323. smalltalk.Array);
  3324. smalltalk.addMethod(
  3325. '_sort',
  3326. smalltalk.method({
  3327. selector: 'sort',
  3328. fn: function (){
  3329. var self=this;
  3330. return smalltalk.send(self, "_basicPerform_", ["sort"]);
  3331. return self;}
  3332. }),
  3333. smalltalk.Array);
  3334. smalltalk.addMethod(
  3335. '_sort_',
  3336. smalltalk.method({
  3337. selector: 'sort:',
  3338. fn: function (aBlock){
  3339. var self=this;
  3340. return self.sort(function(a, b) {
  3341. if(aBlock(a,b)) {return -1} else {return 1}
  3342. })
  3343. ;
  3344. return self;}
  3345. }),
  3346. smalltalk.Array);
  3347. smalltalk.addMethod(
  3348. '_remove_',
  3349. smalltalk.method({
  3350. selector: 'remove:',
  3351. fn: function (anObject){
  3352. var self=this;
  3353. for(var i=0;i<self.length;i++) {
  3354. if(self[i] == anObject) {
  3355. self.splice(i,1);
  3356. break;
  3357. }
  3358. }
  3359. ;
  3360. return self;}
  3361. }),
  3362. smalltalk.Array);
  3363. smalltalk.addMethod(
  3364. '_sorted',
  3365. smalltalk.method({
  3366. selector: 'sorted',
  3367. fn: function (){
  3368. var self=this;
  3369. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort", []);
  3370. return self;}
  3371. }),
  3372. smalltalk.Array);
  3373. smalltalk.addMethod(
  3374. '_sorted_',
  3375. smalltalk.method({
  3376. selector: 'sorted:',
  3377. fn: function (aBlock){
  3378. var self=this;
  3379. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort_", [aBlock]);
  3380. return self;}
  3381. }),
  3382. smalltalk.Array);
  3383. smalltalk.addMethod(
  3384. '_asJSONObject',
  3385. smalltalk.method({
  3386. selector: 'asJSONObject',
  3387. fn: function (){
  3388. var self=this;
  3389. return smalltalk.send(self, "_collect_", [(function(each){return smalltalk.send(each, "_asJSONObject", []);})]);
  3390. return self;}
  3391. }),
  3392. smalltalk.Array);
  3393. smalltalk.addMethod(
  3394. '_removeFrom_to_',
  3395. smalltalk.method({
  3396. selector: 'removeFrom:to:',
  3397. fn: function (aNumber, anotherNumber){
  3398. var self=this;
  3399. self.splice(aNumber - 1,anotherNumber - 1);
  3400. return self;}
  3401. }),
  3402. smalltalk.Array);
  3403. smalltalk.addMethod(
  3404. '_printString',
  3405. smalltalk.method({
  3406. selector: 'printString',
  3407. fn: function (){
  3408. var self=this;
  3409. var str=nil;
  3410. str=smalltalk.send("", "_writeStream", []);
  3411. smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.SequenceableCollection), "__comma", [unescape("%20%28")])]);
  3412. smalltalk.send(self, "_do_separatedBy_", [(function(each){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(each, "_printString", [])]);}), (function(){return smalltalk.send(str, "_nextPutAll_", [" "]);})]);
  3413. smalltalk.send(str, "_nextPutAll_", [unescape("%29")]);
  3414. return smalltalk.send(str, "_contents", []);
  3415. return self;}
  3416. }),
  3417. smalltalk.Array);
  3418. smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel');
  3419. smalltalk.addMethod(
  3420. '_compile_',
  3421. smalltalk.method({
  3422. selector: 'compile:',
  3423. fn: function (aString){
  3424. var self=this;
  3425. return self.compile(aString);
  3426. return self;}
  3427. }),
  3428. smalltalk.RegularExpression);
  3429. smalltalk.addMethod(
  3430. '_exec_',
  3431. smalltalk.method({
  3432. selector: 'exec:',
  3433. fn: function (aString){
  3434. var self=this;
  3435. return self.exec(aString) || nil;
  3436. return self;}
  3437. }),
  3438. smalltalk.RegularExpression);
  3439. smalltalk.addMethod(
  3440. '_test_',
  3441. smalltalk.method({
  3442. selector: 'test:',
  3443. fn: function (aString){
  3444. var self=this;
  3445. return self.test(aString);
  3446. return self;}
  3447. }),
  3448. smalltalk.RegularExpression);
  3449. smalltalk.addMethod(
  3450. '_fromString_flag_',
  3451. smalltalk.method({
  3452. selector: 'fromString:flag:',
  3453. fn: function (aString, anotherString){
  3454. var self=this;
  3455. return new RegExp(aString, anotherString);
  3456. return self;}
  3457. }),
  3458. smalltalk.RegularExpression.klass);
  3459. smalltalk.addMethod(
  3460. '_fromString_',
  3461. smalltalk.method({
  3462. selector: 'fromString:',
  3463. fn: function (aString){
  3464. var self=this;
  3465. return smalltalk.send(self, "_fromString_flag_", [aString, ""]);
  3466. return self;}
  3467. }),
  3468. smalltalk.RegularExpression.klass);
  3469. smalltalk.addClass('Error', smalltalk.Object, ['messageText'], 'Kernel');
  3470. smalltalk.addMethod(
  3471. '_messageText',
  3472. smalltalk.method({
  3473. selector: 'messageText',
  3474. fn: function (){
  3475. var self=this;
  3476. return self['@messageText'];
  3477. return self;}
  3478. }),
  3479. smalltalk.Error);
  3480. smalltalk.addMethod(
  3481. '_messageText_',
  3482. smalltalk.method({
  3483. selector: 'messageText:',
  3484. fn: function (aString){
  3485. var self=this;
  3486. self['@messageText']=aString;
  3487. return self;}
  3488. }),
  3489. smalltalk.Error);
  3490. smalltalk.addMethod(
  3491. '_signal',
  3492. smalltalk.method({
  3493. selector: 'signal',
  3494. fn: function (){
  3495. var self=this;
  3496. self.context = thisContext; self.smalltalkError = true; throw(self);
  3497. return self;}
  3498. }),
  3499. smalltalk.Error);
  3500. smalltalk.addMethod(
  3501. '_context',
  3502. smalltalk.method({
  3503. selector: 'context',
  3504. fn: function (){
  3505. var self=this;
  3506. return self.context;
  3507. return self;}
  3508. }),
  3509. smalltalk.Error);
  3510. smalltalk.addMethod(
  3511. '_signal_',
  3512. smalltalk.method({
  3513. selector: 'signal:',
  3514. fn: function (aString){
  3515. var self=this;
  3516. return (function($rec){smalltalk.send($rec, "_messageText_", [aString]);return smalltalk.send($rec, "_signal", []);})(smalltalk.send(self, "_new", []));
  3517. return self;}
  3518. }),
  3519. smalltalk.Error.klass);
  3520. smalltalk.addClass('MethodContext', smalltalk.Object, [], 'Kernel');
  3521. smalltalk.addMethod(
  3522. '_receiver',
  3523. smalltalk.method({
  3524. selector: 'receiver',
  3525. fn: function (){
  3526. var self=this;
  3527. return self.receiver;
  3528. return self;}
  3529. }),
  3530. smalltalk.MethodContext);
  3531. smalltalk.addMethod(
  3532. '_selector',
  3533. smalltalk.method({
  3534. selector: 'selector',
  3535. fn: function (){
  3536. var self=this;
  3537. return smalltalk.convertSelector(self.selector);
  3538. return self;}
  3539. }),
  3540. smalltalk.MethodContext);
  3541. smalltalk.addMethod(
  3542. '_home',
  3543. smalltalk.method({
  3544. selector: 'home',
  3545. fn: function (){
  3546. var self=this;
  3547. return self.homeContext;
  3548. return self;}
  3549. }),
  3550. smalltalk.MethodContext);
  3551. smalltalk.addMethod(
  3552. '_temps',
  3553. smalltalk.method({
  3554. selector: 'temps',
  3555. fn: function (){
  3556. var self=this;
  3557. return self.temps;
  3558. return self;}
  3559. }),
  3560. smalltalk.MethodContext);
  3561. smalltalk.addMethod(
  3562. '_printString',
  3563. smalltalk.method({
  3564. selector: 'printString',
  3565. fn: function (){
  3566. var self=this;
  3567. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.Object), "__comma", [unescape("%28")]), "__comma", [smalltalk.send(self, "_asString", [])]), "__comma", [unescape("%29")]);
  3568. return self;}
  3569. }),
  3570. smalltalk.MethodContext);
  3571. smalltalk.addMethod(
  3572. '_asString',
  3573. smalltalk.method({
  3574. selector: 'asString',
  3575. fn: function (){
  3576. var self=this;
  3577. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_receiver", []), "_class", []), "_printString", []), "__comma", [unescape("%20%3E%3E%20")]), "__comma", [smalltalk.send(self, "_selector", [])]);
  3578. return self;}
  3579. }),
  3580. smalltalk.MethodContext);
  3581. smalltalk.addClass('Association', smalltalk.Object, ['key', 'value'], 'Kernel');
  3582. smalltalk.addMethod(
  3583. '__eq',
  3584. smalltalk.method({
  3585. selector: '=',
  3586. fn: function (anAssociation){
  3587. var self=this;
  3588. 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", [])]);})]);})]);
  3589. return self;}
  3590. }),
  3591. smalltalk.Association);
  3592. smalltalk.addMethod(
  3593. '_key_',
  3594. smalltalk.method({
  3595. selector: 'key:',
  3596. fn: function (aKey){
  3597. var self=this;
  3598. self['@key']=aKey;
  3599. return self;}
  3600. }),
  3601. smalltalk.Association);
  3602. smalltalk.addMethod(
  3603. '_key',
  3604. smalltalk.method({
  3605. selector: 'key',
  3606. fn: function (){
  3607. var self=this;
  3608. return self['@key'];
  3609. return self;}
  3610. }),
  3611. smalltalk.Association);
  3612. smalltalk.addMethod(
  3613. '_value_',
  3614. smalltalk.method({
  3615. selector: 'value:',
  3616. fn: function (aValue){
  3617. var self=this;
  3618. self['@value']=aValue;
  3619. return self;}
  3620. }),
  3621. smalltalk.Association);
  3622. smalltalk.addMethod(
  3623. '_value',
  3624. smalltalk.method({
  3625. selector: 'value',
  3626. fn: function (){
  3627. var self=this;
  3628. return self['@value'];
  3629. return self;}
  3630. }),
  3631. smalltalk.Association);
  3632. smalltalk.addMethod(
  3633. '_key_value_',
  3634. smalltalk.method({
  3635. selector: 'key:value:',
  3636. fn: function (aKey, aValue){
  3637. var self=this;
  3638. return (function($rec){smalltalk.send($rec, "_key_", [aKey]);smalltalk.send($rec, "_value_", [aValue]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  3639. return self;}
  3640. }),
  3641. smalltalk.Association.klass);
  3642. smalltalk.addClass('Dictionary', smalltalk.Collection, ['keys'], 'Kernel');
  3643. smalltalk.addMethod(
  3644. '__eq',
  3645. smalltalk.method({
  3646. selector: '=',
  3647. fn: function (aDictionary){
  3648. var self=this;
  3649. try{smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aDictionary, "_class", [])]), "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);
  3650. smalltalk.send(self, "_associationsDo_", [(function(assoc){return smalltalk.send(smalltalk.send(smalltalk.send(aDictionary, "_at_ifAbsent_", [smalltalk.send(assoc, "_key", []), (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]), "__eq", [smalltalk.send(assoc, "_value", [])]), "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);})]);
  3651. (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return true}})})();
  3652. return self;
  3653. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  3654. }),
  3655. smalltalk.Dictionary);
  3656. smalltalk.addMethod(
  3657. '_shallowCopy',
  3658. smalltalk.method({
  3659. selector: 'shallowCopy',
  3660. fn: function (){
  3661. var self=this;
  3662. var copy=nil;
  3663. copy=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  3664. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(copy, "_at_put_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  3665. return copy;
  3666. return self;}
  3667. }),
  3668. smalltalk.Dictionary);
  3669. smalltalk.addMethod(
  3670. '_initialize',
  3671. smalltalk.method({
  3672. selector: 'initialize',
  3673. fn: function (){
  3674. var self=this;
  3675. smalltalk.send(self, "_initialize", [], smalltalk.Collection);
  3676. self['@keys']=[];
  3677. return self;}
  3678. }),
  3679. smalltalk.Dictionary);
  3680. smalltalk.addMethod(
  3681. '_size',
  3682. smalltalk.method({
  3683. selector: 'size',
  3684. fn: function (){
  3685. var self=this;
  3686. return smalltalk.send(self['@keys'], "_size", []);
  3687. return self;}
  3688. }),
  3689. smalltalk.Dictionary);
  3690. smalltalk.addMethod(
  3691. '_associations',
  3692. smalltalk.method({
  3693. selector: 'associations',
  3694. fn: function (){
  3695. var self=this;
  3696. var associations=nil;
  3697. associations=[];
  3698. smalltalk.send(self['@keys'], "_do_", [(function(each){return smalltalk.send(associations, "_add_", [smalltalk.send(smalltalk.Association, "_key_value_", [each, smalltalk.send(self, "_at_", [each])])]);})]);
  3699. return associations;
  3700. return self;}
  3701. }),
  3702. smalltalk.Dictionary);
  3703. smalltalk.addMethod(
  3704. '_keys',
  3705. smalltalk.method({
  3706. selector: 'keys',
  3707. fn: function (){
  3708. var self=this;
  3709. return smalltalk.send(self['@keys'], "_copy", []);
  3710. return self;}
  3711. }),
  3712. smalltalk.Dictionary);
  3713. smalltalk.addMethod(
  3714. '_values',
  3715. smalltalk.method({
  3716. selector: 'values',
  3717. fn: function (){
  3718. var self=this;
  3719. return smalltalk.send(self['@keys'], "_collect_", [(function(each){return smalltalk.send(self, "_at_", [each]);})]);
  3720. return self;}
  3721. }),
  3722. smalltalk.Dictionary);
  3723. smalltalk.addMethod(
  3724. '_at_put_',
  3725. smalltalk.method({
  3726. selector: 'at:put:',
  3727. fn: function (aKey, aValue){
  3728. var self=this;
  3729. smalltalk.send(smalltalk.send(self['@keys'], "_includes_", [aKey]), "_ifFalse_", [(function(){return smalltalk.send(self['@keys'], "_add_", [aKey]);})]);
  3730. return smalltalk.send(self, "_basicAt_put_", [aKey, aValue]);
  3731. return self;}
  3732. }),
  3733. smalltalk.Dictionary);
  3734. smalltalk.addMethod(
  3735. '_at_ifAbsent_',
  3736. smalltalk.method({
  3737. selector: 'at:ifAbsent:',
  3738. fn: function (aKey, aBlock){
  3739. var self=this;
  3740. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_keys", []), "_includes_", [aKey]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_basicAt_", [aKey]);}), aBlock]);
  3741. return self;}
  3742. }),
  3743. smalltalk.Dictionary);
  3744. smalltalk.addMethod(
  3745. '_at_ifAbsentPut_',
  3746. smalltalk.method({
  3747. selector: 'at:ifAbsentPut:',
  3748. fn: function (aKey, aBlock){
  3749. var self=this;
  3750. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_at_put_", [aKey, smalltalk.send(aBlock, "_value", [])]);})]);
  3751. return self;}
  3752. }),
  3753. smalltalk.Dictionary);
  3754. smalltalk.addMethod(
  3755. '_at_ifPresent_',
  3756. smalltalk.method({
  3757. selector: 'at:ifPresent:',
  3758. fn: function (aKey, aBlock){
  3759. var self=this;
  3760. return smalltalk.send(smalltalk.send(self, "_basicAt_", [aKey]), "_ifNotNil_", [(function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})]);
  3761. return self;}
  3762. }),
  3763. smalltalk.Dictionary);
  3764. smalltalk.addMethod(
  3765. '_at_ifPresent_ifAbsent_',
  3766. smalltalk.method({
  3767. selector: 'at:ifPresent:ifAbsent:',
  3768. fn: function (aKey, aBlock, anotherBlock){
  3769. var self=this;
  3770. return smalltalk.send(smalltalk.send(self, "_basicAt_", [aKey]), "_ifNil_ifNotNil_", [anotherBlock, (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})]);
  3771. return self;}
  3772. }),
  3773. smalltalk.Dictionary);
  3774. smalltalk.addMethod(
  3775. '_add_',
  3776. smalltalk.method({
  3777. selector: 'add:',
  3778. fn: function (anAssociation){
  3779. var self=this;
  3780. smalltalk.send(self, "_at_put_", [smalltalk.send(anAssociation, "_key", []), smalltalk.send(anAssociation, "_value", [])]);
  3781. return self;}
  3782. }),
  3783. smalltalk.Dictionary);
  3784. smalltalk.addMethod(
  3785. '_addAll_',
  3786. smalltalk.method({
  3787. selector: 'addAll:',
  3788. fn: function (aDictionary){
  3789. var self=this;
  3790. smalltalk.send(self, "_addAll_", [smalltalk.send(aDictionary, "_associations", [])], smalltalk.Collection);
  3791. return aDictionary;
  3792. return self;}
  3793. }),
  3794. smalltalk.Dictionary);
  3795. smalltalk.addMethod(
  3796. '__comma',
  3797. smalltalk.method({
  3798. selector: ',',
  3799. fn: function (aCollection){
  3800. var self=this;
  3801. smalltalk.send(self, "_shouldNotImplement", []);
  3802. return self;}
  3803. }),
  3804. smalltalk.Dictionary);
  3805. smalltalk.addMethod(
  3806. '_copyFrom_to_',
  3807. smalltalk.method({
  3808. selector: 'copyFrom:to:',
  3809. fn: function (anIndex, anotherIndex){
  3810. var self=this;
  3811. smalltalk.send(self, "_shouldNotImplement", []);
  3812. return self;}
  3813. }),
  3814. smalltalk.Dictionary);
  3815. smalltalk.addMethod(
  3816. '_associationsDo_',
  3817. smalltalk.method({
  3818. selector: 'associationsDo:',
  3819. fn: function (aBlock){
  3820. var self=this;
  3821. smalltalk.send(smalltalk.send(self, "_associations", []), "_do_", [aBlock]);
  3822. return self;}
  3823. }),
  3824. smalltalk.Dictionary);
  3825. smalltalk.addMethod(
  3826. '_keysAndValuesDo_',
  3827. smalltalk.method({
  3828. selector: 'keysAndValuesDo:',
  3829. fn: function (aBlock){
  3830. var self=this;
  3831. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(aBlock, "_value_value_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  3832. return self;}
  3833. }),
  3834. smalltalk.Dictionary);
  3835. smalltalk.addMethod(
  3836. '_do_',
  3837. smalltalk.method({
  3838. selector: 'do:',
  3839. fn: function (aBlock){
  3840. var self=this;
  3841. smalltalk.send(smalltalk.send(self, "_values", []), "_do_", [aBlock]);
  3842. return self;}
  3843. }),
  3844. smalltalk.Dictionary);
  3845. smalltalk.addMethod(
  3846. '_select_',
  3847. smalltalk.method({
  3848. selector: 'select:',
  3849. fn: function (aBlock){
  3850. var self=this;
  3851. var newDict=nil;
  3852. newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  3853. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(smalltalk.send(aBlock, "_value_", [value]), "_ifTrue_", [(function(){return smalltalk.send(newDict, "_at_put_", [key, value]);})]);})]);
  3854. return newDict;
  3855. return self;}
  3856. }),
  3857. smalltalk.Dictionary);
  3858. smalltalk.addMethod(
  3859. '_collect_',
  3860. smalltalk.method({
  3861. selector: 'collect:',
  3862. fn: function (aBlock){
  3863. var self=this;
  3864. var newDict=nil;
  3865. newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  3866. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(newDict, "_at_put_", [key, smalltalk.send(aBlock, "_value_", [value])]);})]);
  3867. return newDict;
  3868. return self;}
  3869. }),
  3870. smalltalk.Dictionary);
  3871. smalltalk.addMethod(
  3872. '_detect_ifNone_',
  3873. smalltalk.method({
  3874. selector: 'detect:ifNone:',
  3875. fn: function (aBlock, anotherBlock){
  3876. var self=this;
  3877. return smalltalk.send(smalltalk.send(self, "_values", []), "_detect_ifNone_", [aBlock, anotherBlock]);
  3878. return self;}
  3879. }),
  3880. smalltalk.Dictionary);
  3881. smalltalk.addMethod(
  3882. '_includes_',
  3883. smalltalk.method({
  3884. selector: 'includes:',
  3885. fn: function (anObject){
  3886. var self=this;
  3887. return smalltalk.send(smalltalk.send(self, "_values", []), "_includes_", [anObject]);
  3888. return self;}
  3889. }),
  3890. smalltalk.Dictionary);
  3891. smalltalk.addMethod(
  3892. '_remove_',
  3893. smalltalk.method({
  3894. selector: 'remove:',
  3895. fn: function (aKey){
  3896. var self=this;
  3897. smalltalk.send(self, "_removeKey_", [aKey]);
  3898. return self;}
  3899. }),
  3900. smalltalk.Dictionary);
  3901. smalltalk.addMethod(
  3902. '_removeKey_',
  3903. smalltalk.method({
  3904. selector: 'removeKey:',
  3905. fn: function (aKey){
  3906. var self=this;
  3907. smalltalk.send(self['@keys'], "_remove_", [aKey]);
  3908. return self;}
  3909. }),
  3910. smalltalk.Dictionary);
  3911. smalltalk.addMethod(
  3912. '_at_',
  3913. smalltalk.method({
  3914. selector: 'at:',
  3915. fn: function (aKey){
  3916. var self=this;
  3917. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  3918. return self;}
  3919. }),
  3920. smalltalk.Dictionary);
  3921. smalltalk.addMethod(
  3922. '_asJSONObject',
  3923. smalltalk.method({
  3924. selector: 'asJSONObject',
  3925. fn: function (){
  3926. var self=this;
  3927. var object=nil;
  3928. object=smalltalk.send(smalltalk.Object, "_new", []);
  3929. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(object, "_basicAt_put_", [key, smalltalk.send(value, "_asJSONObject", [])]);})]);
  3930. return object;
  3931. return self;}
  3932. }),
  3933. smalltalk.Dictionary);
  3934. smalltalk.addMethod(
  3935. '_printString',
  3936. smalltalk.method({
  3937. selector: 'printString',
  3938. fn: function (){
  3939. var self=this;
  3940. return smalltalk.send(smalltalk.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")]);})]);
  3941. return self;}
  3942. }),
  3943. smalltalk.Dictionary);
  3944. smalltalk.addClass('ClassBuilder', smalltalk.Object, [], 'Kernel');
  3945. smalltalk.addMethod(
  3946. '_superclass_subclass_',
  3947. smalltalk.method({
  3948. selector: 'superclass:subclass:',
  3949. fn: function (aClass, aString){
  3950. var self=this;
  3951. smalltalk.send(self, "_superclass_subclass_instanceVariableNames_category_", [aClass, aString, "", nil]);
  3952. return self;}
  3953. }),
  3954. smalltalk.ClassBuilder);
  3955. smalltalk.addMethod(
  3956. '_superclass_subclass_instanceVariableNames_category_',
  3957. smalltalk.method({
  3958. selector: 'superclass:subclass:instanceVariableNames:category:',
  3959. fn: function (aClass, aString, aString2, aString3){
  3960. var self=this;
  3961. var newClass=nil;
  3962. newClass=smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_", [aClass, aString, smalltalk.send(self, "_instanceVariableNamesFor_", [aString2])]);
  3963. smalltalk.send(self, "_setupClass_", [newClass]);
  3964. smalltalk.send(newClass, "_category_", [smalltalk.send(aString3, "_ifNil_", [(function(){return "unclassified";})])]);
  3965. return self;}
  3966. }),
  3967. smalltalk.ClassBuilder);
  3968. smalltalk.addMethod(
  3969. '_class_instanceVariableNames_',
  3970. smalltalk.method({
  3971. selector: 'class:instanceVariableNames:',
  3972. fn: function (aClass, aString){
  3973. var self=this;
  3974. smalltalk.send(smalltalk.send(aClass, "_isMetaclass", []), "_ifFalse_", [(function(){return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_name", []), "__comma", [" is not a metaclass"])]);})]);
  3975. smalltalk.send(aClass, "_basicAt_put_", ["iVarNames", smalltalk.send(self, "_instanceVariableNamesFor_", [aString])]);
  3976. smalltalk.send(self, "_setupClass_", [aClass]);
  3977. return self;}
  3978. }),
  3979. smalltalk.ClassBuilder);
  3980. smalltalk.addMethod(
  3981. '_instanceVariableNamesFor_',
  3982. smalltalk.method({
  3983. selector: 'instanceVariableNamesFor:',
  3984. fn: function (aString){
  3985. var self=this;
  3986. return smalltalk.send(smalltalk.send(aString, "_tokenize_", [" "]), "_reject_", [(function(each){return smalltalk.send(each, "_isEmpty", []);})]);
  3987. return self;}
  3988. }),
  3989. smalltalk.ClassBuilder);
  3990. smalltalk.addMethod(
  3991. '_addSubclassOf_named_instanceVariableNames_',
  3992. smalltalk.method({
  3993. selector: 'addSubclassOf:named:instanceVariableNames:',
  3994. fn: function (aClass, aString, aCollection){
  3995. var self=this;
  3996. smalltalk.addClass(aString, aClass, aCollection);
  3997. return smalltalk[aString];
  3998. return self;}
  3999. }),
  4000. smalltalk.ClassBuilder);
  4001. smalltalk.addMethod(
  4002. '_setupClass_',
  4003. smalltalk.method({
  4004. selector: 'setupClass:',
  4005. fn: function (aClass){
  4006. var self=this;
  4007. smalltalk.init(aClass);;
  4008. return self;}
  4009. }),
  4010. smalltalk.ClassBuilder);
  4011. smalltalk.addClass('ClassCategoryReader', smalltalk.Object, ['class', 'category', 'chunkParser'], 'Kernel');
  4012. smalltalk.addMethod(
  4013. '_initialize',
  4014. smalltalk.method({
  4015. selector: 'initialize',
  4016. fn: function (){
  4017. var self=this;
  4018. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  4019. self['@chunkParser']=smalltalk.send(smalltalk.ChunkParser, "_new", []);
  4020. return self;}
  4021. }),
  4022. smalltalk.ClassCategoryReader);
  4023. smalltalk.addMethod(
  4024. '_class_category_',
  4025. smalltalk.method({
  4026. selector: 'class:category:',
  4027. fn: function (aClass, aString){
  4028. var self=this;
  4029. self['@class']=aClass;
  4030. self['@category']=aString;
  4031. return self;}
  4032. }),
  4033. smalltalk.ClassCategoryReader);
  4034. smalltalk.addMethod(
  4035. '_scanFrom_',
  4036. smalltalk.method({
  4037. selector: 'scanFrom:',
  4038. fn: function (aStream){
  4039. var self=this;
  4040. var nextChunk=nil;
  4041. nextChunk=smalltalk.send(smalltalk.send(smalltalk.send(self['@chunkParser'], "_emptyChunk", []), "__slash", [smalltalk.send(self['@chunkParser'], "_chunk", [])]), "_parse_", [aStream]);
  4042. smalltalk.send(smalltalk.send(nextChunk, "_isEmptyChunk", []), "_ifFalse_", [(function(){smalltalk.send(self, "_compileMethod_", [smalltalk.send(nextChunk, "_contents", [])]);return smalltalk.send(self, "_scanFrom_", [aStream]);})]);
  4043. return self;}
  4044. }),
  4045. smalltalk.ClassCategoryReader);
  4046. smalltalk.addMethod(
  4047. '_compileMethod_',
  4048. smalltalk.method({
  4049. selector: 'compileMethod:',
  4050. fn: function (aString){
  4051. var self=this;
  4052. var method=nil;
  4053. method=smalltalk.send(smalltalk.send(smalltalk.Compiler, "_new", []), "_load_forClass_", [aString, self['@class']]);
  4054. smalltalk.send(method, "_category_", [self['@category']]);
  4055. smalltalk.send(self['@class'], "_addCompiledMethod_", [method]);
  4056. return self;}
  4057. }),
  4058. smalltalk.ClassCategoryReader);
  4059. smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel');
  4060. smalltalk.addMethod(
  4061. '_collection',
  4062. smalltalk.method({
  4063. selector: 'collection',
  4064. fn: function (){
  4065. var self=this;
  4066. return self['@collection'];
  4067. return self;}
  4068. }),
  4069. smalltalk.Stream);
  4070. smalltalk.addMethod(
  4071. '_setCollection_',
  4072. smalltalk.method({
  4073. selector: 'setCollection:',
  4074. fn: function (aCollection){
  4075. var self=this;
  4076. self['@collection']=aCollection;
  4077. return self;}
  4078. }),
  4079. smalltalk.Stream);
  4080. smalltalk.addMethod(
  4081. '_position',
  4082. smalltalk.method({
  4083. selector: 'position',
  4084. fn: function (){
  4085. var self=this;
  4086. return smalltalk.send(self['@position'], "_ifNil_", [(function(){return self['@position']=(0);})]);
  4087. return self;}
  4088. }),
  4089. smalltalk.Stream);
  4090. smalltalk.addMethod(
  4091. '_position_',
  4092. smalltalk.method({
  4093. selector: 'position:',
  4094. fn: function (anInteger){
  4095. var self=this;
  4096. self['@position']=anInteger;
  4097. return self;}
  4098. }),
  4099. smalltalk.Stream);
  4100. smalltalk.addMethod(
  4101. '_streamSize',
  4102. smalltalk.method({
  4103. selector: 'streamSize',
  4104. fn: function (){
  4105. var self=this;
  4106. return self['@streamSize'];
  4107. return self;}
  4108. }),
  4109. smalltalk.Stream);
  4110. smalltalk.addMethod(
  4111. '_setStreamSize_',
  4112. smalltalk.method({
  4113. selector: 'setStreamSize:',
  4114. fn: function (anInteger){
  4115. var self=this;
  4116. self['@streamSize']=anInteger;
  4117. return self;}
  4118. }),
  4119. smalltalk.Stream);
  4120. smalltalk.addMethod(
  4121. '_contents',
  4122. smalltalk.method({
  4123. selector: 'contents',
  4124. fn: function (){
  4125. var self=this;
  4126. return smalltalk.send(smalltalk.send(self, "_collection", []), "_copyFrom_to_", [(1), smalltalk.send(self, "_streamSize", [])]);
  4127. return self;}
  4128. }),
  4129. smalltalk.Stream);
  4130. smalltalk.addMethod(
  4131. '_size',
  4132. smalltalk.method({
  4133. selector: 'size',
  4134. fn: function (){
  4135. var self=this;
  4136. return smalltalk.send(self, "_streamSize", []);
  4137. return self;}
  4138. }),
  4139. smalltalk.Stream);
  4140. smalltalk.addMethod(
  4141. '_reset',
  4142. smalltalk.method({
  4143. selector: 'reset',
  4144. fn: function (){
  4145. var self=this;
  4146. smalltalk.send(self, "_position_", [(0)]);
  4147. return self;}
  4148. }),
  4149. smalltalk.Stream);
  4150. smalltalk.addMethod(
  4151. '_close',
  4152. smalltalk.method({
  4153. selector: 'close',
  4154. fn: function (){
  4155. var self=this;
  4156. return self;}
  4157. }),
  4158. smalltalk.Stream);
  4159. smalltalk.addMethod(
  4160. '_flush',
  4161. smalltalk.method({
  4162. selector: 'flush',
  4163. fn: function (){
  4164. var self=this;
  4165. return self;}
  4166. }),
  4167. smalltalk.Stream);
  4168. smalltalk.addMethod(
  4169. '_resetContents',
  4170. smalltalk.method({
  4171. selector: 'resetContents',
  4172. fn: function (){
  4173. var self=this;
  4174. smalltalk.send(self, "_reset", []);
  4175. smalltalk.send(self, "_setStreamSize_", [(0)]);
  4176. return self;}
  4177. }),
  4178. smalltalk.Stream);
  4179. smalltalk.addMethod(
  4180. '_do_',
  4181. smalltalk.method({
  4182. selector: 'do:',
  4183. fn: function (aBlock){
  4184. var self=this;
  4185. smalltalk.send((function(){return smalltalk.send(self, "_atEnd", []);}), "_whileFalse_", [(function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_next", [])]);})]);
  4186. return self;}
  4187. }),
  4188. smalltalk.Stream);
  4189. smalltalk.addMethod(
  4190. '_setToEnd',
  4191. smalltalk.method({
  4192. selector: 'setToEnd',
  4193. fn: function (){
  4194. var self=this;
  4195. smalltalk.send(self, "_position_", [smalltalk.send(self, "_size", [])]);
  4196. return self;}
  4197. }),
  4198. smalltalk.Stream);
  4199. smalltalk.addMethod(
  4200. '_skip_',
  4201. smalltalk.method({
  4202. selector: 'skip:',
  4203. fn: function (anInteger){
  4204. var self=this;
  4205. smalltalk.send(self, "_position_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_position", []), "__plus", [anInteger]), "_min_max_", [smalltalk.send(self, "_size", []), (0)])]);
  4206. return self;}
  4207. }),
  4208. smalltalk.Stream);
  4209. smalltalk.addMethod(
  4210. '_next',
  4211. smalltalk.method({
  4212. selector: 'next',
  4213. fn: function (){
  4214. var self=this;
  4215. smalltalk.send(self, "_position_", [smalltalk.send(smalltalk.send(self, "_position", []), "__plus", [(1)])]);
  4216. return smalltalk.send(self['@collection'], "_at_", [smalltalk.send(self, "_position", [])]);
  4217. return self;}
  4218. }),
  4219. smalltalk.Stream);
  4220. smalltalk.addMethod(
  4221. '_next_',
  4222. smalltalk.method({
  4223. selector: 'next:',
  4224. fn: function (anInteger){
  4225. var self=this;
  4226. var tempCollection=nil;
  4227. tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []);
  4228. smalltalk.send(anInteger, "_timesRepeat_", [(function(){return smalltalk.send(smalltalk.send(self, "_atEnd", []), "_ifFalse_", [(function(){return smalltalk.send(tempCollection, "_add_", [smalltalk.send(self, "_next", [])]);})]);})]);
  4229. return tempCollection;
  4230. return self;}
  4231. }),
  4232. smalltalk.Stream);
  4233. smalltalk.addMethod(
  4234. '_nextPut_',
  4235. smalltalk.method({
  4236. selector: 'nextPut:',
  4237. fn: function (anObject){
  4238. var self=this;
  4239. smalltalk.send(self, "_position_", [smalltalk.send(smalltalk.send(self, "_position", []), "__plus", [(1)])]);
  4240. smalltalk.send(smalltalk.send(self, "_collection", []), "_at_put_", [smalltalk.send(self, "_position", []), anObject]);
  4241. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  4242. return self;}
  4243. }),
  4244. smalltalk.Stream);
  4245. smalltalk.addMethod(
  4246. '_nextPutAll_',
  4247. smalltalk.method({
  4248. selector: 'nextPutAll:',
  4249. fn: function (aCollection){
  4250. var self=this;
  4251. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_nextPut_", [each]);})]);
  4252. return self;}
  4253. }),
  4254. smalltalk.Stream);
  4255. smalltalk.addMethod(
  4256. '_peek',
  4257. smalltalk.method({
  4258. selector: 'peek',
  4259. fn: function (){
  4260. var self=this;
  4261. return smalltalk.send(smalltalk.send(self, "_atEnd", []), "_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(self, "_collection", []), "_at_", [smalltalk.send(smalltalk.send(self, "_position", []), "__plus", [(1)])]);})]);
  4262. return self;}
  4263. }),
  4264. smalltalk.Stream);
  4265. smalltalk.addMethod(
  4266. '_atEnd',
  4267. smalltalk.method({
  4268. selector: 'atEnd',
  4269. fn: function (){
  4270. var self=this;
  4271. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [smalltalk.send(self, "_size", [])]);
  4272. return self;}
  4273. }),
  4274. smalltalk.Stream);
  4275. smalltalk.addMethod(
  4276. '_atStart',
  4277. smalltalk.method({
  4278. selector: 'atStart',
  4279. fn: function (){
  4280. var self=this;
  4281. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [(0)]);
  4282. return self;}
  4283. }),
  4284. smalltalk.Stream);
  4285. smalltalk.addMethod(
  4286. '_isEmpty',
  4287. smalltalk.method({
  4288. selector: 'isEmpty',
  4289. fn: function (){
  4290. var self=this;
  4291. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
  4292. return self;}
  4293. }),
  4294. smalltalk.Stream);
  4295. smalltalk.addMethod(
  4296. '_on_',
  4297. smalltalk.method({
  4298. selector: 'on:',
  4299. fn: function (aCollection){
  4300. var self=this;
  4301. 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", []));
  4302. return self;}
  4303. }),
  4304. smalltalk.Stream.klass);
  4305. smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel');
  4306. smalltalk.addMethod(
  4307. '_next_',
  4308. smalltalk.method({
  4309. selector: 'next:',
  4310. fn: function (anInteger){
  4311. var self=this;
  4312. var tempCollection=nil;
  4313. tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []);
  4314. smalltalk.send(anInteger, "_timesRepeat_", [(function(){return smalltalk.send(smalltalk.send(self, "_atEnd", []), "_ifFalse_", [(function(){return tempCollection=smalltalk.send(tempCollection, "__comma", [smalltalk.send(self, "_next", [])]);})]);})]);
  4315. return tempCollection;
  4316. return self;}
  4317. }),
  4318. smalltalk.StringStream);
  4319. smalltalk.addMethod(
  4320. '_nextPut_',
  4321. smalltalk.method({
  4322. selector: 'nextPut:',
  4323. fn: function (aString){
  4324. var self=this;
  4325. smalltalk.send(self, "_nextPutAll_", [aString]);
  4326. return self;}
  4327. }),
  4328. smalltalk.StringStream);
  4329. smalltalk.addMethod(
  4330. '_nextPutAll_',
  4331. smalltalk.method({
  4332. selector: 'nextPutAll:',
  4333. fn: function (aString){
  4334. var self=this;
  4335. 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_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_position", []), "__plus", [(1)]), "__plus", [smalltalk.send(aString, "_size", [])]), smalltalk.send(smalltalk.send(self, "_collection", []), "_size", [])])])]);
  4336. smalltalk.send(self, "_position_", [smalltalk.send(smalltalk.send(self, "_position", []), "__plus", [smalltalk.send(aString, "_size", [])])]);
  4337. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  4338. return self;}
  4339. }),
  4340. smalltalk.StringStream);
  4341. smalltalk.addMethod(
  4342. '_cr',
  4343. smalltalk.method({
  4344. selector: 'cr',
  4345. fn: function (){
  4346. var self=this;
  4347. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send(smalltalk.String, "_cr", [])]);
  4348. return self;}
  4349. }),
  4350. smalltalk.StringStream);
  4351. smalltalk.addMethod(
  4352. '_crlf',
  4353. smalltalk.method({
  4354. selector: 'crlf',
  4355. fn: function (){
  4356. var self=this;
  4357. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send(smalltalk.String, "_crlf", [])]);
  4358. return self;}
  4359. }),
  4360. smalltalk.StringStream);
  4361. smalltalk.addMethod(
  4362. '_lf',
  4363. smalltalk.method({
  4364. selector: 'lf',
  4365. fn: function (){
  4366. var self=this;
  4367. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send(smalltalk.String, "_lf", [])]);
  4368. return self;}
  4369. }),
  4370. smalltalk.StringStream);
  4371. smalltalk.addMethod(
  4372. '_space',
  4373. smalltalk.method({
  4374. selector: 'space',
  4375. fn: function (){
  4376. var self=this;
  4377. smalltalk.send(self, "_nextPut_", [" "]);
  4378. return self;}
  4379. }),
  4380. smalltalk.StringStream);
  4381. smalltalk.addClass('ClassCommentReader', smalltalk.Object, ['class', 'chunkParser'], 'Kernel');
  4382. smalltalk.addMethod(
  4383. '_class_',
  4384. smalltalk.method({
  4385. selector: 'class:',
  4386. fn: function (aClass){
  4387. var self=this;
  4388. self['@class']=aClass;
  4389. return self;}
  4390. }),
  4391. smalltalk.ClassCommentReader);
  4392. smalltalk.addMethod(
  4393. '_scanFrom_',
  4394. smalltalk.method({
  4395. selector: 'scanFrom:',
  4396. fn: function (aStream){
  4397. var self=this;
  4398. var nextChunk=nil;
  4399. nextChunk=smalltalk.send(smalltalk.send(smalltalk.send(self['@chunkParser'], "_emptyChunk", []), "__slash", [smalltalk.send(self['@chunkParser'], "_chunk", [])]), "_parse_", [aStream]);
  4400. smalltalk.send(smalltalk.send(nextChunk, "_isEmptyChunk", []), "_ifFalse_", [(function(){return smalltalk.send(self, "_setComment_", [smalltalk.send(nextChunk, "_contents", [])]);})]);
  4401. return self;}
  4402. }),
  4403. smalltalk.ClassCommentReader);
  4404. smalltalk.addMethod(
  4405. '_initialize',
  4406. smalltalk.method({
  4407. selector: 'initialize',
  4408. fn: function (){
  4409. var self=this;
  4410. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  4411. self['@chunkParser']=smalltalk.send(smalltalk.ChunkParser, "_new", []);
  4412. return self;}
  4413. }),
  4414. smalltalk.ClassCommentReader);
  4415. smalltalk.addMethod(
  4416. '_setComment_',
  4417. smalltalk.method({
  4418. selector: 'setComment:',
  4419. fn: function (aString){
  4420. var self=this;
  4421. smalltalk.send(self['@class'], "_comment_", [aString]);
  4422. return self;}
  4423. }),
  4424. smalltalk.ClassCommentReader);
  4425. smalltalk.addClass('Random', smalltalk.Object, [], 'Kernel');
  4426. smalltalk.addMethod(
  4427. '_next',
  4428. smalltalk.method({
  4429. selector: 'next',
  4430. fn: function (){
  4431. var self=this;
  4432. return Math.random();
  4433. return self;}
  4434. }),
  4435. smalltalk.Random);
  4436. smalltalk.addMethod(
  4437. '_next_',
  4438. smalltalk.method({
  4439. selector: 'next:',
  4440. fn: function (anInteger){
  4441. var self=this;
  4442. return smalltalk.send((1), "_to_collect_", [anInteger, (function(each){return smalltalk.send(self, "_next", []);})]);
  4443. return self;}
  4444. }),
  4445. smalltalk.Random);
  4446. smalltalk.addClass('Point', smalltalk.Object, ['x', 'y'], 'Kernel');
  4447. smalltalk.addMethod(
  4448. '_x',
  4449. smalltalk.method({
  4450. selector: 'x',
  4451. fn: function (){
  4452. var self=this;
  4453. return self['@x'];
  4454. return self;}
  4455. }),
  4456. smalltalk.Point);
  4457. smalltalk.addMethod(
  4458. '_y',
  4459. smalltalk.method({
  4460. selector: 'y',
  4461. fn: function (){
  4462. var self=this;
  4463. return self['@y'];
  4464. return self;}
  4465. }),
  4466. smalltalk.Point);
  4467. smalltalk.addMethod(
  4468. '_y_',
  4469. smalltalk.method({
  4470. selector: 'y:',
  4471. fn: function (aNumber){
  4472. var self=this;
  4473. self['@y']=aNumber;
  4474. return self;}
  4475. }),
  4476. smalltalk.Point);
  4477. smalltalk.addMethod(
  4478. '_x_',
  4479. smalltalk.method({
  4480. selector: 'x:',
  4481. fn: function (aNumber){
  4482. var self=this;
  4483. self['@x']=aNumber;
  4484. return self;}
  4485. }),
  4486. smalltalk.Point);
  4487. smalltalk.addMethod(
  4488. '__star',
  4489. smalltalk.method({
  4490. selector: '*',
  4491. fn: function (aPoint){
  4492. var self=this;
  4493. return smalltalk.send(smalltalk.Point, "_x_y_", [smalltalk.send(smalltalk.send(self, "_x", []), "__star", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), smalltalk.send(smalltalk.send(self, "_y", []), "__star", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  4494. return self;}
  4495. }),
  4496. smalltalk.Point);
  4497. smalltalk.addMethod(
  4498. '__plus',
  4499. smalltalk.method({
  4500. selector: '+',
  4501. fn: function (aPoint){
  4502. var self=this;
  4503. return smalltalk.send(smalltalk.Point, "_x_y_", [smalltalk.send(smalltalk.send(self, "_x", []), "__plus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), smalltalk.send(smalltalk.send(self, "_y", []), "__plus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  4504. return self;}
  4505. }),
  4506. smalltalk.Point);
  4507. smalltalk.addMethod(
  4508. '__minus',
  4509. smalltalk.method({
  4510. selector: '-',
  4511. fn: function (aPoint){
  4512. var self=this;
  4513. return smalltalk.send(smalltalk.Point, "_x_y_", [smalltalk.send(smalltalk.send(self, "_x", []), "__minus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), smalltalk.send(smalltalk.send(self, "_y", []), "__minus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  4514. return self;}
  4515. }),
  4516. smalltalk.Point);
  4517. smalltalk.addMethod(
  4518. '__slash',
  4519. smalltalk.method({
  4520. selector: '/',
  4521. fn: function (aPoint){
  4522. var self=this;
  4523. return smalltalk.send(smalltalk.Point, "_x_y_", [smalltalk.send(smalltalk.send(self, "_x", []), "__slash", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), smalltalk.send(smalltalk.send(self, "_y", []), "__slash", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  4524. return self;}
  4525. }),
  4526. smalltalk.Point);
  4527. smalltalk.addMethod(
  4528. '_asPoint',
  4529. smalltalk.method({
  4530. selector: 'asPoint',
  4531. fn: function (){
  4532. var self=this;
  4533. return self;
  4534. return self;}
  4535. }),
  4536. smalltalk.Point);
  4537. smalltalk.addMethod(
  4538. '_x_y_',
  4539. smalltalk.method({
  4540. selector: 'x:y:',
  4541. fn: function (aNumber, anotherNumber){
  4542. var self=this;
  4543. return (function($rec){smalltalk.send($rec, "_x_", [aNumber]);smalltalk.send($rec, "_y_", [anotherNumber]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  4544. return self;}
  4545. }),
  4546. smalltalk.Point.klass);
  4547. smalltalk.addClass('Message', smalltalk.Object, ['selector', 'arguments'], 'Kernel');
  4548. smalltalk.addMethod(
  4549. '_selector',
  4550. smalltalk.method({
  4551. selector: 'selector',
  4552. fn: function (){
  4553. var self=this;
  4554. return self['@selector'];
  4555. return self;}
  4556. }),
  4557. smalltalk.Message);
  4558. smalltalk.addMethod(
  4559. '_selector_',
  4560. smalltalk.method({
  4561. selector: 'selector:',
  4562. fn: function (aString){
  4563. var self=this;
  4564. self['@selector']=aString;
  4565. return self;}
  4566. }),
  4567. smalltalk.Message);
  4568. smalltalk.addMethod(
  4569. '_arguments_',
  4570. smalltalk.method({
  4571. selector: 'arguments:',
  4572. fn: function (anArray){
  4573. var self=this;
  4574. self['@arguments']=anArray;
  4575. return self;}
  4576. }),
  4577. smalltalk.Message);
  4578. smalltalk.addMethod(
  4579. '_arguments',
  4580. smalltalk.method({
  4581. selector: 'arguments',
  4582. fn: function (){
  4583. var self=this;
  4584. return self['@arguments'];
  4585. return self;}
  4586. }),
  4587. smalltalk.Message);
  4588. smalltalk.addMethod(
  4589. '_selector_arguments_',
  4590. smalltalk.method({
  4591. selector: 'selector:arguments:',
  4592. fn: function (aString, anArray){
  4593. var self=this;
  4594. return (function($rec){smalltalk.send($rec, "_selector_", [aString]);smalltalk.send($rec, "_arguments_", [anArray]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  4595. return self;}
  4596. }),
  4597. smalltalk.Message.klass);
  4598. smalltalk.addClass('MessageNotUnderstood', smalltalk.Error, ['message', 'receiver'], 'Kernel');
  4599. smalltalk.addMethod(
  4600. '_message',
  4601. smalltalk.method({
  4602. selector: 'message',
  4603. fn: function (){
  4604. var self=this;
  4605. return self['@message'];
  4606. return self;}
  4607. }),
  4608. smalltalk.MessageNotUnderstood);
  4609. smalltalk.addMethod(
  4610. '_message_',
  4611. smalltalk.method({
  4612. selector: 'message:',
  4613. fn: function (aMessage){
  4614. var self=this;
  4615. self['@message']=aMessage;
  4616. return self;}
  4617. }),
  4618. smalltalk.MessageNotUnderstood);
  4619. smalltalk.addMethod(
  4620. '_receiver',
  4621. smalltalk.method({
  4622. selector: 'receiver',
  4623. fn: function (){
  4624. var self=this;
  4625. return self['@receiver'];
  4626. return self;}
  4627. }),
  4628. smalltalk.MessageNotUnderstood);
  4629. smalltalk.addMethod(
  4630. '_receiver_',
  4631. smalltalk.method({
  4632. selector: 'receiver:',
  4633. fn: function (anObject){
  4634. var self=this;
  4635. self['@receiver']=anObject;
  4636. return self;}
  4637. }),
  4638. smalltalk.MessageNotUnderstood);
  4639. smalltalk.addMethod(
  4640. '_messageText',
  4641. smalltalk.method({
  4642. selector: 'messageText',
  4643. fn: function (){
  4644. var self=this;
  4645. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_receiver", []), "_asString", []), "__comma", [unescape("%20does%20not%20understand%20%23")]), "__comma", [smalltalk.send(smalltalk.send(self, "_message", []), "_selector", [])]);
  4646. return self;}
  4647. }),
  4648. smalltalk.MessageNotUnderstood);
  4649. smalltalk.addClass('ErrorHandler', smalltalk.Object, [], 'Kernel');
  4650. smalltalk.addMethod(
  4651. '_handleError_',
  4652. smalltalk.method({
  4653. selector: 'handleError:',
  4654. fn: function (anError){
  4655. var self=this;
  4656. smalltalk.send(smalltalk.send(anError, "_context", []), "_ifNotNil_", [(function(){return smalltalk.send(self, "_logErrorContext_", [smalltalk.send(anError, "_context", [])]);})]);
  4657. smalltalk.send(self, "_logError_", [anError]);
  4658. return self;}
  4659. }),
  4660. smalltalk.ErrorHandler);
  4661. smalltalk.addMethod(
  4662. '_logContext_',
  4663. smalltalk.method({
  4664. selector: 'logContext:',
  4665. fn: function (aContext){
  4666. var self=this;
  4667. smalltalk.send(smalltalk.send(aContext, "_home", []), "_ifNotNil_", [(function(){return smalltalk.send(self, "_logContext_", [smalltalk.send(aContext, "_home", [])]);})]);
  4668. smalltalk.send(self, "_log_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aContext, "_receiver", []), "_asString", []), "__comma", [unescape("%3E%3E")]), "__comma", [smalltalk.send(aContext, "_selector", [])])]);
  4669. return self;}
  4670. }),
  4671. smalltalk.ErrorHandler);
  4672. smalltalk.addMethod(
  4673. '_logErrorContext_',
  4674. smalltalk.method({
  4675. selector: 'logErrorContext:',
  4676. fn: function (aContext){
  4677. var self=this;
  4678. smalltalk.send(aContext, "_ifNotNil_", [(function(){return smalltalk.send(smalltalk.send(aContext, "_home", []), "_ifNotNil_", [(function(){return smalltalk.send(self, "_logContext_", [smalltalk.send(aContext, "_home", [])]);})]);})]);
  4679. return self;}
  4680. }),
  4681. smalltalk.ErrorHandler);
  4682. smalltalk.addMethod(
  4683. '_logError_',
  4684. smalltalk.method({
  4685. selector: 'logError:',
  4686. fn: function (anError){
  4687. var self=this;
  4688. smalltalk.send(self, "_log_", [smalltalk.send(anError, "_messageText", [])]);
  4689. return self;}
  4690. }),
  4691. smalltalk.ErrorHandler);
  4692. smalltalk.addMethod(
  4693. '_log_',
  4694. smalltalk.method({
  4695. selector: 'log:',
  4696. fn: function (aString){
  4697. var self=this;
  4698. smalltalk.send(console, "_log_", [aString]);
  4699. return self;}
  4700. }),
  4701. smalltalk.ErrorHandler);
  4702. smalltalk.ErrorHandler.klass.iVarNames = ['current'];
  4703. smalltalk.addMethod(
  4704. '_current',
  4705. smalltalk.method({
  4706. selector: 'current',
  4707. fn: function (){
  4708. var self=this;
  4709. return self['@current'];
  4710. return self;}
  4711. }),
  4712. smalltalk.ErrorHandler.klass);
  4713. smalltalk.addMethod(
  4714. '_initialize',
  4715. smalltalk.method({
  4716. selector: 'initialize',
  4717. fn: function (){
  4718. var self=this;
  4719. smalltalk.send(self, "_register", []);
  4720. return self;}
  4721. }),
  4722. smalltalk.ErrorHandler.klass);
  4723. smalltalk.addMethod(
  4724. '_register',
  4725. smalltalk.method({
  4726. selector: 'register',
  4727. fn: function (){
  4728. var self=this;
  4729. smalltalk.send(smalltalk.ErrorHandler, "_setCurrent_", [smalltalk.send(self, "_new", [])]);
  4730. return self;}
  4731. }),
  4732. smalltalk.ErrorHandler.klass);
  4733. smalltalk.addMethod(
  4734. '_setCurrent_',
  4735. smalltalk.method({
  4736. selector: 'setCurrent:',
  4737. fn: function (anHandler){
  4738. var self=this;
  4739. self['@current']=anHandler;
  4740. return self;}
  4741. }),
  4742. smalltalk.ErrorHandler.klass);