Kernel.deploy.js 135 KB

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