1
0

Kernel.deploy.js 169 KB

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