2
0

Program.js 231 KB

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