Kernel.deploy.js 135 KB

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