Kernel-Objects.js 191 KB

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