1
0

Kernel.deploy.js 144 KB

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