Kernel.deploy.js 121 KB

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