1
0

Kernel.deploy.js 176 KB

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