Program.js 188 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594
  1. /* ====================================================================
  2. |
  3. | Jtalk Smalltalk
  4. | http://jtalk-project.org
  5. |
  6. ======================================================================
  7. ======================================================================
  8. |
  9. | Copyright (c) 2010-2011
  10. | Nicolas Petton <petton.nicolas@gmail.com>
  11. |
  12. | Jtalk is released under the MIT license
  13. |
  14. | Permission is hereby granted, free of charge, to any person obtaining
  15. | a copy of this software and associated documentation files (the
  16. | 'Software'), to deal in the Software without restriction, including
  17. | without limitation the rights to use, copy, modify, merge, publish,
  18. | distribute, sublicense, and/or sell copies of the Software, and to
  19. | permit persons to whom the Software is furnished to do so, subject to
  20. | the following conditions:
  21. |
  22. | The above copyright notice and this permission notice shall be
  23. | included in all copies or substantial portions of the Software.
  24. |
  25. | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
  26. | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  27. | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  28. | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  29. | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  30. | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  31. | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  32. |
  33. ==================================================================== */
  34. /* Smalltalk constructors definition */
  35. function SmalltalkObject(){};
  36. function SmalltalkBehavior(){};
  37. function SmalltalkClass(){};
  38. function SmalltalkMetaclass(){
  39. this.meta = true;
  40. };
  41. function SmalltalkMethod(){};
  42. function SmalltalkNil(){};
  43. function Smalltalk(){
  44. var st = this;
  45. st.debugMode = true;
  46. /* Smalltalk class creation. A class is an instance of an automatically
  47. created metaclass object. Newly created classes (not their metaclass)
  48. should be added to the smalltalk object, see smalltalk.addClass().
  49. Superclass linking is *not* handled here, see smalltalk.init() */
  50. klass = function(spec) {
  51. var spec = spec || {};
  52. var that;
  53. if(spec.meta) {
  54. that = new SmalltalkMetaclass();
  55. } else {
  56. that = new (klass({meta: true})).fn;
  57. that.klass.instanceClass = that;
  58. that.className = spec.className;
  59. that.klass.className = that.className + ' class';
  60. }
  61. that.fn = spec.fn || function(){};
  62. that.superclass = spec.superclass;
  63. that.iVarNames = spec.iVarNames || [];
  64. if(that.superclass) {
  65. that.klass.superclass = that.superclass.klass;
  66. }
  67. that.category = spec.category || "";
  68. that.fn.prototype.methods = {};
  69. that.fn.prototype.klass = that;
  70. return that;
  71. };
  72. /* Smalltalk method object. To add a method to a class,
  73. use smalltalk.addMethod() */
  74. st.method = function(spec) {
  75. var that = new SmalltalkMethod();
  76. that.selector = spec.selector;
  77. that.category = spec.category;
  78. that.source = spec.source;
  79. that.messageSends = spec.messageSends || [];
  80. that.referencedClasses = spec.referencedClasses || [];
  81. that.fn = spec.fn;
  82. return that
  83. };
  84. /* Initialize a class in its class hierarchy. Handle both class and
  85. metaclasses. */
  86. st.init = function(klass) {
  87. var subclasses = st.subclasses(klass);
  88. for(var i=0;i<klass.iVarNames.length;i++) {
  89. klass.fn.prototype["@"+klass.iVarNames[i]] = nil;
  90. }
  91. if(klass.superclass && klass.superclass !== nil) {
  92. klass.fn.prototype.__proto__ = klass.superclass.fn.prototype;
  93. for(var i=0;i<klass.superclass.iVarNames.length;i++) {
  94. if(!klass["@"+klass.superclass.iVarNames[i]]) {
  95. klass.fn.prototype["@"+klass.superclass.iVarNames[i]] = nil;
  96. }
  97. }
  98. }
  99. for(var i=0;i<subclasses.length;i++) {
  100. st.init(subclasses[i]);
  101. }
  102. if(klass.klass && !klass.meta) {
  103. st.init(klass.klass);
  104. }
  105. };
  106. /* Answer all registered Smalltalk classes */
  107. st.classes = function() {
  108. var classes = [];
  109. for(var i in st) {
  110. if(i.search(/^[A-Z]/g) != -1) {
  111. classes.push(st[i]);
  112. }
  113. }
  114. return classes
  115. };
  116. /* Answer the direct subclasses of a given class.
  117. This is computed dynamically */
  118. st.subclasses = function(klass) {
  119. var subclasses = [];
  120. var classes = st.classes();
  121. for(var i in classes) {
  122. if(classes[i].fn) {
  123. //Metaclasses
  124. if(classes[i].klass && classes[i].klass.superclass === klass) {
  125. subclasses.push(classes[i].klass);
  126. }
  127. //Classes
  128. if(classes[i].superclass === klass) {
  129. subclasses.push(classes[i]);
  130. }
  131. }
  132. }
  133. return subclasses;
  134. };
  135. /* Create a new class wrapping a JavaScript constructor, and add it to the
  136. global smalltalk object. */
  137. st.mapClassName = function(className, category, fn, superclass) {
  138. st[className] = klass({
  139. className: className,
  140. category: category,
  141. superclass: superclass,
  142. fn: fn
  143. });
  144. };
  145. /* Add a class to the smalltalk object, creating a new one if needed. */
  146. st.addClass = function(className, superclass, iVarNames, category) {
  147. if(st[className]) {
  148. st[className].superclass = superclass;
  149. st[className].iVarNames = iVarNames;
  150. st[className].category = category || st[className].category;
  151. } else {
  152. st[className] = klass({
  153. className: className,
  154. iVarNames: iVarNames,
  155. superclass: superclass
  156. });
  157. st[className].category = category || '';
  158. }
  159. };
  160. /* Add a method to a class */
  161. st.addMethod = function(jsSelector, method, klass) {
  162. klass.fn.prototype[jsSelector] = method.fn;
  163. klass.fn.prototype.methods[method.selector] = method;
  164. method.methodClass = klass;
  165. };
  166. /* Handles Smalltalk message send. Automatically converts undefined to the nil object.
  167. If the receiver does not understand the selector, call its #doesNotUnderstand: method */
  168. st.send = function(receiver, selector, args, klass) {
  169. if(typeof receiver === "undefined") {
  170. receiver = nil;
  171. }
  172. var klass = klass || receiver.klass;
  173. var method = klass.fn.prototype[selector];
  174. if(!method) {
  175. return messageNotUnderstood(receiver, selector, args);
  176. }
  177. return method.apply(receiver, args);
  178. };
  179. /* handle #dnu:.
  180. Assume that the receiver understands #doesNotUnderstand: */
  181. messageNotUnderstood = function(receiver, selector, args) {
  182. return receiver._doesNotUnderstand_(
  183. st.Message._new()
  184. ._selector_(convertSelector(selector))
  185. ._arguments_(args)
  186. );
  187. };
  188. /* Convert a string to a valid smalltalk selector.
  189. if you modify the following functions, also change String>>asSelector
  190. accordingly */
  191. convertSelector = function(selector) {
  192. if(selector.match(/__/)) {
  193. return convertBinarySelector(selector);
  194. } else {
  195. return convertKeywordSelector(selector);
  196. }
  197. };
  198. convertKeywordSelector = function(selector) {
  199. return selector.replace(/^_/, '').replace(/_/g, ':');
  200. };
  201. convertBinarySelector = function(selector) {
  202. return selector
  203. .replace(/^_/, '')
  204. .replace(/_plus/, '+')
  205. .replace(/_minus/, '-')
  206. .replace(/_star/, '*')
  207. .replace(/_slash/, '/')
  208. .replace(/_gt/, '>')
  209. .replace(/_lt/, '<')
  210. .replace(/_eq/, '=')
  211. .replace(/_comma/, ',')
  212. .replace(/_at/, '@')
  213. };
  214. /* Converts a JavaScript object to valid Smalltalk Object */
  215. st.readJSObject = function(js) {
  216. var object = js;
  217. var readObject = (js.constructor === Object);
  218. var readArray = (js.constructor === Array);
  219. if(readObject) {
  220. object = smalltalk.Dictionary._new();
  221. }
  222. for(var i in js) {
  223. if(readObject) {
  224. object._at_put_(i, st.readJSObject(js[i]));
  225. }
  226. if(readArray) {
  227. object[i] = st.readJSObject(js[i]);
  228. }
  229. }
  230. return object;
  231. };
  232. }
  233. function SmalltalkMethodContext() {
  234. this.stack = [];
  235. this.push = function(context) {
  236. stack.push(context);
  237. };
  238. this.pop = function() {
  239. stack.pop();
  240. };
  241. }
  242. /* Global Smalltalk objects. nil and thisContext shouldn't be globals. */
  243. var nil = new SmalltalkNil();
  244. var smalltalk = new Smalltalk();
  245. var thisContext = nil;
  246. /****************************************************************************************/
  247. /* Base classes mapping. If you edit this part, do not forget to set the superclass of the
  248. object metaclass to Class after the definition of Object */
  249. smalltalk.mapClassName("Object", "Kernel", SmalltalkObject);
  250. smalltalk.mapClassName("Smalltalk", "Kernel", Smalltalk, smalltalk.Object);
  251. smalltalk.mapClassName("Behavior", "Kernel", SmalltalkBehavior, smalltalk.Object);
  252. smalltalk.mapClassName("Class", "Kernel", SmalltalkClass, smalltalk.Behavior);
  253. smalltalk.mapClassName("Metaclass", "Kernel", SmalltalkMetaclass, smalltalk.Behavior);
  254. smalltalk.mapClassName("CompiledMethod", "Kernel", SmalltalkMethod, smalltalk.Object);
  255. smalltalk.Object.klass.superclass = smalltalk.Class
  256. smalltalk.mapClassName("Number", "Kernel", Number, smalltalk.Object);
  257. smalltalk.mapClassName("BlockClosure", "Kernel", Function, smalltalk.Object);
  258. smalltalk.mapClassName("Boolean", "Kernel", Boolean, smalltalk.Object);
  259. smalltalk.mapClassName("Date", "Kernel", Date, smalltalk.Object);
  260. smalltalk.mapClassName("UndefinedObject", "Kernel", SmalltalkNil, smalltalk.Object);
  261. smalltalk.mapClassName("Collection", "Kernel", null, smalltalk.Object);
  262. smalltalk.mapClassName("SequenceableCollection", "Kernel", null, smalltalk.Collection);
  263. smalltalk.mapClassName("String", "Kernel", String, smalltalk.SequenceableCollection);
  264. smalltalk.mapClassName("Array", "Kernel", Array, smalltalk.SequenceableCollection);
  265. smalltalk.mapClassName("RegularExpression", "Kernel", RegExp, smalltalk.String);
  266. smalltalk.mapClassName("Error", "Kernel", Error, smalltalk.Object);
  267. //if(CanvasRenderingContext2D) {
  268. // smalltalk.mapClassName("CanvasRenderingContext", "Canvas", CanvasRenderingContext2D, smalltalk.Object);
  269. //}
  270. smalltalk.addClass('Object', smalltalk.nil, [], 'Kernel');
  271. smalltalk.addMethod(
  272. '__eq',
  273. smalltalk.method({
  274. selector: '=',
  275. category: 'comparing',
  276. fn: function (anObject){
  277. var self=this;
  278. return self == anObject;
  279. return self;},
  280. source: unescape('%3D%20anObject%0A%09%7B%27return%20self%20%3D%3D%20anObject%27%7D%0A'),
  281. messageSends: [],
  282. referencedClasses: []
  283. }),
  284. smalltalk.Object);
  285. smalltalk.addMethod(
  286. '_~_eq',
  287. smalltalk.method({
  288. selector: '~=',
  289. category: 'comparing',
  290. fn: function (anObject){
  291. var self=this;
  292. return smalltalk.send(smalltalk.send(self, "__eq", [anObject]), "__eq_eq", [false]);
  293. return self;},
  294. source: unescape('%7E%3D%20anObject%0A%09%5E%28self%20%3D%20anObject%29%20%3D%3D%20false%0A'),
  295. messageSends: [unescape("%3D%3D"), unescape("%3D")],
  296. referencedClasses: []
  297. }),
  298. smalltalk.Object);
  299. smalltalk.addMethod(
  300. '_initialize',
  301. smalltalk.method({
  302. selector: 'initialize',
  303. category: 'initialization',
  304. fn: function (){
  305. var self=this;
  306. return self;},
  307. source: unescape('initialize%0A'),
  308. messageSends: [],
  309. referencedClasses: []
  310. }),
  311. smalltalk.Object);
  312. smalltalk.addMethod(
  313. '_yourself',
  314. smalltalk.method({
  315. selector: 'yourself',
  316. category: 'accessing',
  317. fn: function (){
  318. var self=this;
  319. return self;
  320. return self;},
  321. source: unescape('yourself%0A%09%5Eself%0A'),
  322. messageSends: [],
  323. referencedClasses: []
  324. }),
  325. smalltalk.Object);
  326. smalltalk.addMethod(
  327. '_class',
  328. smalltalk.method({
  329. selector: 'class',
  330. category: 'accessing',
  331. fn: function (){
  332. var self=this;
  333. return self.klass;
  334. return self;},
  335. source: unescape('class%0A%09%7B%27return%20self.klass%27%7D%0A'),
  336. messageSends: [],
  337. referencedClasses: []
  338. }),
  339. smalltalk.Object);
  340. smalltalk.addMethod(
  341. '_size',
  342. smalltalk.method({
  343. selector: 'size',
  344. category: 'accessing',
  345. fn: function (){
  346. var self=this;
  347. smalltalk.send(self, "_error_", ["Object not indexable"]);
  348. return self;},
  349. source: unescape('size%0A%09self%20error%3A%20%27Object%20not%20indexable%27%0A'),
  350. messageSends: ["error:"],
  351. referencedClasses: []
  352. }),
  353. smalltalk.Object);
  354. smalltalk.addMethod(
  355. '_copy',
  356. smalltalk.method({
  357. selector: 'copy',
  358. category: 'copying',
  359. fn: function (){
  360. var self=this;
  361. return smalltalk.send(smalltalk.send(self, "_shallowCopy", []), "_postCopy", []);
  362. return self;},
  363. source: unescape('copy%0A%09%5Eself%20shallowCopy%20postCopy%0A'),
  364. messageSends: ["postCopy", "shallowCopy"],
  365. referencedClasses: []
  366. }),
  367. smalltalk.Object);
  368. smalltalk.addMethod(
  369. '_shallowCopy',
  370. smalltalk.method({
  371. selector: 'shallowCopy',
  372. category: 'copying',
  373. fn: function (){
  374. var self=this;
  375. var copy = self.klass._new();
  376. for(var i in self) {
  377. if(/^@.+/.test(i)) {
  378. copy[i] = self[i];
  379. }
  380. }
  381. return copy;
  382. ;
  383. return self;},
  384. source: unescape('shallowCopy%0A%09%7B%27%0A%09%20%20%20%20var%20copy%20%3D%20self.klass._new%28%29%3B%0A%09%20%20%20%20for%28var%20i%20in%20self%29%20%7B%0A%09%09if%28/%5E@.+/.test%28i%29%29%20%7B%0A%09%09%20%20%20%20copy%5Bi%5D%20%3D%20self%5Bi%5D%3B%0A%09%09%7D%0A%09%20%20%20%20%7D%0A%09%20%20%20%20return%20copy%3B%0A%09%27%7D%0A'),
  385. messageSends: [],
  386. referencedClasses: []
  387. }),
  388. smalltalk.Object);
  389. smalltalk.addMethod(
  390. '_deepCopy',
  391. smalltalk.method({
  392. selector: 'deepCopy',
  393. category: 'copying',
  394. fn: function (){
  395. var self=this;
  396. var copy = self.klass._new();
  397. for(var i in self) {
  398. if(/^@.+/.test(i)) {
  399. copy[i] = self[i]._deepCopy();
  400. }
  401. }
  402. return copy;
  403. ;
  404. return self;},
  405. source: unescape('deepCopy%0A%09%7B%27%09%20%20%20%20%0A%09%20%20%20%20var%20copy%20%3D%20self.klass._new%28%29%3B%0A%09%20%20%20%20for%28var%20i%20in%20self%29%20%7B%0A%09%09if%28/%5E@.+/.test%28i%29%29%20%7B%0A%09%09%20%20%20%20copy%5Bi%5D%20%3D%20self%5Bi%5D._deepCopy%28%29%3B%0A%09%09%7D%0A%09%20%20%20%20%7D%0A%09%20%20%20%20return%20copy%3B%0A%09%27%7D.%0A'),
  406. messageSends: [],
  407. referencedClasses: []
  408. }),
  409. smalltalk.Object);
  410. smalltalk.addMethod(
  411. '_postCopy',
  412. smalltalk.method({
  413. selector: 'postCopy',
  414. category: 'copying',
  415. fn: function (){
  416. var self=this;
  417. return self;},
  418. source: unescape('postCopy%0A'),
  419. messageSends: [],
  420. referencedClasses: []
  421. }),
  422. smalltalk.Object);
  423. smalltalk.addMethod(
  424. '__minus_gt',
  425. smalltalk.method({
  426. selector: '->',
  427. category: 'converting',
  428. fn: function (anObject){
  429. var self=this;
  430. return smalltalk.send(smalltalk.Association, "_key_value_", [self, anObject]);
  431. return self;},
  432. source: unescape('-%3E%20anObject%0A%09%5EAssociation%20key%3A%20self%20value%3A%20anObject%0A'),
  433. messageSends: ["key:value:"],
  434. referencedClasses: [smalltalk.Association]
  435. }),
  436. smalltalk.Object);
  437. smalltalk.addMethod(
  438. '_asString',
  439. smalltalk.method({
  440. selector: 'asString',
  441. category: 'converting',
  442. fn: function (){
  443. var self=this;
  444. return smalltalk.send(self, "_printString", []);
  445. return self;},
  446. source: unescape('asString%0A%09%5Eself%20printString%0A'),
  447. messageSends: ["printString"],
  448. referencedClasses: []
  449. }),
  450. smalltalk.Object);
  451. smalltalk.addMethod(
  452. '_asJavascript',
  453. smalltalk.method({
  454. selector: 'asJavascript',
  455. category: 'converting',
  456. fn: function (){
  457. var self=this;
  458. return smalltalk.send(self, "_asString", []);
  459. return self;},
  460. source: unescape('asJavascript%0A%09%5Eself%20asString%0A'),
  461. messageSends: ["asString"],
  462. referencedClasses: []
  463. }),
  464. smalltalk.Object);
  465. smalltalk.addMethod(
  466. '_perform_',
  467. smalltalk.method({
  468. selector: 'perform:',
  469. category: 'message handling',
  470. fn: function (aSymbol){
  471. var self=this;
  472. return smalltalk.send(self, "_perform_withArguments_", [aSymbol, []]);
  473. return self;},
  474. source: unescape('perform%3A%20aSymbol%0A%09%5Eself%20perform%3A%20aSymbol%20withArguments%3A%20%23%28%29%0A'),
  475. messageSends: ["perform:withArguments:"],
  476. referencedClasses: []
  477. }),
  478. smalltalk.Object);
  479. smalltalk.addMethod(
  480. '_perform_withArguments_',
  481. smalltalk.method({
  482. selector: 'perform:withArguments:',
  483. category: 'message handling',
  484. fn: function (aSymbol, aCollection){
  485. var self=this;
  486. return smalltalk.send(self, "_basicPerform_withArguments_", [smalltalk.send(aSymbol, "_asSelector", []), aCollection]);
  487. return self;},
  488. source: unescape('perform%3A%20aSymbol%20withArguments%3A%20aCollection%0A%09%5Eself%20basicPerform%3A%20aSymbol%20asSelector%20withArguments%3A%20aCollection%0A'),
  489. messageSends: ["basicPerform:withArguments:", "asSelector"],
  490. referencedClasses: []
  491. }),
  492. smalltalk.Object);
  493. smalltalk.addMethod(
  494. '_instVarAt_',
  495. smalltalk.method({
  496. selector: 'instVarAt:',
  497. category: 'accessing',
  498. fn: function (aString){
  499. var self=this;
  500. var value = self['@'+aString];
  501. if(typeof(value) == 'undefined') {
  502. return nil;
  503. } else {
  504. return value;
  505. }
  506. ;
  507. return self;},
  508. source: unescape('instVarAt%3A%20aString%0A%09%7B%27%0A%09%20%20%20%20var%20value%20%3D%20self%5B%27%27@%27%27+aString%5D%3B%0A%09%20%20%20%20if%28typeof%28value%29%20%3D%3D%20%27%27undefined%27%27%29%20%7B%0A%09%09return%20nil%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20value%3B%0A%09%20%20%20%20%7D%0A%09%27%7D%0A'),
  509. messageSends: [],
  510. referencedClasses: []
  511. }),
  512. smalltalk.Object);
  513. smalltalk.addMethod(
  514. '_instVarAt_put_',
  515. smalltalk.method({
  516. selector: 'instVarAt:put:',
  517. category: 'accessing',
  518. fn: function (aString, anObject){
  519. var self=this;
  520. self['@' + aString] = anObject;
  521. return self;},
  522. source: unescape('instVarAt%3A%20aString%20put%3A%20anObject%0A%09%7B%27self%5B%27%27@%27%27%20+%20aString%5D%20%3D%20anObject%27%7D%0A'),
  523. messageSends: [],
  524. referencedClasses: []
  525. }),
  526. smalltalk.Object);
  527. smalltalk.addMethod(
  528. '_basicAt_',
  529. smalltalk.method({
  530. selector: 'basicAt:',
  531. category: 'accessing',
  532. fn: function (aString){
  533. var self=this;
  534. var value = self[aString];
  535. if(typeof(value) == 'undefined') {
  536. return nil;
  537. } else {
  538. return value;
  539. }
  540. ;
  541. return self;},
  542. source: unescape('basicAt%3A%20aString%0A%09%7B%27%0A%09%20%20%20%20var%20value%20%3D%20self%5BaString%5D%3B%0A%09%20%20%20%20if%28typeof%28value%29%20%3D%3D%20%27%27undefined%27%27%29%20%7B%0A%09%09return%20nil%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20value%3B%0A%09%20%20%20%20%7D%0A%09%27%7D%0A'),
  543. messageSends: [],
  544. referencedClasses: []
  545. }),
  546. smalltalk.Object);
  547. smalltalk.addMethod(
  548. '_basicAt_put_',
  549. smalltalk.method({
  550. selector: 'basicAt:put:',
  551. category: 'accessing',
  552. fn: function (aString, anObject){
  553. var self=this;
  554. return self[aString] = anObject;
  555. return self;},
  556. source: unescape('basicAt%3A%20aString%20put%3A%20anObject%0A%09%7B%27return%20self%5BaString%5D%20%3D%20anObject%27%7D%0A'),
  557. messageSends: [],
  558. referencedClasses: []
  559. }),
  560. smalltalk.Object);
  561. smalltalk.addMethod(
  562. '_error_',
  563. smalltalk.method({
  564. selector: 'error:',
  565. category: 'error handling',
  566. fn: function (aString){
  567. var self=this;
  568. smalltalk.send(smalltalk.Error, "_signal_", [aString]);
  569. return self;},
  570. source: unescape('error%3A%20aString%0A%09Error%20signal%3A%20aString%0A'),
  571. messageSends: ["signal:"],
  572. referencedClasses: [smalltalk.Error]
  573. }),
  574. smalltalk.Object);
  575. smalltalk.addMethod(
  576. '_subclassResponsibility',
  577. smalltalk.method({
  578. selector: 'subclassResponsibility',
  579. category: 'error handling',
  580. fn: function (){
  581. var self=this;
  582. smalltalk.send(self, "_error_", ["This method is a responsibility of a subclass"]);
  583. return self;},
  584. source: unescape('subclassResponsibility%0A%09self%20error%3A%20%27This%20method%20is%20a%20responsibility%20of%20a%20subclass%27%0A'),
  585. messageSends: ["error:"],
  586. referencedClasses: []
  587. }),
  588. smalltalk.Object);
  589. smalltalk.addMethod(
  590. '_shouldNotImplement',
  591. smalltalk.method({
  592. selector: 'shouldNotImplement',
  593. category: 'error handling',
  594. fn: function (){
  595. var self=this;
  596. smalltalk.send(self, "_error_", [smalltalk.send("This method should not be implemented in ", "__comma", [smalltalk.send(smalltalk.send(self, "_class", []), "_name", [])])]);
  597. return self;},
  598. source: unescape('shouldNotImplement%0A%09self%20error%3A%20%27This%20method%20should%20not%20be%20implemented%20in%20%27%2C%20self%20class%20name%0A'),
  599. messageSends: ["error:", unescape("%2C"), "name", "class"],
  600. referencedClasses: []
  601. }),
  602. smalltalk.Object);
  603. smalltalk.addMethod(
  604. '_try_catch_',
  605. smalltalk.method({
  606. selector: 'try:catch:',
  607. category: 'error handling',
  608. fn: function (aBlock, anotherBlock){
  609. var self=this;
  610. try{aBlock()} catch(e) {anotherBlock(e)};
  611. return self;},
  612. source: unescape('try%3A%20aBlock%20catch%3A%20anotherBlock%0A%09%7B%27try%7BaBlock%28%29%7D%20catch%28e%29%20%7BanotherBlock%28e%29%7D%27%7D%0A'),
  613. messageSends: [],
  614. referencedClasses: []
  615. }),
  616. smalltalk.Object);
  617. smalltalk.addMethod(
  618. '_printString',
  619. smalltalk.method({
  620. selector: 'printString',
  621. category: 'printing',
  622. fn: function (){
  623. var self=this;
  624. return smalltalk.send("a ", "__comma", [smalltalk.send(smalltalk.send(self, "_class", []), "_name", [])]);
  625. return self;},
  626. source: unescape('printString%0A%09%5E%27a%20%27%2C%20self%20class%20name%0A'),
  627. messageSends: [unescape("%2C"), "name", "class"],
  628. referencedClasses: []
  629. }),
  630. smalltalk.Object);
  631. smalltalk.addMethod(
  632. '_printNl',
  633. smalltalk.method({
  634. selector: 'printNl',
  635. category: 'printing',
  636. fn: function (){
  637. var self=this;
  638. console.log(self);
  639. return self;},
  640. source: unescape('printNl%0A%09%7B%27console.log%28self%29%27%7D%0A'),
  641. messageSends: [],
  642. referencedClasses: []
  643. }),
  644. smalltalk.Object);
  645. smalltalk.addMethod(
  646. '_isKindOf_',
  647. smalltalk.method({
  648. selector: 'isKindOf:',
  649. category: 'testing',
  650. fn: function (aClass){
  651. var self=this;
  652. return smalltalk.send(smalltalk.send(self, "_isMemberOf_", [aClass]), "_ifTrue_ifFalse_", [(function(){return true;}), (function(){return smalltalk.send(smalltalk.send(self, "_class", []), "_inheritsFrom_", [aClass]);})]);
  653. return self;},
  654. source: unescape('isKindOf%3A%20aClass%0A%09%5E%28self%20isMemberOf%3A%20aClass%29%0A%09%20%20%20%20ifTrue%3A%20%5Btrue%5D%0A%09%20%20%20%20ifFalse%3A%20%5Bself%20class%20inheritsFrom%3A%20aClass%5D%0A'),
  655. messageSends: ["ifTrue:ifFalse:", "isMemberOf:", "inheritsFrom:", "class"],
  656. referencedClasses: []
  657. }),
  658. smalltalk.Object);
  659. smalltalk.addMethod(
  660. '_isMemberOf_',
  661. smalltalk.method({
  662. selector: 'isMemberOf:',
  663. category: 'testing',
  664. fn: function (aClass){
  665. var self=this;
  666. return smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [aClass]);
  667. return self;},
  668. source: unescape('isMemberOf%3A%20aClass%0A%09%5Eself%20class%20%3D%20aClass%0A'),
  669. messageSends: [unescape("%3D"), "class"],
  670. referencedClasses: []
  671. }),
  672. smalltalk.Object);
  673. smalltalk.addMethod(
  674. '_ifNil_',
  675. smalltalk.method({
  676. selector: 'ifNil:',
  677. category: 'testing',
  678. fn: function (aBlock){
  679. var self=this;
  680. return self;
  681. return self;},
  682. source: unescape('ifNil%3A%20aBlock%0A%09%5Eself%0A'),
  683. messageSends: [],
  684. referencedClasses: []
  685. }),
  686. smalltalk.Object);
  687. smalltalk.addMethod(
  688. '_ifNil_ifNotNil_',
  689. smalltalk.method({
  690. selector: 'ifNil:ifNotNil:',
  691. category: 'testing',
  692. fn: function (aBlock, anotherBlock){
  693. var self=this;
  694. return smalltalk.send(anotherBlock, "_value", []);
  695. return self;},
  696. source: unescape('ifNil%3A%20aBlock%20ifNotNil%3A%20anotherBlock%0A%09%5EanotherBlock%20value%0A'),
  697. messageSends: ["value"],
  698. referencedClasses: []
  699. }),
  700. smalltalk.Object);
  701. smalltalk.addMethod(
  702. '_ifNotNil_',
  703. smalltalk.method({
  704. selector: 'ifNotNil:',
  705. category: 'testing',
  706. fn: function (aBlock){
  707. var self=this;
  708. return smalltalk.send(aBlock, "_value", []);
  709. return self;},
  710. source: unescape('ifNotNil%3A%20aBlock%0A%09%5EaBlock%20value%0A'),
  711. messageSends: ["value"],
  712. referencedClasses: []
  713. }),
  714. smalltalk.Object);
  715. smalltalk.addMethod(
  716. '_ifNotNil_ifNil_',
  717. smalltalk.method({
  718. selector: 'ifNotNil:ifNil:',
  719. category: 'testing',
  720. fn: function (aBlock, anotherBlock){
  721. var self=this;
  722. return smalltalk.send(aBlock, "_value", []);
  723. return self;},
  724. source: unescape('ifNotNil%3A%20aBlock%20ifNil%3A%20anotherBlock%0A%09%5EaBlock%20value%0A'),
  725. messageSends: ["value"],
  726. referencedClasses: []
  727. }),
  728. smalltalk.Object);
  729. smalltalk.addMethod(
  730. '_isNil',
  731. smalltalk.method({
  732. selector: 'isNil',
  733. category: 'testing',
  734. fn: function (){
  735. var self=this;
  736. return false;
  737. return self;},
  738. source: unescape('isNil%0A%09%5Efalse%0A'),
  739. messageSends: [],
  740. referencedClasses: []
  741. }),
  742. smalltalk.Object);
  743. smalltalk.addMethod(
  744. '_notNil',
  745. smalltalk.method({
  746. selector: 'notNil',
  747. category: 'testing',
  748. fn: function (){
  749. var self=this;
  750. return smalltalk.send(smalltalk.send(self, "_isNil", []), "_not", []);
  751. return self;},
  752. source: unescape('notNil%0A%09%5Eself%20isNil%20not%0A'),
  753. messageSends: ["not", "isNil"],
  754. referencedClasses: []
  755. }),
  756. smalltalk.Object);
  757. smalltalk.addMethod(
  758. '_isClass',
  759. smalltalk.method({
  760. selector: 'isClass',
  761. category: 'testing',
  762. fn: function (){
  763. var self=this;
  764. return false;
  765. return self;},
  766. source: unescape('isClass%0A%09%5Efalse%0A'),
  767. messageSends: [],
  768. referencedClasses: []
  769. }),
  770. smalltalk.Object);
  771. smalltalk.addMethod(
  772. '_isMetaclass',
  773. smalltalk.method({
  774. selector: 'isMetaclass',
  775. category: 'testing',
  776. fn: function (){
  777. var self=this;
  778. return false;
  779. return self;},
  780. source: unescape('isMetaclass%0A%09%5Efalse%0A'),
  781. messageSends: [],
  782. referencedClasses: []
  783. }),
  784. smalltalk.Object);
  785. smalltalk.addMethod(
  786. '_isNumber',
  787. smalltalk.method({
  788. selector: 'isNumber',
  789. category: 'testing',
  790. fn: function (){
  791. var self=this;
  792. return false;
  793. return self;},
  794. source: unescape('isNumber%0A%09%5Efalse%0A'),
  795. messageSends: [],
  796. referencedClasses: []
  797. }),
  798. smalltalk.Object);
  799. smalltalk.addMethod(
  800. '_isString',
  801. smalltalk.method({
  802. selector: 'isString',
  803. category: 'testing',
  804. fn: function (){
  805. var self=this;
  806. return false;
  807. return self;},
  808. source: unescape('isString%0A%09%5Efalse%0A'),
  809. messageSends: [],
  810. referencedClasses: []
  811. }),
  812. smalltalk.Object);
  813. smalltalk.addMethod(
  814. '_isParseFailure',
  815. smalltalk.method({
  816. selector: 'isParseFailure',
  817. category: 'testing',
  818. fn: function (){
  819. var self=this;
  820. return false;
  821. return self;},
  822. source: unescape('isParseFailure%0A%09%5Efalse%0A'),
  823. messageSends: [],
  824. referencedClasses: []
  825. }),
  826. smalltalk.Object);
  827. smalltalk.addMethod(
  828. '_basicPerform_',
  829. smalltalk.method({
  830. selector: 'basicPerform:',
  831. category: 'message handling',
  832. fn: function (aSymbol){
  833. var self=this;
  834. return smalltalk.send(self, "_basicPerform_withArguments_", [aSymbol, []]);
  835. return self;},
  836. source: unescape('basicPerform%3A%20aSymbol%20%0A%20%20%20%20%5Eself%20basicPerform%3A%20aSymbol%20withArguments%3A%20%23%28%29%0A'),
  837. messageSends: ["basicPerform:withArguments:"],
  838. referencedClasses: []
  839. }),
  840. smalltalk.Object);
  841. smalltalk.addMethod(
  842. '_basicPerform_withArguments_',
  843. smalltalk.method({
  844. selector: 'basicPerform:withArguments:',
  845. category: 'message handling',
  846. fn: function (aSymbol, aCollection){
  847. var self=this;
  848. return self[aSymbol].apply(self, aCollection);;
  849. return self;},
  850. source: unescape('basicPerform%3A%20aSymbol%20withArguments%3A%20aCollection%0A%09%7B%27return%20self%5BaSymbol%5D.apply%28self%2C%20aCollection%29%3B%27%7D%0A'),
  851. messageSends: [],
  852. referencedClasses: []
  853. }),
  854. smalltalk.Object);
  855. smalltalk.addMethod(
  856. '_basicDelete_',
  857. smalltalk.method({
  858. selector: 'basicDelete:',
  859. category: 'accessing',
  860. fn: function (aString){
  861. var self=this;
  862. delete self[aString];
  863. return self;},
  864. source: unescape('basicDelete%3A%20aString%0A%20%20%20%20%7B%27delete%20self%5BaString%5D%27%7D%0A'),
  865. messageSends: [],
  866. referencedClasses: []
  867. }),
  868. smalltalk.Object);
  869. smalltalk.addMethod(
  870. '_doesNotUnderstand_',
  871. smalltalk.method({
  872. selector: 'doesNotUnderstand:',
  873. category: 'error handling',
  874. fn: function (aMessage){
  875. var self=this;
  876. (function($rec){smalltalk.send($rec, "_receiver_", [self]);smalltalk.send($rec, "_message_", [aMessage]);return smalltalk.send($rec, "_signal", []);})(smalltalk.send(smalltalk.MessageNotUnderstood, "_new", []));
  877. return self;},
  878. source: unescape('doesNotUnderstand%3A%20aMessage%0A%09MessageNotUnderstood%20new%0A%09%09receiver%3A%20self%3B%0A%09%09message%3A%20aMessage%3B%0A%09%09signal'),
  879. messageSends: ["receiver:", "message:", "signal", "new"],
  880. referencedClasses: [smalltalk.MessageNotUnderstood]
  881. }),
  882. smalltalk.Object);
  883. smalltalk.addMethod(
  884. '_asJSON',
  885. smalltalk.method({
  886. selector: 'asJSON',
  887. category: 'converting',
  888. fn: function (){
  889. var self=this;
  890. return JSON.stringify(self._asJSONObject());
  891. return self;},
  892. source: unescape('asJSON%0A%09%7B%27return%20JSON.stringify%28self._asJSONObject%28%29%29%27%7D'),
  893. messageSends: [],
  894. referencedClasses: []
  895. }),
  896. smalltalk.Object);
  897. smalltalk.addMethod(
  898. '_asJSONObject',
  899. smalltalk.method({
  900. selector: 'asJSONObject',
  901. category: 'converting',
  902. fn: function (){
  903. var self=this;
  904. var object=nil;
  905. object=smalltalk.send(smalltalk.Object, "_new", []);
  906. 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", [])]);})]);
  907. return object;
  908. return self;},
  909. source: unescape('asJSONObject%0A%09%7C%20object%20%7C%0A%09object%20%3A%3D%20Object%20new.%0A%09self%20class%20instanceVariableNames%20do%3A%20%5B%3Aeach%20%7C%0A%09%09object%20basicAt%3A%20each%20put%3A%20%28self%20instVarAt%3A%20each%29%20asJSONObject%5D.%0A%09%5Eobject'),
  910. messageSends: ["new", "do:", "instanceVariableNames", "class", "basicAt:put:", "asJSONObject", "instVarAt:"],
  911. referencedClasses: [smalltalk.Object]
  912. }),
  913. smalltalk.Object);
  914. smalltalk.addMethod(
  915. '_initialize',
  916. smalltalk.method({
  917. selector: 'initialize',
  918. category: 'initialization',
  919. fn: function (){
  920. var self=this;
  921. return self;},
  922. source: unescape('initialize%0A%09%22no%20op%22'),
  923. messageSends: [],
  924. referencedClasses: []
  925. }),
  926. smalltalk.Object.klass);
  927. smalltalk.addClass('Smalltalk', smalltalk.Object, [], 'Kernel');
  928. smalltalk.addMethod(
  929. '_classes',
  930. smalltalk.method({
  931. selector: 'classes',
  932. category: 'accessing',
  933. fn: function (){
  934. var self=this;
  935. return self.classes();
  936. return self;},
  937. source: unescape('classes%0A%09%7B%27return%20self.classes%28%29%27%7D'),
  938. messageSends: [],
  939. referencedClasses: []
  940. }),
  941. smalltalk.Smalltalk);
  942. smalltalk.addMethod(
  943. '_debugMode',
  944. smalltalk.method({
  945. selector: 'debugMode',
  946. category: 'accessing',
  947. fn: function (){
  948. var self=this;
  949. return self.debugMode;
  950. return self;},
  951. source: unescape('debugMode%0A%09%7B%27return%20self.debugMode%27%7D'),
  952. messageSends: [],
  953. referencedClasses: []
  954. }),
  955. smalltalk.Smalltalk);
  956. smalltalk.addMethod(
  957. '_debugMode_',
  958. smalltalk.method({
  959. selector: 'debugMode:',
  960. category: 'accessing',
  961. fn: function (aBoolean){
  962. var self=this;
  963. self.debugMode = aBoolean;
  964. return self;},
  965. source: unescape('debugMode%3A%20aBoolean%0A%09%7B%27self.debugMode%20%3D%20aBoolean%27%7D'),
  966. messageSends: [],
  967. referencedClasses: []
  968. }),
  969. smalltalk.Smalltalk);
  970. smalltalk.addMethod(
  971. '_readJSON_',
  972. smalltalk.method({
  973. selector: 'readJSON:',
  974. category: 'accessing',
  975. fn: function (anObject){
  976. var self=this;
  977. return self.readJSObject(anObject);;
  978. return self;},
  979. source: unescape('readJSON%3A%20anObject%0A%09%7B%27return%20self.readJSObject%28anObject%29%3B%27%7D'),
  980. messageSends: [],
  981. referencedClasses: []
  982. }),
  983. smalltalk.Smalltalk);
  984. smalltalk.addMethod(
  985. '_at_',
  986. smalltalk.method({
  987. selector: 'at:',
  988. category: 'accessing',
  989. fn: function (aString){
  990. var self=this;
  991. return self[aString];
  992. return self;},
  993. source: unescape('at%3A%20aString%0A%09%7B%27return%20self%5BaString%5D%27%7D'),
  994. messageSends: [],
  995. referencedClasses: []
  996. }),
  997. smalltalk.Smalltalk);
  998. smalltalk.Smalltalk.klass.iVarNames = ['current'];
  999. smalltalk.addMethod(
  1000. '_current',
  1001. smalltalk.method({
  1002. selector: 'current',
  1003. category: 'accessing',
  1004. fn: function (){
  1005. var self=this;
  1006. return smalltalk;
  1007. return self;},
  1008. source: unescape('current%0A%09%7B%27return%20smalltalk%27%7D%0A'),
  1009. messageSends: [],
  1010. referencedClasses: []
  1011. }),
  1012. smalltalk.Smalltalk.klass);
  1013. smalltalk.addClass('Behavior', smalltalk.Object, [], 'Kernel');
  1014. smalltalk.addMethod(
  1015. '_new',
  1016. smalltalk.method({
  1017. selector: 'new',
  1018. category: 'instance creation',
  1019. fn: function (){
  1020. var self=this;
  1021. return smalltalk.send(smalltalk.send(self, "_basicNew", []), "_initialize", []);
  1022. return self;},
  1023. source: unescape('new%0A%09%5Eself%20basicNew%20initialize'),
  1024. messageSends: ["initialize", "basicNew"],
  1025. referencedClasses: []
  1026. }),
  1027. smalltalk.Behavior);
  1028. smalltalk.addMethod(
  1029. '_basicNew',
  1030. smalltalk.method({
  1031. selector: 'basicNew',
  1032. category: 'instance creation',
  1033. fn: function (){
  1034. var self=this;
  1035. return new self.fn();
  1036. return self;},
  1037. source: unescape('basicNew%0A%09%7B%27return%20new%20self.fn%28%29%27%7D%0A'),
  1038. messageSends: [],
  1039. referencedClasses: []
  1040. }),
  1041. smalltalk.Behavior);
  1042. smalltalk.addMethod(
  1043. '_name',
  1044. smalltalk.method({
  1045. selector: 'name',
  1046. category: 'accessing',
  1047. fn: function (){
  1048. var self=this;
  1049. return self.className || nil;
  1050. return self;},
  1051. source: unescape('name%0A%09%7B%27return%20self.className%20%7C%7C%20nil%27%7D%0A'),
  1052. messageSends: [],
  1053. referencedClasses: []
  1054. }),
  1055. smalltalk.Behavior);
  1056. smalltalk.addMethod(
  1057. '_superclass',
  1058. smalltalk.method({
  1059. selector: 'superclass',
  1060. category: 'accessing',
  1061. fn: function (){
  1062. var self=this;
  1063. return self.superclass || nil;
  1064. return self;},
  1065. source: unescape('superclass%0A%09%7B%27return%20self.superclass%20%7C%7C%20nil%27%7D%0A'),
  1066. messageSends: [],
  1067. referencedClasses: []
  1068. }),
  1069. smalltalk.Behavior);
  1070. smalltalk.addMethod(
  1071. '_subclasses',
  1072. smalltalk.method({
  1073. selector: 'subclasses',
  1074. category: 'accessing',
  1075. fn: function (){
  1076. var self=this;
  1077. return smalltalk.subclasses(self);
  1078. return self;},
  1079. source: unescape('subclasses%0A%09%7B%27return%20smalltalk.subclasses%28self%29%27%7D%0A'),
  1080. messageSends: [],
  1081. referencedClasses: []
  1082. }),
  1083. smalltalk.Behavior);
  1084. smalltalk.addMethod(
  1085. '_allSubclasses',
  1086. smalltalk.method({
  1087. selector: 'allSubclasses',
  1088. category: 'accessing',
  1089. fn: function (){
  1090. var self=this;
  1091. var result=nil;
  1092. result=smalltalk.send(self, "_subclasses", []);
  1093. smalltalk.send(smalltalk.send(self, "_subclasses", []), "_do_", [(function(each){return smalltalk.send(result, "_addAll_", [smalltalk.send(each, "_allSubclasses", [])]);})]);
  1094. return result;
  1095. return self;},
  1096. source: unescape('allSubclasses%0A%09%7C%20result%20%7C%0A%09result%20%3A%3D%20self%20subclasses.%0A%09self%20subclasses%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20result%20addAll%3A%20each%20allSubclasses%5D.%0A%09%5Eresult%0A'),
  1097. messageSends: ["subclasses", "do:", "addAll:", "allSubclasses"],
  1098. referencedClasses: []
  1099. }),
  1100. smalltalk.Behavior);
  1101. smalltalk.addMethod(
  1102. '_withAllSubclasses',
  1103. smalltalk.method({
  1104. selector: 'withAllSubclasses',
  1105. category: 'accessing',
  1106. fn: function (){
  1107. var self=this;
  1108. return (function($rec){smalltalk.send($rec, "_addAll_", [smalltalk.send(self, "_allSubclasses", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.Array, "_with_", [self]));
  1109. return self;},
  1110. source: unescape('withAllSubclasses%0A%09%5E%28Array%20with%3A%20self%29%20addAll%3A%20self%20allSubclasses%3B%20yourself%0A'),
  1111. messageSends: ["addAll:", "allSubclasses", "yourself", "with:"],
  1112. referencedClasses: [smalltalk.Array]
  1113. }),
  1114. smalltalk.Behavior);
  1115. smalltalk.addMethod(
  1116. '_prototype',
  1117. smalltalk.method({
  1118. selector: 'prototype',
  1119. category: 'accessing',
  1120. fn: function (){
  1121. var self=this;
  1122. return self.fn.prototype;
  1123. return self;},
  1124. source: unescape('prototype%0A%09%7B%27return%20self.fn.prototype%27%7D%0A'),
  1125. messageSends: [],
  1126. referencedClasses: []
  1127. }),
  1128. smalltalk.Behavior);
  1129. smalltalk.addMethod(
  1130. '_methodDictionary',
  1131. smalltalk.method({
  1132. selector: 'methodDictionary',
  1133. category: 'accessing',
  1134. fn: function (){
  1135. var self=this;
  1136. var dict = smalltalk.Dictionary._new();
  1137. var methods = self.fn.prototype.methods;
  1138. for(var i in methods) {
  1139. if(methods[i].selector) {
  1140. dict._at_put_(methods[i].selector, methods[i]);
  1141. }
  1142. };
  1143. return dict;
  1144. return self;},
  1145. source: unescape('methodDictionary%0A%09%7B%27var%20dict%20%3D%20smalltalk.Dictionary._new%28%29%3B%0A%09var%20methods%20%3D%20self.fn.prototype.methods%3B%0A%09for%28var%20i%20in%20methods%29%20%7B%0A%09%09if%28methods%5Bi%5D.selector%29%20%7B%0A%09%09%09dict._at_put_%28methods%5Bi%5D.selector%2C%20methods%5Bi%5D%29%3B%0A%09%09%7D%0A%09%7D%3B%0A%09return%20dict%27%7D%0A'),
  1146. messageSends: [],
  1147. referencedClasses: []
  1148. }),
  1149. smalltalk.Behavior);
  1150. smalltalk.addMethod(
  1151. '_methodsFor_',
  1152. smalltalk.method({
  1153. selector: 'methodsFor:',
  1154. category: 'accessing',
  1155. fn: function (aString){
  1156. var self=this;
  1157. return (function($rec){smalltalk.send($rec, "_class_category_", [self, aString]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.ClassCategoryReader, "_new", []));
  1158. return self;},
  1159. source: unescape('methodsFor%3A%20aString%0A%09%5EClassCategoryReader%20new%0A%09%20%20%20%20class%3A%20self%20category%3A%20aString%3B%0A%09%20%20%20%20yourself%0A'),
  1160. messageSends: ["class:category:", "yourself", "new"],
  1161. referencedClasses: [smalltalk.ClassCategoryReader]
  1162. }),
  1163. smalltalk.Behavior);
  1164. smalltalk.addMethod(
  1165. '_addCompiledMethod_',
  1166. smalltalk.method({
  1167. selector: 'addCompiledMethod:',
  1168. category: 'accessing',
  1169. fn: function (aMethod){
  1170. var self=this;
  1171. self.fn.prototype[aMethod.selector._asSelector()] = aMethod.fn;
  1172. self.fn.prototype.methods[aMethod.selector] = aMethod;
  1173. aMethod.methodClass = self;
  1174. return self;},
  1175. source: unescape('addCompiledMethod%3A%20aMethod%0A%09%7B%27self.fn.prototype%5BaMethod.selector._asSelector%28%29%5D%20%3D%20aMethod.fn%3B%0A%09self.fn.prototype.methods%5BaMethod.selector%5D%20%3D%20aMethod%3B%0A%09aMethod.methodClass%20%3D%20self%27%7D%0A'),
  1176. messageSends: [],
  1177. referencedClasses: []
  1178. }),
  1179. smalltalk.Behavior);
  1180. smalltalk.addMethod(
  1181. '_instanceVariableNames',
  1182. smalltalk.method({
  1183. selector: 'instanceVariableNames',
  1184. category: 'accessing',
  1185. fn: function (){
  1186. var self=this;
  1187. return self.iVarNames;
  1188. return self;},
  1189. source: unescape('instanceVariableNames%0A%09%7B%27return%20self.iVarNames%27%7D%0A'),
  1190. messageSends: [],
  1191. referencedClasses: []
  1192. }),
  1193. smalltalk.Behavior);
  1194. smalltalk.addMethod(
  1195. '_comment',
  1196. smalltalk.method({
  1197. selector: 'comment',
  1198. category: 'accessing',
  1199. fn: function (){
  1200. var self=this;
  1201. return smalltalk.send(smalltalk.send(self, "_basicAt_", ["comment"]), "_ifNil_", [(function(){return "";})]);
  1202. return self;},
  1203. source: unescape('comment%0A%20%20%20%20%5E%28self%20basicAt%3A%20%27comment%27%29%20ifNil%3A%20%5B%27%27%5D%0A'),
  1204. messageSends: ["ifNil:", "basicAt:"],
  1205. referencedClasses: []
  1206. }),
  1207. smalltalk.Behavior);
  1208. smalltalk.addMethod(
  1209. '_comment_',
  1210. smalltalk.method({
  1211. selector: 'comment:',
  1212. category: 'accessing',
  1213. fn: function (aString){
  1214. var self=this;
  1215. smalltalk.send(self, "_basicAt_put_", ["comment", aString]);
  1216. return self;},
  1217. source: unescape('comment%3A%20aString%0A%20%20%20%20self%20basicAt%3A%20%27comment%27%20put%3A%20aString%0A'),
  1218. messageSends: ["basicAt:put:"],
  1219. referencedClasses: []
  1220. }),
  1221. smalltalk.Behavior);
  1222. smalltalk.addMethod(
  1223. '_commentStamp',
  1224. smalltalk.method({
  1225. selector: 'commentStamp',
  1226. category: 'accessing',
  1227. fn: function (){
  1228. var self=this;
  1229. return (function($rec){smalltalk.send($rec, "_class_", [self]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.ClassCommentReader, "_new", []));
  1230. return self;},
  1231. source: unescape('commentStamp%0A%20%20%20%20%5EClassCommentReader%20new%0A%09class%3A%20self%3B%0A%09yourself%0A'),
  1232. messageSends: ["class:", "yourself", "new"],
  1233. referencedClasses: [smalltalk.ClassCommentReader]
  1234. }),
  1235. smalltalk.Behavior);
  1236. smalltalk.addMethod(
  1237. '_removeCompiledMethod_',
  1238. smalltalk.method({
  1239. selector: 'removeCompiledMethod:',
  1240. category: 'accessing',
  1241. fn: function (aMethod){
  1242. var self=this;
  1243. delete self.fn.prototype[aMethod.selector._asSelector()];
  1244. delete self.fn.prototype.methods[aMethod.selector];
  1245. return self;},
  1246. source: unescape('removeCompiledMethod%3A%20aMethod%0A%09%7B%27delete%20self.fn.prototype%5BaMethod.selector._asSelector%28%29%5D%3B%0A%09delete%20self.fn.prototype.methods%5BaMethod.selector%5D%27%7D%0A'),
  1247. messageSends: [],
  1248. referencedClasses: []
  1249. }),
  1250. smalltalk.Behavior);
  1251. smalltalk.addMethod(
  1252. '_inheritsFrom_',
  1253. smalltalk.method({
  1254. selector: 'inheritsFrom:',
  1255. category: 'instance creation',
  1256. fn: function (aClass){
  1257. var self=this;
  1258. return smalltalk.send(smalltalk.send(aClass, "_allSubclasses", []), "_includes_", [self]);
  1259. return self;},
  1260. source: unescape('inheritsFrom%3A%20aClass%0A%09%5EaClass%20allSubclasses%20includes%3A%20self'),
  1261. messageSends: ["includes:", "allSubclasses"],
  1262. referencedClasses: []
  1263. }),
  1264. smalltalk.Behavior);
  1265. smalltalk.addClass('Class', smalltalk.Behavior, [], 'Kernel');
  1266. smalltalk.addMethod(
  1267. '_category',
  1268. smalltalk.method({
  1269. selector: 'category',
  1270. category: 'accessing',
  1271. fn: function (){
  1272. var self=this;
  1273. return self.category;
  1274. return self;},
  1275. source: unescape('category%0A%09%7B%27return%20self.category%27%7D'),
  1276. messageSends: [],
  1277. referencedClasses: []
  1278. }),
  1279. smalltalk.Class);
  1280. smalltalk.addMethod(
  1281. '_category_',
  1282. smalltalk.method({
  1283. selector: 'category:',
  1284. category: 'accessing',
  1285. fn: function (aString){
  1286. var self=this;
  1287. self.category = aString;
  1288. return self;},
  1289. source: unescape('category%3A%20aString%0A%09%7B%27self.category%20%3D%20aString%27%7D%0A'),
  1290. messageSends: [],
  1291. referencedClasses: []
  1292. }),
  1293. smalltalk.Class);
  1294. smalltalk.addMethod(
  1295. '_subclass_instanceVariableNames_',
  1296. smalltalk.method({
  1297. selector: 'subclass:instanceVariableNames:',
  1298. category: 'class creation',
  1299. fn: function (aString, anotherString){
  1300. var self=this;
  1301. return smalltalk.send(self, "_subclass_instanceVariableNames_category_", [aString, anotherString, nil]);
  1302. return self;},
  1303. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%0A%09%5Eself%20subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%20category%3A%20nil%0A'),
  1304. messageSends: ["subclass:instanceVariableNames:category:"],
  1305. referencedClasses: []
  1306. }),
  1307. smalltalk.Class);
  1308. smalltalk.addMethod(
  1309. '_subclass_instanceVariableNames_category_',
  1310. smalltalk.method({
  1311. selector: 'subclass:instanceVariableNames:category:',
  1312. category: 'class creation',
  1313. fn: function (aString, aString2, aString3){
  1314. var self=this;
  1315. return smalltalk.send(smalltalk.send(smalltalk.ClassBuilder, "_new", []), "_superclass_subclass_instanceVariableNames_category_", [self, aString, aString2, aString3]);
  1316. return self;},
  1317. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20category%3A%20aString3%0A%09%5EClassBuilder%20new%0A%09%20%20%20%20superclass%3A%20self%20subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20category%3A%20aString3%0A'),
  1318. messageSends: ["superclass:subclass:instanceVariableNames:category:", "new"],
  1319. referencedClasses: [smalltalk.ClassBuilder]
  1320. }),
  1321. smalltalk.Class);
  1322. smalltalk.addMethod(
  1323. '_isClass',
  1324. smalltalk.method({
  1325. selector: 'isClass',
  1326. category: 'testing',
  1327. fn: function (){
  1328. var self=this;
  1329. return true;
  1330. return self;},
  1331. source: unescape('isClass%0A%09%5Etrue%0A'),
  1332. messageSends: [],
  1333. referencedClasses: []
  1334. }),
  1335. smalltalk.Class);
  1336. smalltalk.addMethod(
  1337. '_printString',
  1338. smalltalk.method({
  1339. selector: 'printString',
  1340. category: 'printing',
  1341. fn: function (){
  1342. var self=this;
  1343. return smalltalk.send(self, "_name", []);
  1344. return self;},
  1345. source: unescape('printString%0A%09%5Eself%20name%0A'),
  1346. messageSends: ["name"],
  1347. referencedClasses: []
  1348. }),
  1349. smalltalk.Class);
  1350. smalltalk.addMethod(
  1351. '_rename_',
  1352. smalltalk.method({
  1353. selector: 'rename:',
  1354. category: 'accessing',
  1355. fn: function (aString){
  1356. var self=this;
  1357. smalltalk[aString] = self;
  1358. delete smalltalk[self.className];
  1359. self.className = aString;
  1360. ;
  1361. return self;},
  1362. source: unescape('rename%3A%20aString%0A%09%7B%27%0A%09%09smalltalk%5BaString%5D%20%3D%20self%3B%0A%09%09delete%20smalltalk%5Bself.className%5D%3B%0A%09%09self.className%20%3D%20aString%3B%0A%09%27%7D'),
  1363. messageSends: [],
  1364. referencedClasses: []
  1365. }),
  1366. smalltalk.Class);
  1367. smalltalk.addClass('Metaclass', smalltalk.Behavior, [], 'Kernel');
  1368. smalltalk.addMethod(
  1369. '_instanceClass',
  1370. smalltalk.method({
  1371. selector: 'instanceClass',
  1372. category: 'accessing',
  1373. fn: function (){
  1374. var self=this;
  1375. return self.instanceClass;
  1376. return self;},
  1377. source: unescape('instanceClass%0A%09%7B%27return%20self.instanceClass%27%7D'),
  1378. messageSends: [],
  1379. referencedClasses: []
  1380. }),
  1381. smalltalk.Metaclass);
  1382. smalltalk.addMethod(
  1383. '_instanceVariableNames_',
  1384. smalltalk.method({
  1385. selector: 'instanceVariableNames:',
  1386. category: 'accessing',
  1387. fn: function (aCollection){
  1388. var self=this;
  1389. smalltalk.send(smalltalk.send(smalltalk.ClassBuilder, "_new", []), "_class_instanceVariableNames_", [self, aCollection]);
  1390. return self;},
  1391. source: unescape('instanceVariableNames%3A%20aCollection%0A%09ClassBuilder%20new%0A%09%20%20%20%20class%3A%20self%20instanceVariableNames%3A%20aCollection%0A'),
  1392. messageSends: ["class:instanceVariableNames:", "new"],
  1393. referencedClasses: [smalltalk.ClassBuilder]
  1394. }),
  1395. smalltalk.Metaclass);
  1396. smalltalk.addMethod(
  1397. '_isMetaclass',
  1398. smalltalk.method({
  1399. selector: 'isMetaclass',
  1400. category: 'testing',
  1401. fn: function (){
  1402. var self=this;
  1403. return true;
  1404. return self;},
  1405. source: unescape('isMetaclass%0A%09%5Etrue%0A'),
  1406. messageSends: [],
  1407. referencedClasses: []
  1408. }),
  1409. smalltalk.Metaclass);
  1410. smalltalk.addMethod(
  1411. '_printString',
  1412. smalltalk.method({
  1413. selector: 'printString',
  1414. category: 'printing',
  1415. fn: function (){
  1416. var self=this;
  1417. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_instanceClass", []), "_name", []), "__comma", [" class"]);
  1418. return self;},
  1419. source: unescape('printString%0A%09%5Eself%20instanceClass%20name%2C%20%27%20class%27%0A'),
  1420. messageSends: [unescape("%2C"), "name", "instanceClass"],
  1421. referencedClasses: []
  1422. }),
  1423. smalltalk.Metaclass);
  1424. smalltalk.addClass('CompiledMethod', smalltalk.Object, [], 'Kernel');
  1425. smalltalk.addMethod(
  1426. '_source',
  1427. smalltalk.method({
  1428. selector: 'source',
  1429. category: 'accessing',
  1430. fn: function (){
  1431. var self=this;
  1432. return smalltalk.send(smalltalk.send(self, "_basicAt_", ["source"]), "_ifNil_", [(function(){return "";})]);
  1433. return self;},
  1434. source: unescape('source%0A%09%5E%28self%20basicAt%3A%20%27source%27%29%20ifNil%3A%20%5B%27%27%5D%0A'),
  1435. messageSends: ["ifNil:", "basicAt:"],
  1436. referencedClasses: []
  1437. }),
  1438. smalltalk.CompiledMethod);
  1439. smalltalk.addMethod(
  1440. '_source_',
  1441. smalltalk.method({
  1442. selector: 'source:',
  1443. category: 'accessing',
  1444. fn: function (aString){
  1445. var self=this;
  1446. smalltalk.send(self, "_basicAt_put_", ["source", aString]);
  1447. return self;},
  1448. source: unescape('source%3A%20aString%0A%09self%20basicAt%3A%20%27source%27%20put%3A%20aString%0A'),
  1449. messageSends: ["basicAt:put:"],
  1450. referencedClasses: []
  1451. }),
  1452. smalltalk.CompiledMethod);
  1453. smalltalk.addMethod(
  1454. '_category',
  1455. smalltalk.method({
  1456. selector: 'category',
  1457. category: 'accessing',
  1458. fn: function (){
  1459. var self=this;
  1460. return smalltalk.send(smalltalk.send(self, "_basicAt_", ["category"]), "_ifNil_", [(function(){return "";})]);
  1461. return self;},
  1462. source: unescape('category%0A%09%5E%28self%20basicAt%3A%20%27category%27%29%20ifNil%3A%20%5B%27%27%5D%0A'),
  1463. messageSends: ["ifNil:", "basicAt:"],
  1464. referencedClasses: []
  1465. }),
  1466. smalltalk.CompiledMethod);
  1467. smalltalk.addMethod(
  1468. '_category_',
  1469. smalltalk.method({
  1470. selector: 'category:',
  1471. category: 'accessing',
  1472. fn: function (aString){
  1473. var self=this;
  1474. smalltalk.send(self, "_basicAt_put_", ["category", aString]);
  1475. return self;},
  1476. source: unescape('category%3A%20aString%0A%09self%20basicAt%3A%20%27category%27%20put%3A%20aString%0A'),
  1477. messageSends: ["basicAt:put:"],
  1478. referencedClasses: []
  1479. }),
  1480. smalltalk.CompiledMethod);
  1481. smalltalk.addMethod(
  1482. '_selector',
  1483. smalltalk.method({
  1484. selector: 'selector',
  1485. category: 'accessing',
  1486. fn: function (){
  1487. var self=this;
  1488. return smalltalk.send(self, "_basicAt_", ["selector"]);
  1489. return self;},
  1490. source: unescape('selector%0A%09%5Eself%20basicAt%3A%20%27selector%27%0A'),
  1491. messageSends: ["basicAt:"],
  1492. referencedClasses: []
  1493. }),
  1494. smalltalk.CompiledMethod);
  1495. smalltalk.addMethod(
  1496. '_selector_',
  1497. smalltalk.method({
  1498. selector: 'selector:',
  1499. category: 'accessing',
  1500. fn: function (aString){
  1501. var self=this;
  1502. smalltalk.send(self, "_basicAt_put_", ["selector", aString]);
  1503. return self;},
  1504. source: unescape('selector%3A%20aString%0A%09self%20basicAt%3A%20%27selector%27%20put%3A%20aString%0A'),
  1505. messageSends: ["basicAt:put:"],
  1506. referencedClasses: []
  1507. }),
  1508. smalltalk.CompiledMethod);
  1509. smalltalk.addMethod(
  1510. '_fn',
  1511. smalltalk.method({
  1512. selector: 'fn',
  1513. category: 'accessing',
  1514. fn: function (){
  1515. var self=this;
  1516. return smalltalk.send(self, "_basicAt_", ["fn"]);
  1517. return self;},
  1518. source: unescape('fn%0A%09%5Eself%20basicAt%3A%20%27fn%27%0A'),
  1519. messageSends: ["basicAt:"],
  1520. referencedClasses: []
  1521. }),
  1522. smalltalk.CompiledMethod);
  1523. smalltalk.addMethod(
  1524. '_fn_',
  1525. smalltalk.method({
  1526. selector: 'fn:',
  1527. category: 'accessing',
  1528. fn: function (aBlock){
  1529. var self=this;
  1530. smalltalk.send(self, "_basicAt_put_", ["fn", aBlock]);
  1531. return self;},
  1532. source: unescape('fn%3A%20aBlock%0A%09self%20basicAt%3A%20%27fn%27%20put%3A%20aBlock%0A'),
  1533. messageSends: ["basicAt:put:"],
  1534. referencedClasses: []
  1535. }),
  1536. smalltalk.CompiledMethod);
  1537. smalltalk.addMethod(
  1538. '_messageSends',
  1539. smalltalk.method({
  1540. selector: 'messageSends',
  1541. category: 'accessing',
  1542. fn: function (){
  1543. var self=this;
  1544. return smalltalk.send(self, "_basicAt_", ["messageSends"]);
  1545. return self;},
  1546. source: unescape('messageSends%0A%09%5Eself%20basicAt%3A%20%27messageSends%27'),
  1547. messageSends: ["basicAt:"],
  1548. referencedClasses: []
  1549. }),
  1550. smalltalk.CompiledMethod);
  1551. smalltalk.addMethod(
  1552. '_methodClass',
  1553. smalltalk.method({
  1554. selector: 'methodClass',
  1555. category: 'accessing',
  1556. fn: function (){
  1557. var self=this;
  1558. return smalltalk.send(self, "_basicAt_", ["methodClass"]);
  1559. return self;},
  1560. source: unescape('methodClass%0A%09%5Eself%20basicAt%3A%20%27methodClass%27'),
  1561. messageSends: ["basicAt:"],
  1562. referencedClasses: []
  1563. }),
  1564. smalltalk.CompiledMethod);
  1565. smalltalk.addMethod(
  1566. '_referencedClasses',
  1567. smalltalk.method({
  1568. selector: 'referencedClasses',
  1569. category: 'accessing',
  1570. fn: function (){
  1571. var self=this;
  1572. return smalltalk.send(self, "_basicAt_", ["referencedClasses"]);
  1573. return self;},
  1574. source: unescape('referencedClasses%0A%09%5Eself%20basicAt%3A%20%27referencedClasses%27'),
  1575. messageSends: ["basicAt:"],
  1576. referencedClasses: []
  1577. }),
  1578. smalltalk.CompiledMethod);
  1579. smalltalk.addClass('Number', smalltalk.Object, [], 'Kernel');
  1580. smalltalk.addMethod(
  1581. '__eq',
  1582. smalltalk.method({
  1583. selector: '=',
  1584. category: 'comparing',
  1585. fn: function (aNumber){
  1586. var self=this;
  1587. return Number(self) == aNumber;
  1588. return self;},
  1589. source: unescape('%3D%20aNumber%0A%09%7B%27return%20Number%28self%29%20%3D%3D%20aNumber%27%7D'),
  1590. messageSends: [],
  1591. referencedClasses: []
  1592. }),
  1593. smalltalk.Number);
  1594. smalltalk.addMethod(
  1595. '__gt',
  1596. smalltalk.method({
  1597. selector: '>',
  1598. category: 'comparing',
  1599. fn: function (aNumber){
  1600. var self=this;
  1601. return self > aNumber;
  1602. return self;},
  1603. source: unescape('%3E%20aNumber%0A%09%7B%27return%20self%20%3E%20aNumber%27%7D'),
  1604. messageSends: [],
  1605. referencedClasses: []
  1606. }),
  1607. smalltalk.Number);
  1608. smalltalk.addMethod(
  1609. '__lt',
  1610. smalltalk.method({
  1611. selector: '<',
  1612. category: 'comparing',
  1613. fn: function (aNumber){
  1614. var self=this;
  1615. return self < aNumber;
  1616. return self;},
  1617. source: unescape('%3C%20aNumber%0A%09%7B%27return%20self%20%3C%20aNumber%27%7D'),
  1618. messageSends: [],
  1619. referencedClasses: []
  1620. }),
  1621. smalltalk.Number);
  1622. smalltalk.addMethod(
  1623. '__gt_eq',
  1624. smalltalk.method({
  1625. selector: '>=',
  1626. category: 'comparing',
  1627. fn: function (aNumber){
  1628. var self=this;
  1629. return self >= aNumber;
  1630. return self;},
  1631. source: unescape('%3E%3D%20aNumber%0A%09%7B%27return%20self%20%3E%3D%20aNumber%27%7D'),
  1632. messageSends: [],
  1633. referencedClasses: []
  1634. }),
  1635. smalltalk.Number);
  1636. smalltalk.addMethod(
  1637. '__lt_eq',
  1638. smalltalk.method({
  1639. selector: '<=',
  1640. category: 'comparing',
  1641. fn: function (aNumber){
  1642. var self=this;
  1643. return self <= aNumber;
  1644. return self;},
  1645. source: unescape('%3C%3D%20aNumber%0A%09%7B%27return%20self%20%3C%3D%20aNumber%27%7D'),
  1646. messageSends: [],
  1647. referencedClasses: []
  1648. }),
  1649. smalltalk.Number);
  1650. smalltalk.addMethod(
  1651. '__plus',
  1652. smalltalk.method({
  1653. selector: '+',
  1654. category: 'arithmetic',
  1655. fn: function (aNumber){
  1656. var self=this;
  1657. return self + aNumber;
  1658. return self;},
  1659. source: unescape('+%20aNumber%0A%09%7B%27return%20self%20+%20aNumber%27%7D'),
  1660. messageSends: [],
  1661. referencedClasses: []
  1662. }),
  1663. smalltalk.Number);
  1664. smalltalk.addMethod(
  1665. '__minus',
  1666. smalltalk.method({
  1667. selector: '-',
  1668. category: 'arithmetic',
  1669. fn: function (aNumber){
  1670. var self=this;
  1671. return self - aNumber;
  1672. return self;},
  1673. source: unescape('-%20aNumber%0A%09%7B%27return%20self%20-%20aNumber%27%7D'),
  1674. messageSends: [],
  1675. referencedClasses: []
  1676. }),
  1677. smalltalk.Number);
  1678. smalltalk.addMethod(
  1679. '__star',
  1680. smalltalk.method({
  1681. selector: '*',
  1682. category: 'arithmetic',
  1683. fn: function (aNumber){
  1684. var self=this;
  1685. return self * aNumber;
  1686. return self;},
  1687. source: unescape('*%20aNumber%0A%09%7B%27return%20self%20*%20aNumber%27%7D'),
  1688. messageSends: [],
  1689. referencedClasses: []
  1690. }),
  1691. smalltalk.Number);
  1692. smalltalk.addMethod(
  1693. '__slash',
  1694. smalltalk.method({
  1695. selector: '/',
  1696. category: 'arithmetic',
  1697. fn: function (aNumber){
  1698. var self=this;
  1699. return self / aNumber;
  1700. return self;},
  1701. source: unescape('/%20aNumber%0A%09%7B%27return%20self%20/%20aNumber%27%7D'),
  1702. messageSends: [],
  1703. referencedClasses: []
  1704. }),
  1705. smalltalk.Number);
  1706. smalltalk.addMethod(
  1707. '_max_',
  1708. smalltalk.method({
  1709. selector: 'max:',
  1710. category: 'arithmetic',
  1711. fn: function (aNumber){
  1712. var self=this;
  1713. return Math.max(self, aNumber);;
  1714. return self;},
  1715. source: unescape('max%3A%20aNumber%0A%09%7B%27return%20Math.max%28self%2C%20aNumber%29%3B%27%7D'),
  1716. messageSends: [],
  1717. referencedClasses: []
  1718. }),
  1719. smalltalk.Number);
  1720. smalltalk.addMethod(
  1721. '_min_',
  1722. smalltalk.method({
  1723. selector: 'min:',
  1724. category: 'arithmetic',
  1725. fn: function (aNumber){
  1726. var self=this;
  1727. return Math.min(self, aNumber);;
  1728. return self;},
  1729. source: unescape('min%3A%20aNumber%0A%09%7B%27return%20Math.min%28self%2C%20aNumber%29%3B%27%7D'),
  1730. messageSends: [],
  1731. referencedClasses: []
  1732. }),
  1733. smalltalk.Number);
  1734. smalltalk.addMethod(
  1735. '_rounded',
  1736. smalltalk.method({
  1737. selector: 'rounded',
  1738. category: 'converting',
  1739. fn: function (){
  1740. var self=this;
  1741. return Math.round(self);;
  1742. return self;},
  1743. source: unescape('rounded%0A%09%7B%27return%20Math.round%28self%29%3B%27%7D'),
  1744. messageSends: [],
  1745. referencedClasses: []
  1746. }),
  1747. smalltalk.Number);
  1748. smalltalk.addMethod(
  1749. '_truncated',
  1750. smalltalk.method({
  1751. selector: 'truncated',
  1752. category: 'converting',
  1753. fn: function (){
  1754. var self=this;
  1755. return Math.floor(self);;
  1756. return self;},
  1757. source: unescape('truncated%0A%09%7B%27return%20Math.floor%28self%29%3B%27%7D'),
  1758. messageSends: [],
  1759. referencedClasses: []
  1760. }),
  1761. smalltalk.Number);
  1762. smalltalk.addMethod(
  1763. '_to_',
  1764. smalltalk.method({
  1765. selector: 'to:',
  1766. category: 'converting',
  1767. fn: function (aNumber){
  1768. var self=this;
  1769. var array=nil;
  1770. var first=nil;
  1771. var last=nil;
  1772. var count=nil;
  1773. first=smalltalk.send(self, "_truncated", []);
  1774. last=smalltalk.send(smalltalk.send(aNumber, "_truncated", []), "__plus", [(1)]);
  1775. count=(1);
  1776. smalltalk.send(smalltalk.send(first, "__lt_eq", [last]), "_ifFalse_", [(function(){return smalltalk.send(self, "_error_", ["Wrong interval"]);})]);
  1777. array=smalltalk.send(smalltalk.Array, "_new", []);
  1778. smalltalk.send(smalltalk.send(last, "__minus", [first]), "_timesRepeat_", [(function(){smalltalk.send(array, "_at_put_", [count, first]);count=smalltalk.send(count, "__plus", [(1)]);return first=smalltalk.send(first, "__plus", [(1)]);})]);
  1779. return array;
  1780. return self;},
  1781. source: unescape('to%3A%20aNumber%0A%09%7C%20array%20first%20last%20count%20%7C%0A%09first%20%3A%3D%20self%20truncated.%0A%09last%20%3A%3D%20aNumber%20truncated%20+%201.%0A%09count%20%3A%3D%201.%0A%09%28first%20%3C%3D%20last%29%20ifFalse%3A%20%5Bself%20error%3A%20%27Wrong%20interval%27%5D.%0A%09array%20%3A%3D%20Array%20new.%0A%09%28last%20-%20first%29%20timesRepeat%3A%20%5B%0A%09%20%20%20%20array%20at%3A%20count%20put%3A%20first.%0A%09%20%20%20%20count%20%3A%3D%20count%20+%201.%0A%09%20%20%20%20first%20%3A%3D%20first%20+%201%5D.%0A%09%5Earray%0A'),
  1782. messageSends: ["truncated", unescape("+"), "ifFalse:", unescape("%3C%3D"), "error:", "new", "timesRepeat:", unescape("-"), "at:put:"],
  1783. referencedClasses: [smalltalk.Array]
  1784. }),
  1785. smalltalk.Number);
  1786. smalltalk.addMethod(
  1787. '_timesRepeat_',
  1788. smalltalk.method({
  1789. selector: 'timesRepeat:',
  1790. category: 'enumerating',
  1791. fn: function (aBlock){
  1792. var self=this;
  1793. var integer=nil;
  1794. var count=nil;
  1795. integer=smalltalk.send(self, "_truncated", []);
  1796. count=(1);
  1797. smalltalk.send((function(){return smalltalk.send(count, "__gt", [self]);}), "_whileFalse_", [(function(){smalltalk.send(aBlock, "_value", []);return count=smalltalk.send(count, "__plus", [(1)]);})]);
  1798. return self;},
  1799. source: unescape('timesRepeat%3A%20aBlock%0A%09%7C%20integer%20count%20%7C%0A%09integer%20%3A%3D%20self%20truncated.%0A%09count%20%3A%3D%201.%0A%09%5Bcount%20%3E%20self%5D%20whileFalse%3A%20%5B%0A%09%20%20%20%20aBlock%20value.%0A%09%20%20%20%20count%20%3A%3D%20count%20+%201%5D%0A'),
  1800. messageSends: ["truncated", "whileFalse:", unescape("%3E"), "value", unescape("+")],
  1801. referencedClasses: []
  1802. }),
  1803. smalltalk.Number);
  1804. smalltalk.addMethod(
  1805. '_to_do_',
  1806. smalltalk.method({
  1807. selector: 'to:do:',
  1808. category: 'enumerating',
  1809. fn: function (aNumber, aBlock){
  1810. var self=this;
  1811. return smalltalk.send(smalltalk.send(self, "_to_", [aNumber]), "_do_", [aBlock]);
  1812. return self;},
  1813. source: unescape('to%3A%20aNumber%20do%3A%20aBlock%0A%09%5E%28self%20to%3A%20aNumber%29%20do%3A%20aBlock%0A'),
  1814. messageSends: ["do:", "to:"],
  1815. referencedClasses: []
  1816. }),
  1817. smalltalk.Number);
  1818. smalltalk.addMethod(
  1819. '_asString',
  1820. smalltalk.method({
  1821. selector: 'asString',
  1822. category: 'converting',
  1823. fn: function (){
  1824. var self=this;
  1825. return smalltalk.send(self, "_printString", []);
  1826. return self;},
  1827. source: unescape('asString%0A%09%5Eself%20printString%0A'),
  1828. messageSends: ["printString"],
  1829. referencedClasses: []
  1830. }),
  1831. smalltalk.Number);
  1832. smalltalk.addMethod(
  1833. '_asJavascript',
  1834. smalltalk.method({
  1835. selector: 'asJavascript',
  1836. category: 'converting',
  1837. fn: function (){
  1838. var self=this;
  1839. return smalltalk.send(smalltalk.send(unescape("%28"), "__comma", [smalltalk.send(self, "_printString", [])]), "__comma", [unescape("%29")]);
  1840. return self;},
  1841. source: unescape('asJavascript%0A%09%5E%27%28%27%2C%20self%20printString%2C%20%27%29%27%0A'),
  1842. messageSends: [unescape("%2C"), "printString"],
  1843. referencedClasses: []
  1844. }),
  1845. smalltalk.Number);
  1846. smalltalk.addMethod(
  1847. '_printString',
  1848. smalltalk.method({
  1849. selector: 'printString',
  1850. category: 'printing',
  1851. fn: function (){
  1852. var self=this;
  1853. return String(self);
  1854. return self;},
  1855. source: unescape('printString%0A%09%7B%27return%20String%28self%29%27%7D'),
  1856. messageSends: [],
  1857. referencedClasses: []
  1858. }),
  1859. smalltalk.Number);
  1860. smalltalk.addMethod(
  1861. '_isNumber',
  1862. smalltalk.method({
  1863. selector: 'isNumber',
  1864. category: 'testing',
  1865. fn: function (){
  1866. var self=this;
  1867. return true;
  1868. return self;},
  1869. source: unescape('isNumber%0A%09%5Etrue%0A'),
  1870. messageSends: [],
  1871. referencedClasses: []
  1872. }),
  1873. smalltalk.Number);
  1874. smalltalk.addMethod(
  1875. '_atRandom',
  1876. smalltalk.method({
  1877. selector: 'atRandom',
  1878. category: 'converting',
  1879. fn: function (){
  1880. var self=this;
  1881. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.Random, "_new", []), "_next", []), "__star", [self]), "_truncated", []), "__plus", [(1)]);
  1882. return self;},
  1883. source: unescape('atRandom%0A%20%20%20%20%5E%28Random%20new%20next%20*%20self%29%20truncated%20+%201%0A'),
  1884. messageSends: [unescape("+"), "truncated", unescape("*"), "next", "new"],
  1885. referencedClasses: [smalltalk.Random]
  1886. }),
  1887. smalltalk.Number);
  1888. smalltalk.addMethod(
  1889. '__at',
  1890. smalltalk.method({
  1891. selector: '@',
  1892. category: 'converting',
  1893. fn: function (aNumber){
  1894. var self=this;
  1895. return smalltalk.send(smalltalk.Point, "_x_y_", [self, aNumber]);
  1896. return self;},
  1897. source: unescape('@%20aNumber%0A%09%5EPoint%20x%3A%20self%20y%3A%20aNumber'),
  1898. messageSends: ["x:y:"],
  1899. referencedClasses: [smalltalk.Point]
  1900. }),
  1901. smalltalk.Number);
  1902. smalltalk.addMethod(
  1903. '_asPoint',
  1904. smalltalk.method({
  1905. selector: 'asPoint',
  1906. category: 'converting',
  1907. fn: function (){
  1908. var self=this;
  1909. return smalltalk.send(smalltalk.Point, "_x_y_", [self, self]);
  1910. return self;},
  1911. source: unescape('asPoint%0A%09%5EPoint%20x%3A%20self%20y%3A%20self'),
  1912. messageSends: ["x:y:"],
  1913. referencedClasses: [smalltalk.Point]
  1914. }),
  1915. smalltalk.Number);
  1916. smalltalk.addMethod(
  1917. '_clearInterval',
  1918. smalltalk.method({
  1919. selector: 'clearInterval',
  1920. category: 'timeouts/intervals',
  1921. fn: function (){
  1922. var self=this;
  1923. clearInterval(Number(self));
  1924. return self;},
  1925. source: unescape('clearInterval%0A%09%7B%27clearInterval%28Number%28self%29%29%27%7D'),
  1926. messageSends: [],
  1927. referencedClasses: []
  1928. }),
  1929. smalltalk.Number);
  1930. smalltalk.addMethod(
  1931. '_asJSONObject',
  1932. smalltalk.method({
  1933. selector: 'asJSONObject',
  1934. category: 'converting',
  1935. fn: function (){
  1936. var self=this;
  1937. return self;
  1938. return self;},
  1939. source: unescape('asJSONObject%0A%09%5Eself'),
  1940. messageSends: [],
  1941. referencedClasses: []
  1942. }),
  1943. smalltalk.Number);
  1944. smalltalk.addMethod(
  1945. '_clearTimeout',
  1946. smalltalk.method({
  1947. selector: 'clearTimeout',
  1948. category: 'timeouts/intervals',
  1949. fn: function (){
  1950. var self=this;
  1951. clearTimeout(Number(self));
  1952. return self;},
  1953. source: unescape('clearTimeout%0A%09%7B%27clearTimeout%28Number%28self%29%29%27%7D'),
  1954. messageSends: [],
  1955. referencedClasses: []
  1956. }),
  1957. smalltalk.Number);
  1958. smalltalk.addMethod(
  1959. '_pi',
  1960. smalltalk.method({
  1961. selector: 'pi',
  1962. category: 'instance creation',
  1963. fn: function (){
  1964. var self=this;
  1965. return Math.PI;
  1966. return self;},
  1967. source: unescape('pi%0A%09%7B%27return%20Math.PI%27%7D'),
  1968. messageSends: [],
  1969. referencedClasses: []
  1970. }),
  1971. smalltalk.Number.klass);
  1972. smalltalk.addClass('BlockClosure', smalltalk.Object, [], 'Kernel');
  1973. smalltalk.addMethod(
  1974. '_compiledSource',
  1975. smalltalk.method({
  1976. selector: 'compiledSource',
  1977. category: 'accessing',
  1978. fn: function (){
  1979. var self=this;
  1980. return self.toString();
  1981. return self;},
  1982. source: unescape('compiledSource%0A%09%7B%27return%20self.toString%28%29%27%7D'),
  1983. messageSends: [],
  1984. referencedClasses: []
  1985. }),
  1986. smalltalk.BlockClosure);
  1987. smalltalk.addMethod(
  1988. '_whileTrue_',
  1989. smalltalk.method({
  1990. selector: 'whileTrue:',
  1991. category: 'controlling',
  1992. fn: function (aBlock){
  1993. var self=this;
  1994. while(self()) {aBlock()};
  1995. return self;},
  1996. source: unescape('whileTrue%3A%20aBlock%0A%09%7B%27while%28self%28%29%29%20%7BaBlock%28%29%7D%27%7D'),
  1997. messageSends: [],
  1998. referencedClasses: []
  1999. }),
  2000. smalltalk.BlockClosure);
  2001. smalltalk.addMethod(
  2002. '_whileFalse_',
  2003. smalltalk.method({
  2004. selector: 'whileFalse:',
  2005. category: 'controlling',
  2006. fn: function (aBlock){
  2007. var self=this;
  2008. while(!self()) {aBlock()};
  2009. return self;},
  2010. source: unescape('whileFalse%3A%20aBlock%0A%09%7B%27while%28%21self%28%29%29%20%7BaBlock%28%29%7D%27%7D'),
  2011. messageSends: [],
  2012. referencedClasses: []
  2013. }),
  2014. smalltalk.BlockClosure);
  2015. smalltalk.addMethod(
  2016. '_value',
  2017. smalltalk.method({
  2018. selector: 'value',
  2019. category: 'evaluating',
  2020. fn: function (){
  2021. var self=this;
  2022. return self();;
  2023. return self;},
  2024. source: unescape('value%0A%09%7B%27return%20self%28%29%3B%27%7D'),
  2025. messageSends: [],
  2026. referencedClasses: []
  2027. }),
  2028. smalltalk.BlockClosure);
  2029. smalltalk.addMethod(
  2030. '_value_',
  2031. smalltalk.method({
  2032. selector: 'value:',
  2033. category: 'evaluating',
  2034. fn: function (anArg){
  2035. var self=this;
  2036. return self(anArg);;
  2037. return self;},
  2038. source: unescape('value%3A%20anArg%0A%09%7B%27return%20self%28anArg%29%3B%27%7D'),
  2039. messageSends: [],
  2040. referencedClasses: []
  2041. }),
  2042. smalltalk.BlockClosure);
  2043. smalltalk.addMethod(
  2044. '_value_value_',
  2045. smalltalk.method({
  2046. selector: 'value:value:',
  2047. category: 'evaluating',
  2048. fn: function (firstArg, secondArg){
  2049. var self=this;
  2050. return self(firstArg, secondArg);;
  2051. return self;},
  2052. source: unescape('value%3A%20firstArg%20value%3A%20secondArg%0A%09%7B%27return%20self%28firstArg%2C%20secondArg%29%3B%27%7D'),
  2053. messageSends: [],
  2054. referencedClasses: []
  2055. }),
  2056. smalltalk.BlockClosure);
  2057. smalltalk.addMethod(
  2058. '_value_value_value_',
  2059. smalltalk.method({
  2060. selector: 'value:value:value:',
  2061. category: 'evaluating',
  2062. fn: function (firstArg, secondArg, thirdArg){
  2063. var self=this;
  2064. return self(firstArg, secondArg, thirdArg);;
  2065. return self;},
  2066. source: unescape('value%3A%20firstArg%20value%3A%20secondArg%20value%3A%20thirdArg%0A%09%7B%27return%20self%28firstArg%2C%20secondArg%2C%20thirdArg%29%3B%27%7D'),
  2067. messageSends: [],
  2068. referencedClasses: []
  2069. }),
  2070. smalltalk.BlockClosure);
  2071. smalltalk.addMethod(
  2072. '_valueWithPossibleArguments_',
  2073. smalltalk.method({
  2074. selector: 'valueWithPossibleArguments:',
  2075. category: 'evaluating',
  2076. fn: function (aCollection){
  2077. var self=this;
  2078. return self.apply(null, aCollection);;
  2079. return self;},
  2080. source: unescape('valueWithPossibleArguments%3A%20aCollection%0A%09%7B%27return%20self.apply%28null%2C%20aCollection%29%3B%27%7D'),
  2081. messageSends: [],
  2082. referencedClasses: []
  2083. }),
  2084. smalltalk.BlockClosure);
  2085. smalltalk.addMethod(
  2086. '_on_do_',
  2087. smalltalk.method({
  2088. selector: 'on:do:',
  2089. category: 'error handling',
  2090. fn: function (anErrorClass, aBlock){
  2091. var self=this;
  2092. smalltalk.send(self, "_try_catch_", [self, (function(error){return smalltalk.send(smalltalk.send(error, "_isKindOf_", [anErrorClass]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(aBlock, "_value_", [error]);}), (function(){return smalltalk.send(error, "_signal", []);})]);})]);
  2093. return self;},
  2094. source: unescape('on%3A%20anErrorClass%20do%3A%20aBlock%0A%09self%20try%3A%20self%20catch%3A%20%5B%3Aerror%20%7C%0A%09%20%20%20%20%28error%20isKindOf%3A%20anErrorClass%29%20%0A%09%20%20%20%20%20ifTrue%3A%20%5BaBlock%20value%3A%20error%5D%0A%09%20%20%20%20%20ifFalse%3A%20%5Berror%20signal%5D%5D'),
  2095. messageSends: ["try:catch:", "ifTrue:ifFalse:", "isKindOf:", "value:", "signal"],
  2096. referencedClasses: []
  2097. }),
  2098. smalltalk.BlockClosure);
  2099. smalltalk.addMethod(
  2100. '_valueWithTimeout_',
  2101. smalltalk.method({
  2102. selector: 'valueWithTimeout:',
  2103. category: 'timeout/interval',
  2104. fn: function (aNumber){
  2105. var self=this;
  2106. return setTimeout(self, aNumber);
  2107. return self;},
  2108. source: unescape('valueWithTimeout%3A%20aNumber%0A%09%7B%27return%20setTimeout%28self%2C%20aNumber%29%27%7D'),
  2109. messageSends: [],
  2110. referencedClasses: []
  2111. }),
  2112. smalltalk.BlockClosure);
  2113. smalltalk.addMethod(
  2114. '_valueWithInterval_',
  2115. smalltalk.method({
  2116. selector: 'valueWithInterval:',
  2117. category: 'timeout/interval',
  2118. fn: function (aNumber){
  2119. var self=this;
  2120. return setInterval(self, aNumber);
  2121. return self;},
  2122. source: unescape('valueWithInterval%3A%20aNumber%0A%09%7B%27return%20setInterval%28self%2C%20aNumber%29%27%7D'),
  2123. messageSends: [],
  2124. referencedClasses: []
  2125. }),
  2126. smalltalk.BlockClosure);
  2127. smalltalk.addClass('Boolean', smalltalk.Object, [], 'Kernel');
  2128. smalltalk.addMethod(
  2129. '__eq',
  2130. smalltalk.method({
  2131. selector: '=',
  2132. category: 'comparing',
  2133. fn: function (aBoolean){
  2134. var self=this;
  2135. return Boolean(self == true) == aBoolean;
  2136. return self;},
  2137. source: unescape('%3D%20aBoolean%0A%09%7B%27return%20Boolean%28self%20%3D%3D%20true%29%20%3D%3D%20aBoolean%27%7D'),
  2138. messageSends: [],
  2139. referencedClasses: []
  2140. }),
  2141. smalltalk.Boolean);
  2142. smalltalk.addMethod(
  2143. '_shallowCopy',
  2144. smalltalk.method({
  2145. selector: 'shallowCopy',
  2146. category: 'copying',
  2147. fn: function (){
  2148. var self=this;
  2149. return self;
  2150. return self;},
  2151. source: unescape('shallowCopy%0A%09%5Eself%0A'),
  2152. messageSends: [],
  2153. referencedClasses: []
  2154. }),
  2155. smalltalk.Boolean);
  2156. smalltalk.addMethod(
  2157. '_deepCopy',
  2158. smalltalk.method({
  2159. selector: 'deepCopy',
  2160. category: 'copying',
  2161. fn: function (){
  2162. var self=this;
  2163. return self;
  2164. return self;},
  2165. source: unescape('deepCopy%0A%09%5Eself%0A'),
  2166. messageSends: [],
  2167. referencedClasses: []
  2168. }),
  2169. smalltalk.Boolean);
  2170. smalltalk.addMethod(
  2171. '_ifTrue_',
  2172. smalltalk.method({
  2173. selector: 'ifTrue:',
  2174. category: 'controlling',
  2175. fn: function (aBlock){
  2176. var self=this;
  2177. return smalltalk.send(self, "_ifTrue_ifFalse_", [aBlock, (function(){return nil;})]);
  2178. return self;},
  2179. source: unescape('ifTrue%3A%20aBlock%0A%09%5Eself%20ifTrue%3A%20aBlock%20ifFalse%3A%20%5B%5D%0A'),
  2180. messageSends: ["ifTrue:ifFalse:"],
  2181. referencedClasses: []
  2182. }),
  2183. smalltalk.Boolean);
  2184. smalltalk.addMethod(
  2185. '_ifFalse_',
  2186. smalltalk.method({
  2187. selector: 'ifFalse:',
  2188. category: 'controlling',
  2189. fn: function (aBlock){
  2190. var self=this;
  2191. return smalltalk.send(self, "_ifTrue_ifFalse_", [(function(){return nil;}), aBlock]);
  2192. return self;},
  2193. source: unescape('ifFalse%3A%20aBlock%0A%09%5Eself%20ifTrue%3A%20%5B%5D%20ifFalse%3A%20aBlock%0A'),
  2194. messageSends: ["ifTrue:ifFalse:"],
  2195. referencedClasses: []
  2196. }),
  2197. smalltalk.Boolean);
  2198. smalltalk.addMethod(
  2199. '_ifFalse_ifTrue_',
  2200. smalltalk.method({
  2201. selector: 'ifFalse:ifTrue:',
  2202. category: 'controlling',
  2203. fn: function (aBlock, anotherBlock){
  2204. var self=this;
  2205. return smalltalk.send(self, "_ifTrue_ifFalse_", [anotherBlock, aBlock]);
  2206. return self;},
  2207. source: unescape('ifFalse%3A%20aBlock%20ifTrue%3A%20anotherBlock%0A%09%5Eself%20ifTrue%3A%20anotherBlock%20ifFalse%3A%20aBlock%0A'),
  2208. messageSends: ["ifTrue:ifFalse:"],
  2209. referencedClasses: []
  2210. }),
  2211. smalltalk.Boolean);
  2212. smalltalk.addMethod(
  2213. '_ifTrue_ifFalse_',
  2214. smalltalk.method({
  2215. selector: 'ifTrue:ifFalse:',
  2216. category: 'controlling',
  2217. fn: function (aBlock, anotherBlock){
  2218. var self=this;
  2219. if(self == true) {
  2220. return aBlock();
  2221. } else {
  2222. return anotherBlock();
  2223. }
  2224. ;
  2225. return self;},
  2226. source: unescape('ifTrue%3A%20aBlock%20ifFalse%3A%20anotherBlock%0A%09%7B%27%0A%09%20%20%20%20if%28self%20%3D%3D%20true%29%20%7B%0A%09%09return%20aBlock%28%29%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20anotherBlock%28%29%3B%0A%09%20%20%20%20%7D%0A%09%27%7D'),
  2227. messageSends: [],
  2228. referencedClasses: []
  2229. }),
  2230. smalltalk.Boolean);
  2231. smalltalk.addMethod(
  2232. '_and_',
  2233. smalltalk.method({
  2234. selector: 'and:',
  2235. category: 'controlling',
  2236. fn: function (aBlock){
  2237. var self=this;
  2238. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [aBlock, (function(){return false;})]);
  2239. return self;},
  2240. source: unescape('and%3A%20aBlock%0A%09%5Eself%20%3D%20true%0A%09%20%20%20%20ifTrue%3A%20aBlock%0A%09%20%20%20%20ifFalse%3A%20%5Bfalse%5D%0A'),
  2241. messageSends: ["ifTrue:ifFalse:", unescape("%3D")],
  2242. referencedClasses: []
  2243. }),
  2244. smalltalk.Boolean);
  2245. smalltalk.addMethod(
  2246. '_or_',
  2247. smalltalk.method({
  2248. selector: 'or:',
  2249. category: 'controlling',
  2250. fn: function (aBlock){
  2251. var self=this;
  2252. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [(function(){return true;}), aBlock]);
  2253. return self;},
  2254. source: unescape('or%3A%20aBlock%0A%09%5Eself%20%3D%20true%0A%09%20%20%20%20ifTrue%3A%20%5Btrue%5D%0A%09%20%20%20%20ifFalse%3A%20aBlock%0A'),
  2255. messageSends: ["ifTrue:ifFalse:", unescape("%3D")],
  2256. referencedClasses: []
  2257. }),
  2258. smalltalk.Boolean);
  2259. smalltalk.addMethod(
  2260. '_not',
  2261. smalltalk.method({
  2262. selector: 'not',
  2263. category: 'controlling',
  2264. fn: function (){
  2265. var self=this;
  2266. return smalltalk.send(self, "__eq", [false]);
  2267. return self;},
  2268. source: unescape('not%0A%09%5Eself%20%3D%20false%0A'),
  2269. messageSends: [unescape("%3D")],
  2270. referencedClasses: []
  2271. }),
  2272. smalltalk.Boolean);
  2273. smalltalk.addMethod(
  2274. '_printString',
  2275. smalltalk.method({
  2276. selector: 'printString',
  2277. category: 'printing',
  2278. fn: function (){
  2279. var self=this;
  2280. return self.toString();
  2281. return self;},
  2282. source: unescape('printString%0A%09%7B%27return%20self.toString%28%29%27%7D'),
  2283. messageSends: [],
  2284. referencedClasses: []
  2285. }),
  2286. smalltalk.Boolean);
  2287. smalltalk.addMethod(
  2288. '_asJSONObject',
  2289. smalltalk.method({
  2290. selector: 'asJSONObject',
  2291. category: 'comparing',
  2292. fn: function (){
  2293. var self=this;
  2294. return self;
  2295. return self;},
  2296. source: unescape('asJSONObject%0A%09%5Eself'),
  2297. messageSends: [],
  2298. referencedClasses: []
  2299. }),
  2300. smalltalk.Boolean);
  2301. smalltalk.addClass('Date', smalltalk.Object, [], 'Kernel');
  2302. smalltalk.Date.comment=unescape('The%20Date%20class%20is%20used%20to%20work%20with%20dates%20and%20times.')
  2303. smalltalk.addMethod(
  2304. '_year',
  2305. smalltalk.method({
  2306. selector: 'year',
  2307. category: 'accessing',
  2308. fn: function (){
  2309. var self=this;
  2310. return self.getFullYear();
  2311. return self;},
  2312. source: unescape('year%0A%09%7B%27return%20self.getFullYear%28%29%27%7D'),
  2313. messageSends: [],
  2314. referencedClasses: []
  2315. }),
  2316. smalltalk.Date);
  2317. smalltalk.addMethod(
  2318. '_month',
  2319. smalltalk.method({
  2320. selector: 'month',
  2321. category: 'accessing',
  2322. fn: function (){
  2323. var self=this;
  2324. return self.getMonth() + 1;
  2325. return self;},
  2326. source: unescape('month%0A%09%7B%27return%20self.getMonth%28%29%20+%201%27%7D'),
  2327. messageSends: [],
  2328. referencedClasses: []
  2329. }),
  2330. smalltalk.Date);
  2331. smalltalk.addMethod(
  2332. '_month_',
  2333. smalltalk.method({
  2334. selector: 'month:',
  2335. category: 'accessing',
  2336. fn: function (aNumber){
  2337. var self=this;
  2338. self.setMonth(aNumber - 1);
  2339. return self;},
  2340. source: unescape('month%3A%20aNumber%0A%09%7B%27self.setMonth%28aNumber%20-%201%29%27%7D'),
  2341. messageSends: [],
  2342. referencedClasses: []
  2343. }),
  2344. smalltalk.Date);
  2345. smalltalk.addMethod(
  2346. '_day',
  2347. smalltalk.method({
  2348. selector: 'day',
  2349. category: 'accessing',
  2350. fn: function (){
  2351. var self=this;
  2352. return smalltalk.send(self, "_dayOfWeek", []);
  2353. return self;},
  2354. source: unescape('day%0A%09%5Eself%20dayOfWeek'),
  2355. messageSends: ["dayOfWeek"],
  2356. referencedClasses: []
  2357. }),
  2358. smalltalk.Date);
  2359. smalltalk.addMethod(
  2360. '_dayOfWeek',
  2361. smalltalk.method({
  2362. selector: 'dayOfWeek',
  2363. category: 'accessing',
  2364. fn: function (){
  2365. var self=this;
  2366. return self.getDay() + 1;
  2367. return self;},
  2368. source: unescape('dayOfWeek%0A%09%7B%27return%20self.getDay%28%29%20+%201%27%7D'),
  2369. messageSends: [],
  2370. referencedClasses: []
  2371. }),
  2372. smalltalk.Date);
  2373. smalltalk.addMethod(
  2374. '_dayOfWeek_',
  2375. smalltalk.method({
  2376. selector: 'dayOfWeek:',
  2377. category: 'accessing',
  2378. fn: function (aNumber){
  2379. var self=this;
  2380. return self.setDay(aNumber - 1);
  2381. return self;},
  2382. source: unescape('dayOfWeek%3A%20aNumber%0A%09%7B%27return%20self.setDay%28aNumber%20-%201%29%27%7D'),
  2383. messageSends: [],
  2384. referencedClasses: []
  2385. }),
  2386. smalltalk.Date);
  2387. smalltalk.addMethod(
  2388. '_day_',
  2389. smalltalk.method({
  2390. selector: 'day:',
  2391. category: 'accessing',
  2392. fn: function (aNumber){
  2393. var self=this;
  2394. smalltalk.send(self, "_day_", [aNumber]);
  2395. return self;},
  2396. source: unescape('day%3A%20aNumber%0A%09self%20day%3A%20aNumber'),
  2397. messageSends: ["day:"],
  2398. referencedClasses: []
  2399. }),
  2400. smalltalk.Date);
  2401. smalltalk.addMethod(
  2402. '_year_',
  2403. smalltalk.method({
  2404. selector: 'year:',
  2405. category: 'accessing',
  2406. fn: function (aNumber){
  2407. var self=this;
  2408. self.setFullYear(aNumber);
  2409. return self;},
  2410. source: unescape('year%3A%20aNumber%0A%09%7B%27self.setFullYear%28aNumber%29%27%7D'),
  2411. messageSends: [],
  2412. referencedClasses: []
  2413. }),
  2414. smalltalk.Date);
  2415. smalltalk.addMethod(
  2416. '_dayOfMonth',
  2417. smalltalk.method({
  2418. selector: 'dayOfMonth',
  2419. category: 'accessing',
  2420. fn: function (){
  2421. var self=this;
  2422. return self.getDate();
  2423. return self;},
  2424. source: unescape('dayOfMonth%0A%09%7B%27return%20self.getDate%28%29%27%7D'),
  2425. messageSends: [],
  2426. referencedClasses: []
  2427. }),
  2428. smalltalk.Date);
  2429. smalltalk.addMethod(
  2430. '_dayOfMonth_',
  2431. smalltalk.method({
  2432. selector: 'dayOfMonth:',
  2433. category: 'accessing',
  2434. fn: function (aNumber){
  2435. var self=this;
  2436. self.setDate(aNumber);
  2437. return self;},
  2438. source: unescape('dayOfMonth%3A%20aNumber%0A%09%7B%27self.setDate%28aNumber%29%27%7D'),
  2439. messageSends: [],
  2440. referencedClasses: []
  2441. }),
  2442. smalltalk.Date);
  2443. smalltalk.addMethod(
  2444. '_asString',
  2445. smalltalk.method({
  2446. selector: 'asString',
  2447. category: 'converting',
  2448. fn: function (){
  2449. var self=this;
  2450. return self.toString();
  2451. return self;},
  2452. source: unescape('asString%0A%09%7B%27return%20self.toString%28%29%27%7D'),
  2453. messageSends: [],
  2454. referencedClasses: []
  2455. }),
  2456. smalltalk.Date);
  2457. smalltalk.addMethod(
  2458. '_printString',
  2459. smalltalk.method({
  2460. selector: 'printString',
  2461. category: 'printing',
  2462. fn: function (){
  2463. var self=this;
  2464. return smalltalk.send(self, "_asString", []);
  2465. return self;},
  2466. source: unescape('printString%0A%09%5Eself%20asString'),
  2467. messageSends: ["asString"],
  2468. referencedClasses: []
  2469. }),
  2470. smalltalk.Date);
  2471. smalltalk.addMethod(
  2472. '_asMilliseconds',
  2473. smalltalk.method({
  2474. selector: 'asMilliseconds',
  2475. category: 'converting',
  2476. fn: function (){
  2477. var self=this;
  2478. return smalltalk.send(self, "_time", []);
  2479. return self;},
  2480. source: unescape('asMilliseconds%0A%09%5Eself%20time'),
  2481. messageSends: ["time"],
  2482. referencedClasses: []
  2483. }),
  2484. smalltalk.Date);
  2485. smalltalk.addMethod(
  2486. '_time',
  2487. smalltalk.method({
  2488. selector: 'time',
  2489. category: 'accessing',
  2490. fn: function (){
  2491. var self=this;
  2492. return self.getTime();
  2493. return self;},
  2494. source: unescape('time%0A%09%7B%27return%20self.getTime%28%29%27%7D'),
  2495. messageSends: [],
  2496. referencedClasses: []
  2497. }),
  2498. smalltalk.Date);
  2499. smalltalk.addMethod(
  2500. '_time_',
  2501. smalltalk.method({
  2502. selector: 'time:',
  2503. category: 'accessing',
  2504. fn: function (aNumber){
  2505. var self=this;
  2506. self.setTime(aNumber);
  2507. return self;},
  2508. source: unescape('time%3A%20aNumber%0A%09%7B%27self.setTime%28aNumber%29%27%7D'),
  2509. messageSends: [],
  2510. referencedClasses: []
  2511. }),
  2512. smalltalk.Date);
  2513. smalltalk.addMethod(
  2514. '_asDateString',
  2515. smalltalk.method({
  2516. selector: 'asDateString',
  2517. category: 'converting',
  2518. fn: function (){
  2519. var self=this;
  2520. return self.toDateString();
  2521. return self;},
  2522. source: unescape('asDateString%0A%09%7B%27return%20self.toDateString%28%29%27%7D'),
  2523. messageSends: [],
  2524. referencedClasses: []
  2525. }),
  2526. smalltalk.Date);
  2527. smalltalk.addMethod(
  2528. '_asTimeString',
  2529. smalltalk.method({
  2530. selector: 'asTimeString',
  2531. category: 'converting',
  2532. fn: function (){
  2533. var self=this;
  2534. return self.toTimeString();
  2535. return self;},
  2536. source: unescape('asTimeString%0A%09%7B%27return%20self.toTimeString%28%29%27%7D'),
  2537. messageSends: [],
  2538. referencedClasses: []
  2539. }),
  2540. smalltalk.Date);
  2541. smalltalk.addMethod(
  2542. '_asLocaleString',
  2543. smalltalk.method({
  2544. selector: 'asLocaleString',
  2545. category: 'converting',
  2546. fn: function (){
  2547. var self=this;
  2548. return self.toLocaleString();
  2549. return self;},
  2550. source: unescape('asLocaleString%0A%09%7B%27return%20self.toLocaleString%28%29%27%7D'),
  2551. messageSends: [],
  2552. referencedClasses: []
  2553. }),
  2554. smalltalk.Date);
  2555. smalltalk.addMethod(
  2556. '_asNumber',
  2557. smalltalk.method({
  2558. selector: 'asNumber',
  2559. category: 'converting',
  2560. fn: function (){
  2561. var self=this;
  2562. return smalltalk.send(self, "_asMilliseconds", []);
  2563. return self;},
  2564. source: unescape('asNumber%0A%09%5Eself%20asMilliseconds'),
  2565. messageSends: ["asMilliseconds"],
  2566. referencedClasses: []
  2567. }),
  2568. smalltalk.Date);
  2569. smalltalk.addMethod(
  2570. '_hours_',
  2571. smalltalk.method({
  2572. selector: 'hours:',
  2573. category: 'accessing',
  2574. fn: function (aNumber){
  2575. var self=this;
  2576. self.setHours(aNumber);
  2577. return self;},
  2578. source: unescape('hours%3A%20aNumber%0A%09%7B%27self.setHours%28aNumber%29%27%7D'),
  2579. messageSends: [],
  2580. referencedClasses: []
  2581. }),
  2582. smalltalk.Date);
  2583. smalltalk.addMethod(
  2584. '_minutes_',
  2585. smalltalk.method({
  2586. selector: 'minutes:',
  2587. category: 'accessing',
  2588. fn: function (aNumber){
  2589. var self=this;
  2590. self.setMinutes(aNumber);
  2591. return self;},
  2592. source: unescape('minutes%3A%20aNumber%0A%09%7B%27self.setMinutes%28aNumber%29%27%7D'),
  2593. messageSends: [],
  2594. referencedClasses: []
  2595. }),
  2596. smalltalk.Date);
  2597. smalltalk.addMethod(
  2598. '_seconds_',
  2599. smalltalk.method({
  2600. selector: 'seconds:',
  2601. category: 'accessing',
  2602. fn: function (aNumber){
  2603. var self=this;
  2604. self.setSeconds(aNumber);
  2605. return self;},
  2606. source: unescape('seconds%3A%20aNumber%0A%09%7B%27self.setSeconds%28aNumber%29%27%7D'),
  2607. messageSends: [],
  2608. referencedClasses: []
  2609. }),
  2610. smalltalk.Date);
  2611. smalltalk.addMethod(
  2612. '_milliseconds_',
  2613. smalltalk.method({
  2614. selector: 'milliseconds:',
  2615. category: 'accessing',
  2616. fn: function (aNumber){
  2617. var self=this;
  2618. self.setMilliseconds(aNumber);
  2619. return self;},
  2620. source: unescape('milliseconds%3A%20aNumber%0A%09%7B%27self.setMilliseconds%28aNumber%29%27%7D'),
  2621. messageSends: [],
  2622. referencedClasses: []
  2623. }),
  2624. smalltalk.Date);
  2625. smalltalk.addMethod(
  2626. '_hours',
  2627. smalltalk.method({
  2628. selector: 'hours',
  2629. category: 'accessing',
  2630. fn: function (){
  2631. var self=this;
  2632. return self.getHours();
  2633. return self;},
  2634. source: unescape('hours%0A%09%7B%27return%20self.getHours%28%29%27%7D'),
  2635. messageSends: [],
  2636. referencedClasses: []
  2637. }),
  2638. smalltalk.Date);
  2639. smalltalk.addMethod(
  2640. '_minutes',
  2641. smalltalk.method({
  2642. selector: 'minutes',
  2643. category: 'accessing',
  2644. fn: function (){
  2645. var self=this;
  2646. return self.getMinutes();
  2647. return self;},
  2648. source: unescape('minutes%0A%09%7B%27return%20self.getMinutes%28%29%27%7D'),
  2649. messageSends: [],
  2650. referencedClasses: []
  2651. }),
  2652. smalltalk.Date);
  2653. smalltalk.addMethod(
  2654. '_seconds',
  2655. smalltalk.method({
  2656. selector: 'seconds',
  2657. category: 'accessing',
  2658. fn: function (){
  2659. var self=this;
  2660. return self.getSeconds();
  2661. return self;},
  2662. source: unescape('seconds%0A%09%7B%27return%20self.getSeconds%28%29%27%7D'),
  2663. messageSends: [],
  2664. referencedClasses: []
  2665. }),
  2666. smalltalk.Date);
  2667. smalltalk.addMethod(
  2668. '_milliseconds',
  2669. smalltalk.method({
  2670. selector: 'milliseconds',
  2671. category: 'accessing',
  2672. fn: function (){
  2673. var self=this;
  2674. return self.getMilliseconds();
  2675. return self;},
  2676. source: unescape('milliseconds%0A%09%7B%27return%20self.getMilliseconds%28%29%27%7D'),
  2677. messageSends: [],
  2678. referencedClasses: []
  2679. }),
  2680. smalltalk.Date);
  2681. smalltalk.addMethod(
  2682. '__lt',
  2683. smalltalk.method({
  2684. selector: '<',
  2685. category: 'comparing',
  2686. fn: function (aDate){
  2687. var self=this;
  2688. return self < aDate;
  2689. return self;},
  2690. source: unescape('%3C%20aDate%0A%09%7B%27return%20self%20%3C%20aDate%27%7D'),
  2691. messageSends: [],
  2692. referencedClasses: []
  2693. }),
  2694. smalltalk.Date);
  2695. smalltalk.addMethod(
  2696. '__gt',
  2697. smalltalk.method({
  2698. selector: '>',
  2699. category: 'comparing',
  2700. fn: function (aDate){
  2701. var self=this;
  2702. return self > aDate;
  2703. return self;},
  2704. source: unescape('%3E%20aDate%0A%09%7B%27return%20self%20%3E%20aDate%27%7D'),
  2705. messageSends: [],
  2706. referencedClasses: []
  2707. }),
  2708. smalltalk.Date);
  2709. smalltalk.addMethod(
  2710. '__lt_eq',
  2711. smalltalk.method({
  2712. selector: '<=',
  2713. category: 'comparing',
  2714. fn: function (aDate){
  2715. var self=this;
  2716. self <= aDate;
  2717. return self;},
  2718. source: unescape('%3C%3D%20aDate%0A%09%7B%27self%20%3C%3D%20aDate%27%7D'),
  2719. messageSends: [],
  2720. referencedClasses: []
  2721. }),
  2722. smalltalk.Date);
  2723. smalltalk.addMethod(
  2724. '__gt_eq',
  2725. smalltalk.method({
  2726. selector: '>=',
  2727. category: 'comparing',
  2728. fn: function (aDate){
  2729. var self=this;
  2730. self >= aDate;
  2731. return self;},
  2732. source: unescape('%3E%3D%20aDate%0A%09%7B%27self%20%3E%3D%20aDate%27%7D'),
  2733. messageSends: [],
  2734. referencedClasses: []
  2735. }),
  2736. smalltalk.Date);
  2737. smalltalk.addMethod(
  2738. '__minus',
  2739. smalltalk.method({
  2740. selector: '-',
  2741. category: 'arithmetic',
  2742. fn: function (aDate){
  2743. var self=this;
  2744. return self - aDate;
  2745. return self;},
  2746. source: unescape('-%20aDate%0A%09%7B%27return%20self%20-%20aDate%27%7D'),
  2747. messageSends: [],
  2748. referencedClasses: []
  2749. }),
  2750. smalltalk.Date);
  2751. smalltalk.addMethod(
  2752. '__plus',
  2753. smalltalk.method({
  2754. selector: '+',
  2755. category: 'arithmetic',
  2756. fn: function (aDate){
  2757. var self=this;
  2758. return self + aDate;
  2759. return self;},
  2760. source: unescape('+%20aDate%0A%09%7B%27return%20self%20+%20aDate%27%7D'),
  2761. messageSends: [],
  2762. referencedClasses: []
  2763. }),
  2764. smalltalk.Date);
  2765. smalltalk.addMethod(
  2766. '_asJSONObject',
  2767. smalltalk.method({
  2768. selector: 'asJSONObject',
  2769. category: 'converting',
  2770. fn: function (){
  2771. var self=this;
  2772. return self;
  2773. return self;},
  2774. source: unescape('asJSONObject%0A%09%5Eself'),
  2775. messageSends: [],
  2776. referencedClasses: []
  2777. }),
  2778. smalltalk.Date);
  2779. smalltalk.addMethod(
  2780. '_new_',
  2781. smalltalk.method({
  2782. selector: 'new:',
  2783. category: 'instance creation',
  2784. fn: function (anObject){
  2785. var self=this;
  2786. return new Date(anObject);
  2787. return self;},
  2788. source: unescape('new%3A%20anObject%0A%09%7B%27return%20new%20Date%28anObject%29%27%7D'),
  2789. messageSends: [],
  2790. referencedClasses: []
  2791. }),
  2792. smalltalk.Date.klass);
  2793. smalltalk.addMethod(
  2794. '_fromString_',
  2795. smalltalk.method({
  2796. selector: 'fromString:',
  2797. category: 'instance creation',
  2798. fn: function (aString){
  2799. var self=this;
  2800. return smalltalk.send(self, "_new_", [aString]);
  2801. return self;},
  2802. source: unescape('fromString%3A%20aString%0A%09%22Example%3A%20Date%20fromString%28%272011/04/15%2000%3A00%3A00%27%29%22%0A%09%5Eself%20new%3A%20aString'),
  2803. messageSends: ["new:"],
  2804. referencedClasses: []
  2805. }),
  2806. smalltalk.Date.klass);
  2807. smalltalk.addMethod(
  2808. '_fromSeconds_',
  2809. smalltalk.method({
  2810. selector: 'fromSeconds:',
  2811. category: 'instance creation',
  2812. fn: function (aNumber){
  2813. var self=this;
  2814. return smalltalk.send(self, "_fromMilliseconds_", [smalltalk.send(aNumber, "__star", [(1000)])]);
  2815. return self;},
  2816. source: unescape('fromSeconds%3A%20aNumber%0A%09%5Eself%20fromMilliseconds%3A%20aNumber%20*%201000'),
  2817. messageSends: ["fromMilliseconds:", unescape("*")],
  2818. referencedClasses: []
  2819. }),
  2820. smalltalk.Date.klass);
  2821. smalltalk.addMethod(
  2822. '_fromMilliseconds_',
  2823. smalltalk.method({
  2824. selector: 'fromMilliseconds:',
  2825. category: 'instance creation',
  2826. fn: function (aNumber){
  2827. var self=this;
  2828. return smalltalk.send(self, "_new_", [aNumber]);
  2829. return self;},
  2830. source: unescape('fromMilliseconds%3A%20aNumber%0A%09%5Eself%20new%3A%20aNumber'),
  2831. messageSends: ["new:"],
  2832. referencedClasses: []
  2833. }),
  2834. smalltalk.Date.klass);
  2835. smalltalk.addMethod(
  2836. '_today',
  2837. smalltalk.method({
  2838. selector: 'today',
  2839. category: 'instance creation',
  2840. fn: function (){
  2841. var self=this;
  2842. return smalltalk.send(self, "_new", []);
  2843. return self;},
  2844. source: unescape('today%0A%09%5Eself%20new'),
  2845. messageSends: ["new"],
  2846. referencedClasses: []
  2847. }),
  2848. smalltalk.Date.klass);
  2849. smalltalk.addMethod(
  2850. '_now',
  2851. smalltalk.method({
  2852. selector: 'now',
  2853. category: 'instance creation',
  2854. fn: function (){
  2855. var self=this;
  2856. return smalltalk.send(self, "_today", []);
  2857. return self;},
  2858. source: unescape('now%0A%09%5Eself%20today'),
  2859. messageSends: ["today"],
  2860. referencedClasses: []
  2861. }),
  2862. smalltalk.Date.klass);
  2863. smalltalk.addMethod(
  2864. '_millisecondsToRun_',
  2865. smalltalk.method({
  2866. selector: 'millisecondsToRun:',
  2867. category: 'instance creation',
  2868. fn: function (aBlock){
  2869. var self=this;
  2870. var t=nil;
  2871. t=smalltalk.send(smalltalk.Date, "_now", []);
  2872. smalltalk.send(aBlock, "_value", []);
  2873. return smalltalk.send(smalltalk.send(smalltalk.Date, "_now", []), "__minus", [t]);
  2874. return self;},
  2875. source: unescape('millisecondsToRun%3A%20aBlock%0A%09%7C%20t%20%7C%0A%09t%20%3A%3D%20Date%20now.%0A%09aBlock%20value.%0A%09%5EDate%20now%20-%20t'),
  2876. messageSends: ["now", "value", unescape("-")],
  2877. referencedClasses: [smalltalk.Date]
  2878. }),
  2879. smalltalk.Date.klass);
  2880. smalltalk.addClass('UndefinedObject', smalltalk.Object, [], 'Kernel');
  2881. smalltalk.addMethod(
  2882. '_subclass_instanceVariableNames_',
  2883. smalltalk.method({
  2884. selector: 'subclass:instanceVariableNames:',
  2885. category: 'class creation',
  2886. fn: function (aString, anotherString){
  2887. var self=this;
  2888. return smalltalk.send(self, "_subclass_instanceVariableNames_category_", [aString, anotherString, nil]);
  2889. return self;},
  2890. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%0A%09%5Eself%20subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%20category%3A%20nil%0A'),
  2891. messageSends: ["subclass:instanceVariableNames:category:"],
  2892. referencedClasses: []
  2893. }),
  2894. smalltalk.UndefinedObject);
  2895. smalltalk.addMethod(
  2896. '_subclass_instanceVariableNames_category_',
  2897. smalltalk.method({
  2898. selector: 'subclass:instanceVariableNames:category:',
  2899. category: 'class creation',
  2900. fn: function (aString, aString2, aString3){
  2901. var self=this;
  2902. return smalltalk.send(smalltalk.send(smalltalk.ClassBuilder, "_new", []), "_superclass_subclass_instanceVariableNames_category_", [self, aString, aString2, aString3]);
  2903. return self;},
  2904. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20category%3A%20aString3%0A%09%5EClassBuilder%20new%0A%09%20%20%20%20superclass%3A%20self%20subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20category%3A%20aString3%0A'),
  2905. messageSends: ["superclass:subclass:instanceVariableNames:category:", "new"],
  2906. referencedClasses: [smalltalk.ClassBuilder]
  2907. }),
  2908. smalltalk.UndefinedObject);
  2909. smalltalk.addMethod(
  2910. '_shallowCopy',
  2911. smalltalk.method({
  2912. selector: 'shallowCopy',
  2913. category: 'copying',
  2914. fn: function (){
  2915. var self=this;
  2916. return self;
  2917. return self;},
  2918. source: unescape('shallowCopy%0A%09%5Eself%0A'),
  2919. messageSends: [],
  2920. referencedClasses: []
  2921. }),
  2922. smalltalk.UndefinedObject);
  2923. smalltalk.addMethod(
  2924. '_deepCopy',
  2925. smalltalk.method({
  2926. selector: 'deepCopy',
  2927. category: 'copying',
  2928. fn: function (){
  2929. var self=this;
  2930. return self;
  2931. return self;},
  2932. source: unescape('deepCopy%0A%09%5Eself%0A'),
  2933. messageSends: [],
  2934. referencedClasses: []
  2935. }),
  2936. smalltalk.UndefinedObject);
  2937. smalltalk.addMethod(
  2938. '_ifNil_',
  2939. smalltalk.method({
  2940. selector: 'ifNil:',
  2941. category: 'testing',
  2942. fn: function (aBlock){
  2943. var self=this;
  2944. return smalltalk.send(self, "_ifNil_ifNotNil_", [aBlock, (function(){return nil;})]);
  2945. return self;},
  2946. source: unescape('ifNil%3A%20aBlock%0A%09%5Eself%20ifNil%3A%20aBlock%20ifNotNil%3A%20%5B%5D%0A'),
  2947. messageSends: ["ifNil:ifNotNil:"],
  2948. referencedClasses: []
  2949. }),
  2950. smalltalk.UndefinedObject);
  2951. smalltalk.addMethod(
  2952. '_ifNotNil_',
  2953. smalltalk.method({
  2954. selector: 'ifNotNil:',
  2955. category: 'testing',
  2956. fn: function (aBlock){
  2957. var self=this;
  2958. return self;
  2959. return self;},
  2960. source: unescape('ifNotNil%3A%20aBlock%0A%09%5Eself%0A'),
  2961. messageSends: [],
  2962. referencedClasses: []
  2963. }),
  2964. smalltalk.UndefinedObject);
  2965. smalltalk.addMethod(
  2966. '_ifNil_ifNotNil_',
  2967. smalltalk.method({
  2968. selector: 'ifNil:ifNotNil:',
  2969. category: 'testing',
  2970. fn: function (aBlock, anotherBlock){
  2971. var self=this;
  2972. return smalltalk.send(aBlock, "_value", []);
  2973. return self;},
  2974. source: unescape('ifNil%3A%20aBlock%20ifNotNil%3A%20anotherBlock%0A%09%5EaBlock%20value%0A'),
  2975. messageSends: ["value"],
  2976. referencedClasses: []
  2977. }),
  2978. smalltalk.UndefinedObject);
  2979. smalltalk.addMethod(
  2980. '_ifNotNil_ifNil_',
  2981. smalltalk.method({
  2982. selector: 'ifNotNil:ifNil:',
  2983. category: 'testing',
  2984. fn: function (aBlock, anotherBlock){
  2985. var self=this;
  2986. return smalltalk.send(anotherBlock, "_value", []);
  2987. return self;},
  2988. source: unescape('ifNotNil%3A%20aBlock%20ifNil%3A%20anotherBlock%0A%09%5EanotherBlock%20value%0A'),
  2989. messageSends: ["value"],
  2990. referencedClasses: []
  2991. }),
  2992. smalltalk.UndefinedObject);
  2993. smalltalk.addMethod(
  2994. '_isNil',
  2995. smalltalk.method({
  2996. selector: 'isNil',
  2997. category: 'testing',
  2998. fn: function (){
  2999. var self=this;
  3000. return true;
  3001. return self;},
  3002. source: unescape('isNil%0A%09%5Etrue%0A'),
  3003. messageSends: [],
  3004. referencedClasses: []
  3005. }),
  3006. smalltalk.UndefinedObject);
  3007. smalltalk.addMethod(
  3008. '_notNil',
  3009. smalltalk.method({
  3010. selector: 'notNil',
  3011. category: 'testing',
  3012. fn: function (){
  3013. var self=this;
  3014. return false;
  3015. return self;},
  3016. source: unescape('notNil%0A%09%5Efalse%0A'),
  3017. messageSends: [],
  3018. referencedClasses: []
  3019. }),
  3020. smalltalk.UndefinedObject);
  3021. smalltalk.addMethod(
  3022. '_printString',
  3023. smalltalk.method({
  3024. selector: 'printString',
  3025. category: 'printing',
  3026. fn: function (){
  3027. var self=this;
  3028. return "nil";
  3029. return self;},
  3030. source: unescape('printString%0A%20%20%20%20%5E%27nil%27%0A'),
  3031. messageSends: [],
  3032. referencedClasses: []
  3033. }),
  3034. smalltalk.UndefinedObject);
  3035. smalltalk.addMethod(
  3036. '_new',
  3037. smalltalk.method({
  3038. selector: 'new',
  3039. category: 'instance creation',
  3040. fn: function (){
  3041. var self=this;
  3042. smalltalk.send(self, "_error_", ["You cannot create new instances of UndefinedObject. Use nil"]);
  3043. return self;},
  3044. source: unescape('new%0A%09%20%20%20%20self%20error%3A%20%27You%20cannot%20create%20new%20instances%20of%20UndefinedObject.%20Use%20nil%27%0A'),
  3045. messageSends: ["error:"],
  3046. referencedClasses: []
  3047. }),
  3048. smalltalk.UndefinedObject.klass);
  3049. smalltalk.addClass('Collection', smalltalk.Object, [], 'Kernel');
  3050. smalltalk.addMethod(
  3051. '_size',
  3052. smalltalk.method({
  3053. selector: 'size',
  3054. category: 'accessing',
  3055. fn: function (){
  3056. var self=this;
  3057. smalltalk.send(self, "_subclassResponsibility", []);
  3058. return self;},
  3059. source: unescape('size%0A%09self%20subclassResponsibility%0A'),
  3060. messageSends: ["subclassResponsibility"],
  3061. referencedClasses: []
  3062. }),
  3063. smalltalk.Collection);
  3064. smalltalk.addMethod(
  3065. '_readStream',
  3066. smalltalk.method({
  3067. selector: 'readStream',
  3068. category: 'accessing',
  3069. fn: function (){
  3070. var self=this;
  3071. return smalltalk.send(self, "_stream", []);
  3072. return self;},
  3073. source: unescape('readStream%0A%09%5Eself%20stream%0A'),
  3074. messageSends: ["stream"],
  3075. referencedClasses: []
  3076. }),
  3077. smalltalk.Collection);
  3078. smalltalk.addMethod(
  3079. '_writeStream',
  3080. smalltalk.method({
  3081. selector: 'writeStream',
  3082. category: 'accessing',
  3083. fn: function (){
  3084. var self=this;
  3085. return smalltalk.send(self, "_stream", []);
  3086. return self;},
  3087. source: unescape('writeStream%0A%09%5Eself%20stream%0A'),
  3088. messageSends: ["stream"],
  3089. referencedClasses: []
  3090. }),
  3091. smalltalk.Collection);
  3092. smalltalk.addMethod(
  3093. '_stream',
  3094. smalltalk.method({
  3095. selector: 'stream',
  3096. category: 'accessing',
  3097. fn: function (){
  3098. var self=this;
  3099. return smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [self]);
  3100. return self;},
  3101. source: unescape('stream%0A%09%5Eself%20streamClass%20on%3A%20self%0A'),
  3102. messageSends: ["on:", "streamClass"],
  3103. referencedClasses: []
  3104. }),
  3105. smalltalk.Collection);
  3106. smalltalk.addMethod(
  3107. '_streamClass',
  3108. smalltalk.method({
  3109. selector: 'streamClass',
  3110. category: 'accessing',
  3111. fn: function (){
  3112. var self=this;
  3113. return smalltalk.send(smalltalk.send(self, "_class", []), "_streamClass", []);
  3114. return self;},
  3115. source: unescape('streamClass%0A%09%5Eself%20class%20streamClass%0A'),
  3116. messageSends: ["streamClass", "class"],
  3117. referencedClasses: []
  3118. }),
  3119. smalltalk.Collection);
  3120. smalltalk.addMethod(
  3121. '_add_',
  3122. smalltalk.method({
  3123. selector: 'add:',
  3124. category: 'adding/removing',
  3125. fn: function (anObject){
  3126. var self=this;
  3127. smalltalk.send(self, "_subclassResponsibility", []);
  3128. return self;},
  3129. source: unescape('add%3A%20anObject%0A%09self%20subclassResponsibility%0A'),
  3130. messageSends: ["subclassResponsibility"],
  3131. referencedClasses: []
  3132. }),
  3133. smalltalk.Collection);
  3134. smalltalk.addMethod(
  3135. '_addAll_',
  3136. smalltalk.method({
  3137. selector: 'addAll:',
  3138. category: 'adding/removing',
  3139. fn: function (aCollection){
  3140. var self=this;
  3141. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_add_", [each]);})]);
  3142. return aCollection;
  3143. return self;},
  3144. source: unescape('addAll%3A%20aCollection%0A%09aCollection%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20self%20add%3A%20each%5D.%0A%09%5EaCollection%0A'),
  3145. messageSends: ["do:", "add:"],
  3146. referencedClasses: []
  3147. }),
  3148. smalltalk.Collection);
  3149. smalltalk.addMethod(
  3150. '__comma',
  3151. smalltalk.method({
  3152. selector: ',',
  3153. category: 'copying',
  3154. fn: function (aCollection){
  3155. var self=this;
  3156. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  3157. return self;},
  3158. source: unescape('%2C%20aCollection%0A%09%5Eself%20copy%20%0A%09%20%20%20%20addAll%3A%20aCollection%3B%20%0A%09%20%20%20%20yourself%0A'),
  3159. messageSends: ["addAll:", "yourself", "copy"],
  3160. referencedClasses: []
  3161. }),
  3162. smalltalk.Collection);
  3163. smalltalk.addMethod(
  3164. '_copyWith_',
  3165. smalltalk.method({
  3166. selector: 'copyWith:',
  3167. category: 'copying',
  3168. fn: function (anObject){
  3169. var self=this;
  3170. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  3171. return self;},
  3172. source: unescape('copyWith%3A%20anObject%0A%09%5Eself%20copy%20add%3A%20anObject%3B%20yourself%0A'),
  3173. messageSends: ["add:", "yourself", "copy"],
  3174. referencedClasses: []
  3175. }),
  3176. smalltalk.Collection);
  3177. smalltalk.addMethod(
  3178. '_copyWithAll_',
  3179. smalltalk.method({
  3180. selector: 'copyWithAll:',
  3181. category: 'copying',
  3182. fn: function (aCollection){
  3183. var self=this;
  3184. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  3185. return self;},
  3186. source: unescape('copyWithAll%3A%20aCollection%0A%09%5Eself%20copy%20addAll%3A%20aCollection%3B%20yourself%0A'),
  3187. messageSends: ["addAll:", "yourself", "copy"],
  3188. referencedClasses: []
  3189. }),
  3190. smalltalk.Collection);
  3191. smalltalk.addMethod(
  3192. '_asArray',
  3193. smalltalk.method({
  3194. selector: 'asArray',
  3195. category: 'converting',
  3196. fn: function (){
  3197. var self=this;
  3198. var array=nil;
  3199. var index=nil;
  3200. array=smalltalk.send(smalltalk.Array, "_new", []);
  3201. index=(0);
  3202. smalltalk.send(self, "_do_", [(function(each){index=smalltalk.send(index, "__plus", [(1)]);return smalltalk.send(array, "_at_put_", [index, each]);})]);
  3203. return array;
  3204. return self;},
  3205. source: unescape('asArray%0A%09%7C%20array%20index%20%7C%0A%09array%20%3A%3D%20Array%20new.%0A%09index%20%3A%3D%200.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20index%20%3A%3D%20index%20+%201.%0A%09%20%20%20%20array%20at%3A%20index%20put%3A%20each%5D.%0A%09%5Earray%0A'),
  3206. messageSends: ["new", "do:", unescape("+"), "at:put:"],
  3207. referencedClasses: [smalltalk.Array]
  3208. }),
  3209. smalltalk.Collection);
  3210. smalltalk.addMethod(
  3211. '_do_',
  3212. smalltalk.method({
  3213. selector: 'do:',
  3214. category: 'enumerating',
  3215. fn: function (aBlock){
  3216. var self=this;
  3217. for(var i=0;i<self.length;i++){aBlock(self[i]);};
  3218. return self;},
  3219. source: unescape('do%3A%20aBlock%0A%09%7B%27for%28var%20i%3D0%3Bi%3Cself.length%3Bi++%29%7BaBlock%28self%5Bi%5D%29%3B%7D%27%7D%0A'),
  3220. messageSends: [],
  3221. referencedClasses: []
  3222. }),
  3223. smalltalk.Collection);
  3224. smalltalk.addMethod(
  3225. '_collect_',
  3226. smalltalk.method({
  3227. selector: 'collect:',
  3228. category: 'enumerating',
  3229. fn: function (aBlock){
  3230. var self=this;
  3231. var newCollection=nil;
  3232. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  3233. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [smalltalk.send(aBlock, "_value_", [each])]);})]);
  3234. return newCollection;
  3235. return self;},
  3236. source: unescape('collect%3A%20aBlock%0A%09%7C%20newCollection%20%7C%0A%09newCollection%20%3A%3D%20self%20class%20new.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20newCollection%20add%3A%20%28aBlock%20value%3A%20each%29%5D.%0A%09%5EnewCollection%0A'),
  3237. messageSends: ["new", "class", "do:", "add:", "value:"],
  3238. referencedClasses: []
  3239. }),
  3240. smalltalk.Collection);
  3241. smalltalk.addMethod(
  3242. '_detect_',
  3243. smalltalk.method({
  3244. selector: 'detect:',
  3245. category: 'enumerating',
  3246. fn: function (aBlock){
  3247. var self=this;
  3248. return smalltalk.send(self, "_detect_ifNone_", [aBlock, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  3249. return self;},
  3250. source: unescape('detect%3A%20aBlock%0A%09%5Eself%20detect%3A%20aBlock%20ifNone%3A%20%5Bself%20errorNotFound%5D%0A'),
  3251. messageSends: ["detect:ifNone:", "errorNotFound"],
  3252. referencedClasses: []
  3253. }),
  3254. smalltalk.Collection);
  3255. smalltalk.addMethod(
  3256. '_detect_ifNone_',
  3257. smalltalk.method({
  3258. selector: 'detect:ifNone:',
  3259. category: 'enumerating',
  3260. fn: function (aBlock, anotherBlock){
  3261. var self=this;
  3262. for(var i = 0; i < self.length; i++)
  3263. if(aBlock(self[i]))
  3264. return self[i];
  3265. return anotherBlock();
  3266. ;
  3267. return self;},
  3268. source: unescape('detect%3A%20aBlock%20ifNone%3A%20anotherBlock%0A%09%7B%27%0A%09%09for%28var%20i%20%3D%200%3B%20i%20%3C%20self.length%3B%20i++%29%0A%09%09%09if%28aBlock%28self%5Bi%5D%29%29%0A%09%09%09%09return%20self%5Bi%5D%3B%0A%09%09return%20anotherBlock%28%29%3B%0A%09%27%7D'),
  3269. messageSends: [],
  3270. referencedClasses: []
  3271. }),
  3272. smalltalk.Collection);
  3273. smalltalk.addMethod(
  3274. '_do_separatedBy_',
  3275. smalltalk.method({
  3276. selector: 'do:separatedBy:',
  3277. category: 'enumerating',
  3278. fn: function (aBlock, anotherBlock){
  3279. var self=this;
  3280. var first=nil;
  3281. first=true;
  3282. smalltalk.send(self, "_do_", [(function(each){smalltalk.send(first, "_ifTrue_ifFalse_", [(function(){return first=false;}), (function(){return smalltalk.send(anotherBlock, "_value", []);})]);return smalltalk.send(aBlock, "_value_", [each]);})]);
  3283. return self;},
  3284. source: unescape('do%3A%20aBlock%20separatedBy%3A%20anotherBlock%0A%20%20%20%20%09%7C%20first%20%7C%0A%20%20%20%20%09first%20%3A%3D%20true.%0A%20%20%20%20%09self%20do%3A%20%5B%3Aeach%20%7C%0A%20%20%20%20%09%20%20%20%20first%0A%20%20%20%20%09%09ifTrue%3A%20%5Bfirst%20%3A%3D%20false%5D%0A%20%20%20%20%09%09ifFalse%3A%20%5BanotherBlock%20value%5D.%0A%20%20%20%20%09%20%20%20%20aBlock%20value%3A%20each%5D%0A'),
  3285. messageSends: ["do:", "ifTrue:ifFalse:", "value", "value:"],
  3286. referencedClasses: []
  3287. }),
  3288. smalltalk.Collection);
  3289. smalltalk.addMethod(
  3290. '_inject_into_',
  3291. smalltalk.method({
  3292. selector: 'inject:into:',
  3293. category: 'enumerating',
  3294. fn: function (anObject, aBlock){
  3295. var self=this;
  3296. var result=nil;
  3297. result=anObject;
  3298. smalltalk.send(self, "_do_", [(function(each){return result=smalltalk.send(aBlock, "_value_value_", [result, each]);})]);
  3299. return result;
  3300. return self;},
  3301. source: unescape('inject%3A%20anObject%20into%3A%20aBlock%0A%09%7C%20result%20%7C%0A%09result%20%3A%3D%20anObject.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%20%0A%09%20%20%20%20result%20%3A%3D%20aBlock%20value%3A%20result%20value%3A%20each%5D.%0A%09%5Eresult%0A'),
  3302. messageSends: ["do:", "value:value:"],
  3303. referencedClasses: []
  3304. }),
  3305. smalltalk.Collection);
  3306. smalltalk.addMethod(
  3307. '_reject_',
  3308. smalltalk.method({
  3309. selector: 'reject:',
  3310. category: 'enumerating',
  3311. fn: function (aBlock){
  3312. var self=this;
  3313. return smalltalk.send(self, "_select_", [(function(each){return smalltalk.send(smalltalk.send(aBlock, "_value_", [each]), "__eq", [false]);})]);
  3314. return self;},
  3315. source: unescape('reject%3A%20aBlock%0A%09%5Eself%20select%3A%20%5B%3Aeach%20%7C%20%28aBlock%20value%3A%20each%29%20%3D%20false%5D%0A'),
  3316. messageSends: ["select:", unescape("%3D"), "value:"],
  3317. referencedClasses: []
  3318. }),
  3319. smalltalk.Collection);
  3320. smalltalk.addMethod(
  3321. '_select_',
  3322. smalltalk.method({
  3323. selector: 'select:',
  3324. category: 'enumerating',
  3325. fn: function (aBlock){
  3326. var self=this;
  3327. var stream=nil;
  3328. stream=smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_new", []), "_writeStream", []);
  3329. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(smalltalk.send(aBlock, "_value_", [each]), "_ifTrue_", [(function(){return smalltalk.send(stream, "_nextPut_", [each]);})]);})]);
  3330. return smalltalk.send(stream, "_contents", []);
  3331. return self;},
  3332. source: unescape('select%3A%20aBlock%0A%09%7C%20stream%20%7C%0A%09stream%20%3A%3D%20self%20class%20new%20writeStream.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20%28aBlock%20value%3A%20each%29%20ifTrue%3A%20%5B%0A%09%09stream%20nextPut%3A%20each%5D%5D.%0A%09%5Estream%20contents%0A'),
  3333. messageSends: ["writeStream", "new", "class", "do:", "ifTrue:", "value:", "nextPut:", "contents"],
  3334. referencedClasses: []
  3335. }),
  3336. smalltalk.Collection);
  3337. smalltalk.addMethod(
  3338. '_errorNotFound',
  3339. smalltalk.method({
  3340. selector: 'errorNotFound',
  3341. category: 'error handling',
  3342. fn: function (){
  3343. var self=this;
  3344. smalltalk.send(self, "_error_", ["Object is not in the collection"]);
  3345. return self;},
  3346. source: unescape('errorNotFound%0A%09self%20error%3A%20%27Object%20is%20not%20in%20the%20collection%27%0A'),
  3347. messageSends: ["error:"],
  3348. referencedClasses: []
  3349. }),
  3350. smalltalk.Collection);
  3351. smalltalk.addMethod(
  3352. '_includes_',
  3353. smalltalk.method({
  3354. selector: 'includes:',
  3355. category: 'testing',
  3356. fn: function (anObject){
  3357. var self=this;
  3358. var i = self.length;
  3359. while (i--) {
  3360. if (smalltalk.send(self[i], "__eq", [anObject])) {return true;}
  3361. }
  3362. return false
  3363. ;
  3364. return self;},
  3365. source: unescape('includes%3A%20anObject%0A%09%7B%27%0A%09%09var%20i%20%3D%20self.length%3B%0A%09%09while%20%28i--%29%20%7B%0A%09%09%09if%20%28smalltalk.send%28self%5Bi%5D%2C%20%22__eq%22%2C%20%5BanObject%5D%29%29%20%7Breturn%20true%3B%7D%09%0A%09%09%7D%0A%09%09return%20false%0A%09%27%7D%0A'),
  3366. messageSends: [],
  3367. referencedClasses: []
  3368. }),
  3369. smalltalk.Collection);
  3370. smalltalk.addMethod(
  3371. '_notEmpty',
  3372. smalltalk.method({
  3373. selector: 'notEmpty',
  3374. category: 'testing',
  3375. fn: function (){
  3376. var self=this;
  3377. return smalltalk.send(smalltalk.send(self, "_isEmpty", []), "_not", []);
  3378. return self;},
  3379. source: unescape('notEmpty%0A%09%5Eself%20isEmpty%20not%0A'),
  3380. messageSends: ["not", "isEmpty"],
  3381. referencedClasses: []
  3382. }),
  3383. smalltalk.Collection);
  3384. smalltalk.addMethod(
  3385. '_isEmpty',
  3386. smalltalk.method({
  3387. selector: 'isEmpty',
  3388. category: 'testing',
  3389. fn: function (){
  3390. var self=this;
  3391. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
  3392. return self;},
  3393. source: unescape('isEmpty%0A%09%5Eself%20size%20%3D%200%0A'),
  3394. messageSends: [unescape("%3D"), "size"],
  3395. referencedClasses: []
  3396. }),
  3397. smalltalk.Collection);
  3398. smalltalk.addMethod(
  3399. '_remove_',
  3400. smalltalk.method({
  3401. selector: 'remove:',
  3402. category: 'adding/removing',
  3403. fn: function (anObject){
  3404. var self=this;
  3405. smalltalk.send(self, "_subclassResponsibility", []);
  3406. return self;},
  3407. source: unescape('remove%3A%20anObject%0A%20%20%20%20self%20subclassResponsibility%0A'),
  3408. messageSends: ["subclassResponsibility"],
  3409. referencedClasses: []
  3410. }),
  3411. smalltalk.Collection);
  3412. smalltalk.addMethod(
  3413. '_streamClass',
  3414. smalltalk.method({
  3415. selector: 'streamClass',
  3416. category: 'accessing',
  3417. fn: function (){
  3418. var self=this;
  3419. return smalltalk.Stream;
  3420. return self;},
  3421. source: unescape('streamClass%0A%09%20%20%20%20%5EStream%0A'),
  3422. messageSends: [],
  3423. referencedClasses: [smalltalk.Stream]
  3424. }),
  3425. smalltalk.Collection.klass);
  3426. smalltalk.addMethod(
  3427. '_with_',
  3428. smalltalk.method({
  3429. selector: 'with:',
  3430. category: 'instance creation',
  3431. fn: function (anObject){
  3432. var self=this;
  3433. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  3434. return self;},
  3435. source: unescape('with%3A%20anObject%0A%09%20%20%20%20%5Eself%20new%0A%09%09add%3A%20anObject%3B%0A%09%09yourself%0A'),
  3436. messageSends: ["add:", "yourself", "new"],
  3437. referencedClasses: []
  3438. }),
  3439. smalltalk.Collection.klass);
  3440. smalltalk.addMethod(
  3441. '_with_with_',
  3442. smalltalk.method({
  3443. selector: 'with:with:',
  3444. category: 'instance creation',
  3445. fn: function (anObject, anotherObject){
  3446. var self=this;
  3447. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);smalltalk.send($rec, "_add_", [anotherObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  3448. return self;},
  3449. source: unescape('with%3A%20anObject%20with%3A%20anotherObject%0A%09%20%20%20%20%5Eself%20new%0A%09%09add%3A%20anObject%3B%0A%09%09add%3A%20anotherObject%3B%0A%09%09yourself%0A'),
  3450. messageSends: ["add:", "yourself", "new"],
  3451. referencedClasses: []
  3452. }),
  3453. smalltalk.Collection.klass);
  3454. smalltalk.addMethod(
  3455. '_with_with_with_',
  3456. smalltalk.method({
  3457. selector: 'with:with:with:',
  3458. category: 'instance creation',
  3459. fn: function (firstObject, secondObject, thirdObject){
  3460. var self=this;
  3461. 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", []));
  3462. return self;},
  3463. source: unescape('with%3A%20firstObject%20with%3A%20secondObject%20with%3A%20thirdObject%0A%09%20%20%20%20%5Eself%20new%0A%09%09add%3A%20firstObject%3B%0A%09%09add%3A%20secondObject%3B%0A%09%09add%3A%20thirdObject%3B%0A%09%09yourself%0A'),
  3464. messageSends: ["add:", "yourself", "new"],
  3465. referencedClasses: []
  3466. }),
  3467. smalltalk.Collection.klass);
  3468. smalltalk.addMethod(
  3469. '_withAll_',
  3470. smalltalk.method({
  3471. selector: 'withAll:',
  3472. category: 'instance creation',
  3473. fn: function (aCollection){
  3474. var self=this;
  3475. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  3476. return self;},
  3477. source: unescape('withAll%3A%20aCollection%0A%09%20%20%20%20%5Eself%20new%0A%09%09addAll%3A%20aCollection%3B%0A%09%09yourself%0A'),
  3478. messageSends: ["addAll:", "yourself", "new"],
  3479. referencedClasses: []
  3480. }),
  3481. smalltalk.Collection.klass);
  3482. smalltalk.addClass('SequenceableCollection', smalltalk.Collection, [], 'Kernel');
  3483. smalltalk.addMethod(
  3484. '_at_',
  3485. smalltalk.method({
  3486. selector: 'at:',
  3487. category: 'accessing',
  3488. fn: function (anIndex){
  3489. var self=this;
  3490. return smalltalk.send(self, "_at_ifAbsent_", [anIndex, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  3491. return self;},
  3492. source: unescape('at%3A%20anIndex%0A%09%5Eself%20at%3A%20anIndex%20ifAbsent%3A%20%5B%0A%09%20%20%20%20self%20errorNotFound%5D%0A'),
  3493. messageSends: ["at:ifAbsent:", "errorNotFound"],
  3494. referencedClasses: []
  3495. }),
  3496. smalltalk.SequenceableCollection);
  3497. smalltalk.addMethod(
  3498. '_at_ifAbsent_',
  3499. smalltalk.method({
  3500. selector: 'at:ifAbsent:',
  3501. category: 'accessing',
  3502. fn: function (anIndex, aBlock){
  3503. var self=this;
  3504. smalltalk.send(self, "_subclassResponsibility", []);
  3505. return self;},
  3506. source: unescape('at%3A%20anIndex%20ifAbsent%3A%20aBlock%0A%09self%20subclassResponsibility'),
  3507. messageSends: ["subclassResponsibility"],
  3508. referencedClasses: []
  3509. }),
  3510. smalltalk.SequenceableCollection);
  3511. smalltalk.addMethod(
  3512. '_at_put_',
  3513. smalltalk.method({
  3514. selector: 'at:put:',
  3515. category: 'accessing',
  3516. fn: function (anIndex, anObject){
  3517. var self=this;
  3518. smalltalk.send(self, "_subclassResponsibility", []);
  3519. return self;},
  3520. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%09self%20subclassResponsibility%0A'),
  3521. messageSends: ["subclassResponsibility"],
  3522. referencedClasses: []
  3523. }),
  3524. smalltalk.SequenceableCollection);
  3525. smalltalk.addMethod(
  3526. '_copyFrom_to_',
  3527. smalltalk.method({
  3528. selector: 'copyFrom:to:',
  3529. category: 'copying',
  3530. fn: function (anIndex, anotherIndex){
  3531. var self=this;
  3532. smalltalk.send(self, "_subclassResponsibility", []);
  3533. return self;},
  3534. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09self%20subclassResponsibility%0A'),
  3535. messageSends: ["subclassResponsibility"],
  3536. referencedClasses: []
  3537. }),
  3538. smalltalk.SequenceableCollection);
  3539. smalltalk.addMethod(
  3540. '_first',
  3541. smalltalk.method({
  3542. selector: 'first',
  3543. category: 'accessing',
  3544. fn: function (){
  3545. var self=this;
  3546. return smalltalk.send(self, "_at_", [(1)]);
  3547. return self;},
  3548. source: unescape('first%0A%09%5Eself%20at%3A%201%0A'),
  3549. messageSends: ["at:"],
  3550. referencedClasses: []
  3551. }),
  3552. smalltalk.SequenceableCollection);
  3553. smalltalk.addMethod(
  3554. '_fourth',
  3555. smalltalk.method({
  3556. selector: 'fourth',
  3557. category: 'accessing',
  3558. fn: function (){
  3559. var self=this;
  3560. return smalltalk.send(self, "_at_", [(4)]);
  3561. return self;},
  3562. source: unescape('fourth%0A%09%5Eself%20at%3A%204%0A'),
  3563. messageSends: ["at:"],
  3564. referencedClasses: []
  3565. }),
  3566. smalltalk.SequenceableCollection);
  3567. smalltalk.addMethod(
  3568. '_last',
  3569. smalltalk.method({
  3570. selector: 'last',
  3571. category: 'accessing',
  3572. fn: function (){
  3573. var self=this;
  3574. return smalltalk.send(self, "_at_", [smalltalk.send(self, "_size", [])]);
  3575. return self;},
  3576. source: unescape('last%0A%09%5Eself%20at%3A%20self%20size%0A'),
  3577. messageSends: ["at:", "size"],
  3578. referencedClasses: []
  3579. }),
  3580. smalltalk.SequenceableCollection);
  3581. smalltalk.addMethod(
  3582. '_second',
  3583. smalltalk.method({
  3584. selector: 'second',
  3585. category: 'accessing',
  3586. fn: function (){
  3587. var self=this;
  3588. return smalltalk.send(self, "_at_", [(2)]);
  3589. return self;},
  3590. source: unescape('second%0A%09%5Eself%20at%3A%202%0A'),
  3591. messageSends: ["at:"],
  3592. referencedClasses: []
  3593. }),
  3594. smalltalk.SequenceableCollection);
  3595. smalltalk.addMethod(
  3596. '_third',
  3597. smalltalk.method({
  3598. selector: 'third',
  3599. category: 'accessing',
  3600. fn: function (){
  3601. var self=this;
  3602. return smalltalk.send(self, "_at_", [(3)]);
  3603. return self;},
  3604. source: unescape('third%0A%09%5Eself%20at%3A%203%0A'),
  3605. messageSends: ["at:"],
  3606. referencedClasses: []
  3607. }),
  3608. smalltalk.SequenceableCollection);
  3609. smalltalk.addMethod(
  3610. '_removeLast',
  3611. smalltalk.method({
  3612. selector: 'removeLast',
  3613. category: 'adding',
  3614. fn: function (){
  3615. var self=this;
  3616. smalltalk.send(self, "_remove_", [smalltalk.send(self, "_last", [])]);
  3617. return self;},
  3618. source: unescape('removeLast%0A%09self%20remove%3A%20self%20last'),
  3619. messageSends: ["remove:", "last"],
  3620. referencedClasses: []
  3621. }),
  3622. smalltalk.SequenceableCollection);
  3623. smalltalk.addMethod(
  3624. '_addLast_',
  3625. smalltalk.method({
  3626. selector: 'addLast:',
  3627. category: 'adding',
  3628. fn: function (anObject){
  3629. var self=this;
  3630. smalltalk.send(self, "_add_", [anObject]);
  3631. return self;},
  3632. source: unescape('addLast%3A%20anObject%0A%09self%20add%3A%20anObject'),
  3633. messageSends: ["add:"],
  3634. referencedClasses: []
  3635. }),
  3636. smalltalk.SequenceableCollection);
  3637. smalltalk.addMethod(
  3638. '_withIndexDo_',
  3639. smalltalk.method({
  3640. selector: 'withIndexDo:',
  3641. category: 'enumerating',
  3642. fn: function (aBlock){
  3643. var self=this;
  3644. for(var i=0;i<self.length;i++){aBlock(self[i], i+1);};
  3645. return self;},
  3646. source: unescape('withIndexDo%3A%20aBlock%0A%09%7B%27for%28var%20i%3D0%3Bi%3Cself.length%3Bi++%29%7BaBlock%28self%5Bi%5D%2C%20i+1%29%3B%7D%27%7D'),
  3647. messageSends: [],
  3648. referencedClasses: []
  3649. }),
  3650. smalltalk.SequenceableCollection);
  3651. smalltalk.addMethod(
  3652. '_allButFirst',
  3653. smalltalk.method({
  3654. selector: 'allButFirst',
  3655. category: 'accessing',
  3656. fn: function (){
  3657. var self=this;
  3658. return smalltalk.send(self, "_copyFrom_to_", [(2), smalltalk.send(self, "_size", [])]);
  3659. return self;},
  3660. source: unescape('allButFirst%0A%09%5Eself%20copyFrom%3A%202%20to%3A%20self%20size'),
  3661. messageSends: ["copyFrom:to:", "size"],
  3662. referencedClasses: []
  3663. }),
  3664. smalltalk.SequenceableCollection);
  3665. smalltalk.addMethod(
  3666. '_allButLast',
  3667. smalltalk.method({
  3668. selector: 'allButLast',
  3669. category: 'accessing',
  3670. fn: function (){
  3671. var self=this;
  3672. return smalltalk.send(self, "_copyFrom_to_", [(1), smalltalk.send(smalltalk.send(self, "_size", []), "__minus", [(1)])]);
  3673. return self;},
  3674. source: unescape('allButLast%0A%09%5Eself%20copyFrom%3A%201%20to%3A%20self%20size%20-%201'),
  3675. messageSends: ["copyFrom:to:", unescape("-"), "size"],
  3676. referencedClasses: []
  3677. }),
  3678. smalltalk.SequenceableCollection);
  3679. smalltalk.addMethod(
  3680. '_indexOf_',
  3681. smalltalk.method({
  3682. selector: 'indexOf:',
  3683. category: 'accessing',
  3684. fn: function (anObject){
  3685. var self=this;
  3686. return smalltalk.send(self, "_indexOf_ifAbsent_", [anObject, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  3687. return self;},
  3688. source: unescape('indexOf%3A%20anObject%0A%09%5Eself%20indexOf%3A%20anObject%20ifAbsent%3A%20%5Bself%20errorNotFound%5D'),
  3689. messageSends: ["indexOf:ifAbsent:", "errorNotFound"],
  3690. referencedClasses: []
  3691. }),
  3692. smalltalk.SequenceableCollection);
  3693. smalltalk.addMethod(
  3694. '_indexOf_ifAbsent_',
  3695. smalltalk.method({
  3696. selector: 'indexOf:ifAbsent:',
  3697. category: 'accessing',
  3698. fn: function (anObject, aBlock){
  3699. var self=this;
  3700. for(var i=0;i<self.length;i++){
  3701. if(self[i].__eq(anObject)) {return i+1}
  3702. }
  3703. return aBlock();
  3704. ;
  3705. return self;},
  3706. source: unescape('indexOf%3A%20anObject%20ifAbsent%3A%20aBlock%0A%09%7B%27for%28var%20i%3D0%3Bi%3Cself.length%3Bi++%29%7B%0A%09%09if%28self%5Bi%5D.__eq%28anObject%29%29%20%7Breturn%20i+1%7D%0A%09%7D%0A%09return%20aBlock%28%29%3B%0A%09%27%7D'),
  3707. messageSends: [],
  3708. referencedClasses: []
  3709. }),
  3710. smalltalk.SequenceableCollection);
  3711. smalltalk.addClass('String', smalltalk.SequenceableCollection, [], 'Kernel');
  3712. smalltalk.addMethod(
  3713. '__eq',
  3714. smalltalk.method({
  3715. selector: '=',
  3716. category: 'comparing',
  3717. fn: function (aString){
  3718. var self=this;
  3719. return String(self) == aString;
  3720. return self;},
  3721. source: unescape('%3D%20aString%0A%09%7B%27return%20String%28self%29%20%3D%3D%20aString%27%7D'),
  3722. messageSends: [],
  3723. referencedClasses: []
  3724. }),
  3725. smalltalk.String);
  3726. smalltalk.addMethod(
  3727. '_size',
  3728. smalltalk.method({
  3729. selector: 'size',
  3730. category: 'accessing',
  3731. fn: function (){
  3732. var self=this;
  3733. return self.length;
  3734. return self;},
  3735. source: unescape('size%0A%09%7B%27return%20self.length%27%7D%0A'),
  3736. messageSends: [],
  3737. referencedClasses: []
  3738. }),
  3739. smalltalk.String);
  3740. smalltalk.addMethod(
  3741. '_at_',
  3742. smalltalk.method({
  3743. selector: 'at:',
  3744. category: 'accessing',
  3745. fn: function (anIndex){
  3746. var self=this;
  3747. return self[anIndex - 1];;
  3748. return self;},
  3749. source: unescape('at%3A%20anIndex%0A%09%7B%27return%20self%5BanIndex%20-%201%5D%3B%27%7D'),
  3750. messageSends: [],
  3751. referencedClasses: []
  3752. }),
  3753. smalltalk.String);
  3754. smalltalk.addMethod(
  3755. '_at_put_',
  3756. smalltalk.method({
  3757. selector: 'at:put:',
  3758. category: 'accessing',
  3759. fn: function (anIndex, anObject){
  3760. var self=this;
  3761. smalltalk.send(self, "_errorReadOnly", []);
  3762. return self;},
  3763. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%20%20%20%20%09self%20errorReadOnly%0A'),
  3764. messageSends: ["errorReadOnly"],
  3765. referencedClasses: []
  3766. }),
  3767. smalltalk.String);
  3768. smalltalk.addMethod(
  3769. '_at_ifAbsent_',
  3770. smalltalk.method({
  3771. selector: 'at:ifAbsent:',
  3772. category: 'accessing',
  3773. fn: function (anIndex, aBlock){
  3774. var self=this;
  3775. smalltalk.send(smalltalk.send(self, "_at_", [anIndex]), "_ifNil_", [(function(){return aBlock;})]);
  3776. return self;},
  3777. source: unescape('at%3A%20anIndex%20ifAbsent%3A%20aBlock%0A%20%20%20%20%09%28self%20at%3A%20anIndex%29%20ifNil%3A%20%5BaBlock%5D%0A'),
  3778. messageSends: ["ifNil:", "at:"],
  3779. referencedClasses: []
  3780. }),
  3781. smalltalk.String);
  3782. smalltalk.addMethod(
  3783. '_escaped',
  3784. smalltalk.method({
  3785. selector: 'escaped',
  3786. category: 'accessing',
  3787. fn: function (){
  3788. var self=this;
  3789. return escape(self);
  3790. return self;},
  3791. source: unescape('escaped%0A%09%7B%27return%20escape%28self%29%27%7D%0A'),
  3792. messageSends: [],
  3793. referencedClasses: []
  3794. }),
  3795. smalltalk.String);
  3796. smalltalk.addMethod(
  3797. '_unescaped',
  3798. smalltalk.method({
  3799. selector: 'unescaped',
  3800. category: 'accessing',
  3801. fn: function (){
  3802. var self=this;
  3803. return unescape(self);
  3804. return self;},
  3805. source: unescape('unescaped%0A%09%7B%27return%20unescape%28self%29%27%7D'),
  3806. messageSends: [],
  3807. referencedClasses: []
  3808. }),
  3809. smalltalk.String);
  3810. smalltalk.addMethod(
  3811. '_add_',
  3812. smalltalk.method({
  3813. selector: 'add:',
  3814. category: 'adding',
  3815. fn: function (anObject){
  3816. var self=this;
  3817. smalltalk.send(self, "_errorReadOnly", []);
  3818. return self;},
  3819. source: unescape('add%3A%20anObject%0A%20%20%20%20%09self%20errorReadOnly%0A'),
  3820. messageSends: ["errorReadOnly"],
  3821. referencedClasses: []
  3822. }),
  3823. smalltalk.String);
  3824. smalltalk.addMethod(
  3825. '__comma',
  3826. smalltalk.method({
  3827. selector: ',',
  3828. category: 'copying',
  3829. fn: function (aString){
  3830. var self=this;
  3831. return self + aString;
  3832. return self;},
  3833. source: unescape('%2C%20aString%0A%09%7B%27return%20self%20+%20aString%27%7D'),
  3834. messageSends: [],
  3835. referencedClasses: []
  3836. }),
  3837. smalltalk.String);
  3838. smalltalk.addMethod(
  3839. '_copyFrom_to_',
  3840. smalltalk.method({
  3841. selector: 'copyFrom:to:',
  3842. category: 'copying',
  3843. fn: function (anIndex, anotherIndex){
  3844. var self=this;
  3845. return self.substring(anIndex - 1, anotherIndex);;
  3846. return self;},
  3847. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09%7B%27return%20self.substring%28anIndex%20-%201%2C%20anotherIndex%29%3B%27%7D%0A'),
  3848. messageSends: [],
  3849. referencedClasses: []
  3850. }),
  3851. smalltalk.String);
  3852. smalltalk.addMethod(
  3853. '_shallowCopy',
  3854. smalltalk.method({
  3855. selector: 'shallowCopy',
  3856. category: 'copying',
  3857. fn: function (){
  3858. var self=this;
  3859. return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [self]);
  3860. return self;},
  3861. source: unescape('shallowCopy%0A%20%20%20%20%09%5Eself%20class%20fromString%3A%20self%0A'),
  3862. messageSends: ["fromString:", "class"],
  3863. referencedClasses: []
  3864. }),
  3865. smalltalk.String);
  3866. smalltalk.addMethod(
  3867. '_deepCopy',
  3868. smalltalk.method({
  3869. selector: 'deepCopy',
  3870. category: 'copying',
  3871. fn: function (){
  3872. var self=this;
  3873. return smalltalk.send(self, "_shallowCopy", []);
  3874. return self;},
  3875. source: unescape('deepCopy%0A%20%20%20%20%09%5Eself%20shallowCopy%0A'),
  3876. messageSends: ["shallowCopy"],
  3877. referencedClasses: []
  3878. }),
  3879. smalltalk.String);
  3880. smalltalk.addMethod(
  3881. '_asSelector',
  3882. smalltalk.method({
  3883. selector: 'asSelector',
  3884. category: 'converting',
  3885. fn: function (){
  3886. var self=this;
  3887. var selector=nil;
  3888. selector=smalltalk.send("_", "__comma", [self]);
  3889. selector=smalltalk.send(selector, "_replace_with_", [":", "_"]);
  3890. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B+%5D"), "_plus"]);
  3891. selector=smalltalk.send(selector, "_replace_with_", [unescape("-"), "_minus"]);
  3892. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B*%5D"), "_star"]);
  3893. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B/%5D"), "_slash"]);
  3894. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3E"), "_gt"]);
  3895. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3C"), "_lt"]);
  3896. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3D"), "_eq"]);
  3897. selector=smalltalk.send(selector, "_replace_with_", [unescape("%2C"), "_comma"]);
  3898. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B@%5D"), "_at"]);
  3899. return selector;
  3900. return self;},
  3901. source: unescape('asSelector%0A%09%22If%20you%20change%20this%20method%2C%20change%20smalltalk.convertSelector%20too%20%28see%20js/boot.js%20file%29%22%0A%0A%09%7C%20selector%20%7C%0A%09selector%20%3A%3D%20%27_%27%2C%20self.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%3A%27%20with%3A%20%27_%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B+%5D%27%20with%3A%20%27_plus%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27-%27%20with%3A%20%27_minus%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B*%5D%27%20with%3A%20%27_star%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B/%5D%27%20with%3A%20%27_slash%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%3E%27%20with%3A%20%27_gt%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%3C%27%20with%3A%20%27_lt%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%3D%27%20with%3A%20%27_eq%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%2C%27%20with%3A%20%27_comma%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B@%5D%27%20with%3A%20%27_at%27.%0A%09%5Eselector%0A'),
  3902. messageSends: [unescape("%2C"), "replace:with:"],
  3903. referencedClasses: []
  3904. }),
  3905. smalltalk.String);
  3906. smalltalk.addMethod(
  3907. '_asJavascript',
  3908. smalltalk.method({
  3909. selector: 'asJavascript',
  3910. category: 'converting',
  3911. fn: function (){
  3912. var self=this;
  3913. if(self.search(/^[a-zA-Z0-9_:.$ ]*$/) == -1)
  3914. return "unescape(\"" + escape(self) + "\")";
  3915. else
  3916. return "\"" + self + "\"";
  3917. ;
  3918. return self;},
  3919. source: unescape('asJavascript%0A%09%7B%27%0A%09%09if%28self.search%28/%5E%5Ba-zA-Z0-9_%3A.%24%20%5D*%24/%29%20%3D%3D%20-1%29%0A%09%09%09return%20%22unescape%28%5C%22%22%20+%20escape%28self%29%20+%20%22%5C%22%29%22%3B%0A%09%09else%0A%09%09%09return%20%22%5C%22%22%20+%20self%20+%20%22%5C%22%22%3B%0A%09%27%7D'),
  3920. messageSends: [],
  3921. referencedClasses: []
  3922. }),
  3923. smalltalk.String);
  3924. smalltalk.addMethod(
  3925. '_replace_with_',
  3926. smalltalk.method({
  3927. selector: 'replace:with:',
  3928. category: 'regular expressions',
  3929. fn: function (aString, anotherString){
  3930. var self=this;
  3931. return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send(smalltalk.RegularExpression, "_fromString_flag_", [aString, "g"]), anotherString]);
  3932. return self;},
  3933. source: unescape('replace%3A%20aString%20with%3A%20anotherString%0A%20%20%20%20%09%5Eself%20replaceRegexp%3A%20%28RegularExpression%20fromString%3A%20aString%20flag%3A%20%27g%27%29%20with%3A%20anotherString%0A'),
  3934. messageSends: ["replaceRegexp:with:", "fromString:flag:"],
  3935. referencedClasses: [smalltalk.RegularExpression]
  3936. }),
  3937. smalltalk.String);
  3938. smalltalk.addMethod(
  3939. '_replaceRegexp_with_',
  3940. smalltalk.method({
  3941. selector: 'replaceRegexp:with:',
  3942. category: 'regular expressions',
  3943. fn: function (aRegexp, aString){
  3944. var self=this;
  3945. return self.replace(aRegexp, aString);;
  3946. return self;},
  3947. source: unescape('replaceRegexp%3A%20aRegexp%20with%3A%20aString%0A%09%7B%27return%20self.replace%28aRegexp%2C%20aString%29%3B%27%7D%0A'),
  3948. messageSends: [],
  3949. referencedClasses: []
  3950. }),
  3951. smalltalk.String);
  3952. smalltalk.addMethod(
  3953. '_tokenize_',
  3954. smalltalk.method({
  3955. selector: 'tokenize:',
  3956. category: 'converting',
  3957. fn: function (aString){
  3958. var self=this;
  3959. return self.split(aString);
  3960. return self;},
  3961. source: unescape('tokenize%3A%20aString%0A%09%7B%27return%20self.split%28aString%29%27%7D'),
  3962. messageSends: [],
  3963. referencedClasses: []
  3964. }),
  3965. smalltalk.String);
  3966. smalltalk.addMethod(
  3967. '_match_',
  3968. smalltalk.method({
  3969. selector: 'match:',
  3970. category: 'regular expressions',
  3971. fn: function (aRegexp){
  3972. var self=this;
  3973. return self.search(aRegexp) != -1;
  3974. return self;},
  3975. source: unescape('match%3A%20aRegexp%0A%09%7B%27return%20self.search%28aRegexp%29%20%21%3D%20-1%27%7D%0A'),
  3976. messageSends: [],
  3977. referencedClasses: []
  3978. }),
  3979. smalltalk.String);
  3980. smalltalk.addMethod(
  3981. '_asString',
  3982. smalltalk.method({
  3983. selector: 'asString',
  3984. category: 'converting',
  3985. fn: function (){
  3986. var self=this;
  3987. return self;
  3988. return self;},
  3989. source: unescape('asString%0A%20%20%20%20%09%5Eself%0A'),
  3990. messageSends: [],
  3991. referencedClasses: []
  3992. }),
  3993. smalltalk.String);
  3994. smalltalk.addMethod(
  3995. '_asNumber',
  3996. smalltalk.method({
  3997. selector: 'asNumber',
  3998. category: 'converting',
  3999. fn: function (){
  4000. var self=this;
  4001. return Number(self);;
  4002. return self;},
  4003. source: unescape('asNumber%0A%09%7B%27return%20Number%28self%29%3B%27%7D'),
  4004. messageSends: [],
  4005. referencedClasses: []
  4006. }),
  4007. smalltalk.String);
  4008. smalltalk.addMethod(
  4009. '_asParser',
  4010. smalltalk.method({
  4011. selector: 'asParser',
  4012. category: 'converting',
  4013. fn: function (){
  4014. var self=this;
  4015. return smalltalk.send(smalltalk.send(smalltalk.PPStringParser, "_new", []), "_string_", [self]);
  4016. return self;},
  4017. source: unescape('asParser%0A%20%20%20%20%09%5EPPStringParser%20new%20string%3A%20self%0A'),
  4018. messageSends: ["string:", "new"],
  4019. referencedClasses: [smalltalk.PPStringParser]
  4020. }),
  4021. smalltalk.String);
  4022. smalltalk.addMethod(
  4023. '_asChoiceParser',
  4024. smalltalk.method({
  4025. selector: 'asChoiceParser',
  4026. category: 'converting',
  4027. fn: function (){
  4028. var self=this;
  4029. return smalltalk.send(smalltalk.PPChoiceParser, "_withAll_", [smalltalk.send(smalltalk.send(self, "_asArray", []), "_collect_", [(function(each){return smalltalk.send(each, "_asParser", []);})])]);
  4030. return self;},
  4031. source: unescape('asChoiceParser%0A%20%20%20%20%09%5EPPChoiceParser%20withAll%3A%20%28self%20asArray%20collect%3A%20%5B%3Aeach%20%7C%20each%20asParser%5D%29%0A'),
  4032. messageSends: ["withAll:", "collect:", "asArray", "asParser"],
  4033. referencedClasses: [smalltalk.PPChoiceParser]
  4034. }),
  4035. smalltalk.String);
  4036. smalltalk.addMethod(
  4037. '_asCharacterParser',
  4038. smalltalk.method({
  4039. selector: 'asCharacterParser',
  4040. category: 'converting',
  4041. fn: function (){
  4042. var self=this;
  4043. return smalltalk.send(smalltalk.send(smalltalk.PPCharacterParser, "_new", []), "_string_", [self]);
  4044. return self;},
  4045. source: unescape('asCharacterParser%0A%20%20%20%20%09%5EPPCharacterParser%20new%20string%3A%20self%0A'),
  4046. messageSends: ["string:", "new"],
  4047. referencedClasses: [smalltalk.PPCharacterParser]
  4048. }),
  4049. smalltalk.String);
  4050. smalltalk.addMethod(
  4051. '_errorReadOnly',
  4052. smalltalk.method({
  4053. selector: 'errorReadOnly',
  4054. category: 'error handling',
  4055. fn: function (){
  4056. var self=this;
  4057. smalltalk.send(self, "_error_", [unescape("Object%20is%20read-only")]);
  4058. return self;},
  4059. source: unescape('errorReadOnly%0A%20%20%20%20%09self%20error%3A%20%27Object%20is%20read-only%27%0A'),
  4060. messageSends: ["error:"],
  4061. referencedClasses: []
  4062. }),
  4063. smalltalk.String);
  4064. smalltalk.addMethod(
  4065. '_printString',
  4066. smalltalk.method({
  4067. selector: 'printString',
  4068. category: 'printing',
  4069. fn: function (){
  4070. var self=this;
  4071. return smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [self]), "__comma", [unescape("%27")]);
  4072. return self;},
  4073. source: unescape('printString%0A%20%20%20%20%09%5E%27%27%27%27%2C%20self%2C%20%27%27%27%27%0A'),
  4074. messageSends: [unescape("%2C")],
  4075. referencedClasses: []
  4076. }),
  4077. smalltalk.String);
  4078. smalltalk.addMethod(
  4079. '_printNl',
  4080. smalltalk.method({
  4081. selector: 'printNl',
  4082. category: 'printing',
  4083. fn: function (){
  4084. var self=this;
  4085. console.log(self);
  4086. return self;},
  4087. source: unescape('printNl%0A%09%7B%27console.log%28self%29%27%7D%0A'),
  4088. messageSends: [],
  4089. referencedClasses: []
  4090. }),
  4091. smalltalk.String);
  4092. smalltalk.addMethod(
  4093. '_isString',
  4094. smalltalk.method({
  4095. selector: 'isString',
  4096. category: 'testing',
  4097. fn: function (){
  4098. var self=this;
  4099. return true;
  4100. return self;},
  4101. source: unescape('isString%0A%20%20%20%20%09%5Etrue%0A'),
  4102. messageSends: [],
  4103. referencedClasses: []
  4104. }),
  4105. smalltalk.String);
  4106. smalltalk.addMethod(
  4107. '__gt',
  4108. smalltalk.method({
  4109. selector: '>',
  4110. category: 'comparing',
  4111. fn: function (aString){
  4112. var self=this;
  4113. return String(self) > aString;
  4114. return self;},
  4115. source: unescape('%3E%20aString%0A%09%7B%27return%20String%28self%29%20%3E%20aString%27%7D%0A'),
  4116. messageSends: [],
  4117. referencedClasses: []
  4118. }),
  4119. smalltalk.String);
  4120. smalltalk.addMethod(
  4121. '__lt',
  4122. smalltalk.method({
  4123. selector: '<',
  4124. category: 'comparing',
  4125. fn: function (aString){
  4126. var self=this;
  4127. return String(self) < aString;
  4128. return self;},
  4129. source: unescape('%3C%20aString%0A%09%7B%27return%20String%28self%29%20%3C%20aString%27%7D%0A'),
  4130. messageSends: [],
  4131. referencedClasses: []
  4132. }),
  4133. smalltalk.String);
  4134. smalltalk.addMethod(
  4135. '__gt_eq',
  4136. smalltalk.method({
  4137. selector: '>=',
  4138. category: 'comparing',
  4139. fn: function (aString){
  4140. var self=this;
  4141. return String(self) >= aString;
  4142. return self;},
  4143. source: unescape('%3E%3D%20aString%0A%09%7B%27return%20String%28self%29%20%3E%3D%20aString%27%7D%0A'),
  4144. messageSends: [],
  4145. referencedClasses: []
  4146. }),
  4147. smalltalk.String);
  4148. smalltalk.addMethod(
  4149. '__lt_eq',
  4150. smalltalk.method({
  4151. selector: '<=',
  4152. category: 'comparing',
  4153. fn: function (aString){
  4154. var self=this;
  4155. return String(self) <= aString;
  4156. return self;},
  4157. source: unescape('%3C%3D%20aString%0A%09%7B%27return%20String%28self%29%20%3C%3D%20aString%27%7D'),
  4158. messageSends: [],
  4159. referencedClasses: []
  4160. }),
  4161. smalltalk.String);
  4162. smalltalk.addMethod(
  4163. '_remove_',
  4164. smalltalk.method({
  4165. selector: 'remove:',
  4166. category: 'adding',
  4167. fn: function (anObject){
  4168. var self=this;
  4169. smalltalk.send(self, "_errorReadOnly", []);
  4170. return self;},
  4171. source: unescape('remove%3A%20anObject%0A%20%20%20%20self%20errorReadOnly%0A'),
  4172. messageSends: ["errorReadOnly"],
  4173. referencedClasses: []
  4174. }),
  4175. smalltalk.String);
  4176. smalltalk.addMethod(
  4177. '_asJSONObject',
  4178. smalltalk.method({
  4179. selector: 'asJSONObject',
  4180. category: 'converting',
  4181. fn: function (){
  4182. var self=this;
  4183. return self;
  4184. return self;},
  4185. source: unescape('asJSONObject%0A%09%5Eself'),
  4186. messageSends: [],
  4187. referencedClasses: []
  4188. }),
  4189. smalltalk.String);
  4190. smalltalk.addMethod(
  4191. '_streamClass',
  4192. smalltalk.method({
  4193. selector: 'streamClass',
  4194. category: 'accessing',
  4195. fn: function (){
  4196. var self=this;
  4197. return smalltalk.StringStream;
  4198. return self;},
  4199. source: unescape('streamClass%0A%09%20%20%20%20%5EStringStream%0A'),
  4200. messageSends: [],
  4201. referencedClasses: [smalltalk.StringStream]
  4202. }),
  4203. smalltalk.String.klass);
  4204. smalltalk.addMethod(
  4205. '_fromString_',
  4206. smalltalk.method({
  4207. selector: 'fromString:',
  4208. category: 'instance creation',
  4209. fn: function (aString){
  4210. var self=this;
  4211. return new self.fn(aString);;
  4212. return self;},
  4213. source: unescape('fromString%3A%20aString%0A%09%20%20%20%20%7B%27return%20new%20self.fn%28aString%29%3B%27%7D%0A'),
  4214. messageSends: [],
  4215. referencedClasses: []
  4216. }),
  4217. smalltalk.String.klass);
  4218. smalltalk.addMethod(
  4219. '_cr',
  4220. smalltalk.method({
  4221. selector: 'cr',
  4222. category: 'accessing',
  4223. fn: function (){
  4224. var self=this;
  4225. return '\n';;
  4226. return self;},
  4227. source: unescape('cr%0A%09%7B%27return%20%27%27%5Cn%27%27%3B%27%7D'),
  4228. messageSends: [],
  4229. referencedClasses: []
  4230. }),
  4231. smalltalk.String.klass);
  4232. smalltalk.addMethod(
  4233. '_lf',
  4234. smalltalk.method({
  4235. selector: 'lf',
  4236. category: 'accessing',
  4237. fn: function (){
  4238. var self=this;
  4239. return '\r';;
  4240. return self;},
  4241. source: unescape('lf%0A%09%7B%27return%20%27%27%5Cr%27%27%3B%27%7D%0A'),
  4242. messageSends: [],
  4243. referencedClasses: []
  4244. }),
  4245. smalltalk.String.klass);
  4246. smalltalk.addMethod(
  4247. '_space',
  4248. smalltalk.method({
  4249. selector: 'space',
  4250. category: 'accessing',
  4251. fn: function (){
  4252. var self=this;
  4253. return ' ';;
  4254. return self;},
  4255. source: unescape('space%0A%09%7B%27return%20%27%27%20%27%27%3B%27%7D%0A'),
  4256. messageSends: [],
  4257. referencedClasses: []
  4258. }),
  4259. smalltalk.String.klass);
  4260. smalltalk.addMethod(
  4261. '_tab',
  4262. smalltalk.method({
  4263. selector: 'tab',
  4264. category: 'accessing',
  4265. fn: function (){
  4266. var self=this;
  4267. return '\t';;
  4268. return self;},
  4269. source: unescape('tab%0A%09%7B%27return%20%27%27%5Ct%27%27%3B%27%7D'),
  4270. messageSends: [],
  4271. referencedClasses: []
  4272. }),
  4273. smalltalk.String.klass);
  4274. smalltalk.addClass('Array', smalltalk.SequenceableCollection, [], 'Kernel');
  4275. smalltalk.addMethod(
  4276. '_size',
  4277. smalltalk.method({
  4278. selector: 'size',
  4279. category: 'accessing',
  4280. fn: function (){
  4281. var self=this;
  4282. return self.length;
  4283. return self;},
  4284. source: unescape('size%0A%09%7B%27return%20self.length%27%7D'),
  4285. messageSends: [],
  4286. referencedClasses: []
  4287. }),
  4288. smalltalk.Array);
  4289. smalltalk.addMethod(
  4290. '_at_put_',
  4291. smalltalk.method({
  4292. selector: 'at:put:',
  4293. category: 'accessing',
  4294. fn: function (anIndex, anObject){
  4295. var self=this;
  4296. return self[anIndex - 1] = anObject;
  4297. return self;},
  4298. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%09%7B%27return%20self%5BanIndex%20-%201%5D%20%3D%20anObject%27%7D%0A'),
  4299. messageSends: [],
  4300. referencedClasses: []
  4301. }),
  4302. smalltalk.Array);
  4303. smalltalk.addMethod(
  4304. '_at_ifAbsent_',
  4305. smalltalk.method({
  4306. selector: 'at:ifAbsent:',
  4307. category: 'accessing',
  4308. fn: function (anIndex, aBlock){
  4309. var self=this;
  4310. var value = self[anIndex - 1];
  4311. if(value === undefined) {
  4312. return aBlock();
  4313. } else {
  4314. return value;
  4315. }
  4316. ;
  4317. return self;},
  4318. source: unescape('at%3A%20anIndex%20ifAbsent%3A%20aBlock%0A%09%7B%27%0A%09%20%20%20%20var%20value%20%3D%20self%5BanIndex%20-%201%5D%3B%0A%09%20%20%20%20if%28value%20%3D%3D%3D%20undefined%29%20%7B%0A%09%09return%20aBlock%28%29%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20value%3B%0A%09%20%20%20%20%7D%0A%09%27%7D%0A'),
  4319. messageSends: [],
  4320. referencedClasses: []
  4321. }),
  4322. smalltalk.Array);
  4323. smalltalk.addMethod(
  4324. '_add_',
  4325. smalltalk.method({
  4326. selector: 'add:',
  4327. category: 'adding/removing',
  4328. fn: function (anObject){
  4329. var self=this;
  4330. self.push(anObject); return anObject;;
  4331. return self;},
  4332. source: unescape('add%3A%20anObject%0A%09%7B%27self.push%28anObject%29%3B%20return%20anObject%3B%27%7D%0A'),
  4333. messageSends: [],
  4334. referencedClasses: []
  4335. }),
  4336. smalltalk.Array);
  4337. smalltalk.addMethod(
  4338. '_shallowCopy',
  4339. smalltalk.method({
  4340. selector: 'shallowCopy',
  4341. category: 'copying',
  4342. fn: function (){
  4343. var self=this;
  4344. var newCollection=nil;
  4345. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4346. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [each]);})]);
  4347. return newCollection;
  4348. return self;},
  4349. source: unescape('shallowCopy%0A%09%7C%20newCollection%20%7C%0A%09newCollection%20%3A%3D%20self%20class%20new.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%20newCollection%20add%3A%20each%5D.%0A%09%5EnewCollection%0A'),
  4350. messageSends: ["new", "class", "do:", "add:"],
  4351. referencedClasses: []
  4352. }),
  4353. smalltalk.Array);
  4354. smalltalk.addMethod(
  4355. '_deepCopy',
  4356. smalltalk.method({
  4357. selector: 'deepCopy',
  4358. category: 'copying',
  4359. fn: function (){
  4360. var self=this;
  4361. var newCollection=nil;
  4362. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4363. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [smalltalk.send(each, "_deepCopy", [])]);})]);
  4364. return newCollection;
  4365. return self;},
  4366. source: unescape('deepCopy%0A%09%7C%20newCollection%20%7C%0A%09newCollection%20%3A%3D%20self%20class%20new.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%20newCollection%20add%3A%20each%20deepCopy%5D.%0A%09%5EnewCollection%0A'),
  4367. messageSends: ["new", "class", "do:", "add:", "deepCopy"],
  4368. referencedClasses: []
  4369. }),
  4370. smalltalk.Array);
  4371. smalltalk.addMethod(
  4372. '_copyFrom_to_',
  4373. smalltalk.method({
  4374. selector: 'copyFrom:to:',
  4375. category: 'copying',
  4376. fn: function (anIndex, anotherIndex){
  4377. var self=this;
  4378. var array=nil;
  4379. array=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4380. smalltalk.send(anIndex, "_to_do_", [anotherIndex, (function(each){return smalltalk.send(array, "_add_", [smalltalk.send(self, "_at_", [each])]);})]);
  4381. return array;
  4382. return self;},
  4383. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09%7C%20array%20%7C%0A%09array%20%3A%3D%20self%20class%20new.%0A%09anIndex%20to%3A%20anotherIndex%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20array%20add%3A%20%28self%20at%3A%20each%29%5D.%0A%09%5Earray%0A'),
  4384. messageSends: ["new", "class", "to:do:", "add:", "at:"],
  4385. referencedClasses: []
  4386. }),
  4387. smalltalk.Array);
  4388. smalltalk.addMethod(
  4389. '_join_',
  4390. smalltalk.method({
  4391. selector: 'join:',
  4392. category: 'enumerating',
  4393. fn: function (aString){
  4394. var self=this;
  4395. return self.join(aString);;
  4396. return self;},
  4397. source: unescape('join%3A%20aString%0A%09%7B%27return%20self.join%28aString%29%3B%27%7D'),
  4398. messageSends: [],
  4399. referencedClasses: []
  4400. }),
  4401. smalltalk.Array);
  4402. smalltalk.addMethod(
  4403. '_asJavascript',
  4404. smalltalk.method({
  4405. selector: 'asJavascript',
  4406. category: 'converting',
  4407. fn: function (){
  4408. var self=this;
  4409. 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")]);
  4410. return self;},
  4411. source: unescape('asJavascript%0A%09%5E%27%5B%27%2C%20%28%28self%20collect%3A%20%5B%3Aeach%20%7C%20each%20asJavascript%5D%29%20join%3A%20%27%2C%20%27%29%2C%20%20%27%5D%27%0A'),
  4412. messageSends: [unescape("%2C"), "join:", "collect:", "asJavascript"],
  4413. referencedClasses: []
  4414. }),
  4415. smalltalk.Array);
  4416. smalltalk.addMethod(
  4417. '_sort',
  4418. smalltalk.method({
  4419. selector: 'sort',
  4420. category: 'enumerating',
  4421. fn: function (){
  4422. var self=this;
  4423. return smalltalk.send(self, "_basicPerform_", ["sort"]);
  4424. return self;},
  4425. source: unescape('sort%0A%20%20%20%20%5Eself%20basicPerform%3A%20%27sort%27%0A'),
  4426. messageSends: ["basicPerform:"],
  4427. referencedClasses: []
  4428. }),
  4429. smalltalk.Array);
  4430. smalltalk.addMethod(
  4431. '_sort_',
  4432. smalltalk.method({
  4433. selector: 'sort:',
  4434. category: 'enumerating',
  4435. fn: function (aBlock){
  4436. var self=this;
  4437. return self.sort(function(a, b) {
  4438. if(aBlock(a,b)) {return 1} else {return -1}
  4439. })
  4440. ;
  4441. return self;},
  4442. source: unescape('sort%3A%20aBlock%0A%09%7B%27%0A%09%09return%20self.sort%28function%28a%2C%20b%29%20%7B%0A%09%09%09if%28aBlock%28a%2Cb%29%29%20%7Breturn%201%7D%20else%20%7Breturn%20-1%7D%0A%09%09%7D%29%0A%09%27%7D'),
  4443. messageSends: [],
  4444. referencedClasses: []
  4445. }),
  4446. smalltalk.Array);
  4447. smalltalk.addMethod(
  4448. '_remove_',
  4449. smalltalk.method({
  4450. selector: 'remove:',
  4451. category: 'adding/removing',
  4452. fn: function (anObject){
  4453. var self=this;
  4454. for(var i=0;i<self.length;i++) {
  4455. if(self[i] == anObject) {
  4456. self.splice(i,1);
  4457. break;
  4458. }
  4459. }
  4460. ;
  4461. return self;},
  4462. source: unescape('remove%3A%20anObject%0A%09%7B%27%0A%09%09for%28var%20i%3D0%3Bi%3Cself.length%3Bi++%29%20%7B%0A%09%09%09if%28self%5Bi%5D%20%3D%3D%20anObject%29%20%7B%0A%09%09%09%09self.splice%28i%2C1%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%27%7D%0A'),
  4463. messageSends: [],
  4464. referencedClasses: []
  4465. }),
  4466. smalltalk.Array);
  4467. smalltalk.addMethod(
  4468. '_sorted',
  4469. smalltalk.method({
  4470. selector: 'sorted',
  4471. category: 'enumerating',
  4472. fn: function (){
  4473. var self=this;
  4474. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort", []);
  4475. return self;},
  4476. source: unescape('sorted%0A%09%5Eself%20copy%20sort'),
  4477. messageSends: ["sort", "copy"],
  4478. referencedClasses: []
  4479. }),
  4480. smalltalk.Array);
  4481. smalltalk.addMethod(
  4482. '_sorted_',
  4483. smalltalk.method({
  4484. selector: 'sorted:',
  4485. category: 'enumerating',
  4486. fn: function (aBlock){
  4487. var self=this;
  4488. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sorted_", [aBlock]);
  4489. return self;},
  4490. source: unescape('sorted%3A%20aBlock%0A%09%5Eself%20copy%20sorted%3A%20aBlock'),
  4491. messageSends: ["sorted:", "copy"],
  4492. referencedClasses: []
  4493. }),
  4494. smalltalk.Array);
  4495. smalltalk.addMethod(
  4496. '_asJSONObject',
  4497. smalltalk.method({
  4498. selector: 'asJSONObject',
  4499. category: 'converting',
  4500. fn: function (){
  4501. var self=this;
  4502. return smalltalk.send(self, "_collect_", [(function(each){return smalltalk.send(each, "_asJSONObject", []);})]);
  4503. return self;},
  4504. source: unescape('asJSONObject%0A%09%5Eself%20collect%3A%20%5B%3Aeach%20%7C%20each%20asJSONObject%5D'),
  4505. messageSends: ["collect:", "asJSONObject"],
  4506. referencedClasses: []
  4507. }),
  4508. smalltalk.Array);
  4509. smalltalk.addMethod(
  4510. '_removeFrom_to_',
  4511. smalltalk.method({
  4512. selector: 'removeFrom:to:',
  4513. category: 'adding/removing',
  4514. fn: function (aNumber, anotherNumber){
  4515. var self=this;
  4516. self.splice(aNumber - 1,anotherNumber - 1);
  4517. return self;},
  4518. source: unescape('removeFrom%3A%20aNumber%20to%3A%20anotherNumber%0A%09%7B%27self.splice%28aNumber%20-%201%2CanotherNumber%20-%201%29%27%7D'),
  4519. messageSends: [],
  4520. referencedClasses: []
  4521. }),
  4522. smalltalk.Array);
  4523. smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel');
  4524. smalltalk.addMethod(
  4525. '_compile_',
  4526. smalltalk.method({
  4527. selector: 'compile:',
  4528. category: 'evaluating',
  4529. fn: function (aString){
  4530. var self=this;
  4531. return self.compile(aString);;
  4532. return self;},
  4533. source: unescape('compile%3A%20aString%0A%09%7B%27return%20self.compile%28aString%29%3B%27%7D'),
  4534. messageSends: [],
  4535. referencedClasses: []
  4536. }),
  4537. smalltalk.RegularExpression);
  4538. smalltalk.addMethod(
  4539. '_exec_',
  4540. smalltalk.method({
  4541. selector: 'exec:',
  4542. category: 'evaluating',
  4543. fn: function (aString){
  4544. var self=this;
  4545. return self.exec(aString) || nil;
  4546. return self;},
  4547. source: unescape('exec%3A%20aString%0A%09%7B%27return%20self.exec%28aString%29%20%7C%7C%20nil%27%7D'),
  4548. messageSends: [],
  4549. referencedClasses: []
  4550. }),
  4551. smalltalk.RegularExpression);
  4552. smalltalk.addMethod(
  4553. '_test_',
  4554. smalltalk.method({
  4555. selector: 'test:',
  4556. category: 'evaluating',
  4557. fn: function (aString){
  4558. var self=this;
  4559. return self.test(aString);;
  4560. return self;},
  4561. source: unescape('test%3A%20aString%0A%09%7B%27return%20self.test%28aString%29%3B%27%7D'),
  4562. messageSends: [],
  4563. referencedClasses: []
  4564. }),
  4565. smalltalk.RegularExpression);
  4566. smalltalk.addMethod(
  4567. '_fromString_flag_',
  4568. smalltalk.method({
  4569. selector: 'fromString:flag:',
  4570. category: 'instance creation',
  4571. fn: function (aString, anotherString){
  4572. var self=this;
  4573. return new RegExp(aString, anotherString);;
  4574. return self;},
  4575. source: unescape('fromString%3A%20aString%20flag%3A%20anotherString%0A%09%7B%27return%20new%20RegExp%28aString%2C%20anotherString%29%3B%27%7D%0A'),
  4576. messageSends: [],
  4577. referencedClasses: []
  4578. }),
  4579. smalltalk.RegularExpression.klass);
  4580. smalltalk.addMethod(
  4581. '_fromString_',
  4582. smalltalk.method({
  4583. selector: 'fromString:',
  4584. category: 'instance creation',
  4585. fn: function (aString){
  4586. var self=this;
  4587. return smalltalk.send(self, "_fromString_flag_", [aString, ""]);
  4588. return self;},
  4589. source: unescape('fromString%3A%20aString%0A%09%20%20%20%20%5Eself%20fromString%3A%20aString%20flag%3A%20%27%27%0A'),
  4590. messageSends: ["fromString:flag:"],
  4591. referencedClasses: []
  4592. }),
  4593. smalltalk.RegularExpression.klass);
  4594. smalltalk.addClass('Error', smalltalk.Object, ['messageText'], 'Kernel');
  4595. smalltalk.addMethod(
  4596. '_messageText',
  4597. smalltalk.method({
  4598. selector: 'messageText',
  4599. category: 'accessing',
  4600. fn: function (){
  4601. var self=this;
  4602. return self['@messageText'];
  4603. return self;},
  4604. source: unescape('messageText%0A%09%5EmessageText%0A'),
  4605. messageSends: [],
  4606. referencedClasses: []
  4607. }),
  4608. smalltalk.Error);
  4609. smalltalk.addMethod(
  4610. '_messageText_',
  4611. smalltalk.method({
  4612. selector: 'messageText:',
  4613. category: 'accessing',
  4614. fn: function (aString){
  4615. var self=this;
  4616. self['@messageText']=aString;
  4617. return self;},
  4618. source: unescape('messageText%3A%20aString%0A%09messageText%20%3A%3D%20aString%0A'),
  4619. messageSends: [],
  4620. referencedClasses: []
  4621. }),
  4622. smalltalk.Error);
  4623. smalltalk.addMethod(
  4624. '_signal',
  4625. smalltalk.method({
  4626. selector: 'signal',
  4627. category: 'signaling',
  4628. fn: function (){
  4629. var self=this;
  4630. console.log(self._messageText()); throw(self);
  4631. return self;},
  4632. source: unescape('signal%0A%09%7B%27console.log%28self._messageText%28%29%29%3B%20throw%28self%29%27%7D'),
  4633. messageSends: [],
  4634. referencedClasses: []
  4635. }),
  4636. smalltalk.Error);
  4637. smalltalk.addMethod(
  4638. '_signal_',
  4639. smalltalk.method({
  4640. selector: 'signal:',
  4641. category: 'instance creation',
  4642. fn: function (aString){
  4643. var self=this;
  4644. return (function($rec){smalltalk.send($rec, "_messageText_", [aString]);return smalltalk.send($rec, "_signal", []);})(smalltalk.send(self, "_new", []));
  4645. return self;},
  4646. source: unescape('signal%3A%20aString%0A%09%20%20%20%20%5Eself%20new%0A%09%09messageText%3A%20aString%3B%0A%09%09signal%0A'),
  4647. messageSends: ["messageText:", "signal", "new"],
  4648. referencedClasses: []
  4649. }),
  4650. smalltalk.Error.klass);
  4651. smalltalk.addClass('Association', smalltalk.Object, ['key', 'value'], 'Kernel');
  4652. smalltalk.addMethod(
  4653. '__eq',
  4654. smalltalk.method({
  4655. selector: '=',
  4656. category: 'comparing',
  4657. fn: function (anAssociation){
  4658. var self=this;
  4659. 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", [])]);})]);})]);
  4660. return self;},
  4661. source: unescape('%3D%20anAssociation%0A%09%5Eself%20class%20%3D%20anAssociation%20class%20and%3A%20%5B%0A%09%20%20%20%20self%20key%20%3D%20anAssociation%20key%20and%3A%20%5B%0A%09%09self%20value%20%3D%20anAssociation%20value%5D%5D%0A'),
  4662. messageSends: ["and:", unescape("%3D"), "class", "key", "value"],
  4663. referencedClasses: []
  4664. }),
  4665. smalltalk.Association);
  4666. smalltalk.addMethod(
  4667. '_key_',
  4668. smalltalk.method({
  4669. selector: 'key:',
  4670. category: 'accessing',
  4671. fn: function (aKey){
  4672. var self=this;
  4673. self['@key']=aKey;
  4674. return self;},
  4675. source: unescape('key%3A%20aKey%0A%09key%20%3A%3D%20aKey%0A'),
  4676. messageSends: [],
  4677. referencedClasses: []
  4678. }),
  4679. smalltalk.Association);
  4680. smalltalk.addMethod(
  4681. '_key',
  4682. smalltalk.method({
  4683. selector: 'key',
  4684. category: 'accessing',
  4685. fn: function (){
  4686. var self=this;
  4687. return self['@key'];
  4688. return self;},
  4689. source: unescape('key%0A%09%5Ekey%0A'),
  4690. messageSends: [],
  4691. referencedClasses: []
  4692. }),
  4693. smalltalk.Association);
  4694. smalltalk.addMethod(
  4695. '_value_',
  4696. smalltalk.method({
  4697. selector: 'value:',
  4698. category: 'accessing',
  4699. fn: function (aValue){
  4700. var self=this;
  4701. self['@value']=aValue;
  4702. return self;},
  4703. source: unescape('value%3A%20aValue%0A%09value%20%3A%3D%20aValue%0A'),
  4704. messageSends: [],
  4705. referencedClasses: []
  4706. }),
  4707. smalltalk.Association);
  4708. smalltalk.addMethod(
  4709. '_value',
  4710. smalltalk.method({
  4711. selector: 'value',
  4712. category: 'accessing',
  4713. fn: function (){
  4714. var self=this;
  4715. return self['@value'];
  4716. return self;},
  4717. source: unescape('value%0A%09%5Evalue%0A'),
  4718. messageSends: [],
  4719. referencedClasses: []
  4720. }),
  4721. smalltalk.Association);
  4722. smalltalk.addMethod(
  4723. '_key_value_',
  4724. smalltalk.method({
  4725. selector: 'key:value:',
  4726. category: 'instance creation',
  4727. fn: function (aKey, aValue){
  4728. var self=this;
  4729. return (function($rec){smalltalk.send($rec, "_key_", [aKey]);smalltalk.send($rec, "_value_", [aValue]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  4730. return self;},
  4731. source: unescape('key%3A%20aKey%20value%3A%20aValue%0A%09%20%20%20%20%5Eself%20new%0A%09%09key%3A%20aKey%3B%0A%09%09value%3A%20aValue%3B%0A%09%09yourself%0A'),
  4732. messageSends: ["key:", "value:", "yourself", "new"],
  4733. referencedClasses: []
  4734. }),
  4735. smalltalk.Association.klass);
  4736. smalltalk.addClass('Dictionary', smalltalk.Collection, ['keys'], 'Kernel');
  4737. smalltalk.addMethod(
  4738. '__eq',
  4739. smalltalk.method({
  4740. selector: '=',
  4741. category: 'comparing',
  4742. fn: function (aDictionary){
  4743. var self=this;
  4744. try{smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aDictionary, "_class", [])]), "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);
  4745. smalltalk.send(self, "_associationsDo_", [(function(assoc){return smalltalk.send(smalltalk.send(smalltalk.send(aDictionary, "_at_ifAbsent_", [smalltalk.send(assoc, "_key", []), (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]), "__eq", [smalltalk.send(assoc, "_value", [])]), "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);})]);
  4746. (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return true}})})();
  4747. return self;
  4748. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}},
  4749. source: unescape('%3D%20aDictionary%0A%09self%20class%20%3D%20aDictionary%20class%20ifFalse%3A%20%5B%5Efalse%5D.%0A%09self%20associationsDo%3A%20%5B%3Aassoc%20%7C%0A%09%20%20%20%20%28aDictionary%20at%3A%20assoc%20key%20ifAbsent%3A%20%5B%5Efalse%5D%29%20%3D%20assoc%20value%20%0A%09%09ifFalse%3A%20%5B%5Efalse%5D%5D.%0A%09%5Etrue%0A'),
  4750. messageSends: ["ifFalse:", unescape("%3D"), "class", "associationsDo:", "at:ifAbsent:", "key", "value"],
  4751. referencedClasses: []
  4752. }),
  4753. smalltalk.Dictionary);
  4754. smalltalk.addMethod(
  4755. '_shallowCopy',
  4756. smalltalk.method({
  4757. selector: 'shallowCopy',
  4758. category: 'copying',
  4759. fn: function (){
  4760. var self=this;
  4761. var copy=nil;
  4762. copy=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4763. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(copy, "_at_put_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  4764. return copy;
  4765. return self;},
  4766. source: unescape('shallowCopy%0A%09%7C%20copy%20%7C%0A%09copy%20%3A%3D%20self%20class%20new.%0A%09self%20associationsDo%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20copy%20at%3A%20each%20key%20%20put%3A%20each%20value%5D.%0A%09%5Ecopy%0A'),
  4767. messageSends: ["new", "class", "associationsDo:", "at:put:", "key", "value"],
  4768. referencedClasses: []
  4769. }),
  4770. smalltalk.Dictionary);
  4771. smalltalk.addMethod(
  4772. '_initialize',
  4773. smalltalk.method({
  4774. selector: 'initialize',
  4775. category: 'initialization',
  4776. fn: function (){
  4777. var self=this;
  4778. smalltalk.send(self, "_initialize", [], smalltalk.Collection);
  4779. self['@keys']=[];
  4780. return self;},
  4781. source: unescape('initialize%0A%20%20%20%20%09super%20initialize.%0A%20%20%20%20%09keys%20%3A%3D%20%23%28%29%0A'),
  4782. messageSends: ["initialize"],
  4783. referencedClasses: []
  4784. }),
  4785. smalltalk.Dictionary);
  4786. smalltalk.addMethod(
  4787. '_size',
  4788. smalltalk.method({
  4789. selector: 'size',
  4790. category: 'accessing',
  4791. fn: function (){
  4792. var self=this;
  4793. return smalltalk.send(self['@keys'], "_size", []);
  4794. return self;},
  4795. source: unescape('size%0A%09%5Ekeys%20size%0A'),
  4796. messageSends: ["size"],
  4797. referencedClasses: []
  4798. }),
  4799. smalltalk.Dictionary);
  4800. smalltalk.addMethod(
  4801. '_associations',
  4802. smalltalk.method({
  4803. selector: 'associations',
  4804. category: 'accessing',
  4805. fn: function (){
  4806. var self=this;
  4807. var associations=nil;
  4808. associations=[];
  4809. smalltalk.send(self['@keys'], "_do_", [(function(each){return smalltalk.send(associations, "_add_", [smalltalk.send(smalltalk.Association, "_key_value_", [each, smalltalk.send(self, "_at_", [each])])]);})]);
  4810. return associations;
  4811. return self;},
  4812. source: unescape('associations%0A%09%7C%20associations%20%7C%0A%09associations%20%3A%3D%20%23%28%29.%0A%09keys%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20associations%20add%3A%20%28Association%20key%3A%20each%20value%3A%20%28self%20at%3A%20each%29%29%5D.%0A%09%5Eassociations%0A'),
  4813. messageSends: ["do:", "add:", "key:value:", "at:"],
  4814. referencedClasses: [smalltalk.Association]
  4815. }),
  4816. smalltalk.Dictionary);
  4817. smalltalk.addMethod(
  4818. '_keys',
  4819. smalltalk.method({
  4820. selector: 'keys',
  4821. category: 'accessing',
  4822. fn: function (){
  4823. var self=this;
  4824. return smalltalk.send(self['@keys'], "_copy", []);
  4825. return self;},
  4826. source: unescape('keys%0A%09%5Ekeys%20copy%0A'),
  4827. messageSends: ["copy"],
  4828. referencedClasses: []
  4829. }),
  4830. smalltalk.Dictionary);
  4831. smalltalk.addMethod(
  4832. '_values',
  4833. smalltalk.method({
  4834. selector: 'values',
  4835. category: 'accessing',
  4836. fn: function (){
  4837. var self=this;
  4838. return smalltalk.send(self['@keys'], "_collect_", [(function(each){return smalltalk.send(self, "_at_", [each]);})]);
  4839. return self;},
  4840. source: unescape('values%0A%20%20%20%20%09%5Ekeys%20collect%3A%20%5B%3Aeach%20%7C%20self%20at%3A%20each%5D%0A'),
  4841. messageSends: ["collect:", "at:"],
  4842. referencedClasses: []
  4843. }),
  4844. smalltalk.Dictionary);
  4845. smalltalk.addMethod(
  4846. '_at_put_',
  4847. smalltalk.method({
  4848. selector: 'at:put:',
  4849. category: 'accessing',
  4850. fn: function (aKey, aValue){
  4851. var self=this;
  4852. smalltalk.send(smalltalk.send(self['@keys'], "_includes_", [aKey]), "_ifFalse_", [(function(){return smalltalk.send(self['@keys'], "_add_", [aKey]);})]);
  4853. return smalltalk.send(self, "_basicAt_put_", [aKey, aValue]);
  4854. return self;},
  4855. source: unescape('at%3A%20aKey%20put%3A%20aValue%0A%09%28keys%20includes%3A%20aKey%29%20ifFalse%3A%20%5Bkeys%20add%3A%20aKey%5D.%0A%09%5Eself%20basicAt%3A%20aKey%20put%3A%20aValue%0A'),
  4856. messageSends: ["ifFalse:", "includes:", "add:", "basicAt:put:"],
  4857. referencedClasses: []
  4858. }),
  4859. smalltalk.Dictionary);
  4860. smalltalk.addMethod(
  4861. '_at_ifAbsent_',
  4862. smalltalk.method({
  4863. selector: 'at:ifAbsent:',
  4864. category: 'accessing',
  4865. fn: function (aKey, aBlock){
  4866. var self=this;
  4867. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_keys", []), "_includes_", [aKey]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_basicAt_", [aKey]);}), aBlock]);
  4868. return self;},
  4869. source: unescape('at%3A%20aKey%20ifAbsent%3A%20aBlock%0A%09%5E%28self%20keys%20includes%3A%20aKey%29%0A%09%09ifTrue%3A%20%5Bself%20basicAt%3A%20aKey%5D%0A%09%09ifFalse%3A%20aBlock'),
  4870. messageSends: ["ifTrue:ifFalse:", "includes:", "keys", "basicAt:"],
  4871. referencedClasses: []
  4872. }),
  4873. smalltalk.Dictionary);
  4874. smalltalk.addMethod(
  4875. '_at_ifAbsentPut_',
  4876. smalltalk.method({
  4877. selector: 'at:ifAbsentPut:',
  4878. category: 'accessing',
  4879. fn: function (aKey, aBlock){
  4880. var self=this;
  4881. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_at_put_", [aKey, smalltalk.send(aBlock, "_value", [])]);})]);
  4882. return self;},
  4883. source: unescape('at%3A%20aKey%20ifAbsentPut%3A%20aBlock%0A%20%20%20%20%09%5Eself%20at%3A%20aKey%20ifAbsent%3A%20%5B%0A%20%20%20%20%09%20%20%20%20self%20at%3A%20aKey%20put%3A%20aBlock%20value%5D%0A'),
  4884. messageSends: ["at:ifAbsent:", "at:put:", "value"],
  4885. referencedClasses: []
  4886. }),
  4887. smalltalk.Dictionary);
  4888. smalltalk.addMethod(
  4889. '_at_ifPresent_',
  4890. smalltalk.method({
  4891. selector: 'at:ifPresent:',
  4892. category: 'accessing',
  4893. fn: function (aKey, aBlock){
  4894. var self=this;
  4895. return smalltalk.send(smalltalk.send(self, "_basicAt_", [aKey]), "_ifNotNil_", [(function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})]);
  4896. return self;},
  4897. source: unescape('at%3A%20aKey%20ifPresent%3A%20aBlock%0A%09%5E%28self%20basicAt%3A%20aKey%29%20ifNotNil%3A%20%5BaBlock%20value%3A%20%28self%20at%3A%20aKey%29%5D%0A'),
  4898. messageSends: ["ifNotNil:", "basicAt:", "value:", "at:"],
  4899. referencedClasses: []
  4900. }),
  4901. smalltalk.Dictionary);
  4902. smalltalk.addMethod(
  4903. '_at_ifPresent_ifAbsent_',
  4904. smalltalk.method({
  4905. selector: 'at:ifPresent:ifAbsent:',
  4906. category: 'accessing',
  4907. fn: function (aKey, aBlock, anotherBlock){
  4908. var self=this;
  4909. return smalltalk.send(smalltalk.send(self, "_basicAt_", [aKey]), "_ifNil_ifNotNil_", [anotherBlock, (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})]);
  4910. return self;},
  4911. source: unescape('at%3A%20aKey%20ifPresent%3A%20aBlock%20ifAbsent%3A%20anotherBlock%0A%09%5E%28self%20basicAt%3A%20aKey%29%0A%09%20%20%20%20ifNil%3A%20anotherBlock%0A%09%20%20%20%20ifNotNil%3A%20%5BaBlock%20value%3A%20%28self%20at%3A%20aKey%29%5D%0A'),
  4912. messageSends: ["ifNil:ifNotNil:", "basicAt:", "value:", "at:"],
  4913. referencedClasses: []
  4914. }),
  4915. smalltalk.Dictionary);
  4916. smalltalk.addMethod(
  4917. '_add_',
  4918. smalltalk.method({
  4919. selector: 'add:',
  4920. category: 'adding/removing',
  4921. fn: function (anAssociation){
  4922. var self=this;
  4923. smalltalk.send(self, "_at_put_", [smalltalk.send(anAssociation, "_key", []), smalltalk.send(anAssociation, "_value", [])]);
  4924. return self;},
  4925. source: unescape('add%3A%20anAssociation%0A%20%20%20%20%09self%20at%3A%20anAssociation%20key%20put%3A%20anAssociation%20value%0A'),
  4926. messageSends: ["at:put:", "key", "value"],
  4927. referencedClasses: []
  4928. }),
  4929. smalltalk.Dictionary);
  4930. smalltalk.addMethod(
  4931. '_addAll_',
  4932. smalltalk.method({
  4933. selector: 'addAll:',
  4934. category: 'adding/removing',
  4935. fn: function (aDictionary){
  4936. var self=this;
  4937. smalltalk.send(self, "_addAll_", [smalltalk.send(aDictionary, "_associations", [])], smalltalk.Collection);
  4938. return aDictionary;
  4939. return self;},
  4940. source: unescape('addAll%3A%20aDictionary%0A%20%20%20%20%09super%20addAll%3A%20aDictionary%20associations.%0A%20%20%20%20%09%5EaDictionary%0A'),
  4941. messageSends: ["addAll:", "associations"],
  4942. referencedClasses: []
  4943. }),
  4944. smalltalk.Dictionary);
  4945. smalltalk.addMethod(
  4946. '__comma',
  4947. smalltalk.method({
  4948. selector: ',',
  4949. category: 'copying',
  4950. fn: function (aCollection){
  4951. var self=this;
  4952. smalltalk.send(self, "_shouldNotImplement", []);
  4953. return self;},
  4954. source: unescape('%2C%20aCollection%0A%09self%20shouldNotImplement%0A'),
  4955. messageSends: ["shouldNotImplement"],
  4956. referencedClasses: []
  4957. }),
  4958. smalltalk.Dictionary);
  4959. smalltalk.addMethod(
  4960. '_copyFrom_to_',
  4961. smalltalk.method({
  4962. selector: 'copyFrom:to:',
  4963. category: 'copying',
  4964. fn: function (anIndex, anotherIndex){
  4965. var self=this;
  4966. smalltalk.send(self, "_shouldNotImplement", []);
  4967. return self;},
  4968. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09self%20shouldNotImplement%0A'),
  4969. messageSends: ["shouldNotImplement"],
  4970. referencedClasses: []
  4971. }),
  4972. smalltalk.Dictionary);
  4973. smalltalk.addMethod(
  4974. '_associationsDo_',
  4975. smalltalk.method({
  4976. selector: 'associationsDo:',
  4977. category: 'enumerating',
  4978. fn: function (aBlock){
  4979. var self=this;
  4980. smalltalk.send(smalltalk.send(self, "_associations", []), "_do_", [aBlock]);
  4981. return self;},
  4982. source: unescape('associationsDo%3A%20aBlock%0A%20%20%20%20%09self%20associations%20do%3A%20aBlock%0A'),
  4983. messageSends: ["do:", "associations"],
  4984. referencedClasses: []
  4985. }),
  4986. smalltalk.Dictionary);
  4987. smalltalk.addMethod(
  4988. '_keysAndValuesDo_',
  4989. smalltalk.method({
  4990. selector: 'keysAndValuesDo:',
  4991. category: 'enumerating',
  4992. fn: function (aBlock){
  4993. var self=this;
  4994. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(aBlock, "_value_value_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  4995. return self;},
  4996. source: unescape('keysAndValuesDo%3A%20aBlock%0A%20%20%20%20%09self%20associationsDo%3A%20%5B%3Aeach%20%7C%0A%20%20%20%20%09%20%20%20%20aBlock%20value%3A%20each%20key%20value%3A%20each%20value%5D%0A'),
  4997. messageSends: ["associationsDo:", "value:value:", "key", "value"],
  4998. referencedClasses: []
  4999. }),
  5000. smalltalk.Dictionary);
  5001. smalltalk.addMethod(
  5002. '_do_',
  5003. smalltalk.method({
  5004. selector: 'do:',
  5005. category: 'enumerating',
  5006. fn: function (aBlock){
  5007. var self=this;
  5008. smalltalk.send(smalltalk.send(self, "_values", []), "_do_", [aBlock]);
  5009. return self;},
  5010. source: unescape('do%3A%20aBlock%0A%20%20%20%20%09self%20values%20do%3A%20aBlock%0A'),
  5011. messageSends: ["do:", "values"],
  5012. referencedClasses: []
  5013. }),
  5014. smalltalk.Dictionary);
  5015. smalltalk.addMethod(
  5016. '_select_',
  5017. smalltalk.method({
  5018. selector: 'select:',
  5019. category: 'enumerating',
  5020. fn: function (aBlock){
  5021. var self=this;
  5022. var newDict=nil;
  5023. newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  5024. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(smalltalk.send(aBlock, "_value_", [value]), "_ifTrue_", [(function(){return smalltalk.send(newDict, "_at_put_", [key, value]);})]);})]);
  5025. return newDict;
  5026. return self;},
  5027. source: unescape('select%3A%20aBlock%0A%20%20%20%20%09%7C%20newDict%20%7C%0A%20%20%20%20%09newDict%20%3A%3D%20self%20class%20new.%0A%20%20%20%20%09self%20keysAndValuesDo%3A%20%5B%3Akey%20%3Avalue%20%7C%0A%20%20%20%20%09%20%20%20%20%28aBlock%20value%3A%20value%29%20ifTrue%3A%20%5BnewDict%20at%3A%20key%20put%3A%20value%5D%5D.%0A%20%20%20%20%09%5EnewDict%0A'),
  5028. messageSends: ["new", "class", "keysAndValuesDo:", "ifTrue:", "value:", "at:put:"],
  5029. referencedClasses: []
  5030. }),
  5031. smalltalk.Dictionary);
  5032. smalltalk.addMethod(
  5033. '_collect_',
  5034. smalltalk.method({
  5035. selector: 'collect:',
  5036. category: 'enumerating',
  5037. fn: function (aBlock){
  5038. var self=this;
  5039. var newDict=nil;
  5040. newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  5041. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(newDict, "_at_put_", [key, smalltalk.send(aBlock, "_value_", [value])]);})]);
  5042. return newDict;
  5043. return self;},
  5044. source: unescape('collect%3A%20aBlock%0A%20%20%20%20%09%7C%20newDict%20%7C%0A%20%20%20%20%09newDict%20%3A%3D%20self%20class%20new.%0A%20%20%20%20%09self%20keysAndValuesDo%3A%20%5B%3Akey%20%3Avalue%20%7C%0A%20%20%20%20%09%20%20%20%20newDict%20at%3A%20key%20put%3A%20%28aBlock%20value%3A%20value%29%5D.%0A%20%20%20%20%09%5EnewDict%0A'),
  5045. messageSends: ["new", "class", "keysAndValuesDo:", "at:put:", "value:"],
  5046. referencedClasses: []
  5047. }),
  5048. smalltalk.Dictionary);
  5049. smalltalk.addMethod(
  5050. '_detect_ifNone_',
  5051. smalltalk.method({
  5052. selector: 'detect:ifNone:',
  5053. category: 'enumerating',
  5054. fn: function (aBlock, anotherBlock){
  5055. var self=this;
  5056. return smalltalk.send(smalltalk.send(self, "_values", []), "_detect_ifNone_", [aBlock, anotherBlock]);
  5057. return self;},
  5058. source: unescape('detect%3A%20aBlock%20ifNone%3A%20anotherBlock%0A%09%5Eself%20values%20detect%3A%20aBlock%20ifNone%3A%20anotherBlock%0A'),
  5059. messageSends: ["detect:ifNone:", "values"],
  5060. referencedClasses: []
  5061. }),
  5062. smalltalk.Dictionary);
  5063. smalltalk.addMethod(
  5064. '_includes_',
  5065. smalltalk.method({
  5066. selector: 'includes:',
  5067. category: 'enumerating',
  5068. fn: function (anObject){
  5069. var self=this;
  5070. return smalltalk.send(smalltalk.send(self, "_values", []), "_includes_", [anObject]);
  5071. return self;},
  5072. source: unescape('includes%3A%20anObject%0A%09%5Eself%20values%20includes%3A%20anObject%0A'),
  5073. messageSends: ["includes:", "values"],
  5074. referencedClasses: []
  5075. }),
  5076. smalltalk.Dictionary);
  5077. smalltalk.addMethod(
  5078. '_remove_',
  5079. smalltalk.method({
  5080. selector: 'remove:',
  5081. category: 'adding/removing',
  5082. fn: function (aKey){
  5083. var self=this;
  5084. smalltalk.send(self, "_removeKey_", [aKey]);
  5085. return self;},
  5086. source: unescape('remove%3A%20aKey%0A%20%20%20%20self%20removeKey%3A%20aKey%0A'),
  5087. messageSends: ["removeKey:"],
  5088. referencedClasses: []
  5089. }),
  5090. smalltalk.Dictionary);
  5091. smalltalk.addMethod(
  5092. '_removeKey_',
  5093. smalltalk.method({
  5094. selector: 'removeKey:',
  5095. category: 'adding/removing',
  5096. fn: function (aKey){
  5097. var self=this;
  5098. smalltalk.send(self['@keys'], "_remove_", [aKey]);
  5099. return self;},
  5100. source: unescape('removeKey%3A%20aKey%0A%20%20%20%20keys%20remove%3A%20aKey%0A'),
  5101. messageSends: ["remove:"],
  5102. referencedClasses: []
  5103. }),
  5104. smalltalk.Dictionary);
  5105. smalltalk.addMethod(
  5106. '_at_',
  5107. smalltalk.method({
  5108. selector: 'at:',
  5109. category: 'accessing',
  5110. fn: function (aKey){
  5111. var self=this;
  5112. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  5113. return self;},
  5114. source: unescape('at%3A%20aKey%0A%09%5Eself%20at%3A%20aKey%20ifAbsent%3A%20%5Bself%20errorNotFound%5D'),
  5115. messageSends: ["at:ifAbsent:", "errorNotFound"],
  5116. referencedClasses: []
  5117. }),
  5118. smalltalk.Dictionary);
  5119. smalltalk.addMethod(
  5120. '_asJSONObject',
  5121. smalltalk.method({
  5122. selector: 'asJSONObject',
  5123. category: 'converting',
  5124. fn: function (){
  5125. var self=this;
  5126. var object=nil;
  5127. object=smalltalk.send(smalltalk.Object, "_new", []);
  5128. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(object, "_basicAt_put_", [key, smalltalk.send(value, "_asJSONObject", [])]);})]);
  5129. return object;
  5130. return self;},
  5131. source: unescape('asJSONObject%0A%09%7C%20object%20%7C%0A%09object%20%3A%3D%20Object%20new.%0A%09self%20keysAndValuesDo%3A%20%5B%3Akey%20%3Avalue%20%7C%0A%09%09object%20basicAt%3A%20key%20put%3A%20value%20asJSONObject%5D.%0A%09%5Eobject'),
  5132. messageSends: ["new", "keysAndValuesDo:", "basicAt:put:", "asJSONObject"],
  5133. referencedClasses: [smalltalk.Object]
  5134. }),
  5135. smalltalk.Dictionary);
  5136. smalltalk.addClass('ClassBuilder', smalltalk.Object, [], 'Kernel');
  5137. smalltalk.addMethod(
  5138. '_superclass_subclass_',
  5139. smalltalk.method({
  5140. selector: 'superclass:subclass:',
  5141. category: 'class creation',
  5142. fn: function (aClass, aString){
  5143. var self=this;
  5144. smalltalk.send(self, "_superclass_subclass_instanceVariableNames_category_", [aClass, aString, "", nil]);
  5145. return self;},
  5146. source: unescape('superclass%3A%20aClass%20subclass%3A%20aString%0A%09self%20superclass%3A%20aClass%20subclass%3A%20aString%20instanceVariableNames%3A%20%27%27%20category%3A%20nil%0A'),
  5147. messageSends: ["superclass:subclass:instanceVariableNames:category:"],
  5148. referencedClasses: []
  5149. }),
  5150. smalltalk.ClassBuilder);
  5151. smalltalk.addMethod(
  5152. '_superclass_subclass_instanceVariableNames_category_',
  5153. smalltalk.method({
  5154. selector: 'superclass:subclass:instanceVariableNames:category:',
  5155. category: 'class creation',
  5156. fn: function (aClass, aString, aString2, aString3){
  5157. var self=this;
  5158. var newClass=nil;
  5159. newClass=smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_", [aClass, aString, smalltalk.send(self, "_instanceVariableNamesFor_", [aString2])]);
  5160. smalltalk.send(self, "_setupClass_", [newClass]);
  5161. smalltalk.send(newClass, "_category_", [smalltalk.send(aString3, "_ifNil_", [(function(){return "unclassified";})])]);
  5162. return self;},
  5163. source: unescape('superclass%3A%20aClass%20subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20category%3A%20aString3%0A%09%7C%20newClass%20%7C%0A%09newClass%20%3A%3D%20self%20addSubclassOf%3A%20aClass%20named%3A%20aString%20instanceVariableNames%3A%20%28self%20instanceVariableNamesFor%3A%20aString2%29.%0A%09self%20setupClass%3A%20newClass.%0A%09newClass%20category%3A%20%28aString3%20ifNil%3A%20%5B%27unclassified%27%5D%29%0A'),
  5164. messageSends: ["addSubclassOf:named:instanceVariableNames:", "instanceVariableNamesFor:", "setupClass:", "category:", "ifNil:"],
  5165. referencedClasses: []
  5166. }),
  5167. smalltalk.ClassBuilder);
  5168. smalltalk.addMethod(
  5169. '_class_instanceVariableNames_',
  5170. smalltalk.method({
  5171. selector: 'class:instanceVariableNames:',
  5172. category: 'class creation',
  5173. fn: function (aClass, aString){
  5174. var self=this;
  5175. smalltalk.send(smalltalk.send(aClass, "_isMetaclass", []), "_ifFalse_", [(function(){return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_name", []), "__comma", [" is not a metaclass"])]);})]);
  5176. smalltalk.send(aClass, "_basicAt_put_", ["iVarNames", smalltalk.send(self, "_instanceVariableNamesFor_", [aString])]);
  5177. smalltalk.send(self, "_setupClass_", [aClass]);
  5178. return self;},
  5179. source: unescape('class%3A%20aClass%20instanceVariableNames%3A%20aString%0A%09aClass%20isMetaclass%20ifFalse%3A%20%5Bself%20error%3A%20aClass%20name%2C%20%27%20is%20not%20a%20metaclass%27%5D.%0A%09aClass%20basicAt%3A%20%27iVarNames%27%20put%3A%20%28self%20instanceVariableNamesFor%3A%20aString%29.%0A%09self%20setupClass%3A%20aClass%0A'),
  5180. messageSends: ["ifFalse:", "isMetaclass", "error:", unescape("%2C"), "name", "basicAt:put:", "instanceVariableNamesFor:", "setupClass:"],
  5181. referencedClasses: []
  5182. }),
  5183. smalltalk.ClassBuilder);
  5184. smalltalk.addMethod(
  5185. '_instanceVariableNamesFor_',
  5186. smalltalk.method({
  5187. selector: 'instanceVariableNamesFor:',
  5188. category: 'private',
  5189. fn: function (aString){
  5190. var self=this;
  5191. return smalltalk.send(smalltalk.send(aString, "_tokenize_", [" "]), "_reject_", [(function(each){return smalltalk.send(each, "_isEmpty", []);})]);
  5192. return self;},
  5193. source: unescape('instanceVariableNamesFor%3A%20aString%0A%09%5E%28aString%20tokenize%3A%20%27%20%27%29%20reject%3A%20%5B%3Aeach%20%7C%20each%20isEmpty%5D%0A'),
  5194. messageSends: ["reject:", "tokenize:", "isEmpty"],
  5195. referencedClasses: []
  5196. }),
  5197. smalltalk.ClassBuilder);
  5198. smalltalk.addMethod(
  5199. '_addSubclassOf_named_instanceVariableNames_',
  5200. smalltalk.method({
  5201. selector: 'addSubclassOf:named:instanceVariableNames:',
  5202. category: 'private',
  5203. fn: function (aClass, aString, aCollection){
  5204. var self=this;
  5205. smalltalk.addClass(aString, aClass, aCollection);
  5206. return smalltalk[aString];
  5207. return self;},
  5208. source: unescape('addSubclassOf%3A%20aClass%20named%3A%20aString%20instanceVariableNames%3A%20aCollection%0A%09%7B%27smalltalk.addClass%28aString%2C%20aClass%2C%20aCollection%29%3B%0A%09%20%20%20%20return%20smalltalk%5BaString%5D%27%7D'),
  5209. messageSends: [],
  5210. referencedClasses: []
  5211. }),
  5212. smalltalk.ClassBuilder);
  5213. smalltalk.addMethod(
  5214. '_setupClass_',
  5215. smalltalk.method({
  5216. selector: 'setupClass:',
  5217. category: 'private',
  5218. fn: function (aClass){
  5219. var self=this;
  5220. smalltalk.init(aClass);;
  5221. return self;},
  5222. source: unescape('setupClass%3A%20aClass%0A%09%7B%27smalltalk.init%28aClass%29%3B%27%7D%0A'),
  5223. messageSends: [],
  5224. referencedClasses: []
  5225. }),
  5226. smalltalk.ClassBuilder);
  5227. smalltalk.addClass('ClassCategoryReader', smalltalk.Object, ['class', 'category', 'chunkParser'], 'Kernel');
  5228. smalltalk.addMethod(
  5229. '_initialize',
  5230. smalltalk.method({
  5231. selector: 'initialize',
  5232. category: 'initialization',
  5233. fn: function (){
  5234. var self=this;
  5235. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  5236. self['@chunkParser']=smalltalk.send(smalltalk.ChunkParser, "_new", []);
  5237. return self;},
  5238. source: unescape('initialize%0A%09super%20initialize.%0A%09chunkParser%20%3A%3D%20ChunkParser%20new.%0A'),
  5239. messageSends: ["initialize", "new"],
  5240. referencedClasses: [smalltalk.ChunkParser]
  5241. }),
  5242. smalltalk.ClassCategoryReader);
  5243. smalltalk.addMethod(
  5244. '_class_category_',
  5245. smalltalk.method({
  5246. selector: 'class:category:',
  5247. category: 'accessing',
  5248. fn: function (aClass, aString){
  5249. var self=this;
  5250. self['@class']=aClass;
  5251. self['@category']=aString;
  5252. return self;},
  5253. source: unescape('class%3A%20aClass%20category%3A%20aString%0A%09class%20%3A%3D%20aClass.%0A%09category%20%3A%3D%20aString%0A'),
  5254. messageSends: [],
  5255. referencedClasses: []
  5256. }),
  5257. smalltalk.ClassCategoryReader);
  5258. smalltalk.addMethod(
  5259. '_scanFrom_',
  5260. smalltalk.method({
  5261. selector: 'scanFrom:',
  5262. category: 'fileIn',
  5263. fn: function (aStream){
  5264. var self=this;
  5265. var nextChunk=nil;
  5266. nextChunk=smalltalk.send(smalltalk.send(smalltalk.send(self['@chunkParser'], "_emptyChunk", []), "__slash", [smalltalk.send(self['@chunkParser'], "_chunk", [])]), "_parse_", [aStream]);
  5267. smalltalk.send(smalltalk.send(nextChunk, "_isEmptyChunk", []), "_ifFalse_", [(function(){smalltalk.send(self, "_compileMethod_", [smalltalk.send(nextChunk, "_contents", [])]);return smalltalk.send(self, "_scanFrom_", [aStream]);})]);
  5268. return self;},
  5269. source: unescape('scanFrom%3A%20aStream%0A%09%7C%20nextChunk%20%7C%0A%09nextChunk%20%3A%3D%20%28chunkParser%20emptyChunk%20/%20chunkParser%20chunk%29%20parse%3A%20aStream.%0A%09nextChunk%20isEmptyChunk%20ifFalse%3A%20%5B%0A%09%20%20%20%20self%20compileMethod%3A%20nextChunk%20contents.%0A%09%20%20%20%20self%20scanFrom%3A%20aStream%5D.%0A'),
  5270. messageSends: ["parse:", unescape("/"), "emptyChunk", "chunk", "ifFalse:", "isEmptyChunk", "compileMethod:", "contents", "scanFrom:"],
  5271. referencedClasses: []
  5272. }),
  5273. smalltalk.ClassCategoryReader);
  5274. smalltalk.addMethod(
  5275. '_compileMethod_',
  5276. smalltalk.method({
  5277. selector: 'compileMethod:',
  5278. category: 'private',
  5279. fn: function (aString){
  5280. var self=this;
  5281. var method=nil;
  5282. method=smalltalk.send(smalltalk.send(smalltalk.Compiler, "_new", []), "_load_forClass_", [aString, self['@class']]);
  5283. smalltalk.send(method, "_category_", [self['@category']]);
  5284. smalltalk.send(self['@class'], "_addCompiledMethod_", [method]);
  5285. return self;},
  5286. source: unescape('compileMethod%3A%20aString%0A%09%7C%20method%20%7C%0A%09method%20%3A%3D%20Compiler%20new%20load%3A%20aString%20forClass%3A%20class.%0A%09method%20category%3A%20category.%0A%09class%20addCompiledMethod%3A%20method%0A'),
  5287. messageSends: ["load:forClass:", "new", "category:", "addCompiledMethod:"],
  5288. referencedClasses: [smalltalk.Compiler]
  5289. }),
  5290. smalltalk.ClassCategoryReader);
  5291. smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel');
  5292. smalltalk.addMethod(
  5293. '_collection',
  5294. smalltalk.method({
  5295. selector: 'collection',
  5296. category: 'accessing',
  5297. fn: function (){
  5298. var self=this;
  5299. return self['@collection'];
  5300. return self;},
  5301. source: unescape('collection%0A%09%5Ecollection%0A'),
  5302. messageSends: [],
  5303. referencedClasses: []
  5304. }),
  5305. smalltalk.Stream);
  5306. smalltalk.addMethod(
  5307. '_setCollection_',
  5308. smalltalk.method({
  5309. selector: 'setCollection:',
  5310. category: 'accessing',
  5311. fn: function (aCollection){
  5312. var self=this;
  5313. self['@collection']=aCollection;
  5314. return self;},
  5315. source: unescape('setCollection%3A%20aCollection%0A%09collection%20%3A%3D%20aCollection%0A'),
  5316. messageSends: [],
  5317. referencedClasses: []
  5318. }),
  5319. smalltalk.Stream);
  5320. smalltalk.addMethod(
  5321. '_position',
  5322. smalltalk.method({
  5323. selector: 'position',
  5324. category: 'accessing',
  5325. fn: function (){
  5326. var self=this;
  5327. return smalltalk.send(self['@position'], "_ifNil_", [(function(){return self['@position']=(0);})]);
  5328. return self;},
  5329. source: unescape('position%0A%09%5Eposition%20ifNil%3A%20%5Bposition%20%3A%3D%200%5D%0A'),
  5330. messageSends: ["ifNil:"],
  5331. referencedClasses: []
  5332. }),
  5333. smalltalk.Stream);
  5334. smalltalk.addMethod(
  5335. '_position_',
  5336. smalltalk.method({
  5337. selector: 'position:',
  5338. category: 'accessing',
  5339. fn: function (anInteger){
  5340. var self=this;
  5341. self['@position']=anInteger;
  5342. return self;},
  5343. source: unescape('position%3A%20anInteger%0A%09position%20%3A%3D%20anInteger%0A'),
  5344. messageSends: [],
  5345. referencedClasses: []
  5346. }),
  5347. smalltalk.Stream);
  5348. smalltalk.addMethod(
  5349. '_streamSize',
  5350. smalltalk.method({
  5351. selector: 'streamSize',
  5352. category: 'accessing',
  5353. fn: function (){
  5354. var self=this;
  5355. return self['@streamSize'];
  5356. return self;},
  5357. source: unescape('streamSize%0A%09%5EstreamSize%0A'),
  5358. messageSends: [],
  5359. referencedClasses: []
  5360. }),
  5361. smalltalk.Stream);
  5362. smalltalk.addMethod(
  5363. '_setStreamSize_',
  5364. smalltalk.method({
  5365. selector: 'setStreamSize:',
  5366. category: 'accessing',
  5367. fn: function (anInteger){
  5368. var self=this;
  5369. self['@streamSize']=anInteger;
  5370. return self;},
  5371. source: unescape('setStreamSize%3A%20anInteger%0A%09streamSize%20%3A%3D%20anInteger%0A'),
  5372. messageSends: [],
  5373. referencedClasses: []
  5374. }),
  5375. smalltalk.Stream);
  5376. smalltalk.addMethod(
  5377. '_contents',
  5378. smalltalk.method({
  5379. selector: 'contents',
  5380. category: 'accessing',
  5381. fn: function (){
  5382. var self=this;
  5383. return smalltalk.send(smalltalk.send(self, "_collection", []), "_copyFrom_to_", [(1), smalltalk.send(self, "_streamSize", [])]);
  5384. return self;},
  5385. source: unescape('contents%0A%09%5Eself%20collection%0A%09%20%20%20%20copyFrom%3A%201%20%0A%09%20%20%20%20to%3A%20self%20streamSize%0A'),
  5386. messageSends: ["copyFrom:to:", "collection", "streamSize"],
  5387. referencedClasses: []
  5388. }),
  5389. smalltalk.Stream);
  5390. smalltalk.addMethod(
  5391. '_size',
  5392. smalltalk.method({
  5393. selector: 'size',
  5394. category: 'accessing',
  5395. fn: function (){
  5396. var self=this;
  5397. return smalltalk.send(self, "_streamSize", []);
  5398. return self;},
  5399. source: unescape('size%0A%09%5Eself%20streamSize%0A'),
  5400. messageSends: ["streamSize"],
  5401. referencedClasses: []
  5402. }),
  5403. smalltalk.Stream);
  5404. smalltalk.addMethod(
  5405. '_reset',
  5406. smalltalk.method({
  5407. selector: 'reset',
  5408. category: 'actions',
  5409. fn: function (){
  5410. var self=this;
  5411. smalltalk.send(self, "_position_", [(0)]);
  5412. return self;},
  5413. source: unescape('reset%0A%09self%20position%3A%200%0A'),
  5414. messageSends: ["position:"],
  5415. referencedClasses: []
  5416. }),
  5417. smalltalk.Stream);
  5418. smalltalk.addMethod(
  5419. '_close',
  5420. smalltalk.method({
  5421. selector: 'close',
  5422. category: 'actions',
  5423. fn: function (){
  5424. var self=this;
  5425. return self;},
  5426. source: unescape('close%0A'),
  5427. messageSends: [],
  5428. referencedClasses: []
  5429. }),
  5430. smalltalk.Stream);
  5431. smalltalk.addMethod(
  5432. '_flush',
  5433. smalltalk.method({
  5434. selector: 'flush',
  5435. category: 'actions',
  5436. fn: function (){
  5437. var self=this;
  5438. return self;},
  5439. source: unescape('flush%0A'),
  5440. messageSends: [],
  5441. referencedClasses: []
  5442. }),
  5443. smalltalk.Stream);
  5444. smalltalk.addMethod(
  5445. '_resetContents',
  5446. smalltalk.method({
  5447. selector: 'resetContents',
  5448. category: 'actions',
  5449. fn: function (){
  5450. var self=this;
  5451. smalltalk.send(self, "_reset", []);
  5452. smalltalk.send(self, "_setStreamSize_", [(0)]);
  5453. return self;},
  5454. source: unescape('resetContents%0A%09self%20reset.%0A%09self%20setStreamSize%3A%200%0A'),
  5455. messageSends: ["reset", "setStreamSize:"],
  5456. referencedClasses: []
  5457. }),
  5458. smalltalk.Stream);
  5459. smalltalk.addMethod(
  5460. '_do_',
  5461. smalltalk.method({
  5462. selector: 'do:',
  5463. category: 'enumerating',
  5464. fn: function (aBlock){
  5465. var self=this;
  5466. smalltalk.send((function(){return smalltalk.send(self, "_atEnd", []);}), "_whileFalse_", [(function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_next", [])]);})]);
  5467. return self;},
  5468. source: unescape('do%3A%20aBlock%0A%09%5Bself%20atEnd%5D%20whileFalse%3A%20%5BaBlock%20value%3A%20self%20next%5D%0A'),
  5469. messageSends: ["whileFalse:", "atEnd", "value:", "next"],
  5470. referencedClasses: []
  5471. }),
  5472. smalltalk.Stream);
  5473. smalltalk.addMethod(
  5474. '_setToEnd',
  5475. smalltalk.method({
  5476. selector: 'setToEnd',
  5477. category: 'positioning',
  5478. fn: function (){
  5479. var self=this;
  5480. smalltalk.send(self, "_position_", [smalltalk.send(self, "_size", [])]);
  5481. return self;},
  5482. source: unescape('setToEnd%0A%09self%20position%3A%20self%20size%0A'),
  5483. messageSends: ["position:", "size"],
  5484. referencedClasses: []
  5485. }),
  5486. smalltalk.Stream);
  5487. smalltalk.addMethod(
  5488. '_skip_',
  5489. smalltalk.method({
  5490. selector: 'skip:',
  5491. category: 'positioning',
  5492. fn: function (anInteger){
  5493. var self=this;
  5494. smalltalk.send(self, "_position_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_position", []), "__plus", [anInteger]), "_min_max_", [smalltalk.send(self, "_size", []), (0)])]);
  5495. return self;},
  5496. source: unescape('skip%3A%20anInteger%0A%09self%20position%3A%20%28%28self%20position%20+%20anInteger%29%20min%3A%20self%20size%20max%3A%200%29%0A'),
  5497. messageSends: ["position:", "min:max:", unescape("+"), "position", "size"],
  5498. referencedClasses: []
  5499. }),
  5500. smalltalk.Stream);
  5501. smalltalk.addMethod(
  5502. '_next',
  5503. smalltalk.method({
  5504. selector: 'next',
  5505. category: 'reading',
  5506. fn: function (){
  5507. var self=this;
  5508. smalltalk.send(self, "_position_", [smalltalk.send(smalltalk.send(self, "_position", []), "__plus", [(1)])]);
  5509. return smalltalk.send(self['@collection'], "_at_", [smalltalk.send(self, "_position", [])]);
  5510. return self;},
  5511. source: unescape('next%0A%09self%20position%3A%20self%20position%20+%201.%20%0A%09%5Ecollection%20at%3A%20self%20position%0A'),
  5512. messageSends: ["position:", unescape("+"), "position", "at:"],
  5513. referencedClasses: []
  5514. }),
  5515. smalltalk.Stream);
  5516. smalltalk.addMethod(
  5517. '_next_',
  5518. smalltalk.method({
  5519. selector: 'next:',
  5520. category: 'reading',
  5521. fn: function (anInteger){
  5522. var self=this;
  5523. var tempCollection=nil;
  5524. tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []);
  5525. smalltalk.send(anInteger, "_timesRepeat_", [(function(){return smalltalk.send(smalltalk.send(self, "_atEnd", []), "_ifFalse_", [(function(){return smalltalk.send(tempCollection, "_add_", [smalltalk.send(self, "_next", [])]);})]);})]);
  5526. return tempCollection;
  5527. return self;},
  5528. source: unescape('next%3A%20anInteger%0A%09%7C%20tempCollection%20%7C%0A%09tempCollection%20%3A%3D%20self%20collection%20class%20new.%0A%09anInteger%20timesRepeat%3A%20%5B%0A%09%20%20%20%20self%20atEnd%20ifFalse%3A%20%5B%0A%09%09tempCollection%20add%3A%20self%20next%5D%5D.%0A%09%5EtempCollection%0A'),
  5529. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", "atEnd", "add:", "next"],
  5530. referencedClasses: []
  5531. }),
  5532. smalltalk.Stream);
  5533. smalltalk.addMethod(
  5534. '_nextPut_',
  5535. smalltalk.method({
  5536. selector: 'nextPut:',
  5537. category: 'writing',
  5538. fn: function (anObject){
  5539. var self=this;
  5540. smalltalk.send(self, "_position_", [smalltalk.send(smalltalk.send(self, "_position", []), "__plus", [(1)])]);
  5541. smalltalk.send(smalltalk.send(self, "_collection", []), "_at_put_", [smalltalk.send(self, "_position", []), anObject]);
  5542. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  5543. return self;},
  5544. source: unescape('nextPut%3A%20anObject%0A%09self%20position%3A%20self%20position%20+%201.%0A%09self%20collection%20at%3A%20self%20position%20put%3A%20anObject.%0A%09self%20setStreamSize%3A%20%28self%20streamSize%20max%3A%20self%20position%29%0A'),
  5545. messageSends: ["position:", unescape("+"), "position", "at:put:", "collection", "setStreamSize:", "max:", "streamSize"],
  5546. referencedClasses: []
  5547. }),
  5548. smalltalk.Stream);
  5549. smalltalk.addMethod(
  5550. '_nextPutAll_',
  5551. smalltalk.method({
  5552. selector: 'nextPutAll:',
  5553. category: 'writing',
  5554. fn: function (aCollection){
  5555. var self=this;
  5556. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_nextPut_", [each]);})]);
  5557. return self;},
  5558. source: unescape('nextPutAll%3A%20aCollection%0A%09aCollection%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20self%20nextPut%3A%20each%5D%0A'),
  5559. messageSends: ["do:", "nextPut:"],
  5560. referencedClasses: []
  5561. }),
  5562. smalltalk.Stream);
  5563. smalltalk.addMethod(
  5564. '_peek',
  5565. smalltalk.method({
  5566. selector: 'peek',
  5567. category: 'reading',
  5568. fn: function (){
  5569. var self=this;
  5570. return smalltalk.send(smalltalk.send(self, "_atEnd", []), "_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(self, "_collection", []), "_at_", [smalltalk.send(smalltalk.send(self, "_position", []), "__plus", [(1)])]);})]);
  5571. return self;},
  5572. source: unescape('peek%0A%09%5Eself%20atEnd%20ifFalse%3A%20%5B%0A%09%20%20%20%20self%20collection%20at%3A%20self%20position%20+%201%5D%0A'),
  5573. messageSends: ["ifFalse:", "atEnd", "at:", "collection", unescape("+"), "position"],
  5574. referencedClasses: []
  5575. }),
  5576. smalltalk.Stream);
  5577. smalltalk.addMethod(
  5578. '_atEnd',
  5579. smalltalk.method({
  5580. selector: 'atEnd',
  5581. category: 'testing',
  5582. fn: function (){
  5583. var self=this;
  5584. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [smalltalk.send(self, "_size", [])]);
  5585. return self;},
  5586. source: unescape('atEnd%0A%09%5Eself%20position%20%3D%20self%20size%0A'),
  5587. messageSends: [unescape("%3D"), "position", "size"],
  5588. referencedClasses: []
  5589. }),
  5590. smalltalk.Stream);
  5591. smalltalk.addMethod(
  5592. '_atStart',
  5593. smalltalk.method({
  5594. selector: 'atStart',
  5595. category: 'testing',
  5596. fn: function (){
  5597. var self=this;
  5598. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [(0)]);
  5599. return self;},
  5600. source: unescape('atStart%0A%09%5Eself%20position%20%3D%200%0A'),
  5601. messageSends: [unescape("%3D"), "position"],
  5602. referencedClasses: []
  5603. }),
  5604. smalltalk.Stream);
  5605. smalltalk.addMethod(
  5606. '_isEmpty',
  5607. smalltalk.method({
  5608. selector: 'isEmpty',
  5609. category: 'testing',
  5610. fn: function (){
  5611. var self=this;
  5612. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
  5613. return self;},
  5614. source: unescape('isEmpty%0A%09%5Eself%20size%20%3D%200%0A'),
  5615. messageSends: [unescape("%3D"), "size"],
  5616. referencedClasses: []
  5617. }),
  5618. smalltalk.Stream);
  5619. smalltalk.addMethod(
  5620. '_on_',
  5621. smalltalk.method({
  5622. selector: 'on:',
  5623. category: 'instance creation',
  5624. fn: function (aCollection){
  5625. var self=this;
  5626. 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", []));
  5627. return self;},
  5628. source: unescape('on%3A%20aCollection%0A%09%20%20%20%20%5Eself%20new%20%0A%09%09setCollection%3A%20aCollection%3B%0A%09%09setStreamSize%3A%20aCollection%20size%3B%0A%09%09yourself%0A'),
  5629. messageSends: ["setCollection:", "setStreamSize:", "size", "yourself", "new"],
  5630. referencedClasses: []
  5631. }),
  5632. smalltalk.Stream.klass);
  5633. smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel');
  5634. smalltalk.addMethod(
  5635. '_next_',
  5636. smalltalk.method({
  5637. selector: 'next:',
  5638. category: 'reading',
  5639. fn: function (anInteger){
  5640. var self=this;
  5641. var tempCollection=nil;
  5642. tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []);
  5643. smalltalk.send(anInteger, "_timesRepeat_", [(function(){return smalltalk.send(smalltalk.send(self, "_atEnd", []), "_ifFalse_", [(function(){return tempCollection=smalltalk.send(tempCollection, "__comma", [smalltalk.send(self, "_next", [])]);})]);})]);
  5644. return tempCollection;
  5645. return self;},
  5646. source: unescape('next%3A%20anInteger%0A%09%7C%20tempCollection%20%7C%0A%09tempCollection%20%3A%3D%20self%20collection%20class%20new.%0A%09anInteger%20timesRepeat%3A%20%5B%0A%09%20%20%20%20self%20atEnd%20ifFalse%3A%20%5B%0A%09%09tempCollection%20%3A%3D%20tempCollection%2C%20self%20next%5D%5D.%0A%09%5EtempCollection%0A'),
  5647. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", "atEnd", unescape("%2C"), "next"],
  5648. referencedClasses: []
  5649. }),
  5650. smalltalk.StringStream);
  5651. smalltalk.addMethod(
  5652. '_nextPut_',
  5653. smalltalk.method({
  5654. selector: 'nextPut:',
  5655. category: 'writing',
  5656. fn: function (aString){
  5657. var self=this;
  5658. smalltalk.send(self, "_nextPutAll_", [aString]);
  5659. return self;},
  5660. source: unescape('nextPut%3A%20aString%0A%09self%20nextPutAll%3A%20aString%0A'),
  5661. messageSends: ["nextPutAll:"],
  5662. referencedClasses: []
  5663. }),
  5664. smalltalk.StringStream);
  5665. smalltalk.addMethod(
  5666. '_nextPutAll_',
  5667. smalltalk.method({
  5668. selector: 'nextPutAll:',
  5669. category: 'writing',
  5670. fn: function (aString){
  5671. var self=this;
  5672. 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_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_position", []), "__plus", [(1)]), "__plus", [smalltalk.send(aString, "_size", [])]), smalltalk.send(smalltalk.send(self, "_collection", []), "_size", [])])])]);
  5673. smalltalk.send(self, "_position_", [smalltalk.send(smalltalk.send(self, "_position", []), "__plus", [smalltalk.send(aString, "_size", [])])]);
  5674. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  5675. return self;},
  5676. source: unescape('nextPutAll%3A%20aString%0A%09self%20setCollection%3A%20%0A%09%20%20%20%20%28self%20collection%20copyFrom%3A%201%20to%3A%20self%20position%29%2C%0A%09%20%20%20%20aString%2C%0A%09%20%20%20%20%28self%20collection%20copyFrom%3A%20%28self%20position%20+%201%20+%20aString%20size%29%20to%3A%20self%20collection%20size%29.%0A%09self%20position%3A%20self%20position%20+%20aString%20size.%0A%09self%20setStreamSize%3A%20%28self%20streamSize%20max%3A%20self%20position%29%0A'),
  5677. messageSends: ["setCollection:", unescape("%2C"), "copyFrom:to:", "collection", "position", unescape("+"), "size", "position:", "setStreamSize:", "max:", "streamSize"],
  5678. referencedClasses: []
  5679. }),
  5680. smalltalk.StringStream);
  5681. smalltalk.addClass('ClassCommentReader', smalltalk.Object, ['class', 'chunkParser'], 'Kernel');
  5682. smalltalk.addMethod(
  5683. '_class_',
  5684. smalltalk.method({
  5685. selector: 'class:',
  5686. category: 'accessing',
  5687. fn: function (aClass){
  5688. var self=this;
  5689. self['@class']=aClass;
  5690. return self;},
  5691. source: unescape('class%3A%20aClass%0A%09class%20%3A%3D%20aClass%0A'),
  5692. messageSends: [],
  5693. referencedClasses: []
  5694. }),
  5695. smalltalk.ClassCommentReader);
  5696. smalltalk.addMethod(
  5697. '_scanFrom_',
  5698. smalltalk.method({
  5699. selector: 'scanFrom:',
  5700. category: 'fileIn',
  5701. fn: function (aStream){
  5702. var self=this;
  5703. var nextChunk=nil;
  5704. nextChunk=smalltalk.send(smalltalk.send(smalltalk.send(self['@chunkParser'], "_emptyChunk", []), "__slash", [smalltalk.send(self['@chunkParser'], "_chunk", [])]), "_parse_", [aStream]);
  5705. smalltalk.send(smalltalk.send(nextChunk, "_isEmptyChunk", []), "_ifFalse_", [(function(){return smalltalk.send(self, "_setComment_", [smalltalk.send(nextChunk, "_contents", [])]);})]);
  5706. return self;},
  5707. source: unescape('scanFrom%3A%20aStream%0A%09%7C%20nextChunk%20%7C%0A%09nextChunk%20%3A%3D%20%28chunkParser%20emptyChunk%20/%20chunkParser%20chunk%29%20parse%3A%20aStream.%0A%09nextChunk%20isEmptyChunk%20ifFalse%3A%20%5B%0A%09%20%20%20%20self%20setComment%3A%20nextChunk%20contents%5D.%0A'),
  5708. messageSends: ["parse:", unescape("/"), "emptyChunk", "chunk", "ifFalse:", "isEmptyChunk", "setComment:", "contents"],
  5709. referencedClasses: []
  5710. }),
  5711. smalltalk.ClassCommentReader);
  5712. smalltalk.addMethod(
  5713. '_initialize',
  5714. smalltalk.method({
  5715. selector: 'initialize',
  5716. category: 'initialization',
  5717. fn: function (){
  5718. var self=this;
  5719. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  5720. self['@chunkParser']=smalltalk.send(smalltalk.ChunkParser, "_new", []);
  5721. return self;},
  5722. source: unescape('initialize%0A%09super%20initialize.%0A%09chunkParser%20%3A%3D%20ChunkParser%20new.%0A'),
  5723. messageSends: ["initialize", "new"],
  5724. referencedClasses: [smalltalk.ChunkParser]
  5725. }),
  5726. smalltalk.ClassCommentReader);
  5727. smalltalk.addMethod(
  5728. '_setComment_',
  5729. smalltalk.method({
  5730. selector: 'setComment:',
  5731. category: 'private',
  5732. fn: function (aString){
  5733. var self=this;
  5734. smalltalk.send(self['@class'], "_comment_", [aString]);
  5735. return self;},
  5736. source: unescape('setComment%3A%20aString%0A%20%20%20%20class%20comment%3A%20aString%0A'),
  5737. messageSends: ["comment:"],
  5738. referencedClasses: []
  5739. }),
  5740. smalltalk.ClassCommentReader);
  5741. smalltalk.addClass('Random', smalltalk.Object, [], 'Kernel');
  5742. smalltalk.addMethod(
  5743. '_next',
  5744. smalltalk.method({
  5745. selector: 'next',
  5746. category: 'accessing',
  5747. fn: function (){
  5748. var self=this;
  5749. return Math.random();
  5750. return self;},
  5751. source: unescape('next%0A%09%7B%27return%20Math.random%28%29%27%7D%0A'),
  5752. messageSends: [],
  5753. referencedClasses: []
  5754. }),
  5755. smalltalk.Random);
  5756. smalltalk.addMethod(
  5757. '_next_',
  5758. smalltalk.method({
  5759. selector: 'next:',
  5760. category: 'accessing',
  5761. fn: function (anInteger){
  5762. var self=this;
  5763. return smalltalk.send((1), "_to_collect_", [anInteger, (function(each){return smalltalk.send(self, "_next", []);})]);
  5764. return self;},
  5765. source: unescape('next%3A%20anInteger%0A%20%20%20%20%5E1%20to%3A%20anInteger%20collect%3A%20%5B%3Aeach%20%7C%20self%20next%5D%0A'),
  5766. messageSends: ["to:collect:", "next"],
  5767. referencedClasses: []
  5768. }),
  5769. smalltalk.Random);
  5770. smalltalk.addClass('Point', smalltalk.Object, ['x', 'y'], 'Kernel');
  5771. smalltalk.addMethod(
  5772. '_x',
  5773. smalltalk.method({
  5774. selector: 'x',
  5775. category: 'accessing',
  5776. fn: function (){
  5777. var self=this;
  5778. return self['@x'];
  5779. return self;},
  5780. source: unescape('x%0A%09%5Ex'),
  5781. messageSends: [],
  5782. referencedClasses: []
  5783. }),
  5784. smalltalk.Point);
  5785. smalltalk.addMethod(
  5786. '_y',
  5787. smalltalk.method({
  5788. selector: 'y',
  5789. category: 'accessing',
  5790. fn: function (){
  5791. var self=this;
  5792. return self['@y'];
  5793. return self;},
  5794. source: unescape('y%0A%09%5Ey'),
  5795. messageSends: [],
  5796. referencedClasses: []
  5797. }),
  5798. smalltalk.Point);
  5799. smalltalk.addMethod(
  5800. '_y_',
  5801. smalltalk.method({
  5802. selector: 'y:',
  5803. category: 'accessing',
  5804. fn: function (aNumber){
  5805. var self=this;
  5806. self['@y']=aNumber;
  5807. return self;},
  5808. source: unescape('y%3A%20aNumber%0A%09y%20%3A%3D%20aNumber'),
  5809. messageSends: [],
  5810. referencedClasses: []
  5811. }),
  5812. smalltalk.Point);
  5813. smalltalk.addMethod(
  5814. '_x_',
  5815. smalltalk.method({
  5816. selector: 'x:',
  5817. category: 'accessing',
  5818. fn: function (aNumber){
  5819. var self=this;
  5820. self['@x']=aNumber;
  5821. return self;},
  5822. source: unescape('x%3A%20aNumber%0A%09x%20%3A%3D%20aNumber'),
  5823. messageSends: [],
  5824. referencedClasses: []
  5825. }),
  5826. smalltalk.Point);
  5827. smalltalk.addMethod(
  5828. '__star',
  5829. smalltalk.method({
  5830. selector: '*',
  5831. category: 'arithmetic',
  5832. fn: function (aPoint){
  5833. var self=this;
  5834. return smalltalk.send(smalltalk.Point, "_x_y_", [smalltalk.send(smalltalk.send(self, "_x", []), "__star", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), smalltalk.send(smalltalk.send(self, "_y", []), "__star", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  5835. return self;},
  5836. source: unescape('*%20aPoint%0A%09%5EPoint%20x%3A%20self%20x%20*%20aPoint%20asPoint%20x%20y%3A%20self%20y%20*%20aPoint%20asPoint%20y'),
  5837. messageSends: ["x:y:", unescape("*"), "x", "asPoint", "y"],
  5838. referencedClasses: [smalltalk.Point]
  5839. }),
  5840. smalltalk.Point);
  5841. smalltalk.addMethod(
  5842. '__plus',
  5843. smalltalk.method({
  5844. selector: '+',
  5845. category: 'arithmetic',
  5846. fn: function (aPoint){
  5847. var self=this;
  5848. return smalltalk.send(smalltalk.Point, "_x_y_", [smalltalk.send(smalltalk.send(self, "_x", []), "__plus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), smalltalk.send(smalltalk.send(self, "_y", []), "__plus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  5849. return self;},
  5850. source: unescape('+%20aPoint%0A%09%5EPoint%20x%3A%20self%20x%20+%20aPoint%20asPoint%20x%20y%3A%20self%20y%20+%20aPoint%20asPoint%20y'),
  5851. messageSends: ["x:y:", unescape("+"), "x", "asPoint", "y"],
  5852. referencedClasses: [smalltalk.Point]
  5853. }),
  5854. smalltalk.Point);
  5855. smalltalk.addMethod(
  5856. '__minus',
  5857. smalltalk.method({
  5858. selector: '-',
  5859. category: 'arithmetic',
  5860. fn: function (aPoint){
  5861. var self=this;
  5862. return smalltalk.send(smalltalk.Point, "_x_y_", [smalltalk.send(smalltalk.send(self, "_x", []), "__minus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), smalltalk.send(smalltalk.send(self, "_y", []), "__minus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  5863. return self;},
  5864. source: unescape('-%20aPoint%0A%09%5EPoint%20x%3A%20self%20x%20-%20aPoint%20asPoint%20x%20y%3A%20self%20y%20-%20aPoint%20asPoint%20y'),
  5865. messageSends: ["x:y:", unescape("-"), "x", "asPoint", "y"],
  5866. referencedClasses: [smalltalk.Point]
  5867. }),
  5868. smalltalk.Point);
  5869. smalltalk.addMethod(
  5870. '__slash',
  5871. smalltalk.method({
  5872. selector: '/',
  5873. category: 'arithmetic',
  5874. fn: function (aPoint){
  5875. var self=this;
  5876. return smalltalk.send(smalltalk.Point, "_x_y_", [smalltalk.send(smalltalk.send(self, "_x", []), "__slash", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), smalltalk.send(smalltalk.send(self, "_y", []), "__slash", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  5877. return self;},
  5878. source: unescape('/%20aPoint%0A%09%5EPoint%20x%3A%20self%20x%20/%20aPoint%20asPoint%20x%20y%3A%20self%20y%20/%20aPoint%20asPoint%20y'),
  5879. messageSends: ["x:y:", unescape("/"), "x", "asPoint", "y"],
  5880. referencedClasses: [smalltalk.Point]
  5881. }),
  5882. smalltalk.Point);
  5883. smalltalk.addMethod(
  5884. '_asPoint',
  5885. smalltalk.method({
  5886. selector: 'asPoint',
  5887. category: 'converting',
  5888. fn: function (){
  5889. var self=this;
  5890. return self;
  5891. return self;},
  5892. source: unescape('asPoint%0A%09%5Eself'),
  5893. messageSends: [],
  5894. referencedClasses: []
  5895. }),
  5896. smalltalk.Point);
  5897. smalltalk.addMethod(
  5898. '_x_y_',
  5899. smalltalk.method({
  5900. selector: 'x:y:',
  5901. category: 'instance creation',
  5902. fn: function (aNumber, anotherNumber){
  5903. var self=this;
  5904. return (function($rec){smalltalk.send($rec, "_x_", [aNumber]);smalltalk.send($rec, "_y_", [anotherNumber]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  5905. return self;},
  5906. source: unescape('x%3A%20aNumber%20y%3A%20anotherNumber%0A%09%5Eself%20new%0A%09%09x%3A%20aNumber%3B%0A%09%09y%3A%20anotherNumber%3B%0A%09%09yourself'),
  5907. messageSends: ["x:", "y:", "yourself", "new"],
  5908. referencedClasses: []
  5909. }),
  5910. smalltalk.Point.klass);
  5911. smalltalk.addClass('Message', smalltalk.Object, ['selector', 'arguments'], 'Kernel');
  5912. smalltalk.addMethod(
  5913. '_selector',
  5914. smalltalk.method({
  5915. selector: 'selector',
  5916. category: 'accessing',
  5917. fn: function (){
  5918. var self=this;
  5919. return self['@selector'];
  5920. return self;},
  5921. source: unescape('selector%0A%09%5Eselector'),
  5922. messageSends: [],
  5923. referencedClasses: []
  5924. }),
  5925. smalltalk.Message);
  5926. smalltalk.addMethod(
  5927. '_selector_',
  5928. smalltalk.method({
  5929. selector: 'selector:',
  5930. category: 'accessing',
  5931. fn: function (aString){
  5932. var self=this;
  5933. self['@selector']=aString;
  5934. return self;},
  5935. source: unescape('selector%3A%20aString%0A%09selector%20%3A%3D%20aString'),
  5936. messageSends: [],
  5937. referencedClasses: []
  5938. }),
  5939. smalltalk.Message);
  5940. smalltalk.addMethod(
  5941. '_arguments_',
  5942. smalltalk.method({
  5943. selector: 'arguments:',
  5944. category: 'accessing',
  5945. fn: function (anArray){
  5946. var self=this;
  5947. self['@arguments']=anArray;
  5948. return self;},
  5949. source: unescape('arguments%3A%20anArray%0A%09arguments%20%3A%3D%20anArray'),
  5950. messageSends: [],
  5951. referencedClasses: []
  5952. }),
  5953. smalltalk.Message);
  5954. smalltalk.addMethod(
  5955. '_arguments',
  5956. smalltalk.method({
  5957. selector: 'arguments',
  5958. category: 'accessing',
  5959. fn: function (){
  5960. var self=this;
  5961. return self['@arguments'];
  5962. return self;},
  5963. source: unescape('arguments%0A%09%5Earguments'),
  5964. messageSends: [],
  5965. referencedClasses: []
  5966. }),
  5967. smalltalk.Message);
  5968. smalltalk.addMethod(
  5969. '_selector_arguments_',
  5970. smalltalk.method({
  5971. selector: 'selector:arguments:',
  5972. category: 'instance creation',
  5973. fn: function (aString, anArray){
  5974. var self=this;
  5975. return (function($rec){smalltalk.send($rec, "_selector_", [aString]);smalltalk.send($rec, "_arguments_", [anArray]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  5976. return self;},
  5977. source: unescape('selector%3A%20aString%20arguments%3A%20anArray%0A%09%5Eself%20new%0A%09%09selector%3A%20aString%3B%0A%09%09arguments%3A%20anArray%3B%0A%09%09yourself'),
  5978. messageSends: ["selector:", "arguments:", "yourself", "new"],
  5979. referencedClasses: []
  5980. }),
  5981. smalltalk.Message.klass);
  5982. smalltalk.addClass('MessageNotUnderstood', smalltalk.Error, ['message', 'receiver'], 'Kernel');
  5983. smalltalk.addMethod(
  5984. '_message',
  5985. smalltalk.method({
  5986. selector: 'message',
  5987. category: 'accessing',
  5988. fn: function (){
  5989. var self=this;
  5990. return self['@message'];
  5991. return self;},
  5992. source: unescape('message%0A%09%5Emessage'),
  5993. messageSends: [],
  5994. referencedClasses: []
  5995. }),
  5996. smalltalk.MessageNotUnderstood);
  5997. smalltalk.addMethod(
  5998. '_message_',
  5999. smalltalk.method({
  6000. selector: 'message:',
  6001. category: 'accessing',
  6002. fn: function (aMessage){
  6003. var self=this;
  6004. self['@message']=aMessage;
  6005. return self;},
  6006. source: unescape('message%3A%20aMessage%0A%09message%20%3A%3D%20aMessage'),
  6007. messageSends: [],
  6008. referencedClasses: []
  6009. }),
  6010. smalltalk.MessageNotUnderstood);
  6011. smalltalk.addMethod(
  6012. '_receiver',
  6013. smalltalk.method({
  6014. selector: 'receiver',
  6015. category: 'accessing',
  6016. fn: function (){
  6017. var self=this;
  6018. return self['@receiver'];
  6019. return self;},
  6020. source: unescape('receiver%0A%09%5Ereceiver'),
  6021. messageSends: [],
  6022. referencedClasses: []
  6023. }),
  6024. smalltalk.MessageNotUnderstood);
  6025. smalltalk.addMethod(
  6026. '_receiver_',
  6027. smalltalk.method({
  6028. selector: 'receiver:',
  6029. category: 'accessing',
  6030. fn: function (anObject){
  6031. var self=this;
  6032. self['@receiver']=anObject;
  6033. return self;},
  6034. source: unescape('receiver%3A%20anObject%0A%09receiver%20%3A%3D%20anObject'),
  6035. messageSends: [],
  6036. referencedClasses: []
  6037. }),
  6038. smalltalk.MessageNotUnderstood);
  6039. smalltalk.addMethod(
  6040. '_messageText',
  6041. smalltalk.method({
  6042. selector: 'messageText',
  6043. category: 'accessing',
  6044. fn: function (){
  6045. var self=this;
  6046. 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", [])]);
  6047. return self;},
  6048. source: unescape('messageText%0A%09%5Eself%20receiver%20asString%2C%20%27%20does%20not%20understand%20%23%27%2C%20self%20message%20selector'),
  6049. messageSends: [unescape("%2C"), "asString", "receiver", "selector", "message"],
  6050. referencedClasses: []
  6051. }),
  6052. smalltalk.MessageNotUnderstood);
  6053. smalltalk.addClass('Hello', smalltalk.Object, [], 'Hello');
  6054. smalltalk.addMethod(
  6055. '_hello',
  6056. smalltalk.method({
  6057. selector: 'hello',
  6058. category: 'printing',
  6059. fn: function (){
  6060. var self=this;
  6061. return "Hello world from JTalk in Node.js";
  6062. return self;},
  6063. source: unescape('hello%0A%20%20%20%20%20%20%20%20%5E%27Hello%20world%20from%20JTalk%20in%20Node.js%27%0A'),
  6064. messageSends: [],
  6065. referencedClasses: []
  6066. }),
  6067. smalltalk.Hello);
  6068. smalltalk.init(smalltalk.Object);
  6069. smalltalk.classes()._do_(function(each) {each._initialize()});
  6070. sys = require('sys');
  6071. sys.puts(smalltalk.Hello._new()._hello());