1
0

Kernel.deploy.js 166 KB

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