Kernel.deploy.js 148 KB

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