1
0

Kernel.deploy.js 132 KB

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