Kernel.deploy.js 176 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885
  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 (aNumber){
  1783. var self=this;
  1784. return self % aNumber;
  1785. return self;}
  1786. }),
  1787. smalltalk.Number);
  1788. smalltalk.addMethod(
  1789. '_to_by_',
  1790. smalltalk.method({
  1791. selector: 'to:by:',
  1792. fn: function (stop, step){
  1793. var self=this;
  1794. var array=nil;
  1795. var value=nil;
  1796. var pos=nil;
  1797. value=self;
  1798. array=smalltalk.send((smalltalk.Array || Array), "_new", []);
  1799. pos=(1);
  1800. ((($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")]);})]));
  1801. ((($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]));})()}})();})]));
  1802. return array;
  1803. return self;}
  1804. }),
  1805. smalltalk.Number);
  1806. smalltalk.addMethod(
  1807. '_to_by_do_',
  1808. smalltalk.method({
  1809. selector: 'to:by:do:',
  1810. fn: function (stop, step, aBlock){
  1811. var self=this;
  1812. var value=nil;
  1813. value=self;
  1814. ((($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")]);})]));
  1815. ((($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]));})()}})();})]));
  1816. return self;}
  1817. }),
  1818. smalltalk.Number);
  1819. smalltalk.addMethod(
  1820. '_deepCopy',
  1821. smalltalk.method({
  1822. selector: 'deepCopy',
  1823. fn: function (){
  1824. var self=this;
  1825. return smalltalk.send(self, "_copy", []);
  1826. return self;}
  1827. }),
  1828. smalltalk.Number);
  1829. smalltalk.addMethod(
  1830. '_copy',
  1831. smalltalk.method({
  1832. selector: 'copy',
  1833. fn: function (){
  1834. var self=this;
  1835. return self;
  1836. return self;}
  1837. }),
  1838. smalltalk.Number);
  1839. smalltalk.addMethod(
  1840. '_\\',
  1841. smalltalk.method({
  1842. selector: '\\',
  1843. fn: function (aNumber){
  1844. var self=this;
  1845. return self % aNumber;
  1846. return self;}
  1847. }),
  1848. smalltalk.Number);
  1849. smalltalk.addMethod(
  1850. '_sqrt',
  1851. smalltalk.method({
  1852. selector: 'sqrt',
  1853. fn: function (){
  1854. var self=this;
  1855. return Math.sqrt(self);
  1856. return self;}
  1857. }),
  1858. smalltalk.Number);
  1859. smalltalk.addMethod(
  1860. '_squared',
  1861. smalltalk.method({
  1862. selector: 'squared',
  1863. fn: function (){
  1864. var self=this;
  1865. return self * self;
  1866. return self;}
  1867. }),
  1868. smalltalk.Number);
  1869. smalltalk.addMethod(
  1870. '_pi',
  1871. smalltalk.method({
  1872. selector: 'pi',
  1873. fn: function (){
  1874. var self=this;
  1875. return Math.PI;
  1876. return self;}
  1877. }),
  1878. smalltalk.Number.klass);
  1879. smalltalk.addClass('BlockClosure', smalltalk.Object, [], 'Kernel');
  1880. smalltalk.addMethod(
  1881. '_compiledSource',
  1882. smalltalk.method({
  1883. selector: 'compiledSource',
  1884. fn: function (){
  1885. var self=this;
  1886. return self.toString();
  1887. return self;}
  1888. }),
  1889. smalltalk.BlockClosure);
  1890. smalltalk.addMethod(
  1891. '_whileTrue_',
  1892. smalltalk.method({
  1893. selector: 'whileTrue:',
  1894. fn: function (aBlock){
  1895. var self=this;
  1896. while(self()) {aBlock()};
  1897. return self;}
  1898. }),
  1899. smalltalk.BlockClosure);
  1900. smalltalk.addMethod(
  1901. '_whileFalse_',
  1902. smalltalk.method({
  1903. selector: 'whileFalse:',
  1904. fn: function (aBlock){
  1905. var self=this;
  1906. while(!self()) {aBlock()};
  1907. return self;}
  1908. }),
  1909. smalltalk.BlockClosure);
  1910. smalltalk.addMethod(
  1911. '_value',
  1912. smalltalk.method({
  1913. selector: 'value',
  1914. fn: function (){
  1915. var self=this;
  1916. return self();;
  1917. return self;}
  1918. }),
  1919. smalltalk.BlockClosure);
  1920. smalltalk.addMethod(
  1921. '_value_',
  1922. smalltalk.method({
  1923. selector: 'value:',
  1924. fn: function (anArg){
  1925. var self=this;
  1926. return self(anArg);;
  1927. return self;}
  1928. }),
  1929. smalltalk.BlockClosure);
  1930. smalltalk.addMethod(
  1931. '_value_value_',
  1932. smalltalk.method({
  1933. selector: 'value:value:',
  1934. fn: function (firstArg, secondArg){
  1935. var self=this;
  1936. return self(firstArg, secondArg);;
  1937. return self;}
  1938. }),
  1939. smalltalk.BlockClosure);
  1940. smalltalk.addMethod(
  1941. '_value_value_value_',
  1942. smalltalk.method({
  1943. selector: 'value:value:value:',
  1944. fn: function (firstArg, secondArg, thirdArg){
  1945. var self=this;
  1946. return self(firstArg, secondArg, thirdArg);;
  1947. return self;}
  1948. }),
  1949. smalltalk.BlockClosure);
  1950. smalltalk.addMethod(
  1951. '_valueWithPossibleArguments_',
  1952. smalltalk.method({
  1953. selector: 'valueWithPossibleArguments:',
  1954. fn: function (aCollection){
  1955. var self=this;
  1956. return self.apply(null, aCollection);;
  1957. return self;}
  1958. }),
  1959. smalltalk.BlockClosure);
  1960. smalltalk.addMethod(
  1961. '_on_do_',
  1962. smalltalk.method({
  1963. selector: 'on:do:',
  1964. fn: function (anErrorClass, aBlock){
  1965. var self=this;
  1966. 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", []);})]));})]);
  1967. return self;}
  1968. }),
  1969. smalltalk.BlockClosure);
  1970. smalltalk.addMethod(
  1971. '_valueWithTimeout_',
  1972. smalltalk.method({
  1973. selector: 'valueWithTimeout:',
  1974. fn: function (aNumber){
  1975. var self=this;
  1976. return setTimeout(self, aNumber);
  1977. return self;}
  1978. }),
  1979. smalltalk.BlockClosure);
  1980. smalltalk.addMethod(
  1981. '_valueWithInterval_',
  1982. smalltalk.method({
  1983. selector: 'valueWithInterval:',
  1984. fn: function (aNumber){
  1985. var self=this;
  1986. return setInterval(self, aNumber);
  1987. return self;}
  1988. }),
  1989. smalltalk.BlockClosure);
  1990. smalltalk.addMethod(
  1991. '_whileFalse',
  1992. smalltalk.method({
  1993. selector: 'whileFalse',
  1994. fn: function (){
  1995. var self=this;
  1996. smalltalk.send(self, "_whileFalse_", [(function(){return nil;})]);
  1997. return self;}
  1998. }),
  1999. smalltalk.BlockClosure);
  2000. smalltalk.addMethod(
  2001. '_whileTrue',
  2002. smalltalk.method({
  2003. selector: 'whileTrue',
  2004. fn: function (){
  2005. var self=this;
  2006. smalltalk.send(self, "_whileTrue_", [(function(){return nil;})]);
  2007. return self;}
  2008. }),
  2009. smalltalk.BlockClosure);
  2010. smalltalk.addMethod(
  2011. '_new',
  2012. smalltalk.method({
  2013. selector: 'new',
  2014. fn: function (){
  2015. var self=this;
  2016. return new self();
  2017. return self;}
  2018. }),
  2019. smalltalk.BlockClosure);
  2020. smalltalk.addMethod(
  2021. '_applyTo_arguments_',
  2022. smalltalk.method({
  2023. selector: 'applyTo:arguments:',
  2024. fn: function (anObject, aCollection){
  2025. var self=this;
  2026. return self.apply(anObject, aCollection);
  2027. return self;}
  2028. }),
  2029. smalltalk.BlockClosure);
  2030. smalltalk.addMethod(
  2031. '_timeToRun',
  2032. smalltalk.method({
  2033. selector: 'timeToRun',
  2034. fn: function (){
  2035. var self=this;
  2036. return smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [self]);
  2037. return self;}
  2038. }),
  2039. smalltalk.BlockClosure);
  2040. smalltalk.addMethod(
  2041. '_numArgs',
  2042. smalltalk.method({
  2043. selector: 'numArgs',
  2044. fn: function (){
  2045. var self=this;
  2046. return self.length;
  2047. return self;}
  2048. }),
  2049. smalltalk.BlockClosure);
  2050. smalltalk.addClass('Boolean', smalltalk.Object, [], 'Kernel');
  2051. smalltalk.addMethod(
  2052. '__eq',
  2053. smalltalk.method({
  2054. selector: '=',
  2055. fn: function (aBoolean){
  2056. var self=this;
  2057. 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}})})();})]));
  2058. return Boolean(self == true) == aBoolean;
  2059. return self;
  2060. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  2061. }),
  2062. smalltalk.Boolean);
  2063. smalltalk.addMethod(
  2064. '_shallowCopy',
  2065. smalltalk.method({
  2066. selector: 'shallowCopy',
  2067. fn: function (){
  2068. var self=this;
  2069. return self;
  2070. return self;}
  2071. }),
  2072. smalltalk.Boolean);
  2073. smalltalk.addMethod(
  2074. '_deepCopy',
  2075. smalltalk.method({
  2076. selector: 'deepCopy',
  2077. fn: function (){
  2078. var self=this;
  2079. return self;
  2080. return self;}
  2081. }),
  2082. smalltalk.Boolean);
  2083. smalltalk.addMethod(
  2084. '_ifTrue_',
  2085. smalltalk.method({
  2086. selector: 'ifTrue:',
  2087. fn: function (aBlock){
  2088. var self=this;
  2089. return smalltalk.send(self, "_ifTrue_ifFalse_", [aBlock, (function(){return nil;})]);
  2090. return self;}
  2091. }),
  2092. smalltalk.Boolean);
  2093. smalltalk.addMethod(
  2094. '_ifFalse_',
  2095. smalltalk.method({
  2096. selector: 'ifFalse:',
  2097. fn: function (aBlock){
  2098. var self=this;
  2099. return smalltalk.send(self, "_ifTrue_ifFalse_", [(function(){return nil;}), aBlock]);
  2100. return self;}
  2101. }),
  2102. smalltalk.Boolean);
  2103. smalltalk.addMethod(
  2104. '_ifFalse_ifTrue_',
  2105. smalltalk.method({
  2106. selector: 'ifFalse:ifTrue:',
  2107. fn: function (aBlock, anotherBlock){
  2108. var self=this;
  2109. return smalltalk.send(self, "_ifTrue_ifFalse_", [anotherBlock, aBlock]);
  2110. return self;}
  2111. }),
  2112. smalltalk.Boolean);
  2113. smalltalk.addMethod(
  2114. '_ifTrue_ifFalse_',
  2115. smalltalk.method({
  2116. selector: 'ifTrue:ifFalse:',
  2117. fn: function (aBlock, anotherBlock){
  2118. var self=this;
  2119. if(self == true) {
  2120. return aBlock();
  2121. } else {
  2122. return anotherBlock();
  2123. }
  2124. ;
  2125. return self;}
  2126. }),
  2127. smalltalk.Boolean);
  2128. smalltalk.addMethod(
  2129. '_and_',
  2130. smalltalk.method({
  2131. selector: 'and:',
  2132. fn: function (aBlock){
  2133. var self=this;
  2134. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [aBlock, (function(){return false;})]);
  2135. return self;}
  2136. }),
  2137. smalltalk.Boolean);
  2138. smalltalk.addMethod(
  2139. '_or_',
  2140. smalltalk.method({
  2141. selector: 'or:',
  2142. fn: function (aBlock){
  2143. var self=this;
  2144. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [(function(){return true;}), aBlock]);
  2145. return self;}
  2146. }),
  2147. smalltalk.Boolean);
  2148. smalltalk.addMethod(
  2149. '_not',
  2150. smalltalk.method({
  2151. selector: 'not',
  2152. fn: function (){
  2153. var self=this;
  2154. return smalltalk.send(self, "__eq", [false]);
  2155. return self;}
  2156. }),
  2157. smalltalk.Boolean);
  2158. smalltalk.addMethod(
  2159. '_printString',
  2160. smalltalk.method({
  2161. selector: 'printString',
  2162. fn: function (){
  2163. var self=this;
  2164. return self.toString();
  2165. return self;}
  2166. }),
  2167. smalltalk.Boolean);
  2168. smalltalk.addMethod(
  2169. '_asJSONObject',
  2170. smalltalk.method({
  2171. selector: 'asJSONObject',
  2172. fn: function (){
  2173. var self=this;
  2174. return self;
  2175. return self;}
  2176. }),
  2177. smalltalk.Boolean);
  2178. smalltalk.addMethod(
  2179. '_&',
  2180. smalltalk.method({
  2181. selector: '&',
  2182. fn: function (aBoolean){
  2183. var self=this;
  2184. if(self == true) {
  2185. return aBoolean;
  2186. } else {
  2187. return false;
  2188. }
  2189. ;
  2190. return self;}
  2191. }),
  2192. smalltalk.Boolean);
  2193. smalltalk.addMethod(
  2194. '_|',
  2195. smalltalk.method({
  2196. selector: '|',
  2197. fn: function (aBoolean){
  2198. var self=this;
  2199. if(self == true) {
  2200. return true;
  2201. } else {
  2202. return aBoolean;
  2203. }
  2204. ;
  2205. return self;}
  2206. }),
  2207. smalltalk.Boolean);
  2208. smalltalk.addMethod(
  2209. '__eq_eq',
  2210. smalltalk.method({
  2211. selector: '==',
  2212. fn: function (aBoolean){
  2213. var self=this;
  2214. 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}})})();})]));
  2215. return Boolean(self == true) === Boolean(aBoolean == true);
  2216. return self;
  2217. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq_eq'){return e.fn()} throw(e)}}
  2218. }),
  2219. smalltalk.Boolean);
  2220. smalltalk.addClass('Date', smalltalk.Object, [], 'Kernel');
  2221. smalltalk.addMethod(
  2222. '_year',
  2223. smalltalk.method({
  2224. selector: 'year',
  2225. fn: function (){
  2226. var self=this;
  2227. return self.getFullYear();
  2228. return self;}
  2229. }),
  2230. smalltalk.Date);
  2231. smalltalk.addMethod(
  2232. '_month',
  2233. smalltalk.method({
  2234. selector: 'month',
  2235. fn: function (){
  2236. var self=this;
  2237. return self.getMonth() + 1;
  2238. return self;}
  2239. }),
  2240. smalltalk.Date);
  2241. smalltalk.addMethod(
  2242. '_month_',
  2243. smalltalk.method({
  2244. selector: 'month:',
  2245. fn: function (aNumber){
  2246. var self=this;
  2247. self.setMonth(aNumber - 1);
  2248. return self;}
  2249. }),
  2250. smalltalk.Date);
  2251. smalltalk.addMethod(
  2252. '_day',
  2253. smalltalk.method({
  2254. selector: 'day',
  2255. fn: function (){
  2256. var self=this;
  2257. return smalltalk.send(self, "_dayOfWeek", []);
  2258. return self;}
  2259. }),
  2260. smalltalk.Date);
  2261. smalltalk.addMethod(
  2262. '_dayOfWeek',
  2263. smalltalk.method({
  2264. selector: 'dayOfWeek',
  2265. fn: function (){
  2266. var self=this;
  2267. return self.getDay() + 1;
  2268. return self;}
  2269. }),
  2270. smalltalk.Date);
  2271. smalltalk.addMethod(
  2272. '_dayOfWeek_',
  2273. smalltalk.method({
  2274. selector: 'dayOfWeek:',
  2275. fn: function (aNumber){
  2276. var self=this;
  2277. return self.setDay(aNumber - 1);
  2278. return self;}
  2279. }),
  2280. smalltalk.Date);
  2281. smalltalk.addMethod(
  2282. '_day_',
  2283. smalltalk.method({
  2284. selector: 'day:',
  2285. fn: function (aNumber){
  2286. var self=this;
  2287. smalltalk.send(self, "_day_", [aNumber]);
  2288. return self;}
  2289. }),
  2290. smalltalk.Date);
  2291. smalltalk.addMethod(
  2292. '_year_',
  2293. smalltalk.method({
  2294. selector: 'year:',
  2295. fn: function (aNumber){
  2296. var self=this;
  2297. self.setFullYear(aNumber);
  2298. return self;}
  2299. }),
  2300. smalltalk.Date);
  2301. smalltalk.addMethod(
  2302. '_dayOfMonth',
  2303. smalltalk.method({
  2304. selector: 'dayOfMonth',
  2305. fn: function (){
  2306. var self=this;
  2307. return self.getDate();
  2308. return self;}
  2309. }),
  2310. smalltalk.Date);
  2311. smalltalk.addMethod(
  2312. '_dayOfMonth_',
  2313. smalltalk.method({
  2314. selector: 'dayOfMonth:',
  2315. fn: function (aNumber){
  2316. var self=this;
  2317. self.setDate(aNumber);
  2318. return self;}
  2319. }),
  2320. smalltalk.Date);
  2321. smalltalk.addMethod(
  2322. '_asString',
  2323. smalltalk.method({
  2324. selector: 'asString',
  2325. fn: function (){
  2326. var self=this;
  2327. return self.toString();
  2328. return self;}
  2329. }),
  2330. smalltalk.Date);
  2331. smalltalk.addMethod(
  2332. '_printString',
  2333. smalltalk.method({
  2334. selector: 'printString',
  2335. fn: function (){
  2336. var self=this;
  2337. return smalltalk.send(self, "_asString", []);
  2338. return self;}
  2339. }),
  2340. smalltalk.Date);
  2341. smalltalk.addMethod(
  2342. '_asMilliseconds',
  2343. smalltalk.method({
  2344. selector: 'asMilliseconds',
  2345. fn: function (){
  2346. var self=this;
  2347. return smalltalk.send(self, "_time", []);
  2348. return self;}
  2349. }),
  2350. smalltalk.Date);
  2351. smalltalk.addMethod(
  2352. '_time',
  2353. smalltalk.method({
  2354. selector: 'time',
  2355. fn: function (){
  2356. var self=this;
  2357. return self.getTime();
  2358. return self;}
  2359. }),
  2360. smalltalk.Date);
  2361. smalltalk.addMethod(
  2362. '_time_',
  2363. smalltalk.method({
  2364. selector: 'time:',
  2365. fn: function (aNumber){
  2366. var self=this;
  2367. self.setTime(aNumber);
  2368. return self;}
  2369. }),
  2370. smalltalk.Date);
  2371. smalltalk.addMethod(
  2372. '_asDateString',
  2373. smalltalk.method({
  2374. selector: 'asDateString',
  2375. fn: function (){
  2376. var self=this;
  2377. return self.toDateString();
  2378. return self;}
  2379. }),
  2380. smalltalk.Date);
  2381. smalltalk.addMethod(
  2382. '_asTimeString',
  2383. smalltalk.method({
  2384. selector: 'asTimeString',
  2385. fn: function (){
  2386. var self=this;
  2387. return self.toTimeString();
  2388. return self;}
  2389. }),
  2390. smalltalk.Date);
  2391. smalltalk.addMethod(
  2392. '_asLocaleString',
  2393. smalltalk.method({
  2394. selector: 'asLocaleString',
  2395. fn: function (){
  2396. var self=this;
  2397. return self.toLocaleString();
  2398. return self;}
  2399. }),
  2400. smalltalk.Date);
  2401. smalltalk.addMethod(
  2402. '_asNumber',
  2403. smalltalk.method({
  2404. selector: 'asNumber',
  2405. fn: function (){
  2406. var self=this;
  2407. return smalltalk.send(self, "_asMilliseconds", []);
  2408. return self;}
  2409. }),
  2410. smalltalk.Date);
  2411. smalltalk.addMethod(
  2412. '_hours_',
  2413. smalltalk.method({
  2414. selector: 'hours:',
  2415. fn: function (aNumber){
  2416. var self=this;
  2417. self.setHours(aNumber);
  2418. return self;}
  2419. }),
  2420. smalltalk.Date);
  2421. smalltalk.addMethod(
  2422. '_minutes_',
  2423. smalltalk.method({
  2424. selector: 'minutes:',
  2425. fn: function (aNumber){
  2426. var self=this;
  2427. self.setMinutes(aNumber);
  2428. return self;}
  2429. }),
  2430. smalltalk.Date);
  2431. smalltalk.addMethod(
  2432. '_seconds_',
  2433. smalltalk.method({
  2434. selector: 'seconds:',
  2435. fn: function (aNumber){
  2436. var self=this;
  2437. self.setSeconds(aNumber);
  2438. return self;}
  2439. }),
  2440. smalltalk.Date);
  2441. smalltalk.addMethod(
  2442. '_milliseconds_',
  2443. smalltalk.method({
  2444. selector: 'milliseconds:',
  2445. fn: function (aNumber){
  2446. var self=this;
  2447. self.setMilliseconds(aNumber);
  2448. return self;}
  2449. }),
  2450. smalltalk.Date);
  2451. smalltalk.addMethod(
  2452. '_hours',
  2453. smalltalk.method({
  2454. selector: 'hours',
  2455. fn: function (){
  2456. var self=this;
  2457. return self.getHours();
  2458. return self;}
  2459. }),
  2460. smalltalk.Date);
  2461. smalltalk.addMethod(
  2462. '_minutes',
  2463. smalltalk.method({
  2464. selector: 'minutes',
  2465. fn: function (){
  2466. var self=this;
  2467. return self.getMinutes();
  2468. return self;}
  2469. }),
  2470. smalltalk.Date);
  2471. smalltalk.addMethod(
  2472. '_seconds',
  2473. smalltalk.method({
  2474. selector: 'seconds',
  2475. fn: function (){
  2476. var self=this;
  2477. return self.getSeconds();
  2478. return self;}
  2479. }),
  2480. smalltalk.Date);
  2481. smalltalk.addMethod(
  2482. '_milliseconds',
  2483. smalltalk.method({
  2484. selector: 'milliseconds',
  2485. fn: function (){
  2486. var self=this;
  2487. return self.getMilliseconds();
  2488. return self;}
  2489. }),
  2490. smalltalk.Date);
  2491. smalltalk.addMethod(
  2492. '__lt',
  2493. smalltalk.method({
  2494. selector: '<',
  2495. fn: function (aDate){
  2496. var self=this;
  2497. return self < aDate;
  2498. return self;}
  2499. }),
  2500. smalltalk.Date);
  2501. smalltalk.addMethod(
  2502. '__gt',
  2503. smalltalk.method({
  2504. selector: '>',
  2505. fn: function (aDate){
  2506. var self=this;
  2507. return self > aDate;
  2508. return self;}
  2509. }),
  2510. smalltalk.Date);
  2511. smalltalk.addMethod(
  2512. '__lt_eq',
  2513. smalltalk.method({
  2514. selector: '<=',
  2515. fn: function (aDate){
  2516. var self=this;
  2517. return self <= aDate;
  2518. return self;}
  2519. }),
  2520. smalltalk.Date);
  2521. smalltalk.addMethod(
  2522. '__gt_eq',
  2523. smalltalk.method({
  2524. selector: '>=',
  2525. fn: function (aDate){
  2526. var self=this;
  2527. return self >= aDate;
  2528. return self;}
  2529. }),
  2530. smalltalk.Date);
  2531. smalltalk.addMethod(
  2532. '__minus',
  2533. smalltalk.method({
  2534. selector: '-',
  2535. fn: function (aDate){
  2536. var self=this;
  2537. return self - aDate;
  2538. return self;}
  2539. }),
  2540. smalltalk.Date);
  2541. smalltalk.addMethod(
  2542. '__plus',
  2543. smalltalk.method({
  2544. selector: '+',
  2545. fn: function (aDate){
  2546. var self=this;
  2547. return self + aDate;
  2548. return self;}
  2549. }),
  2550. smalltalk.Date);
  2551. smalltalk.addMethod(
  2552. '_asJSONObject',
  2553. smalltalk.method({
  2554. selector: 'asJSONObject',
  2555. fn: function (){
  2556. var self=this;
  2557. return self;
  2558. return self;}
  2559. }),
  2560. smalltalk.Date);
  2561. smalltalk.addMethod(
  2562. '_new_',
  2563. smalltalk.method({
  2564. selector: 'new:',
  2565. fn: function (anObject){
  2566. var self=this;
  2567. return new Date(anObject);
  2568. return self;}
  2569. }),
  2570. smalltalk.Date.klass);
  2571. smalltalk.addMethod(
  2572. '_fromString_',
  2573. smalltalk.method({
  2574. selector: 'fromString:',
  2575. fn: function (aString){
  2576. var self=this;
  2577. return smalltalk.send(self, "_new_", [aString]);
  2578. return self;}
  2579. }),
  2580. smalltalk.Date.klass);
  2581. smalltalk.addMethod(
  2582. '_fromSeconds_',
  2583. smalltalk.method({
  2584. selector: 'fromSeconds:',
  2585. fn: function (aNumber){
  2586. var self=this;
  2587. return smalltalk.send(self, "_fromMilliseconds_", [((($receiver = aNumber).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)]))]);
  2588. return self;}
  2589. }),
  2590. smalltalk.Date.klass);
  2591. smalltalk.addMethod(
  2592. '_fromMilliseconds_',
  2593. smalltalk.method({
  2594. selector: 'fromMilliseconds:',
  2595. fn: function (aNumber){
  2596. var self=this;
  2597. return smalltalk.send(self, "_new_", [aNumber]);
  2598. return self;}
  2599. }),
  2600. smalltalk.Date.klass);
  2601. smalltalk.addMethod(
  2602. '_today',
  2603. smalltalk.method({
  2604. selector: 'today',
  2605. fn: function (){
  2606. var self=this;
  2607. return smalltalk.send(self, "_new", []);
  2608. return self;}
  2609. }),
  2610. smalltalk.Date.klass);
  2611. smalltalk.addMethod(
  2612. '_now',
  2613. smalltalk.method({
  2614. selector: 'now',
  2615. fn: function (){
  2616. var self=this;
  2617. return smalltalk.send(self, "_today", []);
  2618. return self;}
  2619. }),
  2620. smalltalk.Date.klass);
  2621. smalltalk.addMethod(
  2622. '_millisecondsToRun_',
  2623. smalltalk.method({
  2624. selector: 'millisecondsToRun:',
  2625. fn: function (aBlock){
  2626. var self=this;
  2627. var t=nil;
  2628. t=smalltalk.send((smalltalk.Date || Date), "_now", []);
  2629. smalltalk.send(aBlock, "_value", []);
  2630. return ((($receiver = smalltalk.send((smalltalk.Date || Date), "_now", [])).klass === smalltalk.Number) ? $receiver -t : smalltalk.send($receiver, "__minus", [t]));
  2631. return self;}
  2632. }),
  2633. smalltalk.Date.klass);
  2634. smalltalk.addClass('UndefinedObject', smalltalk.Object, [], 'Kernel');
  2635. smalltalk.addMethod(
  2636. '_subclass_instanceVariableNames_',
  2637. smalltalk.method({
  2638. selector: 'subclass:instanceVariableNames:',
  2639. fn: function (aString, anotherString){
  2640. var self=this;
  2641. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, anotherString, nil]);
  2642. return self;}
  2643. }),
  2644. smalltalk.UndefinedObject);
  2645. smalltalk.addMethod(
  2646. '_subclass_instanceVariableNames_category_',
  2647. smalltalk.method({
  2648. selector: 'subclass:instanceVariableNames:category:',
  2649. fn: function (aString, aString2, aString3){
  2650. var self=this;
  2651. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
  2652. return self;}
  2653. }),
  2654. smalltalk.UndefinedObject);
  2655. smalltalk.addMethod(
  2656. '_shallowCopy',
  2657. smalltalk.method({
  2658. selector: 'shallowCopy',
  2659. fn: function (){
  2660. var self=this;
  2661. return self;
  2662. return self;}
  2663. }),
  2664. smalltalk.UndefinedObject);
  2665. smalltalk.addMethod(
  2666. '_deepCopy',
  2667. smalltalk.method({
  2668. selector: 'deepCopy',
  2669. fn: function (){
  2670. var self=this;
  2671. return self;
  2672. return self;}
  2673. }),
  2674. smalltalk.UndefinedObject);
  2675. smalltalk.addMethod(
  2676. '_ifNil_',
  2677. smalltalk.method({
  2678. selector: 'ifNil:',
  2679. fn: function (aBlock){
  2680. var self=this;
  2681. return smalltalk.send(self, "_ifNil_ifNotNil_", [aBlock, (function(){return nil;})]);
  2682. return self;}
  2683. }),
  2684. smalltalk.UndefinedObject);
  2685. smalltalk.addMethod(
  2686. '_ifNotNil_',
  2687. smalltalk.method({
  2688. selector: 'ifNotNil:',
  2689. fn: function (aBlock){
  2690. var self=this;
  2691. return self;
  2692. return self;}
  2693. }),
  2694. smalltalk.UndefinedObject);
  2695. smalltalk.addMethod(
  2696. '_ifNil_ifNotNil_',
  2697. smalltalk.method({
  2698. selector: 'ifNil:ifNotNil:',
  2699. fn: function (aBlock, anotherBlock){
  2700. var self=this;
  2701. return smalltalk.send(aBlock, "_value", []);
  2702. return self;}
  2703. }),
  2704. smalltalk.UndefinedObject);
  2705. smalltalk.addMethod(
  2706. '_ifNotNil_ifNil_',
  2707. smalltalk.method({
  2708. selector: 'ifNotNil:ifNil:',
  2709. fn: function (aBlock, anotherBlock){
  2710. var self=this;
  2711. return smalltalk.send(anotherBlock, "_value", []);
  2712. return self;}
  2713. }),
  2714. smalltalk.UndefinedObject);
  2715. smalltalk.addMethod(
  2716. '_isNil',
  2717. smalltalk.method({
  2718. selector: 'isNil',
  2719. fn: function (){
  2720. var self=this;
  2721. return true;
  2722. return self;}
  2723. }),
  2724. smalltalk.UndefinedObject);
  2725. smalltalk.addMethod(
  2726. '_notNil',
  2727. smalltalk.method({
  2728. selector: 'notNil',
  2729. fn: function (){
  2730. var self=this;
  2731. return false;
  2732. return self;}
  2733. }),
  2734. smalltalk.UndefinedObject);
  2735. smalltalk.addMethod(
  2736. '_printString',
  2737. smalltalk.method({
  2738. selector: 'printString',
  2739. fn: function (){
  2740. var self=this;
  2741. return "nil";
  2742. return self;}
  2743. }),
  2744. smalltalk.UndefinedObject);
  2745. smalltalk.addMethod(
  2746. '_subclass_instanceVariableNames_package_',
  2747. smalltalk.method({
  2748. selector: 'subclass:instanceVariableNames:package:',
  2749. fn: function (aString, aString2, aString3){
  2750. var self=this;
  2751. return smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_superclass_subclass_instanceVariableNames_package_", [self, aString, aString2, aString3]);
  2752. return self;}
  2753. }),
  2754. smalltalk.UndefinedObject);
  2755. smalltalk.addMethod(
  2756. '_new',
  2757. smalltalk.method({
  2758. selector: 'new',
  2759. fn: function (){
  2760. var self=this;
  2761. smalltalk.send(self, "_error_", ["You cannot create new instances of UndefinedObject. Use nil"]);
  2762. return self;}
  2763. }),
  2764. smalltalk.UndefinedObject.klass);
  2765. smalltalk.addClass('Collection', smalltalk.Object, [], 'Kernel');
  2766. smalltalk.addMethod(
  2767. '_size',
  2768. smalltalk.method({
  2769. selector: 'size',
  2770. fn: function (){
  2771. var self=this;
  2772. smalltalk.send(self, "_subclassResponsibility", []);
  2773. return self;}
  2774. }),
  2775. smalltalk.Collection);
  2776. smalltalk.addMethod(
  2777. '_readStream',
  2778. smalltalk.method({
  2779. selector: 'readStream',
  2780. fn: function (){
  2781. var self=this;
  2782. return smalltalk.send(self, "_stream", []);
  2783. return self;}
  2784. }),
  2785. smalltalk.Collection);
  2786. smalltalk.addMethod(
  2787. '_writeStream',
  2788. smalltalk.method({
  2789. selector: 'writeStream',
  2790. fn: function (){
  2791. var self=this;
  2792. return smalltalk.send(self, "_stream", []);
  2793. return self;}
  2794. }),
  2795. smalltalk.Collection);
  2796. smalltalk.addMethod(
  2797. '_stream',
  2798. smalltalk.method({
  2799. selector: 'stream',
  2800. fn: function (){
  2801. var self=this;
  2802. return smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [self]);
  2803. return self;}
  2804. }),
  2805. smalltalk.Collection);
  2806. smalltalk.addMethod(
  2807. '_streamClass',
  2808. smalltalk.method({
  2809. selector: 'streamClass',
  2810. fn: function (){
  2811. var self=this;
  2812. return smalltalk.send(smalltalk.send(self, "_class", []), "_streamClass", []);
  2813. return self;}
  2814. }),
  2815. smalltalk.Collection);
  2816. smalltalk.addMethod(
  2817. '_add_',
  2818. smalltalk.method({
  2819. selector: 'add:',
  2820. fn: function (anObject){
  2821. var self=this;
  2822. smalltalk.send(self, "_subclassResponsibility", []);
  2823. return self;}
  2824. }),
  2825. smalltalk.Collection);
  2826. smalltalk.addMethod(
  2827. '_addAll_',
  2828. smalltalk.method({
  2829. selector: 'addAll:',
  2830. fn: function (aCollection){
  2831. var self=this;
  2832. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_add_", [each]);})]);
  2833. return aCollection;
  2834. return self;}
  2835. }),
  2836. smalltalk.Collection);
  2837. smalltalk.addMethod(
  2838. '__comma',
  2839. smalltalk.method({
  2840. selector: ',',
  2841. fn: function (aCollection){
  2842. var self=this;
  2843. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  2844. return self;}
  2845. }),
  2846. smalltalk.Collection);
  2847. smalltalk.addMethod(
  2848. '_copyWith_',
  2849. smalltalk.method({
  2850. selector: 'copyWith:',
  2851. fn: function (anObject){
  2852. var self=this;
  2853. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  2854. return self;}
  2855. }),
  2856. smalltalk.Collection);
  2857. smalltalk.addMethod(
  2858. '_copyWithAll_',
  2859. smalltalk.method({
  2860. selector: 'copyWithAll:',
  2861. fn: function (aCollection){
  2862. var self=this;
  2863. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  2864. return self;}
  2865. }),
  2866. smalltalk.Collection);
  2867. smalltalk.addMethod(
  2868. '_asArray',
  2869. smalltalk.method({
  2870. selector: 'asArray',
  2871. fn: function (){
  2872. var self=this;
  2873. var array=nil;
  2874. var index=nil;
  2875. array=smalltalk.send((smalltalk.Array || Array), "_new", []);
  2876. index=(0);
  2877. 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]);})]);
  2878. return array;
  2879. return self;}
  2880. }),
  2881. smalltalk.Collection);
  2882. smalltalk.addMethod(
  2883. '_do_',
  2884. smalltalk.method({
  2885. selector: 'do:',
  2886. fn: function (aBlock){
  2887. var self=this;
  2888. for(var i=0;i<self.length;i++){aBlock(self[i]);};
  2889. return self;}
  2890. }),
  2891. smalltalk.Collection);
  2892. smalltalk.addMethod(
  2893. '_collect_',
  2894. smalltalk.method({
  2895. selector: 'collect:',
  2896. fn: function (aBlock){
  2897. var self=this;
  2898. var newCollection=nil;
  2899. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  2900. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [smalltalk.send(aBlock, "_value_", [each])]);})]);
  2901. return newCollection;
  2902. return self;}
  2903. }),
  2904. smalltalk.Collection);
  2905. smalltalk.addMethod(
  2906. '_detect_',
  2907. smalltalk.method({
  2908. selector: 'detect:',
  2909. fn: function (aBlock){
  2910. var self=this;
  2911. return smalltalk.send(self, "_detect_ifNone_", [aBlock, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  2912. return self;}
  2913. }),
  2914. smalltalk.Collection);
  2915. smalltalk.addMethod(
  2916. '_detect_ifNone_',
  2917. smalltalk.method({
  2918. selector: 'detect:ifNone:',
  2919. fn: function (aBlock, anotherBlock){
  2920. var self=this;
  2921. for(var i = 0; i < self.length; i++)
  2922. if(aBlock(self[i]))
  2923. return self[i];
  2924. return anotherBlock();
  2925. ;
  2926. return self;}
  2927. }),
  2928. smalltalk.Collection);
  2929. smalltalk.addMethod(
  2930. '_do_separatedBy_',
  2931. smalltalk.method({
  2932. selector: 'do:separatedBy:',
  2933. fn: function (aBlock, anotherBlock){
  2934. var self=this;
  2935. var first=nil;
  2936. first=true;
  2937. 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]);})]);
  2938. return self;}
  2939. }),
  2940. smalltalk.Collection);
  2941. smalltalk.addMethod(
  2942. '_inject_into_',
  2943. smalltalk.method({
  2944. selector: 'inject:into:',
  2945. fn: function (anObject, aBlock){
  2946. var self=this;
  2947. var result=nil;
  2948. result=anObject;
  2949. smalltalk.send(self, "_do_", [(function(each){return result=smalltalk.send(aBlock, "_value_value_", [result, each]);})]);
  2950. return result;
  2951. return self;}
  2952. }),
  2953. smalltalk.Collection);
  2954. smalltalk.addMethod(
  2955. '_reject_',
  2956. smalltalk.method({
  2957. selector: 'reject:',
  2958. fn: function (aBlock){
  2959. var self=this;
  2960. return smalltalk.send(self, "_select_", [(function(each){return smalltalk.send(smalltalk.send(aBlock, "_value_", [each]), "__eq", [false]);})]);
  2961. return self;}
  2962. }),
  2963. smalltalk.Collection);
  2964. smalltalk.addMethod(
  2965. '_select_',
  2966. smalltalk.method({
  2967. selector: 'select:',
  2968. fn: function (aBlock){
  2969. var self=this;
  2970. var stream=nil;
  2971. stream=smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_new", []), "_writeStream", []);
  2972. 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]);})]));})]);
  2973. return smalltalk.send(stream, "_contents", []);
  2974. return self;}
  2975. }),
  2976. smalltalk.Collection);
  2977. smalltalk.addMethod(
  2978. '_errorNotFound',
  2979. smalltalk.method({
  2980. selector: 'errorNotFound',
  2981. fn: function (){
  2982. var self=this;
  2983. smalltalk.send(self, "_error_", ["Object is not in the collection"]);
  2984. return self;}
  2985. }),
  2986. smalltalk.Collection);
  2987. smalltalk.addMethod(
  2988. '_includes_',
  2989. smalltalk.method({
  2990. selector: 'includes:',
  2991. fn: function (anObject){
  2992. var self=this;
  2993. var i = self.length;
  2994. while (i--) {
  2995. if (smalltalk.send(self[i], "__eq", [anObject])) {return true;}
  2996. }
  2997. return false
  2998. ;
  2999. return self;}
  3000. }),
  3001. smalltalk.Collection);
  3002. smalltalk.addMethod(
  3003. '_notEmpty',
  3004. smalltalk.method({
  3005. selector: 'notEmpty',
  3006. fn: function (){
  3007. var self=this;
  3008. return smalltalk.send(smalltalk.send(self, "_isEmpty", []), "_not", []);
  3009. return self;}
  3010. }),
  3011. smalltalk.Collection);
  3012. smalltalk.addMethod(
  3013. '_isEmpty',
  3014. smalltalk.method({
  3015. selector: 'isEmpty',
  3016. fn: function (){
  3017. var self=this;
  3018. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
  3019. return self;}
  3020. }),
  3021. smalltalk.Collection);
  3022. smalltalk.addMethod(
  3023. '_remove_',
  3024. smalltalk.method({
  3025. selector: 'remove:',
  3026. fn: function (anObject){
  3027. var self=this;
  3028. smalltalk.send(self, "_subclassResponsibility", []);
  3029. return self;}
  3030. }),
  3031. smalltalk.Collection);
  3032. smalltalk.addMethod(
  3033. '_asSet',
  3034. smalltalk.method({
  3035. selector: 'asSet',
  3036. fn: function (){
  3037. var self=this;
  3038. return smalltalk.send((smalltalk.Set || Set), "_withAll_", [self]);
  3039. return self;}
  3040. }),
  3041. smalltalk.Collection);
  3042. smalltalk.addMethod(
  3043. '_ifNotEmpty_',
  3044. smalltalk.method({
  3045. selector: 'ifNotEmpty:',
  3046. fn: function (aBlock){
  3047. var self=this;
  3048. smalltalk.send(smalltalk.send(self, "_notEmpty", []), "_ifTrue_", [aBlock]);
  3049. return self;}
  3050. }),
  3051. smalltalk.Collection);
  3052. smalltalk.addMethod(
  3053. '_ifEmpty_',
  3054. smalltalk.method({
  3055. selector: 'ifEmpty:',
  3056. fn: function (aBlock){
  3057. var self=this;
  3058. smalltalk.send(smalltalk.send(self, "_isEmpty", []), "_ifTrue_", [aBlock]);
  3059. return self;}
  3060. }),
  3061. smalltalk.Collection);
  3062. smalltalk.addMethod(
  3063. '_copyWithoutAll_',
  3064. smalltalk.method({
  3065. selector: 'copyWithoutAll:',
  3066. fn: function (aCollection){
  3067. var self=this;
  3068. return smalltalk.send(self, "_reject_", [(function(each){return smalltalk.send(aCollection, "_includes_", [each]);})]);
  3069. return self;}
  3070. }),
  3071. smalltalk.Collection);
  3072. smalltalk.addMethod(
  3073. '_streamClass',
  3074. smalltalk.method({
  3075. selector: 'streamClass',
  3076. fn: function (){
  3077. var self=this;
  3078. return (smalltalk.Stream || Stream);
  3079. return self;}
  3080. }),
  3081. smalltalk.Collection.klass);
  3082. smalltalk.addMethod(
  3083. '_with_',
  3084. smalltalk.method({
  3085. selector: 'with:',
  3086. fn: function (anObject){
  3087. var self=this;
  3088. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  3089. return self;}
  3090. }),
  3091. smalltalk.Collection.klass);
  3092. smalltalk.addMethod(
  3093. '_with_with_',
  3094. smalltalk.method({
  3095. selector: 'with:with:',
  3096. fn: function (anObject, anotherObject){
  3097. var self=this;
  3098. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);smalltalk.send($rec, "_add_", [anotherObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  3099. return self;}
  3100. }),
  3101. smalltalk.Collection.klass);
  3102. smalltalk.addMethod(
  3103. '_with_with_with_',
  3104. smalltalk.method({
  3105. selector: 'with:with:with:',
  3106. fn: function (firstObject, secondObject, thirdObject){
  3107. var self=this;
  3108. 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", []));
  3109. return self;}
  3110. }),
  3111. smalltalk.Collection.klass);
  3112. smalltalk.addMethod(
  3113. '_withAll_',
  3114. smalltalk.method({
  3115. selector: 'withAll:',
  3116. fn: function (aCollection){
  3117. var self=this;
  3118. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  3119. return self;}
  3120. }),
  3121. smalltalk.Collection.klass);
  3122. smalltalk.addClass('SequenceableCollection', smalltalk.Collection, [], 'Kernel');
  3123. smalltalk.addMethod(
  3124. '_at_',
  3125. smalltalk.method({
  3126. selector: 'at:',
  3127. fn: function (anIndex){
  3128. var self=this;
  3129. return smalltalk.send(self, "_at_ifAbsent_", [anIndex, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  3130. return self;}
  3131. }),
  3132. smalltalk.SequenceableCollection);
  3133. smalltalk.addMethod(
  3134. '_at_ifAbsent_',
  3135. smalltalk.method({
  3136. selector: 'at:ifAbsent:',
  3137. fn: function (anIndex, aBlock){
  3138. var self=this;
  3139. smalltalk.send(self, "_subclassResponsibility", []);
  3140. return self;}
  3141. }),
  3142. smalltalk.SequenceableCollection);
  3143. smalltalk.addMethod(
  3144. '_at_put_',
  3145. smalltalk.method({
  3146. selector: 'at:put:',
  3147. fn: function (anIndex, anObject){
  3148. var self=this;
  3149. smalltalk.send(self, "_subclassResponsibility", []);
  3150. return self;}
  3151. }),
  3152. smalltalk.SequenceableCollection);
  3153. smalltalk.addMethod(
  3154. '_copyFrom_to_',
  3155. smalltalk.method({
  3156. selector: 'copyFrom:to:',
  3157. fn: function (anIndex, anotherIndex){
  3158. var self=this;
  3159. smalltalk.send(self, "_subclassResponsibility", []);
  3160. return self;}
  3161. }),
  3162. smalltalk.SequenceableCollection);
  3163. smalltalk.addMethod(
  3164. '_first',
  3165. smalltalk.method({
  3166. selector: 'first',
  3167. fn: function (){
  3168. var self=this;
  3169. return smalltalk.send(self, "_at_", [(1)]);
  3170. return self;}
  3171. }),
  3172. smalltalk.SequenceableCollection);
  3173. smalltalk.addMethod(
  3174. '_fourth',
  3175. smalltalk.method({
  3176. selector: 'fourth',
  3177. fn: function (){
  3178. var self=this;
  3179. return smalltalk.send(self, "_at_", [(4)]);
  3180. return self;}
  3181. }),
  3182. smalltalk.SequenceableCollection);
  3183. smalltalk.addMethod(
  3184. '_last',
  3185. smalltalk.method({
  3186. selector: 'last',
  3187. fn: function (){
  3188. var self=this;
  3189. return smalltalk.send(self, "_at_", [smalltalk.send(self, "_size", [])]);
  3190. return self;}
  3191. }),
  3192. smalltalk.SequenceableCollection);
  3193. smalltalk.addMethod(
  3194. '_second',
  3195. smalltalk.method({
  3196. selector: 'second',
  3197. fn: function (){
  3198. var self=this;
  3199. return smalltalk.send(self, "_at_", [(2)]);
  3200. return self;}
  3201. }),
  3202. smalltalk.SequenceableCollection);
  3203. smalltalk.addMethod(
  3204. '_third',
  3205. smalltalk.method({
  3206. selector: 'third',
  3207. fn: function (){
  3208. var self=this;
  3209. return smalltalk.send(self, "_at_", [(3)]);
  3210. return self;}
  3211. }),
  3212. smalltalk.SequenceableCollection);
  3213. smalltalk.addMethod(
  3214. '_removeLast',
  3215. smalltalk.method({
  3216. selector: 'removeLast',
  3217. fn: function (){
  3218. var self=this;
  3219. smalltalk.send(self, "_remove_", [smalltalk.send(self, "_last", [])]);
  3220. return self;}
  3221. }),
  3222. smalltalk.SequenceableCollection);
  3223. smalltalk.addMethod(
  3224. '_addLast_',
  3225. smalltalk.method({
  3226. selector: 'addLast:',
  3227. fn: function (anObject){
  3228. var self=this;
  3229. smalltalk.send(self, "_add_", [anObject]);
  3230. return self;}
  3231. }),
  3232. smalltalk.SequenceableCollection);
  3233. smalltalk.addMethod(
  3234. '_withIndexDo_',
  3235. smalltalk.method({
  3236. selector: 'withIndexDo:',
  3237. fn: function (aBlock){
  3238. var self=this;
  3239. for(var i=0;i<self.length;i++){aBlock(self[i], i+1);};
  3240. return self;}
  3241. }),
  3242. smalltalk.SequenceableCollection);
  3243. smalltalk.addMethod(
  3244. '_allButFirst',
  3245. smalltalk.method({
  3246. selector: 'allButFirst',
  3247. fn: function (){
  3248. var self=this;
  3249. return smalltalk.send(self, "_copyFrom_to_", [(2), smalltalk.send(self, "_size", [])]);
  3250. return self;}
  3251. }),
  3252. smalltalk.SequenceableCollection);
  3253. smalltalk.addMethod(
  3254. '_allButLast',
  3255. smalltalk.method({
  3256. selector: 'allButLast',
  3257. fn: function (){
  3258. var self=this;
  3259. return smalltalk.send(self, "_copyFrom_to_", [(1), ((($receiver = smalltalk.send(self, "_size", [])).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]))]);
  3260. return self;}
  3261. }),
  3262. smalltalk.SequenceableCollection);
  3263. smalltalk.addMethod(
  3264. '_indexOf_',
  3265. smalltalk.method({
  3266. selector: 'indexOf:',
  3267. fn: function (anObject){
  3268. var self=this;
  3269. return smalltalk.send(self, "_indexOf_ifAbsent_", [anObject, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  3270. return self;}
  3271. }),
  3272. smalltalk.SequenceableCollection);
  3273. smalltalk.addMethod(
  3274. '_indexOf_ifAbsent_',
  3275. smalltalk.method({
  3276. selector: 'indexOf:ifAbsent:',
  3277. fn: function (anObject, aBlock){
  3278. var self=this;
  3279. for(var i=0;i<self.length;i++){
  3280. if(self[i].__eq(anObject)) {return i+1}
  3281. }
  3282. return aBlock();
  3283. ;
  3284. return self;}
  3285. }),
  3286. smalltalk.SequenceableCollection);
  3287. smalltalk.addMethod(
  3288. '_indexOf_startingAt_ifAbsent_',
  3289. smalltalk.method({
  3290. selector: 'indexOf:startingAt:ifAbsent:',
  3291. fn: function (anObject, start, aBlock){
  3292. var self=this;
  3293. for(var i=start-1;i<self.length;i++){
  3294. if(self[i].__eq(anObject)) {return i+1}
  3295. }
  3296. return aBlock();
  3297. ;
  3298. return self;}
  3299. }),
  3300. smalltalk.SequenceableCollection);
  3301. smalltalk.addMethod(
  3302. '_indexOf_startingAt_',
  3303. smalltalk.method({
  3304. selector: 'indexOf:startingAt:',
  3305. fn: function (anObject, start){
  3306. var self=this;
  3307. return smalltalk.send(self, "_indexOf_startingAt_ifAbsent_", [anObject, start, (function(){return (0);})]);
  3308. return self;}
  3309. }),
  3310. smalltalk.SequenceableCollection);
  3311. smalltalk.addMethod(
  3312. '_reversed',
  3313. smalltalk.method({
  3314. selector: 'reversed',
  3315. fn: function (){
  3316. var self=this;
  3317. smalltalk.send(self, "_subclassResponsibility", []);
  3318. return self;}
  3319. }),
  3320. smalltalk.SequenceableCollection);
  3321. smalltalk.addMethod(
  3322. '_atRandom',
  3323. smalltalk.method({
  3324. selector: 'atRandom',
  3325. fn: function (){
  3326. var self=this;
  3327. return smalltalk.send(self, "_at_", [smalltalk.send(smalltalk.send(self, "_size", []), "_atRandom", [])]);
  3328. return self;}
  3329. }),
  3330. smalltalk.SequenceableCollection);
  3331. smalltalk.addClass('String', smalltalk.SequenceableCollection, [], 'Kernel');
  3332. smalltalk.addMethod(
  3333. '__eq',
  3334. smalltalk.method({
  3335. selector: '=',
  3336. fn: function (aString){
  3337. var self=this;
  3338. 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}})})();})]));
  3339. return String(self) == aString;
  3340. return self;
  3341. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  3342. }),
  3343. smalltalk.String);
  3344. smalltalk.addMethod(
  3345. '_size',
  3346. smalltalk.method({
  3347. selector: 'size',
  3348. fn: function (){
  3349. var self=this;
  3350. return self.length;
  3351. return self;}
  3352. }),
  3353. smalltalk.String);
  3354. smalltalk.addMethod(
  3355. '_at_',
  3356. smalltalk.method({
  3357. selector: 'at:',
  3358. fn: function (anIndex){
  3359. var self=this;
  3360. return self[anIndex - 1];
  3361. return self;}
  3362. }),
  3363. smalltalk.String);
  3364. smalltalk.addMethod(
  3365. '_at_put_',
  3366. smalltalk.method({
  3367. selector: 'at:put:',
  3368. fn: function (anIndex, anObject){
  3369. var self=this;
  3370. smalltalk.send(self, "_errorReadOnly", []);
  3371. return self;}
  3372. }),
  3373. smalltalk.String);
  3374. smalltalk.addMethod(
  3375. '_at_ifAbsent_',
  3376. smalltalk.method({
  3377. selector: 'at:ifAbsent:',
  3378. fn: function (anIndex, aBlock){
  3379. var self=this;
  3380. (($receiver = smalltalk.send(self, "_at_", [anIndex])) == nil || $receiver == undefined) ? (function(){return aBlock;})() : $receiver;
  3381. return self;}
  3382. }),
  3383. smalltalk.String);
  3384. smalltalk.addMethod(
  3385. '_escaped',
  3386. smalltalk.method({
  3387. selector: 'escaped',
  3388. fn: function (){
  3389. var self=this;
  3390. return escape(self);
  3391. return self;}
  3392. }),
  3393. smalltalk.String);
  3394. smalltalk.addMethod(
  3395. '_unescaped',
  3396. smalltalk.method({
  3397. selector: 'unescaped',
  3398. fn: function (){
  3399. var self=this;
  3400. return unescape(self);
  3401. return self;}
  3402. }),
  3403. smalltalk.String);
  3404. smalltalk.addMethod(
  3405. '_add_',
  3406. smalltalk.method({
  3407. selector: 'add:',
  3408. fn: function (anObject){
  3409. var self=this;
  3410. smalltalk.send(self, "_errorReadOnly", []);
  3411. return self;}
  3412. }),
  3413. smalltalk.String);
  3414. smalltalk.addMethod(
  3415. '__comma',
  3416. smalltalk.method({
  3417. selector: ',',
  3418. fn: function (aString){
  3419. var self=this;
  3420. return self + aString;
  3421. return self;}
  3422. }),
  3423. smalltalk.String);
  3424. smalltalk.addMethod(
  3425. '_copyFrom_to_',
  3426. smalltalk.method({
  3427. selector: 'copyFrom:to:',
  3428. fn: function (anIndex, anotherIndex){
  3429. var self=this;
  3430. return self.substring(anIndex - 1, anotherIndex);
  3431. return self;}
  3432. }),
  3433. smalltalk.String);
  3434. smalltalk.addMethod(
  3435. '_shallowCopy',
  3436. smalltalk.method({
  3437. selector: 'shallowCopy',
  3438. fn: function (){
  3439. var self=this;
  3440. return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [self]);
  3441. return self;}
  3442. }),
  3443. smalltalk.String);
  3444. smalltalk.addMethod(
  3445. '_deepCopy',
  3446. smalltalk.method({
  3447. selector: 'deepCopy',
  3448. fn: function (){
  3449. var self=this;
  3450. return smalltalk.send(self, "_shallowCopy", []);
  3451. return self;}
  3452. }),
  3453. smalltalk.String);
  3454. smalltalk.addMethod(
  3455. '_asSelector',
  3456. smalltalk.method({
  3457. selector: 'asSelector',
  3458. fn: function (){
  3459. var self=this;
  3460. var selector=nil;
  3461. selector=smalltalk.send("_", "__comma", [self]);
  3462. selector=smalltalk.send(selector, "_replace_with_", [":", "_"]);
  3463. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B+%5D"), "_plus"]);
  3464. selector=smalltalk.send(selector, "_replace_with_", [unescape("-"), "_minus"]);
  3465. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B*%5D"), "_star"]);
  3466. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B/%5D"), "_slash"]);
  3467. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3E"), "_gt"]);
  3468. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3C"), "_lt"]);
  3469. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3D"), "_eq"]);
  3470. selector=smalltalk.send(selector, "_replace_with_", [unescape("%2C"), "_comma"]);
  3471. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B@%5D"), "_at"]);
  3472. return selector;
  3473. return self;}
  3474. }),
  3475. smalltalk.String);
  3476. smalltalk.addMethod(
  3477. '_asJavascript',
  3478. smalltalk.method({
  3479. selector: 'asJavascript',
  3480. fn: function (){
  3481. var self=this;
  3482. if(self.search(/^[a-zA-Z0-9_:.$ ]*$/) == -1)
  3483. return "unescape(\"" + escape(self) + "\")";
  3484. else
  3485. return "\"" + self + "\"";
  3486. ;
  3487. return self;}
  3488. }),
  3489. smalltalk.String);
  3490. smalltalk.addMethod(
  3491. '_replace_with_',
  3492. smalltalk.method({
  3493. selector: 'replace:with:',
  3494. fn: function (aString, anotherString){
  3495. var self=this;
  3496. return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send((smalltalk.RegularExpression || RegularExpression), "_fromString_flag_", [aString, "g"]), anotherString]);
  3497. return self;}
  3498. }),
  3499. smalltalk.String);
  3500. smalltalk.addMethod(
  3501. '_replaceRegexp_with_',
  3502. smalltalk.method({
  3503. selector: 'replaceRegexp:with:',
  3504. fn: function (aRegexp, aString){
  3505. var self=this;
  3506. return self.replace(aRegexp, aString);
  3507. return self;}
  3508. }),
  3509. smalltalk.String);
  3510. smalltalk.addMethod(
  3511. '_tokenize_',
  3512. smalltalk.method({
  3513. selector: 'tokenize:',
  3514. fn: function (aString){
  3515. var self=this;
  3516. return self.split(aString);
  3517. return self;}
  3518. }),
  3519. smalltalk.String);
  3520. smalltalk.addMethod(
  3521. '_match_',
  3522. smalltalk.method({
  3523. selector: 'match:',
  3524. fn: function (aRegexp){
  3525. var self=this;
  3526. return self.search(aRegexp) != -1;
  3527. return self;}
  3528. }),
  3529. smalltalk.String);
  3530. smalltalk.addMethod(
  3531. '_asString',
  3532. smalltalk.method({
  3533. selector: 'asString',
  3534. fn: function (){
  3535. var self=this;
  3536. return self;
  3537. return self;}
  3538. }),
  3539. smalltalk.String);
  3540. smalltalk.addMethod(
  3541. '_asNumber',
  3542. smalltalk.method({
  3543. selector: 'asNumber',
  3544. fn: function (){
  3545. var self=this;
  3546. return Number(self);
  3547. return self;}
  3548. }),
  3549. smalltalk.String);
  3550. smalltalk.addMethod(
  3551. '_errorReadOnly',
  3552. smalltalk.method({
  3553. selector: 'errorReadOnly',
  3554. fn: function (){
  3555. var self=this;
  3556. smalltalk.send(self, "_error_", [unescape("Object%20is%20read-only")]);
  3557. return self;}
  3558. }),
  3559. smalltalk.String);
  3560. smalltalk.addMethod(
  3561. '_printString',
  3562. smalltalk.method({
  3563. selector: 'printString',
  3564. fn: function (){
  3565. var self=this;
  3566. return smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [self]), "__comma", [unescape("%27")]);
  3567. return self;}
  3568. }),
  3569. smalltalk.String);
  3570. smalltalk.addMethod(
  3571. '_printNl',
  3572. smalltalk.method({
  3573. selector: 'printNl',
  3574. fn: function (){
  3575. var self=this;
  3576. console.log(self);
  3577. return self;}
  3578. }),
  3579. smalltalk.String);
  3580. smalltalk.addMethod(
  3581. '_isString',
  3582. smalltalk.method({
  3583. selector: 'isString',
  3584. fn: function (){
  3585. var self=this;
  3586. return true;
  3587. return self;}
  3588. }),
  3589. smalltalk.String);
  3590. smalltalk.addMethod(
  3591. '__gt',
  3592. smalltalk.method({
  3593. selector: '>',
  3594. fn: function (aString){
  3595. var self=this;
  3596. return String(self) > aString;
  3597. return self;}
  3598. }),
  3599. smalltalk.String);
  3600. smalltalk.addMethod(
  3601. '__lt',
  3602. smalltalk.method({
  3603. selector: '<',
  3604. fn: function (aString){
  3605. var self=this;
  3606. return String(self) < aString;
  3607. return self;}
  3608. }),
  3609. smalltalk.String);
  3610. smalltalk.addMethod(
  3611. '__gt_eq',
  3612. smalltalk.method({
  3613. selector: '>=',
  3614. fn: function (aString){
  3615. var self=this;
  3616. return String(self) >= aString;
  3617. return self;}
  3618. }),
  3619. smalltalk.String);
  3620. smalltalk.addMethod(
  3621. '__lt_eq',
  3622. smalltalk.method({
  3623. selector: '<=',
  3624. fn: function (aString){
  3625. var self=this;
  3626. return String(self) <= aString;
  3627. return self;}
  3628. }),
  3629. smalltalk.String);
  3630. smalltalk.addMethod(
  3631. '_remove_',
  3632. smalltalk.method({
  3633. selector: 'remove:',
  3634. fn: function (anObject){
  3635. var self=this;
  3636. smalltalk.send(self, "_errorReadOnly", []);
  3637. return self;}
  3638. }),
  3639. smalltalk.String);
  3640. smalltalk.addMethod(
  3641. '_asJSONObject',
  3642. smalltalk.method({
  3643. selector: 'asJSONObject',
  3644. fn: function (){
  3645. var self=this;
  3646. return self;
  3647. return self;}
  3648. }),
  3649. smalltalk.String);
  3650. smalltalk.addMethod(
  3651. '_trimLeft_',
  3652. smalltalk.method({
  3653. selector: 'trimLeft:',
  3654. fn: function (separators){
  3655. var self=this;
  3656. 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"]), ""]);
  3657. return self;}
  3658. }),
  3659. smalltalk.String);
  3660. smalltalk.addMethod(
  3661. '_trimRight_',
  3662. smalltalk.method({
  3663. selector: 'trimRight:',
  3664. fn: function (separators){
  3665. var self=this;
  3666. 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"]), ""]);
  3667. return self;}
  3668. }),
  3669. smalltalk.String);
  3670. smalltalk.addMethod(
  3671. '_trimLeft',
  3672. smalltalk.method({
  3673. selector: 'trimLeft',
  3674. fn: function (){
  3675. var self=this;
  3676. return smalltalk.send(self, "_trimLeft_", [unescape("%5Cs")]);
  3677. return self;}
  3678. }),
  3679. smalltalk.String);
  3680. smalltalk.addMethod(
  3681. '_trimRight',
  3682. smalltalk.method({
  3683. selector: 'trimRight',
  3684. fn: function (){
  3685. var self=this;
  3686. return smalltalk.send(self, "_trimRight_", [unescape("%5Cs")]);
  3687. return self;}
  3688. }),
  3689. smalltalk.String);
  3690. smalltalk.addMethod(
  3691. '_trimBoth',
  3692. smalltalk.method({
  3693. selector: 'trimBoth',
  3694. fn: function (){
  3695. var self=this;
  3696. return smalltalk.send(self, "_trimBoth_", [unescape("%5Cs")]);
  3697. return self;}
  3698. }),
  3699. smalltalk.String);
  3700. smalltalk.addMethod(
  3701. '_trimBoth_',
  3702. smalltalk.method({
  3703. selector: 'trimBoth:',
  3704. fn: function (separators){
  3705. var self=this;
  3706. return smalltalk.send(smalltalk.send(self, "_trimLeft_", [separators]), "_trimRight_", [separators]);
  3707. return self;}
  3708. }),
  3709. smalltalk.String);
  3710. smalltalk.addMethod(
  3711. '_asLowercase',
  3712. smalltalk.method({
  3713. selector: 'asLowercase',
  3714. fn: function (){
  3715. var self=this;
  3716. return self.toLowerCase();
  3717. return self;}
  3718. }),
  3719. smalltalk.String);
  3720. smalltalk.addMethod(
  3721. '_asUppercase',
  3722. smalltalk.method({
  3723. selector: 'asUppercase',
  3724. fn: function (){
  3725. var self=this;
  3726. return self.toUpperCase();
  3727. return self;}
  3728. }),
  3729. smalltalk.String);
  3730. smalltalk.addMethod(
  3731. '_join_',
  3732. smalltalk.method({
  3733. selector: 'join:',
  3734. fn: function (aCollection){
  3735. var self=this;
  3736. 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]);})]);})]);
  3737. return self;}
  3738. }),
  3739. smalltalk.String);
  3740. smalltalk.addMethod(
  3741. '_includesSubString_',
  3742. smalltalk.method({
  3743. selector: 'includesSubString:',
  3744. fn: function (subString){
  3745. var self=this;
  3746. return self.indexOf(subString) != -1 ;
  3747. return self;}
  3748. }),
  3749. smalltalk.String);
  3750. smalltalk.addMethod(
  3751. '_asciiValue',
  3752. smalltalk.method({
  3753. selector: 'asciiValue',
  3754. fn: function (){
  3755. var self=this;
  3756. return self.charCodeAt(0);;
  3757. return self;}
  3758. }),
  3759. smalltalk.String);
  3760. smalltalk.addMethod(
  3761. '_lineIndicesDo_',
  3762. smalltalk.method({
  3763. selector: 'lineIndicesDo:',
  3764. fn: function (aBlock){
  3765. var self=this;
  3766. try{var cr=nil;
  3767. var lf=nil;
  3768. var start=nil;
  3769. var sz=nil;
  3770. var nextLF=nil;
  3771. var nextCR=nil;
  3772. start=(1);
  3773. sz=smalltalk.send(self, "_size", []);
  3774. cr=smalltalk.send((smalltalk.String || String), "_cr", []);
  3775. nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, (1)]);
  3776. lf=smalltalk.send((smalltalk.String || String), "_lf", []);
  3777. nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, (1)]);
  3778. (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]);})]));})]));})()}})();
  3779. return self;
  3780. } catch(e) {if(e.name === 'stReturn' && e.selector === '_lineIndicesDo_'){return e.fn()} throw(e)}}
  3781. }),
  3782. smalltalk.String);
  3783. smalltalk.addMethod(
  3784. '_linesDo_',
  3785. smalltalk.method({
  3786. selector: 'linesDo:',
  3787. fn: function (aBlock){
  3788. var self=this;
  3789. smalltalk.send(self, "_lineIndicesDo_", [(function(start, endWithoutDelimiters, end){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_copyFrom_to_", [start, endWithoutDelimiters])]);})]);
  3790. return self;}
  3791. }),
  3792. smalltalk.String);
  3793. smalltalk.addMethod(
  3794. '_lines',
  3795. smalltalk.method({
  3796. selector: 'lines',
  3797. fn: function (){
  3798. var self=this;
  3799. var lines=nil;
  3800. lines=smalltalk.send((smalltalk.Array || Array), "_new", []);
  3801. smalltalk.send(self, "_linesDo_", [(function(aLine){return smalltalk.send(lines, "_add_", [aLine]);})]);
  3802. return lines;
  3803. return self;}
  3804. }),
  3805. smalltalk.String);
  3806. smalltalk.addMethod(
  3807. '_lineNumber_',
  3808. smalltalk.method({
  3809. selector: 'lineNumber:',
  3810. fn: function (anIndex){
  3811. var self=this;
  3812. try{var lineCount=nil;
  3813. lineCount=(0);
  3814. 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])}})})();})]));})]);
  3815. (function(){throw({name: 'stReturn', selector: '_lineNumber_', fn: function(){return nil}})})();
  3816. return self;
  3817. } catch(e) {if(e.name === 'stReturn' && e.selector === '_lineNumber_'){return e.fn()} throw(e)}}
  3818. }),
  3819. smalltalk.String);
  3820. smalltalk.addMethod(
  3821. '_reversed',
  3822. smalltalk.method({
  3823. selector: 'reversed',
  3824. fn: function (){
  3825. var self=this;
  3826. return self.split("").reverse().join("");
  3827. return self;}
  3828. }),
  3829. smalltalk.String);
  3830. smalltalk.addMethod(
  3831. '__eq_eq',
  3832. smalltalk.method({
  3833. selector: '==',
  3834. fn: function (aString){
  3835. var self=this;
  3836. 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}})})();})]));
  3837. return String(self) === String(aString);
  3838. return self;
  3839. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq_eq'){return e.fn()} throw(e)}}
  3840. }),
  3841. smalltalk.String);
  3842. smalltalk.addMethod(
  3843. '_asJavaScriptSelector',
  3844. smalltalk.method({
  3845. selector: 'asJavaScriptSelector',
  3846. fn: function (){
  3847. var self=this;
  3848. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_asSelector", []), "_replace_with_", [unescape("%5E_"), ""]), "_replace_with_", [unescape("_.*"), ""]);
  3849. return self;}
  3850. }),
  3851. smalltalk.String);
  3852. smalltalk.addMethod(
  3853. '_streamClass',
  3854. smalltalk.method({
  3855. selector: 'streamClass',
  3856. fn: function (){
  3857. var self=this;
  3858. return (smalltalk.StringStream || StringStream);
  3859. return self;}
  3860. }),
  3861. smalltalk.String.klass);
  3862. smalltalk.addMethod(
  3863. '_fromString_',
  3864. smalltalk.method({
  3865. selector: 'fromString:',
  3866. fn: function (aString){
  3867. var self=this;
  3868. return new self.fn(aString);
  3869. return self;}
  3870. }),
  3871. smalltalk.String.klass);
  3872. smalltalk.addMethod(
  3873. '_cr',
  3874. smalltalk.method({
  3875. selector: 'cr',
  3876. fn: function (){
  3877. var self=this;
  3878. return '\r';
  3879. return self;}
  3880. }),
  3881. smalltalk.String.klass);
  3882. smalltalk.addMethod(
  3883. '_lf',
  3884. smalltalk.method({
  3885. selector: 'lf',
  3886. fn: function (){
  3887. var self=this;
  3888. return '\n';
  3889. return self;}
  3890. }),
  3891. smalltalk.String.klass);
  3892. smalltalk.addMethod(
  3893. '_space',
  3894. smalltalk.method({
  3895. selector: 'space',
  3896. fn: function (){
  3897. var self=this;
  3898. return ' ';
  3899. return self;}
  3900. }),
  3901. smalltalk.String.klass);
  3902. smalltalk.addMethod(
  3903. '_tab',
  3904. smalltalk.method({
  3905. selector: 'tab',
  3906. fn: function (){
  3907. var self=this;
  3908. return '\t';
  3909. return self;}
  3910. }),
  3911. smalltalk.String.klass);
  3912. smalltalk.addMethod(
  3913. '_crlf',
  3914. smalltalk.method({
  3915. selector: 'crlf',
  3916. fn: function (){
  3917. var self=this;
  3918. return '\r\n';
  3919. return self;}
  3920. }),
  3921. smalltalk.String.klass);
  3922. smalltalk.addMethod(
  3923. '_streamContents_',
  3924. smalltalk.method({
  3925. selector: 'streamContents:',
  3926. fn: function (blockWithArg){
  3927. var self=this;
  3928. var stream=nil;
  3929. stream=smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [smalltalk.send((smalltalk.String || String), "_new", [])]);
  3930. smalltalk.send(blockWithArg, "_value_", [stream]);
  3931. return smalltalk.send(stream, "_contents", []);
  3932. return self;}
  3933. }),
  3934. smalltalk.String.klass);
  3935. smalltalk.addMethod(
  3936. '_value_',
  3937. smalltalk.method({
  3938. selector: 'value:',
  3939. fn: function (aUTFCharCode){
  3940. var self=this;
  3941. return String.fromCharCode(aUTFCharCode);;
  3942. return self;}
  3943. }),
  3944. smalltalk.String.klass);
  3945. smalltalk.addClass('Array', smalltalk.SequenceableCollection, [], 'Kernel');
  3946. smalltalk.addMethod(
  3947. '_size',
  3948. smalltalk.method({
  3949. selector: 'size',
  3950. fn: function (){
  3951. var self=this;
  3952. return self.length;
  3953. return self;}
  3954. }),
  3955. smalltalk.Array);
  3956. smalltalk.addMethod(
  3957. '_at_put_',
  3958. smalltalk.method({
  3959. selector: 'at:put:',
  3960. fn: function (anIndex, anObject){
  3961. var self=this;
  3962. return self[anIndex - 1] = anObject;
  3963. return self;}
  3964. }),
  3965. smalltalk.Array);
  3966. smalltalk.addMethod(
  3967. '_at_ifAbsent_',
  3968. smalltalk.method({
  3969. selector: 'at:ifAbsent:',
  3970. fn: function (anIndex, aBlock){
  3971. var self=this;
  3972. var value = self[anIndex - 1];
  3973. if(value === undefined) {
  3974. return aBlock();
  3975. } else {
  3976. return value;
  3977. }
  3978. ;
  3979. return self;}
  3980. }),
  3981. smalltalk.Array);
  3982. smalltalk.addMethod(
  3983. '_add_',
  3984. smalltalk.method({
  3985. selector: 'add:',
  3986. fn: function (anObject){
  3987. var self=this;
  3988. self.push(anObject); return anObject;;
  3989. return self;}
  3990. }),
  3991. smalltalk.Array);
  3992. smalltalk.addMethod(
  3993. '_shallowCopy',
  3994. smalltalk.method({
  3995. selector: 'shallowCopy',
  3996. fn: function (){
  3997. var self=this;
  3998. var newCollection=nil;
  3999. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4000. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [each]);})]);
  4001. return newCollection;
  4002. return self;}
  4003. }),
  4004. smalltalk.Array);
  4005. smalltalk.addMethod(
  4006. '_deepCopy',
  4007. smalltalk.method({
  4008. selector: 'deepCopy',
  4009. fn: function (){
  4010. var self=this;
  4011. var newCollection=nil;
  4012. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4013. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [smalltalk.send(each, "_deepCopy", [])]);})]);
  4014. return newCollection;
  4015. return self;}
  4016. }),
  4017. smalltalk.Array);
  4018. smalltalk.addMethod(
  4019. '_copyFrom_to_',
  4020. smalltalk.method({
  4021. selector: 'copyFrom:to:',
  4022. fn: function (anIndex, anotherIndex){
  4023. var self=this;
  4024. var array=nil;
  4025. array=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4026. smalltalk.send(anIndex, "_to_do_", [anotherIndex, (function(each){return smalltalk.send(array, "_add_", [smalltalk.send(self, "_at_", [each])]);})]);
  4027. return array;
  4028. return self;}
  4029. }),
  4030. smalltalk.Array);
  4031. smalltalk.addMethod(
  4032. '_join_',
  4033. smalltalk.method({
  4034. selector: 'join:',
  4035. fn: function (aString){
  4036. var self=this;
  4037. return self.join(aString);
  4038. return self;}
  4039. }),
  4040. smalltalk.Array);
  4041. smalltalk.addMethod(
  4042. '_asJavascript',
  4043. smalltalk.method({
  4044. selector: 'asJavascript',
  4045. fn: function (){
  4046. var self=this;
  4047. 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")]);
  4048. return self;}
  4049. }),
  4050. smalltalk.Array);
  4051. smalltalk.addMethod(
  4052. '_sort',
  4053. smalltalk.method({
  4054. selector: 'sort',
  4055. fn: function (){
  4056. var self=this;
  4057. return smalltalk.send(self, "_basicPerform_", ["sort"]);
  4058. return self;}
  4059. }),
  4060. smalltalk.Array);
  4061. smalltalk.addMethod(
  4062. '_sort_',
  4063. smalltalk.method({
  4064. selector: 'sort:',
  4065. fn: function (aBlock){
  4066. var self=this;
  4067. return self.sort(function(a, b) {
  4068. if(aBlock(a,b)) {return -1} else {return 1}
  4069. })
  4070. ;
  4071. return self;}
  4072. }),
  4073. smalltalk.Array);
  4074. smalltalk.addMethod(
  4075. '_remove_',
  4076. smalltalk.method({
  4077. selector: 'remove:',
  4078. fn: function (anObject){
  4079. var self=this;
  4080. for(var i=0;i<self.length;i++) {
  4081. if(self[i] == anObject) {
  4082. self.splice(i,1);
  4083. break;
  4084. }
  4085. }
  4086. ;
  4087. return self;}
  4088. }),
  4089. smalltalk.Array);
  4090. smalltalk.addMethod(
  4091. '_sorted',
  4092. smalltalk.method({
  4093. selector: 'sorted',
  4094. fn: function (){
  4095. var self=this;
  4096. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort", []);
  4097. return self;}
  4098. }),
  4099. smalltalk.Array);
  4100. smalltalk.addMethod(
  4101. '_sorted_',
  4102. smalltalk.method({
  4103. selector: 'sorted:',
  4104. fn: function (aBlock){
  4105. var self=this;
  4106. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort_", [aBlock]);
  4107. return self;}
  4108. }),
  4109. smalltalk.Array);
  4110. smalltalk.addMethod(
  4111. '_asJSONObject',
  4112. smalltalk.method({
  4113. selector: 'asJSONObject',
  4114. fn: function (){
  4115. var self=this;
  4116. return smalltalk.send(self, "_collect_", [(function(each){return smalltalk.send(each, "_asJSONObject", []);})]);
  4117. return self;}
  4118. }),
  4119. smalltalk.Array);
  4120. smalltalk.addMethod(
  4121. '_removeFrom_to_',
  4122. smalltalk.method({
  4123. selector: 'removeFrom:to:',
  4124. fn: function (aNumber, anotherNumber){
  4125. var self=this;
  4126. self.splice(aNumber - 1,anotherNumber - 1);
  4127. return self;}
  4128. }),
  4129. smalltalk.Array);
  4130. smalltalk.addMethod(
  4131. '_printString',
  4132. smalltalk.method({
  4133. selector: 'printString',
  4134. fn: function (){
  4135. var self=this;
  4136. var str=nil;
  4137. str=smalltalk.send("", "_writeStream", []);
  4138. smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.SequenceableCollection), "__comma", [unescape("%20%28")])]);
  4139. smalltalk.send(self, "_do_separatedBy_", [(function(each){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(each, "_printString", [])]);}), (function(){return smalltalk.send(str, "_nextPutAll_", [" "]);})]);
  4140. smalltalk.send(str, "_nextPutAll_", [unescape("%29")]);
  4141. return smalltalk.send(str, "_contents", []);
  4142. return self;}
  4143. }),
  4144. smalltalk.Array);
  4145. smalltalk.addMethod(
  4146. '_reversed',
  4147. smalltalk.method({
  4148. selector: 'reversed',
  4149. fn: function (){
  4150. var self=this;
  4151. return self._copy().reverse();
  4152. return self;}
  4153. }),
  4154. smalltalk.Array);
  4155. smalltalk.addMethod(
  4156. '__eq',
  4157. smalltalk.method({
  4158. selector: '=',
  4159. fn: function (aCollection){
  4160. var self=this;
  4161. 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}})})();})]));
  4162. 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}})})();})]));})]);
  4163. (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return true}})})();
  4164. return self;
  4165. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  4166. }),
  4167. smalltalk.Array);
  4168. smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel');
  4169. smalltalk.addMethod(
  4170. '_compile_',
  4171. smalltalk.method({
  4172. selector: 'compile:',
  4173. fn: function (aString){
  4174. var self=this;
  4175. return self.compile(aString);
  4176. return self;}
  4177. }),
  4178. smalltalk.RegularExpression);
  4179. smalltalk.addMethod(
  4180. '_exec_',
  4181. smalltalk.method({
  4182. selector: 'exec:',
  4183. fn: function (aString){
  4184. var self=this;
  4185. return self.exec(aString) || nil;
  4186. return self;}
  4187. }),
  4188. smalltalk.RegularExpression);
  4189. smalltalk.addMethod(
  4190. '_test_',
  4191. smalltalk.method({
  4192. selector: 'test:',
  4193. fn: function (aString){
  4194. var self=this;
  4195. return self.test(aString);
  4196. return self;}
  4197. }),
  4198. smalltalk.RegularExpression);
  4199. smalltalk.addMethod(
  4200. '_fromString_flag_',
  4201. smalltalk.method({
  4202. selector: 'fromString:flag:',
  4203. fn: function (aString, anotherString){
  4204. var self=this;
  4205. return new RegExp(aString, anotherString);
  4206. return self;}
  4207. }),
  4208. smalltalk.RegularExpression.klass);
  4209. smalltalk.addMethod(
  4210. '_fromString_',
  4211. smalltalk.method({
  4212. selector: 'fromString:',
  4213. fn: function (aString){
  4214. var self=this;
  4215. return smalltalk.send(self, "_fromString_flag_", [aString, ""]);
  4216. return self;}
  4217. }),
  4218. smalltalk.RegularExpression.klass);
  4219. smalltalk.addClass('Error', smalltalk.Object, ['messageText'], 'Kernel');
  4220. smalltalk.addMethod(
  4221. '_messageText',
  4222. smalltalk.method({
  4223. selector: 'messageText',
  4224. fn: function (){
  4225. var self=this;
  4226. return self['@messageText'];
  4227. return self;}
  4228. }),
  4229. smalltalk.Error);
  4230. smalltalk.addMethod(
  4231. '_messageText_',
  4232. smalltalk.method({
  4233. selector: 'messageText:',
  4234. fn: function (aString){
  4235. var self=this;
  4236. self['@messageText']=aString;
  4237. return self;}
  4238. }),
  4239. smalltalk.Error);
  4240. smalltalk.addMethod(
  4241. '_signal',
  4242. smalltalk.method({
  4243. selector: 'signal',
  4244. fn: function (){
  4245. var self=this;
  4246. self.context = smalltalk.getThisContext(); self.smalltalkError = true; throw(self);
  4247. return self;}
  4248. }),
  4249. smalltalk.Error);
  4250. smalltalk.addMethod(
  4251. '_context',
  4252. smalltalk.method({
  4253. selector: 'context',
  4254. fn: function (){
  4255. var self=this;
  4256. return self.context;
  4257. return self;}
  4258. }),
  4259. smalltalk.Error);
  4260. smalltalk.addMethod(
  4261. '_signal_',
  4262. smalltalk.method({
  4263. selector: 'signal:',
  4264. fn: function (aString){
  4265. var self=this;
  4266. return (function($rec){smalltalk.send($rec, "_messageText_", [aString]);return smalltalk.send($rec, "_signal", []);})(smalltalk.send(self, "_new", []));
  4267. return self;}
  4268. }),
  4269. smalltalk.Error.klass);
  4270. smalltalk.addClass('MethodContext', smalltalk.Object, [], 'Kernel');
  4271. smalltalk.addMethod(
  4272. '_receiver',
  4273. smalltalk.method({
  4274. selector: 'receiver',
  4275. fn: function (){
  4276. var self=this;
  4277. return self.receiver;
  4278. return self;}
  4279. }),
  4280. smalltalk.MethodContext);
  4281. smalltalk.addMethod(
  4282. '_selector',
  4283. smalltalk.method({
  4284. selector: 'selector',
  4285. fn: function (){
  4286. var self=this;
  4287. return smalltalk.convertSelector(self.selector);
  4288. return self;}
  4289. }),
  4290. smalltalk.MethodContext);
  4291. smalltalk.addMethod(
  4292. '_home',
  4293. smalltalk.method({
  4294. selector: 'home',
  4295. fn: function (){
  4296. var self=this;
  4297. return self.homeContext;
  4298. return self;}
  4299. }),
  4300. smalltalk.MethodContext);
  4301. smalltalk.addMethod(
  4302. '_temps',
  4303. smalltalk.method({
  4304. selector: 'temps',
  4305. fn: function (){
  4306. var self=this;
  4307. return self.temps;
  4308. return self;}
  4309. }),
  4310. smalltalk.MethodContext);
  4311. smalltalk.addMethod(
  4312. '_printString',
  4313. smalltalk.method({
  4314. selector: 'printString',
  4315. fn: function (){
  4316. var self=this;
  4317. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.Object), "__comma", [unescape("%28")]), "__comma", [smalltalk.send(self, "_asString", [])]), "__comma", [unescape("%29")]);
  4318. return self;}
  4319. }),
  4320. smalltalk.MethodContext);
  4321. smalltalk.addMethod(
  4322. '_asString',
  4323. smalltalk.method({
  4324. selector: 'asString',
  4325. fn: function (){
  4326. var self=this;
  4327. 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", [])]);
  4328. return self;}
  4329. }),
  4330. smalltalk.MethodContext);
  4331. smalltalk.addClass('Association', smalltalk.Object, ['key', 'value'], 'Kernel');
  4332. smalltalk.addMethod(
  4333. '__eq',
  4334. smalltalk.method({
  4335. selector: '=',
  4336. fn: function (anAssociation){
  4337. var self=this;
  4338. 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", [])]);})]);})]);
  4339. return self;}
  4340. }),
  4341. smalltalk.Association);
  4342. smalltalk.addMethod(
  4343. '_key_',
  4344. smalltalk.method({
  4345. selector: 'key:',
  4346. fn: function (aKey){
  4347. var self=this;
  4348. self['@key']=aKey;
  4349. return self;}
  4350. }),
  4351. smalltalk.Association);
  4352. smalltalk.addMethod(
  4353. '_key',
  4354. smalltalk.method({
  4355. selector: 'key',
  4356. fn: function (){
  4357. var self=this;
  4358. return self['@key'];
  4359. return self;}
  4360. }),
  4361. smalltalk.Association);
  4362. smalltalk.addMethod(
  4363. '_value_',
  4364. smalltalk.method({
  4365. selector: 'value:',
  4366. fn: function (aValue){
  4367. var self=this;
  4368. self['@value']=aValue;
  4369. return self;}
  4370. }),
  4371. smalltalk.Association);
  4372. smalltalk.addMethod(
  4373. '_value',
  4374. smalltalk.method({
  4375. selector: 'value',
  4376. fn: function (){
  4377. var self=this;
  4378. return self['@value'];
  4379. return self;}
  4380. }),
  4381. smalltalk.Association);
  4382. smalltalk.addMethod(
  4383. '_storeOn_',
  4384. smalltalk.method({
  4385. selector: 'storeOn:',
  4386. fn: function (aStream){
  4387. var self=this;
  4388. smalltalk.send(self['@key'], "_storeOn_", [aStream]);
  4389. smalltalk.send(aStream, "_nextPutAll_", [unescape("-%3E")]);
  4390. smalltalk.send(self['@value'], "_storeOn_", [aStream]);
  4391. return self;}
  4392. }),
  4393. smalltalk.Association);
  4394. smalltalk.addMethod(
  4395. '_key_value_',
  4396. smalltalk.method({
  4397. selector: 'key:value:',
  4398. fn: function (aKey, aValue){
  4399. var self=this;
  4400. return (function($rec){smalltalk.send($rec, "_key_", [aKey]);smalltalk.send($rec, "_value_", [aValue]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  4401. return self;}
  4402. }),
  4403. smalltalk.Association.klass);
  4404. smalltalk.addClass('Dictionary', smalltalk.Collection, ['keys'], 'Kernel');
  4405. smalltalk.addMethod(
  4406. '__eq',
  4407. smalltalk.method({
  4408. selector: '=',
  4409. fn: function (aDictionary){
  4410. var self=this;
  4411. 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}})})();})]));
  4412. ((($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}})})();})]));
  4413. (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return smalltalk.send(smalltalk.send(self, "_associations", []), "__eq", [smalltalk.send(aDictionary, "_associations", [])])}})})();
  4414. return self;
  4415. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  4416. }),
  4417. smalltalk.Dictionary);
  4418. smalltalk.addMethod(
  4419. '_shallowCopy',
  4420. smalltalk.method({
  4421. selector: 'shallowCopy',
  4422. fn: function (){
  4423. var self=this;
  4424. var copy=nil;
  4425. copy=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4426. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(copy, "_at_put_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  4427. return copy;
  4428. return self;}
  4429. }),
  4430. smalltalk.Dictionary);
  4431. smalltalk.addMethod(
  4432. '_initialize',
  4433. smalltalk.method({
  4434. selector: 'initialize',
  4435. fn: function (){
  4436. var self=this;
  4437. smalltalk.send(self, "_initialize", [], smalltalk.Collection);
  4438. self['@keys']=[];
  4439. return self;}
  4440. }),
  4441. smalltalk.Dictionary);
  4442. smalltalk.addMethod(
  4443. '_size',
  4444. smalltalk.method({
  4445. selector: 'size',
  4446. fn: function (){
  4447. var self=this;
  4448. return smalltalk.send(self['@keys'], "_size", []);
  4449. return self;}
  4450. }),
  4451. smalltalk.Dictionary);
  4452. smalltalk.addMethod(
  4453. '_associations',
  4454. smalltalk.method({
  4455. selector: 'associations',
  4456. fn: function (){
  4457. var self=this;
  4458. var associations=nil;
  4459. associations=[];
  4460. 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])])]);})]);
  4461. return associations;
  4462. return self;}
  4463. }),
  4464. smalltalk.Dictionary);
  4465. smalltalk.addMethod(
  4466. '_keys',
  4467. smalltalk.method({
  4468. selector: 'keys',
  4469. fn: function (){
  4470. var self=this;
  4471. return smalltalk.send(self['@keys'], "_copy", []);
  4472. return self;}
  4473. }),
  4474. smalltalk.Dictionary);
  4475. smalltalk.addMethod(
  4476. '_values',
  4477. smalltalk.method({
  4478. selector: 'values',
  4479. fn: function (){
  4480. var self=this;
  4481. return smalltalk.send(self['@keys'], "_collect_", [(function(each){return smalltalk.send(self, "_at_", [each]);})]);
  4482. return self;}
  4483. }),
  4484. smalltalk.Dictionary);
  4485. smalltalk.addMethod(
  4486. '_at_put_',
  4487. smalltalk.method({
  4488. selector: 'at:put:',
  4489. fn: function (aKey, aValue){
  4490. var self=this;
  4491. ((($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]);})]));
  4492. return smalltalk.send(self, "_basicAt_put_", [aKey, aValue]);
  4493. return self;}
  4494. }),
  4495. smalltalk.Dictionary);
  4496. smalltalk.addMethod(
  4497. '_at_ifAbsent_',
  4498. smalltalk.method({
  4499. selector: 'at:ifAbsent:',
  4500. fn: function (aKey, aBlock){
  4501. var self=this;
  4502. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_keys", []), "_includes_", [aKey]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_basicAt_", [aKey]);}), aBlock]);
  4503. return self;}
  4504. }),
  4505. smalltalk.Dictionary);
  4506. smalltalk.addMethod(
  4507. '_at_ifAbsentPut_',
  4508. smalltalk.method({
  4509. selector: 'at:ifAbsentPut:',
  4510. fn: function (aKey, aBlock){
  4511. var self=this;
  4512. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_at_put_", [aKey, smalltalk.send(aBlock, "_value", [])]);})]);
  4513. return self;}
  4514. }),
  4515. smalltalk.Dictionary);
  4516. smalltalk.addMethod(
  4517. '_at_ifPresent_',
  4518. smalltalk.method({
  4519. selector: 'at:ifPresent:',
  4520. fn: function (aKey, aBlock){
  4521. var self=this;
  4522. return (($receiver = smalltalk.send(self, "_basicAt_", [aKey])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})() : nil;
  4523. return self;}
  4524. }),
  4525. smalltalk.Dictionary);
  4526. smalltalk.addMethod(
  4527. '_at_ifPresent_ifAbsent_',
  4528. smalltalk.method({
  4529. selector: 'at:ifPresent:ifAbsent:',
  4530. fn: function (aKey, aBlock, anotherBlock){
  4531. var self=this;
  4532. return smalltalk.send(smalltalk.send(self, "_basicAt_", [aKey]), "_ifNil_ifNotNil_", [anotherBlock, (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})]);
  4533. return self;}
  4534. }),
  4535. smalltalk.Dictionary);
  4536. smalltalk.addMethod(
  4537. '_add_',
  4538. smalltalk.method({
  4539. selector: 'add:',
  4540. fn: function (anAssociation){
  4541. var self=this;
  4542. smalltalk.send(self, "_at_put_", [smalltalk.send(anAssociation, "_key", []), smalltalk.send(anAssociation, "_value", [])]);
  4543. return self;}
  4544. }),
  4545. smalltalk.Dictionary);
  4546. smalltalk.addMethod(
  4547. '_addAll_',
  4548. smalltalk.method({
  4549. selector: 'addAll:',
  4550. fn: function (aDictionary){
  4551. var self=this;
  4552. smalltalk.send(self, "_addAll_", [smalltalk.send(aDictionary, "_associations", [])], smalltalk.Collection);
  4553. return aDictionary;
  4554. return self;}
  4555. }),
  4556. smalltalk.Dictionary);
  4557. smalltalk.addMethod(
  4558. '__comma',
  4559. smalltalk.method({
  4560. selector: ',',
  4561. fn: function (aCollection){
  4562. var self=this;
  4563. smalltalk.send(self, "_shouldNotImplement", []);
  4564. return self;}
  4565. }),
  4566. smalltalk.Dictionary);
  4567. smalltalk.addMethod(
  4568. '_copyFrom_to_',
  4569. smalltalk.method({
  4570. selector: 'copyFrom:to:',
  4571. fn: function (anIndex, anotherIndex){
  4572. var self=this;
  4573. smalltalk.send(self, "_shouldNotImplement", []);
  4574. return self;}
  4575. }),
  4576. smalltalk.Dictionary);
  4577. smalltalk.addMethod(
  4578. '_associationsDo_',
  4579. smalltalk.method({
  4580. selector: 'associationsDo:',
  4581. fn: function (aBlock){
  4582. var self=this;
  4583. smalltalk.send(smalltalk.send(self, "_associations", []), "_do_", [aBlock]);
  4584. return self;}
  4585. }),
  4586. smalltalk.Dictionary);
  4587. smalltalk.addMethod(
  4588. '_keysAndValuesDo_',
  4589. smalltalk.method({
  4590. selector: 'keysAndValuesDo:',
  4591. fn: function (aBlock){
  4592. var self=this;
  4593. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(aBlock, "_value_value_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  4594. return self;}
  4595. }),
  4596. smalltalk.Dictionary);
  4597. smalltalk.addMethod(
  4598. '_do_',
  4599. smalltalk.method({
  4600. selector: 'do:',
  4601. fn: function (aBlock){
  4602. var self=this;
  4603. smalltalk.send(smalltalk.send(self, "_values", []), "_do_", [aBlock]);
  4604. return self;}
  4605. }),
  4606. smalltalk.Dictionary);
  4607. smalltalk.addMethod(
  4608. '_select_',
  4609. smalltalk.method({
  4610. selector: 'select:',
  4611. fn: function (aBlock){
  4612. var self=this;
  4613. var newDict=nil;
  4614. newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4615. 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]);})]));})]);
  4616. return newDict;
  4617. return self;}
  4618. }),
  4619. smalltalk.Dictionary);
  4620. smalltalk.addMethod(
  4621. '_collect_',
  4622. smalltalk.method({
  4623. selector: 'collect:',
  4624. fn: function (aBlock){
  4625. var self=this;
  4626. var newDict=nil;
  4627. newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4628. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(newDict, "_at_put_", [key, smalltalk.send(aBlock, "_value_", [value])]);})]);
  4629. return newDict;
  4630. return self;}
  4631. }),
  4632. smalltalk.Dictionary);
  4633. smalltalk.addMethod(
  4634. '_detect_ifNone_',
  4635. smalltalk.method({
  4636. selector: 'detect:ifNone:',
  4637. fn: function (aBlock, anotherBlock){
  4638. var self=this;
  4639. return smalltalk.send(smalltalk.send(self, "_values", []), "_detect_ifNone_", [aBlock, anotherBlock]);
  4640. return self;}
  4641. }),
  4642. smalltalk.Dictionary);
  4643. smalltalk.addMethod(
  4644. '_includes_',
  4645. smalltalk.method({
  4646. selector: 'includes:',
  4647. fn: function (anObject){
  4648. var self=this;
  4649. return smalltalk.send(smalltalk.send(self, "_values", []), "_includes_", [anObject]);
  4650. return self;}
  4651. }),
  4652. smalltalk.Dictionary);
  4653. smalltalk.addMethod(
  4654. '_remove_',
  4655. smalltalk.method({
  4656. selector: 'remove:',
  4657. fn: function (aKey){
  4658. var self=this;
  4659. smalltalk.send(self, "_removeKey_", [aKey]);
  4660. return self;}
  4661. }),
  4662. smalltalk.Dictionary);
  4663. smalltalk.addMethod(
  4664. '_removeKey_',
  4665. smalltalk.method({
  4666. selector: 'removeKey:',
  4667. fn: function (aKey){
  4668. var self=this;
  4669. smalltalk.send(self['@keys'], "_remove_", [aKey]);
  4670. return self;}
  4671. }),
  4672. smalltalk.Dictionary);
  4673. smalltalk.addMethod(
  4674. '_at_',
  4675. smalltalk.method({
  4676. selector: 'at:',
  4677. fn: function (aKey){
  4678. var self=this;
  4679. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  4680. return self;}
  4681. }),
  4682. smalltalk.Dictionary);
  4683. smalltalk.addMethod(
  4684. '_asJSONObject',
  4685. smalltalk.method({
  4686. selector: 'asJSONObject',
  4687. fn: function (){
  4688. var self=this;
  4689. var object=nil;
  4690. object=smalltalk.send((smalltalk.Object || Object), "_new", []);
  4691. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(object, "_basicAt_put_", [key, smalltalk.send(value, "_asJSONObject", [])]);})]);
  4692. return object;
  4693. return self;}
  4694. }),
  4695. smalltalk.Dictionary);
  4696. smalltalk.addMethod(
  4697. '_printString',
  4698. smalltalk.method({
  4699. selector: 'printString',
  4700. fn: function (){
  4701. var self=this;
  4702. 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")]);})]);
  4703. return self;}
  4704. }),
  4705. smalltalk.Dictionary);
  4706. smalltalk.addMethod(
  4707. '_storeOn_',
  4708. smalltalk.method({
  4709. selector: 'storeOn:',
  4710. fn: function (aStream){
  4711. var self=this;
  4712. smalltalk.send(aStream, "_nextPutAll_", [unescape("%23%7B")]);
  4713. smalltalk.send(smalltalk.send(self, "_associations", []), "_do_separatedBy_", [(function(each){return smalltalk.send(each, "_storeOn_", [aStream]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [". "]);})]);
  4714. smalltalk.send(aStream, "_nextPutAll_", [unescape("%7D")]);
  4715. return self;}
  4716. }),
  4717. smalltalk.Dictionary);
  4718. smalltalk.addMethod(
  4719. '_fromPairs_',
  4720. smalltalk.method({
  4721. selector: 'fromPairs:',
  4722. fn: function (aCollection){
  4723. var self=this;
  4724. var dict=nil;
  4725. dict=smalltalk.send(self, "_new", []);
  4726. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(dict, "_add_", [each]);})]);
  4727. return dict;
  4728. return self;}
  4729. }),
  4730. smalltalk.Dictionary.klass);
  4731. smalltalk.addClass('ClassBuilder', smalltalk.Object, [], 'Kernel');
  4732. smalltalk.addMethod(
  4733. '_superclass_subclass_',
  4734. smalltalk.method({
  4735. selector: 'superclass:subclass:',
  4736. fn: function (aClass, aString){
  4737. var self=this;
  4738. return smalltalk.send(self, "_superclass_subclass_instanceVariableNames_package_", [aClass, aString, "", nil]);
  4739. return self;}
  4740. }),
  4741. smalltalk.ClassBuilder);
  4742. smalltalk.addMethod(
  4743. '_class_instanceVariableNames_',
  4744. smalltalk.method({
  4745. selector: 'class:instanceVariableNames:',
  4746. fn: function (aClass, aString){
  4747. var self=this;
  4748. ((($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"])]);})]));
  4749. smalltalk.send(aClass, "_basicAt_put_", ["iVarNames", smalltalk.send(self, "_instanceVariableNamesFor_", [aString])]);
  4750. smalltalk.send(self, "_setupClass_", [aClass]);
  4751. return self;}
  4752. }),
  4753. smalltalk.ClassBuilder);
  4754. smalltalk.addMethod(
  4755. '_instanceVariableNamesFor_',
  4756. smalltalk.method({
  4757. selector: 'instanceVariableNamesFor:',
  4758. fn: function (aString){
  4759. var self=this;
  4760. return smalltalk.send(smalltalk.send(aString, "_tokenize_", [" "]), "_reject_", [(function(each){return smalltalk.send(each, "_isEmpty", []);})]);
  4761. return self;}
  4762. }),
  4763. smalltalk.ClassBuilder);
  4764. smalltalk.addMethod(
  4765. '_addSubclassOf_named_instanceVariableNames_',
  4766. smalltalk.method({
  4767. selector: 'addSubclassOf:named:instanceVariableNames:',
  4768. fn: function (aClass, aString, aCollection){
  4769. var self=this;
  4770. smalltalk.addClass(aString, aClass, aCollection);
  4771. return smalltalk[aString];
  4772. return self;}
  4773. }),
  4774. smalltalk.ClassBuilder);
  4775. smalltalk.addMethod(
  4776. '_setupClass_',
  4777. smalltalk.method({
  4778. selector: 'setupClass:',
  4779. fn: function (aClass){
  4780. var self=this;
  4781. smalltalk.init(aClass);;
  4782. return self;}
  4783. }),
  4784. smalltalk.ClassBuilder);
  4785. smalltalk.addMethod(
  4786. '_superclass_subclass_instanceVariableNames_package_',
  4787. smalltalk.method({
  4788. selector: 'superclass:subclass:instanceVariableNames:package:',
  4789. fn: function (aClass, aString, aString2, aString3){
  4790. var self=this;
  4791. var newClass=nil;
  4792. newClass=smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_package_", [aClass, aString, smalltalk.send(self, "_instanceVariableNamesFor_", [aString2]), (($receiver = aString3) == nil || $receiver == undefined) ? (function(){return "unclassified";})() : $receiver]);
  4793. smalltalk.send(self, "_setupClass_", [newClass]);
  4794. return newClass;
  4795. return self;}
  4796. }),
  4797. smalltalk.ClassBuilder);
  4798. smalltalk.addMethod(
  4799. '_addSubclassOf_named_instanceVariableNames_package_',
  4800. smalltalk.method({
  4801. selector: 'addSubclassOf:named:instanceVariableNames:package:',
  4802. fn: function (aClass, aString, aCollection, packageName){
  4803. var self=this;
  4804. smalltalk.addClass(aString, aClass, aCollection, packageName);
  4805. return smalltalk[aString];
  4806. return self;}
  4807. }),
  4808. smalltalk.ClassBuilder);
  4809. smalltalk.addMethod(
  4810. '_copyClass_named_',
  4811. smalltalk.method({
  4812. selector: 'copyClass:named:',
  4813. fn: function (aClass, aString){
  4814. var self=this;
  4815. var newClass=nil;
  4816. newClass=smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_package_", [smalltalk.send(aClass, "_superclass", []), aString, smalltalk.send(aClass, "_instanceVariableNames", []), smalltalk.send(smalltalk.send(aClass, "_package", []), "_name", [])]);
  4817. smalltalk.send(self, "_setupClass_", [newClass]);
  4818. 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", [])]);})]);
  4819. 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", [])]);})]);
  4820. smalltalk.send(self, "_setupClass_", [newClass]);
  4821. return newClass;
  4822. return self;}
  4823. }),
  4824. smalltalk.ClassBuilder);
  4825. smalltalk.addClass('ClassCategoryReader', smalltalk.Object, ['class', 'category', 'chunkParser'], 'Kernel');
  4826. smalltalk.addMethod(
  4827. '_initialize',
  4828. smalltalk.method({
  4829. selector: 'initialize',
  4830. fn: function (){
  4831. var self=this;
  4832. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  4833. self['@chunkParser']=smalltalk.send((smalltalk.ChunkParser || ChunkParser), "_new", []);
  4834. return self;}
  4835. }),
  4836. smalltalk.ClassCategoryReader);
  4837. smalltalk.addMethod(
  4838. '_class_category_',
  4839. smalltalk.method({
  4840. selector: 'class:category:',
  4841. fn: function (aClass, aString){
  4842. var self=this;
  4843. self['@class']=aClass;
  4844. self['@category']=aString;
  4845. return self;}
  4846. }),
  4847. smalltalk.ClassCategoryReader);
  4848. smalltalk.addMethod(
  4849. '_scanFrom_',
  4850. smalltalk.method({
  4851. selector: 'scanFrom:',
  4852. fn: function (aChunkParser){
  4853. var self=this;
  4854. var chunk=nil;
  4855. (function(){while(!(function(){chunk=smalltalk.send(aChunkParser, "_nextChunk", []);return smalltalk.send(chunk, "_isEmpty", []);})()) {(function(){return smalltalk.send(self, "_compileMethod_", [chunk]);})()}})();
  4856. return self;}
  4857. }),
  4858. smalltalk.ClassCategoryReader);
  4859. smalltalk.addMethod(
  4860. '_compileMethod_',
  4861. smalltalk.method({
  4862. selector: 'compileMethod:',
  4863. fn: function (aString){
  4864. var self=this;
  4865. var method=nil;
  4866. method=smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_load_forClass_", [aString, self['@class']]);
  4867. smalltalk.send(method, "_category_", [self['@category']]);
  4868. smalltalk.send(self['@class'], "_addCompiledMethod_", [method]);
  4869. return self;}
  4870. }),
  4871. smalltalk.ClassCategoryReader);
  4872. smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel');
  4873. smalltalk.addMethod(
  4874. '_collection',
  4875. smalltalk.method({
  4876. selector: 'collection',
  4877. fn: function (){
  4878. var self=this;
  4879. return self['@collection'];
  4880. return self;}
  4881. }),
  4882. smalltalk.Stream);
  4883. smalltalk.addMethod(
  4884. '_setCollection_',
  4885. smalltalk.method({
  4886. selector: 'setCollection:',
  4887. fn: function (aCollection){
  4888. var self=this;
  4889. self['@collection']=aCollection;
  4890. return self;}
  4891. }),
  4892. smalltalk.Stream);
  4893. smalltalk.addMethod(
  4894. '_position',
  4895. smalltalk.method({
  4896. selector: 'position',
  4897. fn: function (){
  4898. var self=this;
  4899. return (($receiver = self['@position']) == nil || $receiver == undefined) ? (function(){return self['@position']=(0);})() : $receiver;
  4900. return self;}
  4901. }),
  4902. smalltalk.Stream);
  4903. smalltalk.addMethod(
  4904. '_position_',
  4905. smalltalk.method({
  4906. selector: 'position:',
  4907. fn: function (anInteger){
  4908. var self=this;
  4909. self['@position']=anInteger;
  4910. return self;}
  4911. }),
  4912. smalltalk.Stream);
  4913. smalltalk.addMethod(
  4914. '_streamSize',
  4915. smalltalk.method({
  4916. selector: 'streamSize',
  4917. fn: function (){
  4918. var self=this;
  4919. return self['@streamSize'];
  4920. return self;}
  4921. }),
  4922. smalltalk.Stream);
  4923. smalltalk.addMethod(
  4924. '_setStreamSize_',
  4925. smalltalk.method({
  4926. selector: 'setStreamSize:',
  4927. fn: function (anInteger){
  4928. var self=this;
  4929. self['@streamSize']=anInteger;
  4930. return self;}
  4931. }),
  4932. smalltalk.Stream);
  4933. smalltalk.addMethod(
  4934. '_contents',
  4935. smalltalk.method({
  4936. selector: 'contents',
  4937. fn: function (){
  4938. var self=this;
  4939. return smalltalk.send(smalltalk.send(self, "_collection", []), "_copyFrom_to_", [(1), smalltalk.send(self, "_streamSize", [])]);
  4940. return self;}
  4941. }),
  4942. smalltalk.Stream);
  4943. smalltalk.addMethod(
  4944. '_size',
  4945. smalltalk.method({
  4946. selector: 'size',
  4947. fn: function (){
  4948. var self=this;
  4949. return smalltalk.send(self, "_streamSize", []);
  4950. return self;}
  4951. }),
  4952. smalltalk.Stream);
  4953. smalltalk.addMethod(
  4954. '_reset',
  4955. smalltalk.method({
  4956. selector: 'reset',
  4957. fn: function (){
  4958. var self=this;
  4959. smalltalk.send(self, "_position_", [(0)]);
  4960. return self;}
  4961. }),
  4962. smalltalk.Stream);
  4963. smalltalk.addMethod(
  4964. '_close',
  4965. smalltalk.method({
  4966. selector: 'close',
  4967. fn: function (){
  4968. var self=this;
  4969. return self;}
  4970. }),
  4971. smalltalk.Stream);
  4972. smalltalk.addMethod(
  4973. '_flush',
  4974. smalltalk.method({
  4975. selector: 'flush',
  4976. fn: function (){
  4977. var self=this;
  4978. return self;}
  4979. }),
  4980. smalltalk.Stream);
  4981. smalltalk.addMethod(
  4982. '_resetContents',
  4983. smalltalk.method({
  4984. selector: 'resetContents',
  4985. fn: function (){
  4986. var self=this;
  4987. smalltalk.send(self, "_reset", []);
  4988. smalltalk.send(self, "_setStreamSize_", [(0)]);
  4989. return self;}
  4990. }),
  4991. smalltalk.Stream);
  4992. smalltalk.addMethod(
  4993. '_do_',
  4994. smalltalk.method({
  4995. selector: 'do:',
  4996. fn: function (aBlock){
  4997. var self=this;
  4998. (function(){while(!(function(){return smalltalk.send(self, "_atEnd", []);})()) {(function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_next", [])]);})()}})();
  4999. return self;}
  5000. }),
  5001. smalltalk.Stream);
  5002. smalltalk.addMethod(
  5003. '_setToEnd',
  5004. smalltalk.method({
  5005. selector: 'setToEnd',
  5006. fn: function (){
  5007. var self=this;
  5008. smalltalk.send(self, "_position_", [smalltalk.send(self, "_size", [])]);
  5009. return self;}
  5010. }),
  5011. smalltalk.Stream);
  5012. smalltalk.addMethod(
  5013. '_skip_',
  5014. smalltalk.method({
  5015. selector: 'skip:',
  5016. fn: function (anInteger){
  5017. var self=this;
  5018. 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)])]);
  5019. return self;}
  5020. }),
  5021. smalltalk.Stream);
  5022. smalltalk.addMethod(
  5023. '_next',
  5024. smalltalk.method({
  5025. selector: 'next',
  5026. fn: function (){
  5027. var self=this;
  5028. smalltalk.send(self, "_position_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);
  5029. return smalltalk.send(self['@collection'], "_at_", [smalltalk.send(self, "_position", [])]);
  5030. return self;}
  5031. }),
  5032. smalltalk.Stream);
  5033. smalltalk.addMethod(
  5034. '_next_',
  5035. smalltalk.method({
  5036. selector: 'next:',
  5037. fn: function (anInteger){
  5038. var self=this;
  5039. var tempCollection=nil;
  5040. tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []);
  5041. 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", [])]);})]));})]);
  5042. return tempCollection;
  5043. return self;}
  5044. }),
  5045. smalltalk.Stream);
  5046. smalltalk.addMethod(
  5047. '_nextPut_',
  5048. smalltalk.method({
  5049. selector: 'nextPut:',
  5050. fn: function (anObject){
  5051. var self=this;
  5052. smalltalk.send(self, "_position_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);
  5053. smalltalk.send(smalltalk.send(self, "_collection", []), "_at_put_", [smalltalk.send(self, "_position", []), anObject]);
  5054. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  5055. return self;}
  5056. }),
  5057. smalltalk.Stream);
  5058. smalltalk.addMethod(
  5059. '_nextPutAll_',
  5060. smalltalk.method({
  5061. selector: 'nextPutAll:',
  5062. fn: function (aCollection){
  5063. var self=this;
  5064. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_nextPut_", [each]);})]);
  5065. return self;}
  5066. }),
  5067. smalltalk.Stream);
  5068. smalltalk.addMethod(
  5069. '_peek',
  5070. smalltalk.method({
  5071. selector: 'peek',
  5072. fn: function (){
  5073. var self=this;
  5074. 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)]))]);})]));
  5075. return self;}
  5076. }),
  5077. smalltalk.Stream);
  5078. smalltalk.addMethod(
  5079. '_atEnd',
  5080. smalltalk.method({
  5081. selector: 'atEnd',
  5082. fn: function (){
  5083. var self=this;
  5084. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [smalltalk.send(self, "_size", [])]);
  5085. return self;}
  5086. }),
  5087. smalltalk.Stream);
  5088. smalltalk.addMethod(
  5089. '_atStart',
  5090. smalltalk.method({
  5091. selector: 'atStart',
  5092. fn: function (){
  5093. var self=this;
  5094. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [(0)]);
  5095. return self;}
  5096. }),
  5097. smalltalk.Stream);
  5098. smalltalk.addMethod(
  5099. '_isEmpty',
  5100. smalltalk.method({
  5101. selector: 'isEmpty',
  5102. fn: function (){
  5103. var self=this;
  5104. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
  5105. return self;}
  5106. }),
  5107. smalltalk.Stream);
  5108. smalltalk.addMethod(
  5109. '_on_',
  5110. smalltalk.method({
  5111. selector: 'on:',
  5112. fn: function (aCollection){
  5113. var self=this;
  5114. 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", []));
  5115. return self;}
  5116. }),
  5117. smalltalk.Stream.klass);
  5118. smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel');
  5119. smalltalk.addMethod(
  5120. '_next_',
  5121. smalltalk.method({
  5122. selector: 'next:',
  5123. fn: function (anInteger){
  5124. var self=this;
  5125. var tempCollection=nil;
  5126. tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []);
  5127. 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", [])]);})]));})]);
  5128. return tempCollection;
  5129. return self;}
  5130. }),
  5131. smalltalk.StringStream);
  5132. smalltalk.addMethod(
  5133. '_nextPut_',
  5134. smalltalk.method({
  5135. selector: 'nextPut:',
  5136. fn: function (aString){
  5137. var self=this;
  5138. smalltalk.send(self, "_nextPutAll_", [aString]);
  5139. return self;}
  5140. }),
  5141. smalltalk.StringStream);
  5142. smalltalk.addMethod(
  5143. '_nextPutAll_',
  5144. smalltalk.method({
  5145. selector: 'nextPutAll:',
  5146. fn: function (aString){
  5147. var self=this;
  5148. 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", [])])])]);
  5149. 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", [])]))]);
  5150. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  5151. return self;}
  5152. }),
  5153. smalltalk.StringStream);
  5154. smalltalk.addMethod(
  5155. '_cr',
  5156. smalltalk.method({
  5157. selector: 'cr',
  5158. fn: function (){
  5159. var self=this;
  5160. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_cr", [])]);
  5161. return self;}
  5162. }),
  5163. smalltalk.StringStream);
  5164. smalltalk.addMethod(
  5165. '_crlf',
  5166. smalltalk.method({
  5167. selector: 'crlf',
  5168. fn: function (){
  5169. var self=this;
  5170. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_crlf", [])]);
  5171. return self;}
  5172. }),
  5173. smalltalk.StringStream);
  5174. smalltalk.addMethod(
  5175. '_lf',
  5176. smalltalk.method({
  5177. selector: 'lf',
  5178. fn: function (){
  5179. var self=this;
  5180. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_lf", [])]);
  5181. return self;}
  5182. }),
  5183. smalltalk.StringStream);
  5184. smalltalk.addMethod(
  5185. '_space',
  5186. smalltalk.method({
  5187. selector: 'space',
  5188. fn: function (){
  5189. var self=this;
  5190. smalltalk.send(self, "_nextPut_", [" "]);
  5191. return self;}
  5192. }),
  5193. smalltalk.StringStream);
  5194. smalltalk.addClass('ClassCommentReader', smalltalk.Object, ['class', 'chunkParser'], 'Kernel');
  5195. smalltalk.addMethod(
  5196. '_class_',
  5197. smalltalk.method({
  5198. selector: 'class:',
  5199. fn: function (aClass){
  5200. var self=this;
  5201. self['@class']=aClass;
  5202. return self;}
  5203. }),
  5204. smalltalk.ClassCommentReader);
  5205. smalltalk.addMethod(
  5206. '_scanFrom_',
  5207. smalltalk.method({
  5208. selector: 'scanFrom:',
  5209. fn: function (aChunkParser){
  5210. var self=this;
  5211. var chunk=nil;
  5212. chunk=smalltalk.send(aChunkParser, "_nextChunk", []);
  5213. ((($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]);})]));
  5214. return self;}
  5215. }),
  5216. smalltalk.ClassCommentReader);
  5217. smalltalk.addMethod(
  5218. '_initialize',
  5219. smalltalk.method({
  5220. selector: 'initialize',
  5221. fn: function (){
  5222. var self=this;
  5223. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  5224. self['@chunkParser']=smalltalk.send((smalltalk.ChunkParser || ChunkParser), "_new", []);
  5225. return self;}
  5226. }),
  5227. smalltalk.ClassCommentReader);
  5228. smalltalk.addMethod(
  5229. '_setComment_',
  5230. smalltalk.method({
  5231. selector: 'setComment:',
  5232. fn: function (aString){
  5233. var self=this;
  5234. smalltalk.send(self['@class'], "_comment_", [aString]);
  5235. return self;}
  5236. }),
  5237. smalltalk.ClassCommentReader);
  5238. smalltalk.addClass('Random', smalltalk.Object, [], 'Kernel');
  5239. smalltalk.addMethod(
  5240. '_next',
  5241. smalltalk.method({
  5242. selector: 'next',
  5243. fn: function (){
  5244. var self=this;
  5245. return Math.random();
  5246. return self;}
  5247. }),
  5248. smalltalk.Random);
  5249. smalltalk.addMethod(
  5250. '_next_',
  5251. smalltalk.method({
  5252. selector: 'next:',
  5253. fn: function (anInteger){
  5254. var self=this;
  5255. return smalltalk.send(smalltalk.send((1), "_to_", [anInteger]), "_collect_", [(function(each){return smalltalk.send(self, "_next", []);})]);
  5256. return self;}
  5257. }),
  5258. smalltalk.Random);
  5259. smalltalk.addClass('Point', smalltalk.Object, ['x', 'y'], 'Kernel');
  5260. smalltalk.addMethod(
  5261. '_x',
  5262. smalltalk.method({
  5263. selector: 'x',
  5264. fn: function (){
  5265. var self=this;
  5266. return self['@x'];
  5267. return self;}
  5268. }),
  5269. smalltalk.Point);
  5270. smalltalk.addMethod(
  5271. '_y',
  5272. smalltalk.method({
  5273. selector: 'y',
  5274. fn: function (){
  5275. var self=this;
  5276. return self['@y'];
  5277. return self;}
  5278. }),
  5279. smalltalk.Point);
  5280. smalltalk.addMethod(
  5281. '_y_',
  5282. smalltalk.method({
  5283. selector: 'y:',
  5284. fn: function (aNumber){
  5285. var self=this;
  5286. self['@y']=aNumber;
  5287. return self;}
  5288. }),
  5289. smalltalk.Point);
  5290. smalltalk.addMethod(
  5291. '_x_',
  5292. smalltalk.method({
  5293. selector: 'x:',
  5294. fn: function (aNumber){
  5295. var self=this;
  5296. self['@x']=aNumber;
  5297. return self;}
  5298. }),
  5299. smalltalk.Point);
  5300. smalltalk.addMethod(
  5301. '__star',
  5302. smalltalk.method({
  5303. selector: '*',
  5304. fn: function (aPoint){
  5305. var self=this;
  5306. 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", [])]))]);
  5307. return self;}
  5308. }),
  5309. smalltalk.Point);
  5310. smalltalk.addMethod(
  5311. '__plus',
  5312. smalltalk.method({
  5313. selector: '+',
  5314. fn: function (aPoint){
  5315. var self=this;
  5316. 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", [])]))]);
  5317. return self;}
  5318. }),
  5319. smalltalk.Point);
  5320. smalltalk.addMethod(
  5321. '__minus',
  5322. smalltalk.method({
  5323. selector: '-',
  5324. fn: function (aPoint){
  5325. var self=this;
  5326. 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", [])]))]);
  5327. return self;}
  5328. }),
  5329. smalltalk.Point);
  5330. smalltalk.addMethod(
  5331. '__slash',
  5332. smalltalk.method({
  5333. selector: '/',
  5334. fn: function (aPoint){
  5335. var self=this;
  5336. 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", [])]))]);
  5337. return self;}
  5338. }),
  5339. smalltalk.Point);
  5340. smalltalk.addMethod(
  5341. '_asPoint',
  5342. smalltalk.method({
  5343. selector: 'asPoint',
  5344. fn: function (){
  5345. var self=this;
  5346. return self;
  5347. return self;}
  5348. }),
  5349. smalltalk.Point);
  5350. smalltalk.addMethod(
  5351. '__eq',
  5352. smalltalk.method({
  5353. selector: '=',
  5354. fn: function (aPoint){
  5355. var self=this;
  5356. 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", [])])]);})]);
  5357. return self;}
  5358. }),
  5359. smalltalk.Point);
  5360. smalltalk.addMethod(
  5361. '_x_y_',
  5362. smalltalk.method({
  5363. selector: 'x:y:',
  5364. fn: function (aNumber, anotherNumber){
  5365. var self=this;
  5366. return (function($rec){smalltalk.send($rec, "_x_", [aNumber]);smalltalk.send($rec, "_y_", [anotherNumber]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  5367. return self;}
  5368. }),
  5369. smalltalk.Point.klass);
  5370. smalltalk.addClass('Message', smalltalk.Object, ['selector', 'arguments'], 'Kernel');
  5371. smalltalk.addMethod(
  5372. '_selector',
  5373. smalltalk.method({
  5374. selector: 'selector',
  5375. fn: function (){
  5376. var self=this;
  5377. return self['@selector'];
  5378. return self;}
  5379. }),
  5380. smalltalk.Message);
  5381. smalltalk.addMethod(
  5382. '_selector_',
  5383. smalltalk.method({
  5384. selector: 'selector:',
  5385. fn: function (aString){
  5386. var self=this;
  5387. self['@selector']=aString;
  5388. return self;}
  5389. }),
  5390. smalltalk.Message);
  5391. smalltalk.addMethod(
  5392. '_arguments_',
  5393. smalltalk.method({
  5394. selector: 'arguments:',
  5395. fn: function (anArray){
  5396. var self=this;
  5397. self['@arguments']=anArray;
  5398. return self;}
  5399. }),
  5400. smalltalk.Message);
  5401. smalltalk.addMethod(
  5402. '_arguments',
  5403. smalltalk.method({
  5404. selector: 'arguments',
  5405. fn: function (){
  5406. var self=this;
  5407. return self['@arguments'];
  5408. return self;}
  5409. }),
  5410. smalltalk.Message);
  5411. smalltalk.addMethod(
  5412. '_printString',
  5413. smalltalk.method({
  5414. selector: 'printString',
  5415. fn: function (){
  5416. var self=this;
  5417. 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);})]);
  5418. return self;}
  5419. }),
  5420. smalltalk.Message);
  5421. smalltalk.addMethod(
  5422. '_selector_arguments_',
  5423. smalltalk.method({
  5424. selector: 'selector:arguments:',
  5425. fn: function (aString, anArray){
  5426. var self=this;
  5427. return (function($rec){smalltalk.send($rec, "_selector_", [aString]);smalltalk.send($rec, "_arguments_", [anArray]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  5428. return self;}
  5429. }),
  5430. smalltalk.Message.klass);
  5431. smalltalk.addClass('MessageNotUnderstood', smalltalk.Error, ['message', 'receiver'], 'Kernel');
  5432. smalltalk.addMethod(
  5433. '_message',
  5434. smalltalk.method({
  5435. selector: 'message',
  5436. fn: function (){
  5437. var self=this;
  5438. return self['@message'];
  5439. return self;}
  5440. }),
  5441. smalltalk.MessageNotUnderstood);
  5442. smalltalk.addMethod(
  5443. '_message_',
  5444. smalltalk.method({
  5445. selector: 'message:',
  5446. fn: function (aMessage){
  5447. var self=this;
  5448. self['@message']=aMessage;
  5449. return self;}
  5450. }),
  5451. smalltalk.MessageNotUnderstood);
  5452. smalltalk.addMethod(
  5453. '_receiver',
  5454. smalltalk.method({
  5455. selector: 'receiver',
  5456. fn: function (){
  5457. var self=this;
  5458. return self['@receiver'];
  5459. return self;}
  5460. }),
  5461. smalltalk.MessageNotUnderstood);
  5462. smalltalk.addMethod(
  5463. '_receiver_',
  5464. smalltalk.method({
  5465. selector: 'receiver:',
  5466. fn: function (anObject){
  5467. var self=this;
  5468. self['@receiver']=anObject;
  5469. return self;}
  5470. }),
  5471. smalltalk.MessageNotUnderstood);
  5472. smalltalk.addMethod(
  5473. '_messageText',
  5474. smalltalk.method({
  5475. selector: 'messageText',
  5476. fn: function (){
  5477. var self=this;
  5478. 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", [])]);
  5479. return self;}
  5480. }),
  5481. smalltalk.MessageNotUnderstood);
  5482. smalltalk.addClass('ErrorHandler', smalltalk.Object, [], 'Kernel');
  5483. smalltalk.addMethod(
  5484. '_handleError_',
  5485. smalltalk.method({
  5486. selector: 'handleError:',
  5487. fn: function (anError){
  5488. var self=this;
  5489. (($receiver = smalltalk.send(anError, "_context", [])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self, "_logErrorContext_", [smalltalk.send(anError, "_context", [])]);})() : nil;
  5490. smalltalk.send(self, "_logError_", [anError]);
  5491. return self;}
  5492. }),
  5493. smalltalk.ErrorHandler);
  5494. smalltalk.addMethod(
  5495. '_logContext_',
  5496. smalltalk.method({
  5497. selector: 'logContext:',
  5498. fn: function (aContext){
  5499. var self=this;
  5500. (($receiver = smalltalk.send(aContext, "_home", [])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self, "_logContext_", [smalltalk.send(aContext, "_home", [])]);})() : nil;
  5501. smalltalk.send(self, "_log_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aContext, "_receiver", []), "_asString", []), "__comma", [unescape("%3E%3E")]), "__comma", [smalltalk.send(aContext, "_selector", [])])]);
  5502. return self;}
  5503. }),
  5504. smalltalk.ErrorHandler);
  5505. smalltalk.addMethod(
  5506. '_logErrorContext_',
  5507. smalltalk.method({
  5508. selector: 'logErrorContext:',
  5509. fn: function (aContext){
  5510. var self=this;
  5511. (($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;
  5512. return self;}
  5513. }),
  5514. smalltalk.ErrorHandler);
  5515. smalltalk.addMethod(
  5516. '_logError_',
  5517. smalltalk.method({
  5518. selector: 'logError:',
  5519. fn: function (anError){
  5520. var self=this;
  5521. smalltalk.send(self, "_log_", [smalltalk.send(anError, "_messageText", [])]);
  5522. return self;}
  5523. }),
  5524. smalltalk.ErrorHandler);
  5525. smalltalk.addMethod(
  5526. '_log_',
  5527. smalltalk.method({
  5528. selector: 'log:',
  5529. fn: function (aString){
  5530. var self=this;
  5531. smalltalk.send((typeof console == 'undefined' ? nil : console), "_log_", [aString]);
  5532. return self;}
  5533. }),
  5534. smalltalk.ErrorHandler);
  5535. smalltalk.ErrorHandler.klass.iVarNames = ['current'];
  5536. smalltalk.addMethod(
  5537. '_current',
  5538. smalltalk.method({
  5539. selector: 'current',
  5540. fn: function (){
  5541. var self=this;
  5542. return (($receiver = self['@current']) == nil || $receiver == undefined) ? (function(){return self['@current']=smalltalk.send(self, "_new", []);})() : $receiver;
  5543. return self;}
  5544. }),
  5545. smalltalk.ErrorHandler.klass);
  5546. smalltalk.addMethod(
  5547. '_initialize',
  5548. smalltalk.method({
  5549. selector: 'initialize',
  5550. fn: function (){
  5551. var self=this;
  5552. smalltalk.send(self, "_register", []);
  5553. return self;}
  5554. }),
  5555. smalltalk.ErrorHandler.klass);
  5556. smalltalk.addMethod(
  5557. '_register',
  5558. smalltalk.method({
  5559. selector: 'register',
  5560. fn: function (){
  5561. var self=this;
  5562. smalltalk.send((smalltalk.ErrorHandler || ErrorHandler), "_setCurrent_", [smalltalk.send(self, "_new", [])]);
  5563. return self;}
  5564. }),
  5565. smalltalk.ErrorHandler.klass);
  5566. smalltalk.addMethod(
  5567. '_setCurrent_',
  5568. smalltalk.method({
  5569. selector: 'setCurrent:',
  5570. fn: function (anHandler){
  5571. var self=this;
  5572. self['@current']=anHandler;
  5573. return self;}
  5574. }),
  5575. smalltalk.ErrorHandler.klass);
  5576. smalltalk.addClass('JSObjectProxy', smalltalk.Object, ['jsObject'], 'Kernel');
  5577. smalltalk.addMethod(
  5578. '_jsObject_',
  5579. smalltalk.method({
  5580. selector: 'jsObject:',
  5581. fn: function (aJSObject){
  5582. var self=this;
  5583. self['@jsObject']=aJSObject;
  5584. return self;}
  5585. }),
  5586. smalltalk.JSObjectProxy);
  5587. smalltalk.addMethod(
  5588. '_jsObject',
  5589. smalltalk.method({
  5590. selector: 'jsObject',
  5591. fn: function (){
  5592. var self=this;
  5593. return self['@jsObject'];
  5594. return self;}
  5595. }),
  5596. smalltalk.JSObjectProxy);
  5597. smalltalk.addMethod(
  5598. '_printString',
  5599. smalltalk.method({
  5600. selector: 'printString',
  5601. fn: function (){
  5602. var self=this;
  5603. return smalltalk.send(smalltalk.send(self, "_jsObject", []), "_toString", []);
  5604. return self;}
  5605. }),
  5606. smalltalk.JSObjectProxy);
  5607. smalltalk.addMethod(
  5608. '_inspectOn_',
  5609. smalltalk.method({
  5610. selector: 'inspectOn:',
  5611. fn: function (anInspector){
  5612. var self=this;
  5613. var variables=nil;
  5614. variables=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []);
  5615. smalltalk.send(variables, "_at_put_", [unescape("%23self"), smalltalk.send(self, "_jsObject", [])]);
  5616. smalltalk.send(anInspector, "_setLabel_", [smalltalk.send(self, "_printString", [])]);
  5617. for(var i in self['@jsObject']) {
  5618. variables._at_put_(i, self['@jsObject'][i]);
  5619. };
  5620. smalltalk.send(anInspector, "_setVariables_", [variables]);
  5621. return self;}
  5622. }),
  5623. smalltalk.JSObjectProxy);
  5624. smalltalk.addMethod(
  5625. '_doesNotUnderstand_',
  5626. smalltalk.method({
  5627. selector: 'doesNotUnderstand:',
  5628. fn: function (aMessage){
  5629. var self=this;
  5630. var obj=nil;
  5631. var selector=nil;
  5632. var jsSelector=nil;
  5633. var arguments=nil;
  5634. obj=smalltalk.send(self, "_jsObject", []);
  5635. selector=smalltalk.send(aMessage, "_selector", []);
  5636. jsSelector=smalltalk.send(selector, "_asJavaScriptSelector", []);
  5637. arguments=smalltalk.send(aMessage, "_arguments", []);
  5638. if(obj[jsSelector] != undefined) {return smalltalk.send(obj, jsSelector, arguments)};
  5639. smalltalk.send(self, "_doesNotUnderstand_", [aMessage], smalltalk.Object);
  5640. return self;}
  5641. }),
  5642. smalltalk.JSObjectProxy);
  5643. smalltalk.addMethod(
  5644. '_at_',
  5645. smalltalk.method({
  5646. selector: 'at:',
  5647. fn: function (aString){
  5648. var self=this;
  5649. return self['@jsObject'][aString];
  5650. return self;}
  5651. }),
  5652. smalltalk.JSObjectProxy);
  5653. smalltalk.addMethod(
  5654. '_at_put_',
  5655. smalltalk.method({
  5656. selector: 'at:put:',
  5657. fn: function (aString, anObject){
  5658. var self=this;
  5659. self['@jsObject'][aString] = anObject;
  5660. return self;}
  5661. }),
  5662. smalltalk.JSObjectProxy);
  5663. smalltalk.addMethod(
  5664. '_on_',
  5665. smalltalk.method({
  5666. selector: 'on:',
  5667. fn: function (aJSObject){
  5668. var self=this;
  5669. return (function($rec){smalltalk.send($rec, "_jsObject_", [aJSObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  5670. return self;}
  5671. }),
  5672. smalltalk.JSObjectProxy.klass);
  5673. smalltalk.addClass('Set', smalltalk.Collection, ['elements'], 'Kernel');
  5674. smalltalk.addMethod(
  5675. '_add_',
  5676. smalltalk.method({
  5677. selector: 'add:',
  5678. fn: function (anObject){
  5679. var self=this;
  5680. var found;
  5681. for(var i in self['@elements']) {
  5682. if(anObject == self['@elements'][i]) {
  5683. found = true;
  5684. break;
  5685. }
  5686. }
  5687. if(!found) {self['@elements'].push(anObject)}
  5688. ;
  5689. return self;}
  5690. }),
  5691. smalltalk.Set);
  5692. smalltalk.addMethod(
  5693. '_remove_',
  5694. smalltalk.method({
  5695. selector: 'remove:',
  5696. fn: function (anObject){
  5697. var self=this;
  5698. smalltalk.send(self['@elements'], "_remove_", [anObject]);
  5699. return self;}
  5700. }),
  5701. smalltalk.Set);
  5702. smalltalk.addMethod(
  5703. '_initialize',
  5704. smalltalk.method({
  5705. selector: 'initialize',
  5706. fn: function (){
  5707. var self=this;
  5708. smalltalk.send(self, "_initialize", [], smalltalk.Collection);
  5709. self['@elements']=[];
  5710. return self;}
  5711. }),
  5712. smalltalk.Set);
  5713. smalltalk.addMethod(
  5714. '_size',
  5715. smalltalk.method({
  5716. selector: 'size',
  5717. fn: function (){
  5718. var self=this;
  5719. return smalltalk.send(self['@elements'], "_size", []);
  5720. return self;}
  5721. }),
  5722. smalltalk.Set);
  5723. smalltalk.addMethod(
  5724. '_asArray',
  5725. smalltalk.method({
  5726. selector: 'asArray',
  5727. fn: function (){
  5728. var self=this;
  5729. return smalltalk.send(self['@elements'], "_copy", []);
  5730. return self;}
  5731. }),
  5732. smalltalk.Set);
  5733. smalltalk.addMethod(
  5734. '_detect_ifNone_',
  5735. smalltalk.method({
  5736. selector: 'detect:ifNone:',
  5737. fn: function (aBlock, anotherBlock){
  5738. var self=this;
  5739. return smalltalk.send(self['@elements'], "_detect_ifNone_", [aBlock, anotherBlock]);
  5740. return self;}
  5741. }),
  5742. smalltalk.Set);
  5743. smalltalk.addMethod(
  5744. '_do_',
  5745. smalltalk.method({
  5746. selector: 'do:',
  5747. fn: function (aBlock){
  5748. var self=this;
  5749. smalltalk.send(self['@elements'], "_do_", [aBlock]);
  5750. return self;}
  5751. }),
  5752. smalltalk.Set);
  5753. smalltalk.addMethod(
  5754. '_includes_',
  5755. smalltalk.method({
  5756. selector: 'includes:',
  5757. fn: function (anObject){
  5758. var self=this;
  5759. return smalltalk.send(self['@elements'], "_includes_", [anObject]);
  5760. return self;}
  5761. }),
  5762. smalltalk.Set);
  5763. smalltalk.addMethod(
  5764. '__eq',
  5765. smalltalk.method({
  5766. selector: '=',
  5767. fn: function (aCollection){
  5768. var self=this;
  5769. 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", [])]);})]);
  5770. return self;}
  5771. }),
  5772. smalltalk.Set);
  5773. smalltalk.addClass('Transcript', smalltalk.Object, ['textarea'], 'Kernel');
  5774. smalltalk.Transcript.klass.iVarNames = ['current'];
  5775. smalltalk.addMethod(
  5776. '_open',
  5777. smalltalk.method({
  5778. selector: 'open',
  5779. fn: function (){
  5780. var self=this;
  5781. smalltalk.send(smalltalk.send(self, "_current", []), "_open", []);
  5782. return self;}
  5783. }),
  5784. smalltalk.Transcript.klass);
  5785. smalltalk.addMethod(
  5786. '_new',
  5787. smalltalk.method({
  5788. selector: 'new',
  5789. fn: function (){
  5790. var self=this;
  5791. smalltalk.send(self, "_shouldNotImplement", []);
  5792. return self;}
  5793. }),
  5794. smalltalk.Transcript.klass);
  5795. smalltalk.addMethod(
  5796. '_current',
  5797. smalltalk.method({
  5798. selector: 'current',
  5799. fn: function (){
  5800. var self=this;
  5801. return self['@current'];
  5802. return self;}
  5803. }),
  5804. smalltalk.Transcript.klass);
  5805. smalltalk.addMethod(
  5806. '_show_',
  5807. smalltalk.method({
  5808. selector: 'show:',
  5809. fn: function (anObject){
  5810. var self=this;
  5811. smalltalk.send(smalltalk.send(self, "_current", []), "_show_", [anObject]);
  5812. return self;}
  5813. }),
  5814. smalltalk.Transcript.klass);
  5815. smalltalk.addMethod(
  5816. '_cr',
  5817. smalltalk.method({
  5818. selector: 'cr',
  5819. fn: function (){
  5820. var self=this;
  5821. smalltalk.send(smalltalk.send(self, "_current", []), "_show_", [smalltalk.send((smalltalk.String || String), "_cr", [])]);
  5822. return self;}
  5823. }),
  5824. smalltalk.Transcript.klass);
  5825. smalltalk.addMethod(
  5826. '_clear',
  5827. smalltalk.method({
  5828. selector: 'clear',
  5829. fn: function (){
  5830. var self=this;
  5831. smalltalk.send(smalltalk.send(self, "_current", []), "_clear", []);
  5832. return self;}
  5833. }),
  5834. smalltalk.Transcript.klass);
  5835. smalltalk.addMethod(
  5836. '_register_',
  5837. smalltalk.method({
  5838. selector: 'register:',
  5839. fn: function (aTranscript){
  5840. var self=this;
  5841. self['@current']=aTranscript;
  5842. return self;}
  5843. }),
  5844. smalltalk.Transcript.klass);
  5845. smalltalk.addClass('ConsoleTranscript', smalltalk.Object, ['textarea'], 'Kernel');
  5846. smalltalk.addMethod(
  5847. '_clear',
  5848. smalltalk.method({
  5849. selector: 'clear',
  5850. fn: function (){
  5851. var self=this;
  5852. return self;}
  5853. }),
  5854. smalltalk.ConsoleTranscript);
  5855. smalltalk.addMethod(
  5856. '_cr',
  5857. smalltalk.method({
  5858. selector: 'cr',
  5859. fn: function (){
  5860. var self=this;
  5861. return self;}
  5862. }),
  5863. smalltalk.ConsoleTranscript);
  5864. smalltalk.addMethod(
  5865. '_show_',
  5866. smalltalk.method({
  5867. selector: 'show:',
  5868. fn: function (anObject){
  5869. var self=this;
  5870. var string=nil;
  5871. string=smalltalk.send(anObject, "_asString", []);
  5872. console.log(String(string));
  5873. return self;}
  5874. }),
  5875. smalltalk.ConsoleTranscript);
  5876. smalltalk.addMethod(
  5877. '_open',
  5878. smalltalk.method({
  5879. selector: 'open',
  5880. fn: function (){
  5881. var self=this;
  5882. return self;}
  5883. }),
  5884. smalltalk.ConsoleTranscript);
  5885. smalltalk.addMethod(
  5886. '_initialize',
  5887. smalltalk.method({
  5888. selector: 'initialize',
  5889. fn: function (){
  5890. var self=this;
  5891. smalltalk.send((smalltalk.Transcript || Transcript), "_register_", [smalltalk.send(self, "_new", [])]);
  5892. return self;}
  5893. }),
  5894. smalltalk.ConsoleTranscript.klass);
  5895. smalltalk.addClass('Dictionary2', smalltalk.Dictionary, ['keys'], 'Kernel');
  5896. smalltalk.addMethod(
  5897. '__eq',
  5898. smalltalk.method({
  5899. selector: '=',
  5900. fn: function (aDictionary){
  5901. var self=this;
  5902. 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}})})();})]));
  5903. ((($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}})})();})]));
  5904. (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return smalltalk.send(smalltalk.send(self, "_associations", []), "__eq", [smalltalk.send(aDictionary, "_associations", [])])}})})();
  5905. return self;
  5906. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  5907. }),
  5908. smalltalk.Dictionary2);
  5909. smalltalk.addMethod(
  5910. '_shallowCopy',
  5911. smalltalk.method({
  5912. selector: 'shallowCopy',
  5913. fn: function (){
  5914. var self=this;
  5915. var copy=nil;
  5916. copy=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  5917. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(copy, "_at_put_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  5918. return copy;
  5919. return self;}
  5920. }),
  5921. smalltalk.Dictionary2);
  5922. smalltalk.addMethod(
  5923. '_initialize',
  5924. smalltalk.method({
  5925. selector: 'initialize',
  5926. fn: function (){
  5927. var self=this;
  5928. smalltalk.send(self, "_initialize", [], smalltalk.Dictionary);
  5929. self['@keys']=[];
  5930. return self;}
  5931. }),
  5932. smalltalk.Dictionary2);
  5933. smalltalk.addMethod(
  5934. '_size',
  5935. smalltalk.method({
  5936. selector: 'size',
  5937. fn: function (){
  5938. var self=this;
  5939. return smalltalk.send(self['@keys'], "_size", []);
  5940. return self;}
  5941. }),
  5942. smalltalk.Dictionary2);
  5943. smalltalk.addMethod(
  5944. '_associations',
  5945. smalltalk.method({
  5946. selector: 'associations',
  5947. fn: function (){
  5948. var self=this;
  5949. var associations=nil;
  5950. associations=[];
  5951. 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])])]);})]);
  5952. return associations;
  5953. return self;}
  5954. }),
  5955. smalltalk.Dictionary2);
  5956. smalltalk.addMethod(
  5957. '_keys',
  5958. smalltalk.method({
  5959. selector: 'keys',
  5960. fn: function (){
  5961. var self=this;
  5962. return smalltalk.send(self['@keys'], "_copy", []);
  5963. return self;}
  5964. }),
  5965. smalltalk.Dictionary2);
  5966. smalltalk.addMethod(
  5967. '_values',
  5968. smalltalk.method({
  5969. selector: 'values',
  5970. fn: function (){
  5971. var self=this;
  5972. return smalltalk.send(self['@keys'], "_collect_", [(function(each){return smalltalk.send(self, "_at_", [each]);})]);
  5973. return self;}
  5974. }),
  5975. smalltalk.Dictionary2);
  5976. smalltalk.addMethod(
  5977. '_at_put_',
  5978. smalltalk.method({
  5979. selector: 'at:put:',
  5980. fn: function (aKey, aValue){
  5981. var self=this;
  5982. ((($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]);})]));
  5983. return smalltalk.send(self, "_basicAt_put_", [aKey, aValue]);
  5984. return self;}
  5985. }),
  5986. smalltalk.Dictionary2);
  5987. smalltalk.addMethod(
  5988. '_at_ifAbsent_',
  5989. smalltalk.method({
  5990. selector: 'at:ifAbsent:',
  5991. fn: function (aKey, aBlock){
  5992. var self=this;
  5993. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_keys", []), "_includes_", [aKey]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_basicAt_", [aKey]);}), aBlock]);
  5994. return self;}
  5995. }),
  5996. smalltalk.Dictionary2);
  5997. smalltalk.addMethod(
  5998. '_at_ifAbsentPut_',
  5999. smalltalk.method({
  6000. selector: 'at:ifAbsentPut:',
  6001. fn: function (aKey, aBlock){
  6002. var self=this;
  6003. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_at_put_", [aKey, smalltalk.send(aBlock, "_value", [])]);})]);
  6004. return self;}
  6005. }),
  6006. smalltalk.Dictionary2);
  6007. smalltalk.addMethod(
  6008. '_at_ifPresent_',
  6009. smalltalk.method({
  6010. selector: 'at:ifPresent:',
  6011. fn: function (aKey, aBlock){
  6012. var self=this;
  6013. return (($receiver = smalltalk.send(self, "_basicAt_", [aKey])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})() : nil;
  6014. return self;}
  6015. }),
  6016. smalltalk.Dictionary2);
  6017. smalltalk.addMethod(
  6018. '_at_ifPresent_ifAbsent_',
  6019. smalltalk.method({
  6020. selector: 'at:ifPresent:ifAbsent:',
  6021. fn: function (aKey, aBlock, anotherBlock){
  6022. var self=this;
  6023. return smalltalk.send(smalltalk.send(self, "_basicAt_", [aKey]), "_ifNil_ifNotNil_", [anotherBlock, (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})]);
  6024. return self;}
  6025. }),
  6026. smalltalk.Dictionary2);
  6027. smalltalk.addMethod(
  6028. '_add_',
  6029. smalltalk.method({
  6030. selector: 'add:',
  6031. fn: function (anAssociation){
  6032. var self=this;
  6033. smalltalk.send(self, "_at_put_", [smalltalk.send(anAssociation, "_key", []), smalltalk.send(anAssociation, "_value", [])]);
  6034. return self;}
  6035. }),
  6036. smalltalk.Dictionary2);
  6037. smalltalk.addMethod(
  6038. '_addAll_',
  6039. smalltalk.method({
  6040. selector: 'addAll:',
  6041. fn: function (aDictionary){
  6042. var self=this;
  6043. smalltalk.send(self, "_addAll_", [smalltalk.send(aDictionary, "_associations", [])], smalltalk.Dictionary);
  6044. return aDictionary;
  6045. return self;}
  6046. }),
  6047. smalltalk.Dictionary2);
  6048. smalltalk.addMethod(
  6049. '__comma',
  6050. smalltalk.method({
  6051. selector: ',',
  6052. fn: function (aCollection){
  6053. var self=this;
  6054. smalltalk.send(self, "_shouldNotImplement", []);
  6055. return self;}
  6056. }),
  6057. smalltalk.Dictionary2);
  6058. smalltalk.addMethod(
  6059. '_copyFrom_to_',
  6060. smalltalk.method({
  6061. selector: 'copyFrom:to:',
  6062. fn: function (anIndex, anotherIndex){
  6063. var self=this;
  6064. smalltalk.send(self, "_shouldNotImplement", []);
  6065. return self;}
  6066. }),
  6067. smalltalk.Dictionary2);
  6068. smalltalk.addMethod(
  6069. '_associationsDo_',
  6070. smalltalk.method({
  6071. selector: 'associationsDo:',
  6072. fn: function (aBlock){
  6073. var self=this;
  6074. smalltalk.send(smalltalk.send(self, "_associations", []), "_do_", [aBlock]);
  6075. return self;}
  6076. }),
  6077. smalltalk.Dictionary2);
  6078. smalltalk.addMethod(
  6079. '_keysAndValuesDo_',
  6080. smalltalk.method({
  6081. selector: 'keysAndValuesDo:',
  6082. fn: function (aBlock){
  6083. var self=this;
  6084. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(aBlock, "_value_value_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  6085. return self;}
  6086. }),
  6087. smalltalk.Dictionary2);
  6088. smalltalk.addMethod(
  6089. '_do_',
  6090. smalltalk.method({
  6091. selector: 'do:',
  6092. fn: function (aBlock){
  6093. var self=this;
  6094. smalltalk.send(smalltalk.send(self, "_values", []), "_do_", [aBlock]);
  6095. return self;}
  6096. }),
  6097. smalltalk.Dictionary2);
  6098. smalltalk.addMethod(
  6099. '_select_',
  6100. smalltalk.method({
  6101. selector: 'select:',
  6102. fn: function (aBlock){
  6103. var self=this;
  6104. var newDict=nil;
  6105. newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  6106. 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]);})]));})]);
  6107. return newDict;
  6108. return self;}
  6109. }),
  6110. smalltalk.Dictionary2);
  6111. smalltalk.addMethod(
  6112. '_collect_',
  6113. smalltalk.method({
  6114. selector: 'collect:',
  6115. fn: function (aBlock){
  6116. var self=this;
  6117. var newDict=nil;
  6118. newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  6119. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(newDict, "_at_put_", [key, smalltalk.send(aBlock, "_value_", [value])]);})]);
  6120. return newDict;
  6121. return self;}
  6122. }),
  6123. smalltalk.Dictionary2);
  6124. smalltalk.addMethod(
  6125. '_detect_ifNone_',
  6126. smalltalk.method({
  6127. selector: 'detect:ifNone:',
  6128. fn: function (aBlock, anotherBlock){
  6129. var self=this;
  6130. return smalltalk.send(smalltalk.send(self, "_values", []), "_detect_ifNone_", [aBlock, anotherBlock]);
  6131. return self;}
  6132. }),
  6133. smalltalk.Dictionary2);
  6134. smalltalk.addMethod(
  6135. '_includes_',
  6136. smalltalk.method({
  6137. selector: 'includes:',
  6138. fn: function (anObject){
  6139. var self=this;
  6140. return smalltalk.send(smalltalk.send(self, "_values", []), "_includes_", [anObject]);
  6141. return self;}
  6142. }),
  6143. smalltalk.Dictionary2);
  6144. smalltalk.addMethod(
  6145. '_remove_',
  6146. smalltalk.method({
  6147. selector: 'remove:',
  6148. fn: function (aKey){
  6149. var self=this;
  6150. smalltalk.send(self, "_removeKey_", [aKey]);
  6151. return self;}
  6152. }),
  6153. smalltalk.Dictionary2);
  6154. smalltalk.addMethod(
  6155. '_removeKey_',
  6156. smalltalk.method({
  6157. selector: 'removeKey:',
  6158. fn: function (aKey){
  6159. var self=this;
  6160. smalltalk.send(self['@keys'], "_remove_", [aKey]);
  6161. return self;}
  6162. }),
  6163. smalltalk.Dictionary2);
  6164. smalltalk.addMethod(
  6165. '_at_',
  6166. smalltalk.method({
  6167. selector: 'at:',
  6168. fn: function (aKey){
  6169. var self=this;
  6170. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  6171. return self;}
  6172. }),
  6173. smalltalk.Dictionary2);
  6174. smalltalk.addMethod(
  6175. '_asJSONObject',
  6176. smalltalk.method({
  6177. selector: 'asJSONObject',
  6178. fn: function (){
  6179. var self=this;
  6180. var object=nil;
  6181. object=smalltalk.send((smalltalk.Object || Object), "_new", []);
  6182. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(object, "_basicAt_put_", [key, smalltalk.send(value, "_asJSONObject", [])]);})]);
  6183. return object;
  6184. return self;}
  6185. }),
  6186. smalltalk.Dictionary2);
  6187. smalltalk.addMethod(
  6188. '_printString',
  6189. smalltalk.method({
  6190. selector: 'printString',
  6191. fn: function (){
  6192. var self=this;
  6193. 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")]);})]);
  6194. return self;}
  6195. }),
  6196. smalltalk.Dictionary2);
  6197. smalltalk.addMethod(
  6198. '_storeOn_',
  6199. smalltalk.method({
  6200. selector: 'storeOn:',
  6201. fn: function (aStream){
  6202. var self=this;
  6203. smalltalk.send(aStream, "_nextPutAll_", [unescape("%23%7B")]);
  6204. smalltalk.send(smalltalk.send(self, "_associations", []), "_do_separatedBy_", [(function(each){return smalltalk.send(each, "_storeOn_", [aStream]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [". "]);})]);
  6205. smalltalk.send(aStream, "_nextPutAll_", [unescape("%7D")]);
  6206. return self;}
  6207. }),
  6208. smalltalk.Dictionary2);