1
0

Kernel.deploy.js 121 KB

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