Kernel-Objects.js 195 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669
  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.packageDescriptors||$core.packages)["Kernel-Objects"].innerEval = function (expr) { return eval(expr); };
  6. ($core.packageDescriptors||$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: "bitAnd:",
  3606. protocol: "converting",
  3607. fn: function (aNumber){
  3608. var self=this,$self=this;
  3609. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3610. return $core.withContext(function($ctx1) {
  3611. //>>excludeEnd("ctx");
  3612. return self & aNumber;
  3613. return self;
  3614. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3615. }, function($ctx1) {$ctx1.fill(self,"bitAnd:",{aNumber:aNumber},$globals.Number)});
  3616. //>>excludeEnd("ctx");
  3617. },
  3618. //>>excludeStart("ide", pragmas.excludeIdeData);
  3619. args: ["aNumber"],
  3620. source: "bitAnd: aNumber\x0a\x09<inlineJS: 'return self & aNumber'>",
  3621. referencedClasses: [],
  3622. //>>excludeEnd("ide");
  3623. messageSends: []
  3624. }),
  3625. $globals.Number);
  3626. $core.addMethod(
  3627. $core.method({
  3628. selector: "bitNot",
  3629. protocol: "converting",
  3630. fn: function (){
  3631. var self=this,$self=this;
  3632. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3633. return $core.withContext(function($ctx1) {
  3634. //>>excludeEnd("ctx");
  3635. return ~self;
  3636. return self;
  3637. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3638. }, function($ctx1) {$ctx1.fill(self,"bitNot",{},$globals.Number)});
  3639. //>>excludeEnd("ctx");
  3640. },
  3641. //>>excludeStart("ide", pragmas.excludeIdeData);
  3642. args: [],
  3643. source: "bitNot\x0a\x09<inlineJS: 'return ~self'>",
  3644. referencedClasses: [],
  3645. //>>excludeEnd("ide");
  3646. messageSends: []
  3647. }),
  3648. $globals.Number);
  3649. $core.addMethod(
  3650. $core.method({
  3651. selector: "bitOr:",
  3652. protocol: "converting",
  3653. fn: function (aNumber){
  3654. var self=this,$self=this;
  3655. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3656. return $core.withContext(function($ctx1) {
  3657. //>>excludeEnd("ctx");
  3658. return self | aNumber;
  3659. return self;
  3660. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3661. }, function($ctx1) {$ctx1.fill(self,"bitOr:",{aNumber:aNumber},$globals.Number)});
  3662. //>>excludeEnd("ctx");
  3663. },
  3664. //>>excludeStart("ide", pragmas.excludeIdeData);
  3665. args: ["aNumber"],
  3666. source: "bitOr: aNumber\x0a\x09<inlineJS: 'return self | aNumber'>",
  3667. referencedClasses: [],
  3668. //>>excludeEnd("ide");
  3669. messageSends: []
  3670. }),
  3671. $globals.Number);
  3672. $core.addMethod(
  3673. $core.method({
  3674. selector: "bitXor:",
  3675. protocol: "converting",
  3676. fn: function (aNumber){
  3677. var self=this,$self=this;
  3678. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3679. return $core.withContext(function($ctx1) {
  3680. //>>excludeEnd("ctx");
  3681. return self ^ aNumber;
  3682. return self;
  3683. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3684. }, function($ctx1) {$ctx1.fill(self,"bitXor:",{aNumber:aNumber},$globals.Number)});
  3685. //>>excludeEnd("ctx");
  3686. },
  3687. //>>excludeStart("ide", pragmas.excludeIdeData);
  3688. args: ["aNumber"],
  3689. source: "bitXor: aNumber\x0a\x09<inlineJS: 'return self ^ aNumber'>",
  3690. referencedClasses: [],
  3691. //>>excludeEnd("ide");
  3692. messageSends: []
  3693. }),
  3694. $globals.Number);
  3695. $core.addMethod(
  3696. $core.method({
  3697. selector: "ceiling",
  3698. protocol: "converting",
  3699. fn: function (){
  3700. var self=this,$self=this;
  3701. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3702. return $core.withContext(function($ctx1) {
  3703. //>>excludeEnd("ctx");
  3704. return Math.ceil(self);;
  3705. return self;
  3706. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3707. }, function($ctx1) {$ctx1.fill(self,"ceiling",{},$globals.Number)});
  3708. //>>excludeEnd("ctx");
  3709. },
  3710. //>>excludeStart("ide", pragmas.excludeIdeData);
  3711. args: [],
  3712. source: "ceiling\x0a\x09<inlineJS: 'return Math.ceil(self);'>",
  3713. referencedClasses: [],
  3714. //>>excludeEnd("ide");
  3715. messageSends: []
  3716. }),
  3717. $globals.Number);
  3718. $core.addMethod(
  3719. $core.method({
  3720. selector: "copy",
  3721. protocol: "copying",
  3722. fn: function (){
  3723. var self=this,$self=this;
  3724. return self;
  3725. },
  3726. //>>excludeStart("ide", pragmas.excludeIdeData);
  3727. args: [],
  3728. source: "copy\x0a\x09^ self",
  3729. referencedClasses: [],
  3730. //>>excludeEnd("ide");
  3731. messageSends: []
  3732. }),
  3733. $globals.Number);
  3734. $core.addMethod(
  3735. $core.method({
  3736. selector: "cos",
  3737. protocol: "mathematical functions",
  3738. fn: function (){
  3739. var self=this,$self=this;
  3740. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3741. return $core.withContext(function($ctx1) {
  3742. //>>excludeEnd("ctx");
  3743. return Math.cos(self);;
  3744. return self;
  3745. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3746. }, function($ctx1) {$ctx1.fill(self,"cos",{},$globals.Number)});
  3747. //>>excludeEnd("ctx");
  3748. },
  3749. //>>excludeStart("ide", pragmas.excludeIdeData);
  3750. args: [],
  3751. source: "cos\x0a\x09<inlineJS: 'return Math.cos(self);'>",
  3752. referencedClasses: [],
  3753. //>>excludeEnd("ide");
  3754. messageSends: []
  3755. }),
  3756. $globals.Number);
  3757. $core.addMethod(
  3758. $core.method({
  3759. selector: "deepCopy",
  3760. protocol: "copying",
  3761. fn: function (){
  3762. var self=this,$self=this;
  3763. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3764. return $core.withContext(function($ctx1) {
  3765. //>>excludeEnd("ctx");
  3766. return $self._copy();
  3767. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3768. }, function($ctx1) {$ctx1.fill(self,"deepCopy",{},$globals.Number)});
  3769. //>>excludeEnd("ctx");
  3770. },
  3771. //>>excludeStart("ide", pragmas.excludeIdeData);
  3772. args: [],
  3773. source: "deepCopy\x0a\x09^ self copy",
  3774. referencedClasses: [],
  3775. //>>excludeEnd("ide");
  3776. messageSends: ["copy"]
  3777. }),
  3778. $globals.Number);
  3779. $core.addMethod(
  3780. $core.method({
  3781. selector: "degreesToRadians",
  3782. protocol: "converting",
  3783. fn: function (){
  3784. var self=this,$self=this;
  3785. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3786. return $core.withContext(function($ctx1) {
  3787. //>>excludeEnd("ctx");
  3788. return $self.__star($recv($globals.Number)._radiansPerDegree());
  3789. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3790. }, function($ctx1) {$ctx1.fill(self,"degreesToRadians",{},$globals.Number)});
  3791. //>>excludeEnd("ctx");
  3792. },
  3793. //>>excludeStart("ide", pragmas.excludeIdeData);
  3794. args: [],
  3795. source: "degreesToRadians\x0a\x09^ self * Number radiansPerDegree",
  3796. referencedClasses: ["Number"],
  3797. //>>excludeEnd("ide");
  3798. messageSends: ["*", "radiansPerDegree"]
  3799. }),
  3800. $globals.Number);
  3801. $core.addMethod(
  3802. $core.method({
  3803. selector: "even",
  3804. protocol: "testing",
  3805. fn: function (){
  3806. var self=this,$self=this;
  3807. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3808. return $core.withContext(function($ctx1) {
  3809. //>>excludeEnd("ctx");
  3810. return (0).__eq($self.__backslash_backslash((2)));
  3811. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3812. }, function($ctx1) {$ctx1.fill(self,"even",{},$globals.Number)});
  3813. //>>excludeEnd("ctx");
  3814. },
  3815. //>>excludeStart("ide", pragmas.excludeIdeData);
  3816. args: [],
  3817. source: "even\x0a\x09^ 0 = (self \x5c\x5c 2)",
  3818. referencedClasses: [],
  3819. //>>excludeEnd("ide");
  3820. messageSends: ["=", "\x5c\x5c"]
  3821. }),
  3822. $globals.Number);
  3823. $core.addMethod(
  3824. $core.method({
  3825. selector: "floor",
  3826. protocol: "converting",
  3827. fn: function (){
  3828. var self=this,$self=this;
  3829. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3830. return $core.withContext(function($ctx1) {
  3831. //>>excludeEnd("ctx");
  3832. return Math.floor(self);;
  3833. return self;
  3834. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3835. }, function($ctx1) {$ctx1.fill(self,"floor",{},$globals.Number)});
  3836. //>>excludeEnd("ctx");
  3837. },
  3838. //>>excludeStart("ide", pragmas.excludeIdeData);
  3839. args: [],
  3840. source: "floor\x0a\x09<inlineJS: 'return Math.floor(self);'>",
  3841. referencedClasses: [],
  3842. //>>excludeEnd("ide");
  3843. messageSends: []
  3844. }),
  3845. $globals.Number);
  3846. $core.addMethod(
  3847. $core.method({
  3848. selector: "isImmutable",
  3849. protocol: "testing",
  3850. fn: function (){
  3851. var self=this,$self=this;
  3852. return true;
  3853. },
  3854. //>>excludeStart("ide", pragmas.excludeIdeData);
  3855. args: [],
  3856. source: "isImmutable\x0a\x09^ true",
  3857. referencedClasses: [],
  3858. //>>excludeEnd("ide");
  3859. messageSends: []
  3860. }),
  3861. $globals.Number);
  3862. $core.addMethod(
  3863. $core.method({
  3864. selector: "isNumber",
  3865. protocol: "testing",
  3866. fn: function (){
  3867. var self=this,$self=this;
  3868. return true;
  3869. },
  3870. //>>excludeStart("ide", pragmas.excludeIdeData);
  3871. args: [],
  3872. source: "isNumber\x0a\x09^ true",
  3873. referencedClasses: [],
  3874. //>>excludeEnd("ide");
  3875. messageSends: []
  3876. }),
  3877. $globals.Number);
  3878. $core.addMethod(
  3879. $core.method({
  3880. selector: "isZero",
  3881. protocol: "testing",
  3882. fn: function (){
  3883. var self=this,$self=this;
  3884. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3885. return $core.withContext(function($ctx1) {
  3886. //>>excludeEnd("ctx");
  3887. return $self.__eq((0));
  3888. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3889. }, function($ctx1) {$ctx1.fill(self,"isZero",{},$globals.Number)});
  3890. //>>excludeEnd("ctx");
  3891. },
  3892. //>>excludeStart("ide", pragmas.excludeIdeData);
  3893. args: [],
  3894. source: "isZero\x0a\x09^ self = 0",
  3895. referencedClasses: [],
  3896. //>>excludeEnd("ide");
  3897. messageSends: ["="]
  3898. }),
  3899. $globals.Number);
  3900. $core.addMethod(
  3901. $core.method({
  3902. selector: "ln",
  3903. protocol: "mathematical functions",
  3904. fn: function (){
  3905. var self=this,$self=this;
  3906. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3907. return $core.withContext(function($ctx1) {
  3908. //>>excludeEnd("ctx");
  3909. return Math.log(self);;
  3910. return self;
  3911. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3912. }, function($ctx1) {$ctx1.fill(self,"ln",{},$globals.Number)});
  3913. //>>excludeEnd("ctx");
  3914. },
  3915. //>>excludeStart("ide", pragmas.excludeIdeData);
  3916. args: [],
  3917. source: "ln\x0a\x09<inlineJS: 'return Math.log(self);'>",
  3918. referencedClasses: [],
  3919. //>>excludeEnd("ide");
  3920. messageSends: []
  3921. }),
  3922. $globals.Number);
  3923. $core.addMethod(
  3924. $core.method({
  3925. selector: "ln1p",
  3926. protocol: "mathematical functions",
  3927. fn: function (){
  3928. var self=this,$self=this;
  3929. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3930. return $core.withContext(function($ctx1) {
  3931. //>>excludeEnd("ctx");
  3932. return Math.log1p(self);;
  3933. return self;
  3934. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3935. }, function($ctx1) {$ctx1.fill(self,"ln1p",{},$globals.Number)});
  3936. //>>excludeEnd("ctx");
  3937. },
  3938. //>>excludeStart("ide", pragmas.excludeIdeData);
  3939. args: [],
  3940. source: "ln1p\x0a\x09<inlineJS: 'return Math.log1p(self);'>",
  3941. referencedClasses: [],
  3942. //>>excludeEnd("ide");
  3943. messageSends: []
  3944. }),
  3945. $globals.Number);
  3946. $core.addMethod(
  3947. $core.method({
  3948. selector: "log",
  3949. protocol: "mathematical functions",
  3950. fn: function (){
  3951. var self=this,$self=this;
  3952. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3953. return $core.withContext(function($ctx1) {
  3954. //>>excludeEnd("ctx");
  3955. return Math.log(self) / Math.LN10;;
  3956. return self;
  3957. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3958. }, function($ctx1) {$ctx1.fill(self,"log",{},$globals.Number)});
  3959. //>>excludeEnd("ctx");
  3960. },
  3961. //>>excludeStart("ide", pragmas.excludeIdeData);
  3962. args: [],
  3963. source: "log\x0a\x09<inlineJS: 'return Math.log(self) / Math.LN10;'>",
  3964. referencedClasses: [],
  3965. //>>excludeEnd("ide");
  3966. messageSends: []
  3967. }),
  3968. $globals.Number);
  3969. $core.addMethod(
  3970. $core.method({
  3971. selector: "log:",
  3972. protocol: "mathematical functions",
  3973. fn: function (aNumber){
  3974. var self=this,$self=this;
  3975. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3976. return $core.withContext(function($ctx1) {
  3977. //>>excludeEnd("ctx");
  3978. return Math.log(self) / Math.log(aNumber);;
  3979. return self;
  3980. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3981. }, function($ctx1) {$ctx1.fill(self,"log:",{aNumber:aNumber},$globals.Number)});
  3982. //>>excludeEnd("ctx");
  3983. },
  3984. //>>excludeStart("ide", pragmas.excludeIdeData);
  3985. args: ["aNumber"],
  3986. source: "log: aNumber\x0a\x09<inlineJS: 'return Math.log(self) / Math.log(aNumber);'>",
  3987. referencedClasses: [],
  3988. //>>excludeEnd("ide");
  3989. messageSends: []
  3990. }),
  3991. $globals.Number);
  3992. $core.addMethod(
  3993. $core.method({
  3994. selector: "max:",
  3995. protocol: "arithmetic",
  3996. fn: function (aNumber){
  3997. var self=this,$self=this;
  3998. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3999. return $core.withContext(function($ctx1) {
  4000. //>>excludeEnd("ctx");
  4001. return Math.max(self, aNumber);;
  4002. return self;
  4003. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4004. }, function($ctx1) {$ctx1.fill(self,"max:",{aNumber:aNumber},$globals.Number)});
  4005. //>>excludeEnd("ctx");
  4006. },
  4007. //>>excludeStart("ide", pragmas.excludeIdeData);
  4008. args: ["aNumber"],
  4009. source: "max: aNumber\x0a\x09<inlineJS: 'return Math.max(self, aNumber);'>",
  4010. referencedClasses: [],
  4011. //>>excludeEnd("ide");
  4012. messageSends: []
  4013. }),
  4014. $globals.Number);
  4015. $core.addMethod(
  4016. $core.method({
  4017. selector: "min:",
  4018. protocol: "arithmetic",
  4019. fn: function (aNumber){
  4020. var self=this,$self=this;
  4021. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4022. return $core.withContext(function($ctx1) {
  4023. //>>excludeEnd("ctx");
  4024. return Math.min(self, aNumber);;
  4025. return self;
  4026. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4027. }, function($ctx1) {$ctx1.fill(self,"min:",{aNumber:aNumber},$globals.Number)});
  4028. //>>excludeEnd("ctx");
  4029. },
  4030. //>>excludeStart("ide", pragmas.excludeIdeData);
  4031. args: ["aNumber"],
  4032. source: "min: aNumber\x0a\x09<inlineJS: 'return Math.min(self, aNumber);'>",
  4033. referencedClasses: [],
  4034. //>>excludeEnd("ide");
  4035. messageSends: []
  4036. }),
  4037. $globals.Number);
  4038. $core.addMethod(
  4039. $core.method({
  4040. selector: "min:max:",
  4041. protocol: "arithmetic",
  4042. fn: function (aMin,aMax){
  4043. var self=this,$self=this;
  4044. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4045. return $core.withContext(function($ctx1) {
  4046. //>>excludeEnd("ctx");
  4047. return $recv($self._min_(aMin))._max_(aMax);
  4048. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4049. }, function($ctx1) {$ctx1.fill(self,"min:max:",{aMin:aMin,aMax:aMax},$globals.Number)});
  4050. //>>excludeEnd("ctx");
  4051. },
  4052. //>>excludeStart("ide", pragmas.excludeIdeData);
  4053. args: ["aMin", "aMax"],
  4054. source: "min: aMin max: aMax\x0a\x09^ (self min: aMin) max: aMax",
  4055. referencedClasses: [],
  4056. //>>excludeEnd("ide");
  4057. messageSends: ["max:", "min:"]
  4058. }),
  4059. $globals.Number);
  4060. $core.addMethod(
  4061. $core.method({
  4062. selector: "negated",
  4063. protocol: "arithmetic",
  4064. fn: function (){
  4065. var self=this,$self=this;
  4066. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4067. return $core.withContext(function($ctx1) {
  4068. //>>excludeEnd("ctx");
  4069. return (0).__minus(self);
  4070. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4071. }, function($ctx1) {$ctx1.fill(self,"negated",{},$globals.Number)});
  4072. //>>excludeEnd("ctx");
  4073. },
  4074. //>>excludeStart("ide", pragmas.excludeIdeData);
  4075. args: [],
  4076. source: "negated\x0a\x09^ 0 - self",
  4077. referencedClasses: [],
  4078. //>>excludeEnd("ide");
  4079. messageSends: ["-"]
  4080. }),
  4081. $globals.Number);
  4082. $core.addMethod(
  4083. $core.method({
  4084. selector: "negative",
  4085. protocol: "testing",
  4086. fn: function (){
  4087. var self=this,$self=this;
  4088. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4089. return $core.withContext(function($ctx1) {
  4090. //>>excludeEnd("ctx");
  4091. return $self.__lt((0));
  4092. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4093. }, function($ctx1) {$ctx1.fill(self,"negative",{},$globals.Number)});
  4094. //>>excludeEnd("ctx");
  4095. },
  4096. //>>excludeStart("ide", pragmas.excludeIdeData);
  4097. args: [],
  4098. source: "negative\x0a\x09\x22Answer whether the receiver is mathematically negative.\x22\x0a\x0a\x09^ self < 0",
  4099. referencedClasses: [],
  4100. //>>excludeEnd("ide");
  4101. messageSends: ["<"]
  4102. }),
  4103. $globals.Number);
  4104. $core.addMethod(
  4105. $core.method({
  4106. selector: "odd",
  4107. protocol: "testing",
  4108. fn: function (){
  4109. var self=this,$self=this;
  4110. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4111. return $core.withContext(function($ctx1) {
  4112. //>>excludeEnd("ctx");
  4113. return $recv($self._even())._not();
  4114. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4115. }, function($ctx1) {$ctx1.fill(self,"odd",{},$globals.Number)});
  4116. //>>excludeEnd("ctx");
  4117. },
  4118. //>>excludeStart("ide", pragmas.excludeIdeData);
  4119. args: [],
  4120. source: "odd\x0a\x09^ self even not",
  4121. referencedClasses: [],
  4122. //>>excludeEnd("ide");
  4123. messageSends: ["not", "even"]
  4124. }),
  4125. $globals.Number);
  4126. $core.addMethod(
  4127. $core.method({
  4128. selector: "positive",
  4129. protocol: "testing",
  4130. fn: function (){
  4131. var self=this,$self=this;
  4132. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4133. return $core.withContext(function($ctx1) {
  4134. //>>excludeEnd("ctx");
  4135. return $self.__gt_eq((0));
  4136. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4137. }, function($ctx1) {$ctx1.fill(self,"positive",{},$globals.Number)});
  4138. //>>excludeEnd("ctx");
  4139. },
  4140. //>>excludeStart("ide", pragmas.excludeIdeData);
  4141. args: [],
  4142. source: "positive\x0a\x09\x22Answer whether the receiver is positive or equal to 0. (ST-80 protocol).\x22\x0a\x0a\x09^ self >= 0",
  4143. referencedClasses: [],
  4144. //>>excludeEnd("ide");
  4145. messageSends: [">="]
  4146. }),
  4147. $globals.Number);
  4148. $core.addMethod(
  4149. $core.method({
  4150. selector: "printOn:",
  4151. protocol: "printing",
  4152. fn: function (aStream){
  4153. var self=this,$self=this;
  4154. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4155. return $core.withContext(function($ctx1) {
  4156. //>>excludeEnd("ctx");
  4157. $recv(aStream)._nextPutAll_($self._asString());
  4158. return self;
  4159. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4160. }, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},$globals.Number)});
  4161. //>>excludeEnd("ctx");
  4162. },
  4163. //>>excludeStart("ide", pragmas.excludeIdeData);
  4164. args: ["aStream"],
  4165. source: "printOn: aStream\x0a\x09aStream nextPutAll: self asString",
  4166. referencedClasses: [],
  4167. //>>excludeEnd("ide");
  4168. messageSends: ["nextPutAll:", "asString"]
  4169. }),
  4170. $globals.Number);
  4171. $core.addMethod(
  4172. $core.method({
  4173. selector: "printShowingDecimalPlaces:",
  4174. protocol: "printing",
  4175. fn: function (placesDesired){
  4176. var self=this,$self=this;
  4177. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4178. return $core.withContext(function($ctx1) {
  4179. //>>excludeEnd("ctx");
  4180. return self.toFixed(placesDesired);
  4181. return self;
  4182. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4183. }, function($ctx1) {$ctx1.fill(self,"printShowingDecimalPlaces:",{placesDesired:placesDesired},$globals.Number)});
  4184. //>>excludeEnd("ctx");
  4185. },
  4186. //>>excludeStart("ide", pragmas.excludeIdeData);
  4187. args: ["placesDesired"],
  4188. source: "printShowingDecimalPlaces: placesDesired\x0a\x09<inlineJS: 'return self.toFixed(placesDesired)'>",
  4189. referencedClasses: [],
  4190. //>>excludeEnd("ide");
  4191. messageSends: []
  4192. }),
  4193. $globals.Number);
  4194. $core.addMethod(
  4195. $core.method({
  4196. selector: "printStringBase:",
  4197. protocol: "converting",
  4198. fn: function (aBase){
  4199. var self=this,$self=this;
  4200. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4201. return $core.withContext(function($ctx1) {
  4202. //>>excludeEnd("ctx");
  4203. return self.toString(aBase);
  4204. return self;
  4205. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4206. }, function($ctx1) {$ctx1.fill(self,"printStringBase:",{aBase:aBase},$globals.Number)});
  4207. //>>excludeEnd("ctx");
  4208. },
  4209. //>>excludeStart("ide", pragmas.excludeIdeData);
  4210. args: ["aBase"],
  4211. source: "printStringBase: aBase\x0a\x09<inlineJS: 'return self.toString(aBase)'>",
  4212. referencedClasses: [],
  4213. //>>excludeEnd("ide");
  4214. messageSends: []
  4215. }),
  4216. $globals.Number);
  4217. $core.addMethod(
  4218. $core.method({
  4219. selector: "radiansToDegrees",
  4220. protocol: "converting",
  4221. fn: function (){
  4222. var self=this,$self=this;
  4223. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4224. return $core.withContext(function($ctx1) {
  4225. //>>excludeEnd("ctx");
  4226. return $self.__slash($recv($globals.Number)._radiansPerDegree());
  4227. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4228. }, function($ctx1) {$ctx1.fill(self,"radiansToDegrees",{},$globals.Number)});
  4229. //>>excludeEnd("ctx");
  4230. },
  4231. //>>excludeStart("ide", pragmas.excludeIdeData);
  4232. args: [],
  4233. source: "radiansToDegrees\x0a\x09^ self / Number radiansPerDegree",
  4234. referencedClasses: ["Number"],
  4235. //>>excludeEnd("ide");
  4236. messageSends: ["/", "radiansPerDegree"]
  4237. }),
  4238. $globals.Number);
  4239. $core.addMethod(
  4240. $core.method({
  4241. selector: "raisedTo:",
  4242. protocol: "mathematical functions",
  4243. fn: function (exponent){
  4244. var self=this,$self=this;
  4245. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4246. return $core.withContext(function($ctx1) {
  4247. //>>excludeEnd("ctx");
  4248. return Math.pow(self, exponent);;
  4249. return self;
  4250. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4251. }, function($ctx1) {$ctx1.fill(self,"raisedTo:",{exponent:exponent},$globals.Number)});
  4252. //>>excludeEnd("ctx");
  4253. },
  4254. //>>excludeStart("ide", pragmas.excludeIdeData);
  4255. args: ["exponent"],
  4256. source: "raisedTo: exponent\x0a\x09<inlineJS: 'return Math.pow(self, exponent);'>",
  4257. referencedClasses: [],
  4258. //>>excludeEnd("ide");
  4259. messageSends: []
  4260. }),
  4261. $globals.Number);
  4262. $core.addMethod(
  4263. $core.method({
  4264. selector: "rounded",
  4265. protocol: "converting",
  4266. fn: function (){
  4267. var self=this,$self=this;
  4268. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4269. return $core.withContext(function($ctx1) {
  4270. //>>excludeEnd("ctx");
  4271. return Math.round(self);;
  4272. return self;
  4273. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4274. }, function($ctx1) {$ctx1.fill(self,"rounded",{},$globals.Number)});
  4275. //>>excludeEnd("ctx");
  4276. },
  4277. //>>excludeStart("ide", pragmas.excludeIdeData);
  4278. args: [],
  4279. source: "rounded\x0a\x09<inlineJS: 'return Math.round(self);'>",
  4280. referencedClasses: [],
  4281. //>>excludeEnd("ide");
  4282. messageSends: []
  4283. }),
  4284. $globals.Number);
  4285. $core.addMethod(
  4286. $core.method({
  4287. selector: "sign",
  4288. protocol: "mathematical functions",
  4289. fn: function (){
  4290. var self=this,$self=this;
  4291. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4292. return $core.withContext(function($ctx1) {
  4293. //>>excludeEnd("ctx");
  4294. var $1,$2;
  4295. $1=$self._isZero();
  4296. if($core.assert($1)){
  4297. return (0);
  4298. }
  4299. $2=$self._positive();
  4300. if($core.assert($2)){
  4301. return (1);
  4302. } else {
  4303. return (-1);
  4304. }
  4305. return self;
  4306. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4307. }, function($ctx1) {$ctx1.fill(self,"sign",{},$globals.Number)});
  4308. //>>excludeEnd("ctx");
  4309. },
  4310. //>>excludeStart("ide", pragmas.excludeIdeData);
  4311. args: [],
  4312. source: "sign\x0a\x09self isZero \x0a\x09\x09ifTrue: [ ^ 0 ].\x0a\x09self positive\x0a\x09\x09ifTrue: [ ^ 1 ]\x0a\x09\x09ifFalse: [ ^ -1 ].",
  4313. referencedClasses: [],
  4314. //>>excludeEnd("ide");
  4315. messageSends: ["ifTrue:", "isZero", "ifTrue:ifFalse:", "positive"]
  4316. }),
  4317. $globals.Number);
  4318. $core.addMethod(
  4319. $core.method({
  4320. selector: "sin",
  4321. protocol: "mathematical functions",
  4322. fn: function (){
  4323. var self=this,$self=this;
  4324. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4325. return $core.withContext(function($ctx1) {
  4326. //>>excludeEnd("ctx");
  4327. return Math.sin(self);;
  4328. return self;
  4329. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4330. }, function($ctx1) {$ctx1.fill(self,"sin",{},$globals.Number)});
  4331. //>>excludeEnd("ctx");
  4332. },
  4333. //>>excludeStart("ide", pragmas.excludeIdeData);
  4334. args: [],
  4335. source: "sin\x0a\x09<inlineJS: 'return Math.sin(self);'>",
  4336. referencedClasses: [],
  4337. //>>excludeEnd("ide");
  4338. messageSends: []
  4339. }),
  4340. $globals.Number);
  4341. $core.addMethod(
  4342. $core.method({
  4343. selector: "sqrt",
  4344. protocol: "mathematical functions",
  4345. fn: function (){
  4346. var self=this,$self=this;
  4347. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4348. return $core.withContext(function($ctx1) {
  4349. //>>excludeEnd("ctx");
  4350. return Math.sqrt(self);
  4351. return self;
  4352. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4353. }, function($ctx1) {$ctx1.fill(self,"sqrt",{},$globals.Number)});
  4354. //>>excludeEnd("ctx");
  4355. },
  4356. //>>excludeStart("ide", pragmas.excludeIdeData);
  4357. args: [],
  4358. source: "sqrt\x0a\x09<inlineJS: 'return Math.sqrt(self)'>",
  4359. referencedClasses: [],
  4360. //>>excludeEnd("ide");
  4361. messageSends: []
  4362. }),
  4363. $globals.Number);
  4364. $core.addMethod(
  4365. $core.method({
  4366. selector: "squared",
  4367. protocol: "mathematical functions",
  4368. fn: function (){
  4369. var self=this,$self=this;
  4370. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4371. return $core.withContext(function($ctx1) {
  4372. //>>excludeEnd("ctx");
  4373. return $self.__star(self);
  4374. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4375. }, function($ctx1) {$ctx1.fill(self,"squared",{},$globals.Number)});
  4376. //>>excludeEnd("ctx");
  4377. },
  4378. //>>excludeStart("ide", pragmas.excludeIdeData);
  4379. args: [],
  4380. source: "squared\x0a\x09^ self * self",
  4381. referencedClasses: [],
  4382. //>>excludeEnd("ide");
  4383. messageSends: ["*"]
  4384. }),
  4385. $globals.Number);
  4386. $core.addMethod(
  4387. $core.method({
  4388. selector: "tan",
  4389. protocol: "mathematical functions",
  4390. fn: function (){
  4391. var self=this,$self=this;
  4392. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4393. return $core.withContext(function($ctx1) {
  4394. //>>excludeEnd("ctx");
  4395. return Math.tan(self);;
  4396. return self;
  4397. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4398. }, function($ctx1) {$ctx1.fill(self,"tan",{},$globals.Number)});
  4399. //>>excludeEnd("ctx");
  4400. },
  4401. //>>excludeStart("ide", pragmas.excludeIdeData);
  4402. args: [],
  4403. source: "tan\x0a\x09<inlineJS: 'return Math.tan(self);'>",
  4404. referencedClasses: [],
  4405. //>>excludeEnd("ide");
  4406. messageSends: []
  4407. }),
  4408. $globals.Number);
  4409. $core.addMethod(
  4410. $core.method({
  4411. selector: "timesRepeat:",
  4412. protocol: "enumerating",
  4413. fn: function (aBlock){
  4414. var self=this,$self=this;
  4415. var count;
  4416. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4417. return $core.withContext(function($ctx1) {
  4418. //>>excludeEnd("ctx");
  4419. count=(1);
  4420. $recv((function(){
  4421. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4422. return $core.withContext(function($ctx2) {
  4423. //>>excludeEnd("ctx");
  4424. return $recv(count).__gt(self);
  4425. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4426. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  4427. //>>excludeEnd("ctx");
  4428. }))._whileFalse_((function(){
  4429. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4430. return $core.withContext(function($ctx2) {
  4431. //>>excludeEnd("ctx");
  4432. $recv(aBlock)._value();
  4433. count=$recv(count).__plus((1));
  4434. return count;
  4435. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4436. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  4437. //>>excludeEnd("ctx");
  4438. }));
  4439. return self;
  4440. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4441. }, function($ctx1) {$ctx1.fill(self,"timesRepeat:",{aBlock:aBlock,count:count},$globals.Number)});
  4442. //>>excludeEnd("ctx");
  4443. },
  4444. //>>excludeStart("ide", pragmas.excludeIdeData);
  4445. args: ["aBlock"],
  4446. source: "timesRepeat: aBlock\x0a\x09| count |\x0a\x09count := 1.\x0a\x09[ count > self ] whileFalse: [\x0a\x09\x09aBlock value.\x0a\x09\x09count := count + 1 ]",
  4447. referencedClasses: [],
  4448. //>>excludeEnd("ide");
  4449. messageSends: ["whileFalse:", ">", "value", "+"]
  4450. }),
  4451. $globals.Number);
  4452. $core.addMethod(
  4453. $core.method({
  4454. selector: "to:",
  4455. protocol: "converting",
  4456. fn: function (aNumber){
  4457. var self=this,$self=this;
  4458. var array,first,last,count;
  4459. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4460. return $core.withContext(function($ctx1) {
  4461. //>>excludeEnd("ctx");
  4462. first=$self._truncated();
  4463. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4464. $ctx1.sendIdx["truncated"]=1;
  4465. //>>excludeEnd("ctx");
  4466. last=$recv($recv(aNumber)._truncated()).__plus((1));
  4467. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4468. $ctx1.sendIdx["+"]=1;
  4469. //>>excludeEnd("ctx");
  4470. count=(1);
  4471. array=$recv($globals.Array)._new();
  4472. $recv($recv(last).__minus(first))._timesRepeat_((function(){
  4473. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4474. return $core.withContext(function($ctx2) {
  4475. //>>excludeEnd("ctx");
  4476. $recv(array)._at_put_(count,first);
  4477. count=$recv(count).__plus((1));
  4478. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4479. $ctx2.sendIdx["+"]=2;
  4480. //>>excludeEnd("ctx");
  4481. count;
  4482. first=$recv(first).__plus((1));
  4483. return first;
  4484. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4485. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  4486. //>>excludeEnd("ctx");
  4487. }));
  4488. return array;
  4489. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4490. }, function($ctx1) {$ctx1.fill(self,"to:",{aNumber:aNumber,array:array,first:first,last:last,count:count},$globals.Number)});
  4491. //>>excludeEnd("ctx");
  4492. },
  4493. //>>excludeStart("ide", pragmas.excludeIdeData);
  4494. args: ["aNumber"],
  4495. 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",
  4496. referencedClasses: ["Array"],
  4497. //>>excludeEnd("ide");
  4498. messageSends: ["truncated", "+", "new", "timesRepeat:", "-", "at:put:"]
  4499. }),
  4500. $globals.Number);
  4501. $core.addMethod(
  4502. $core.method({
  4503. selector: "to:by:",
  4504. protocol: "converting",
  4505. fn: function (stop,step){
  4506. var self=this,$self=this;
  4507. var array,value,pos;
  4508. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4509. return $core.withContext(function($ctx1) {
  4510. //>>excludeEnd("ctx");
  4511. var $1,$2;
  4512. value=self;
  4513. array=$recv($globals.Array)._new();
  4514. pos=(1);
  4515. $1=$recv(step).__eq((0));
  4516. if($core.assert($1)){
  4517. $self._error_("step must be non-zero");
  4518. }
  4519. $2=$recv(step).__lt((0));
  4520. if($core.assert($2)){
  4521. $recv((function(){
  4522. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4523. return $core.withContext(function($ctx2) {
  4524. //>>excludeEnd("ctx");
  4525. return $recv(value).__gt_eq(stop);
  4526. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4527. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  4528. //>>excludeEnd("ctx");
  4529. }))._whileTrue_((function(){
  4530. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4531. return $core.withContext(function($ctx2) {
  4532. //>>excludeEnd("ctx");
  4533. $recv(array)._at_put_(pos,value);
  4534. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4535. $ctx2.sendIdx["at:put:"]=1;
  4536. //>>excludeEnd("ctx");
  4537. pos=$recv(pos).__plus((1));
  4538. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4539. $ctx2.sendIdx["+"]=1;
  4540. //>>excludeEnd("ctx");
  4541. pos;
  4542. value=$recv(value).__plus(step);
  4543. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4544. $ctx2.sendIdx["+"]=2;
  4545. //>>excludeEnd("ctx");
  4546. return value;
  4547. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4548. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)});
  4549. //>>excludeEnd("ctx");
  4550. }));
  4551. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4552. $ctx1.sendIdx["whileTrue:"]=1;
  4553. //>>excludeEnd("ctx");
  4554. } else {
  4555. $recv((function(){
  4556. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4557. return $core.withContext(function($ctx2) {
  4558. //>>excludeEnd("ctx");
  4559. return $recv(value).__lt_eq(stop);
  4560. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4561. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)});
  4562. //>>excludeEnd("ctx");
  4563. }))._whileTrue_((function(){
  4564. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4565. return $core.withContext(function($ctx2) {
  4566. //>>excludeEnd("ctx");
  4567. $recv(array)._at_put_(pos,value);
  4568. pos=$recv(pos).__plus((1));
  4569. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4570. $ctx2.sendIdx["+"]=3;
  4571. //>>excludeEnd("ctx");
  4572. pos;
  4573. value=$recv(value).__plus(step);
  4574. return value;
  4575. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4576. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,7)});
  4577. //>>excludeEnd("ctx");
  4578. }));
  4579. }
  4580. return array;
  4581. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4582. }, function($ctx1) {$ctx1.fill(self,"to:by:",{stop:stop,step:step,array:array,value:value,pos:pos},$globals.Number)});
  4583. //>>excludeEnd("ctx");
  4584. },
  4585. //>>excludeStart("ide", pragmas.excludeIdeData);
  4586. args: ["stop", "step"],
  4587. 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",
  4588. referencedClasses: ["Array"],
  4589. //>>excludeEnd("ide");
  4590. messageSends: ["new", "ifTrue:", "=", "error:", "ifTrue:ifFalse:", "<", "whileTrue:", ">=", "at:put:", "+", "<="]
  4591. }),
  4592. $globals.Number);
  4593. $core.addMethod(
  4594. $core.method({
  4595. selector: "to:by:do:",
  4596. protocol: "enumerating",
  4597. fn: function (stop,step,aBlock){
  4598. var self=this,$self=this;
  4599. var value;
  4600. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4601. return $core.withContext(function($ctx1) {
  4602. //>>excludeEnd("ctx");
  4603. var $1,$2;
  4604. value=self;
  4605. $1=$recv(step).__eq((0));
  4606. if($core.assert($1)){
  4607. $self._error_("step must be non-zero");
  4608. }
  4609. $2=$recv(step).__lt((0));
  4610. if($core.assert($2)){
  4611. $recv((function(){
  4612. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4613. return $core.withContext(function($ctx2) {
  4614. //>>excludeEnd("ctx");
  4615. return $recv(value).__gt_eq(stop);
  4616. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4617. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  4618. //>>excludeEnd("ctx");
  4619. }))._whileTrue_((function(){
  4620. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4621. return $core.withContext(function($ctx2) {
  4622. //>>excludeEnd("ctx");
  4623. $recv(aBlock)._value_(value);
  4624. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4625. $ctx2.sendIdx["value:"]=1;
  4626. //>>excludeEnd("ctx");
  4627. value=$recv(value).__plus(step);
  4628. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4629. $ctx2.sendIdx["+"]=1;
  4630. //>>excludeEnd("ctx");
  4631. return value;
  4632. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4633. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)});
  4634. //>>excludeEnd("ctx");
  4635. }));
  4636. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4637. $ctx1.sendIdx["whileTrue:"]=1;
  4638. //>>excludeEnd("ctx");
  4639. } else {
  4640. $recv((function(){
  4641. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4642. return $core.withContext(function($ctx2) {
  4643. //>>excludeEnd("ctx");
  4644. return $recv(value).__lt_eq(stop);
  4645. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4646. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)});
  4647. //>>excludeEnd("ctx");
  4648. }))._whileTrue_((function(){
  4649. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4650. return $core.withContext(function($ctx2) {
  4651. //>>excludeEnd("ctx");
  4652. $recv(aBlock)._value_(value);
  4653. value=$recv(value).__plus(step);
  4654. return value;
  4655. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4656. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,7)});
  4657. //>>excludeEnd("ctx");
  4658. }));
  4659. }
  4660. return self;
  4661. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4662. }, function($ctx1) {$ctx1.fill(self,"to:by:do:",{stop:stop,step:step,aBlock:aBlock,value:value},$globals.Number)});
  4663. //>>excludeEnd("ctx");
  4664. },
  4665. //>>excludeStart("ide", pragmas.excludeIdeData);
  4666. args: ["stop", "step", "aBlock"],
  4667. 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 ]]",
  4668. referencedClasses: [],
  4669. //>>excludeEnd("ide");
  4670. messageSends: ["ifTrue:", "=", "error:", "ifTrue:ifFalse:", "<", "whileTrue:", ">=", "value:", "+", "<="]
  4671. }),
  4672. $globals.Number);
  4673. $core.addMethod(
  4674. $core.method({
  4675. selector: "to:do:",
  4676. protocol: "enumerating",
  4677. fn: function (stop,aBlock){
  4678. var self=this,$self=this;
  4679. var nextValue;
  4680. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4681. return $core.withContext(function($ctx1) {
  4682. //>>excludeEnd("ctx");
  4683. nextValue=self;
  4684. $recv((function(){
  4685. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4686. return $core.withContext(function($ctx2) {
  4687. //>>excludeEnd("ctx");
  4688. return $recv(nextValue).__lt_eq(stop);
  4689. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4690. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  4691. //>>excludeEnd("ctx");
  4692. }))._whileTrue_((function(){
  4693. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4694. return $core.withContext(function($ctx2) {
  4695. //>>excludeEnd("ctx");
  4696. $recv(aBlock)._value_(nextValue);
  4697. nextValue=$recv(nextValue).__plus((1));
  4698. return nextValue;
  4699. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4700. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  4701. //>>excludeEnd("ctx");
  4702. }));
  4703. return self;
  4704. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4705. }, function($ctx1) {$ctx1.fill(self,"to:do:",{stop:stop,aBlock:aBlock,nextValue:nextValue},$globals.Number)});
  4706. //>>excludeEnd("ctx");
  4707. },
  4708. //>>excludeStart("ide", pragmas.excludeIdeData);
  4709. args: ["stop", "aBlock"],
  4710. 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 ]",
  4711. referencedClasses: [],
  4712. //>>excludeEnd("ide");
  4713. messageSends: ["whileTrue:", "<=", "value:", "+"]
  4714. }),
  4715. $globals.Number);
  4716. $core.addMethod(
  4717. $core.method({
  4718. selector: "truncated",
  4719. protocol: "converting",
  4720. fn: function (){
  4721. var self=this,$self=this;
  4722. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4723. return $core.withContext(function($ctx1) {
  4724. //>>excludeEnd("ctx");
  4725. if(self >= 0) {
  4726. return Math.floor(self);
  4727. } else {
  4728. return Math.floor(self * (-1)) * (-1);
  4729. };
  4730. ;
  4731. return self;
  4732. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4733. }, function($ctx1) {$ctx1.fill(self,"truncated",{},$globals.Number)});
  4734. //>>excludeEnd("ctx");
  4735. },
  4736. //>>excludeStart("ide", pragmas.excludeIdeData);
  4737. args: [],
  4738. 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'>",
  4739. referencedClasses: [],
  4740. //>>excludeEnd("ide");
  4741. messageSends: []
  4742. }),
  4743. $globals.Number);
  4744. $core.addMethod(
  4745. $core.method({
  4746. selector: "|",
  4747. protocol: "converting",
  4748. fn: function (aNumber){
  4749. var self=this,$self=this;
  4750. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4751. return $core.withContext(function($ctx1) {
  4752. //>>excludeEnd("ctx");
  4753. return self | aNumber;
  4754. return self;
  4755. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4756. }, function($ctx1) {$ctx1.fill(self,"|",{aNumber:aNumber},$globals.Number)});
  4757. //>>excludeEnd("ctx");
  4758. },
  4759. //>>excludeStart("ide", pragmas.excludeIdeData);
  4760. args: ["aNumber"],
  4761. source: "| aNumber\x0a\x09<inlineJS: 'return self | aNumber'>",
  4762. referencedClasses: [],
  4763. //>>excludeEnd("ide");
  4764. messageSends: []
  4765. }),
  4766. $globals.Number);
  4767. $core.addMethod(
  4768. $core.method({
  4769. selector: "classTag",
  4770. protocol: "accessing",
  4771. fn: function (){
  4772. var self=this,$self=this;
  4773. return "magnitude";
  4774. },
  4775. //>>excludeStart("ide", pragmas.excludeIdeData);
  4776. args: [],
  4777. 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'",
  4778. referencedClasses: [],
  4779. //>>excludeEnd("ide");
  4780. messageSends: []
  4781. }),
  4782. $globals.Number.a$cls);
  4783. $core.addMethod(
  4784. $core.method({
  4785. selector: "e",
  4786. protocol: "instance creation",
  4787. fn: function (){
  4788. var self=this,$self=this;
  4789. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4790. return $core.withContext(function($ctx1) {
  4791. //>>excludeEnd("ctx");
  4792. return Math.E;;
  4793. return self;
  4794. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4795. }, function($ctx1) {$ctx1.fill(self,"e",{},$globals.Number.a$cls)});
  4796. //>>excludeEnd("ctx");
  4797. },
  4798. //>>excludeStart("ide", pragmas.excludeIdeData);
  4799. args: [],
  4800. source: "e\x0a\x09<inlineJS: 'return Math.E;'>",
  4801. referencedClasses: [],
  4802. //>>excludeEnd("ide");
  4803. messageSends: []
  4804. }),
  4805. $globals.Number.a$cls);
  4806. $core.addMethod(
  4807. $core.method({
  4808. selector: "pi",
  4809. protocol: "instance creation",
  4810. fn: function (){
  4811. var self=this,$self=this;
  4812. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4813. return $core.withContext(function($ctx1) {
  4814. //>>excludeEnd("ctx");
  4815. return Math.PI;
  4816. return self;
  4817. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4818. }, function($ctx1) {$ctx1.fill(self,"pi",{},$globals.Number.a$cls)});
  4819. //>>excludeEnd("ctx");
  4820. },
  4821. //>>excludeStart("ide", pragmas.excludeIdeData);
  4822. args: [],
  4823. source: "pi\x0a\x09<inlineJS: 'return Math.PI'>",
  4824. referencedClasses: [],
  4825. //>>excludeEnd("ide");
  4826. messageSends: []
  4827. }),
  4828. $globals.Number.a$cls);
  4829. $core.addMethod(
  4830. $core.method({
  4831. selector: "radiansPerDegree",
  4832. protocol: "instance creation",
  4833. fn: function (){
  4834. var self=this,$self=this;
  4835. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4836. return $core.withContext(function($ctx1) {
  4837. //>>excludeEnd("ctx");
  4838. return $recv($self._pi()).__slash((180));
  4839. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4840. }, function($ctx1) {$ctx1.fill(self,"radiansPerDegree",{},$globals.Number.a$cls)});
  4841. //>>excludeEnd("ctx");
  4842. },
  4843. //>>excludeStart("ide", pragmas.excludeIdeData);
  4844. args: [],
  4845. source: "radiansPerDegree\x0a\x09^ (self pi) / 180",
  4846. referencedClasses: [],
  4847. //>>excludeEnd("ide");
  4848. messageSends: ["/", "pi"]
  4849. }),
  4850. $globals.Number.a$cls);
  4851. $core.addClass("Point", $globals.Object, ["x", "y"], "Kernel-Objects");
  4852. //>>excludeStart("ide", pragmas.excludeIdeData);
  4853. $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";
  4854. //>>excludeEnd("ide");
  4855. $core.addMethod(
  4856. $core.method({
  4857. selector: "*",
  4858. protocol: "arithmetic",
  4859. fn: function (aPoint){
  4860. var self=this,$self=this;
  4861. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4862. return $core.withContext(function($ctx1) {
  4863. //>>excludeEnd("ctx");
  4864. var $2,$4,$3,$1,$6,$5;
  4865. $2=$self._x();
  4866. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4867. $ctx1.sendIdx["x"]=1;
  4868. //>>excludeEnd("ctx");
  4869. $4=$recv(aPoint)._asPoint();
  4870. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4871. $ctx1.sendIdx["asPoint"]=1;
  4872. //>>excludeEnd("ctx");
  4873. $3=$recv($4)._x();
  4874. $1=$recv($2).__star($3);
  4875. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4876. $ctx1.sendIdx["*"]=1;
  4877. //>>excludeEnd("ctx");
  4878. $6=$self._y();
  4879. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4880. $ctx1.sendIdx["y"]=1;
  4881. //>>excludeEnd("ctx");
  4882. $5=$recv($6).__star($recv($recv(aPoint)._asPoint())._y());
  4883. return $recv($globals.Point)._x_y_($1,$5);
  4884. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4885. }, function($ctx1) {$ctx1.fill(self,"*",{aPoint:aPoint},$globals.Point)});
  4886. //>>excludeEnd("ctx");
  4887. },
  4888. //>>excludeStart("ide", pragmas.excludeIdeData);
  4889. args: ["aPoint"],
  4890. source: "* aPoint\x0a\x09^ Point x: self x * aPoint asPoint x y: self y * aPoint asPoint y",
  4891. referencedClasses: ["Point"],
  4892. //>>excludeEnd("ide");
  4893. messageSends: ["x:y:", "*", "x", "asPoint", "y"]
  4894. }),
  4895. $globals.Point);
  4896. $core.addMethod(
  4897. $core.method({
  4898. selector: "+",
  4899. protocol: "arithmetic",
  4900. fn: function (aPoint){
  4901. var self=this,$self=this;
  4902. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4903. return $core.withContext(function($ctx1) {
  4904. //>>excludeEnd("ctx");
  4905. var $2,$4,$3,$1,$6,$5;
  4906. $2=$self._x();
  4907. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4908. $ctx1.sendIdx["x"]=1;
  4909. //>>excludeEnd("ctx");
  4910. $4=$recv(aPoint)._asPoint();
  4911. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4912. $ctx1.sendIdx["asPoint"]=1;
  4913. //>>excludeEnd("ctx");
  4914. $3=$recv($4)._x();
  4915. $1=$recv($2).__plus($3);
  4916. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4917. $ctx1.sendIdx["+"]=1;
  4918. //>>excludeEnd("ctx");
  4919. $6=$self._y();
  4920. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4921. $ctx1.sendIdx["y"]=1;
  4922. //>>excludeEnd("ctx");
  4923. $5=$recv($6).__plus($recv($recv(aPoint)._asPoint())._y());
  4924. return $recv($globals.Point)._x_y_($1,$5);
  4925. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4926. }, function($ctx1) {$ctx1.fill(self,"+",{aPoint:aPoint},$globals.Point)});
  4927. //>>excludeEnd("ctx");
  4928. },
  4929. //>>excludeStart("ide", pragmas.excludeIdeData);
  4930. args: ["aPoint"],
  4931. source: "+ aPoint\x0a\x09^ Point x: self x + aPoint asPoint x y: self y + aPoint asPoint y",
  4932. referencedClasses: ["Point"],
  4933. //>>excludeEnd("ide");
  4934. messageSends: ["x:y:", "+", "x", "asPoint", "y"]
  4935. }),
  4936. $globals.Point);
  4937. $core.addMethod(
  4938. $core.method({
  4939. selector: "-",
  4940. protocol: "arithmetic",
  4941. fn: function (aPoint){
  4942. var self=this,$self=this;
  4943. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4944. return $core.withContext(function($ctx1) {
  4945. //>>excludeEnd("ctx");
  4946. var $2,$4,$3,$1,$6,$5;
  4947. $2=$self._x();
  4948. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4949. $ctx1.sendIdx["x"]=1;
  4950. //>>excludeEnd("ctx");
  4951. $4=$recv(aPoint)._asPoint();
  4952. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4953. $ctx1.sendIdx["asPoint"]=1;
  4954. //>>excludeEnd("ctx");
  4955. $3=$recv($4)._x();
  4956. $1=$recv($2).__minus($3);
  4957. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4958. $ctx1.sendIdx["-"]=1;
  4959. //>>excludeEnd("ctx");
  4960. $6=$self._y();
  4961. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4962. $ctx1.sendIdx["y"]=1;
  4963. //>>excludeEnd("ctx");
  4964. $5=$recv($6).__minus($recv($recv(aPoint)._asPoint())._y());
  4965. return $recv($globals.Point)._x_y_($1,$5);
  4966. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4967. }, function($ctx1) {$ctx1.fill(self,"-",{aPoint:aPoint},$globals.Point)});
  4968. //>>excludeEnd("ctx");
  4969. },
  4970. //>>excludeStart("ide", pragmas.excludeIdeData);
  4971. args: ["aPoint"],
  4972. source: "- aPoint\x0a\x09^ Point x: self x - aPoint asPoint x y: self y - aPoint asPoint y",
  4973. referencedClasses: ["Point"],
  4974. //>>excludeEnd("ide");
  4975. messageSends: ["x:y:", "-", "x", "asPoint", "y"]
  4976. }),
  4977. $globals.Point);
  4978. $core.addMethod(
  4979. $core.method({
  4980. selector: "/",
  4981. protocol: "arithmetic",
  4982. fn: function (aPoint){
  4983. var self=this,$self=this;
  4984. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4985. return $core.withContext(function($ctx1) {
  4986. //>>excludeEnd("ctx");
  4987. var $2,$4,$3,$1,$6,$5;
  4988. $2=$self._x();
  4989. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4990. $ctx1.sendIdx["x"]=1;
  4991. //>>excludeEnd("ctx");
  4992. $4=$recv(aPoint)._asPoint();
  4993. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4994. $ctx1.sendIdx["asPoint"]=1;
  4995. //>>excludeEnd("ctx");
  4996. $3=$recv($4)._x();
  4997. $1=$recv($2).__slash($3);
  4998. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4999. $ctx1.sendIdx["/"]=1;
  5000. //>>excludeEnd("ctx");
  5001. $6=$self._y();
  5002. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5003. $ctx1.sendIdx["y"]=1;
  5004. //>>excludeEnd("ctx");
  5005. $5=$recv($6).__slash($recv($recv(aPoint)._asPoint())._y());
  5006. return $recv($globals.Point)._x_y_($1,$5);
  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^ Point x: self x / aPoint asPoint x y: self y / aPoint asPoint y",
  5014. referencedClasses: ["Point"],
  5015. //>>excludeEnd("ide");
  5016. messageSends: ["x:y:", "/", "x", "asPoint", "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).__lt($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).__lt($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).__lt_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).__lt_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: "=",
  5108. protocol: "comparing",
  5109. fn: function (aPoint){
  5110. var self=this,$self=this;
  5111. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5112. return $core.withContext(function($ctx1) {
  5113. //>>excludeEnd("ctx");
  5114. var $2,$1,$4,$3,$6,$5;
  5115. $2=$recv(aPoint)._class();
  5116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5117. $ctx1.sendIdx["class"]=1;
  5118. //>>excludeEnd("ctx");
  5119. $1=$recv($2).__eq($self._class());
  5120. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5121. $ctx1.sendIdx["="]=1;
  5122. //>>excludeEnd("ctx");
  5123. return $recv($1)._and_((function(){
  5124. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5125. return $core.withContext(function($ctx2) {
  5126. //>>excludeEnd("ctx");
  5127. $4=$recv(aPoint)._x();
  5128. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5129. $ctx2.sendIdx["x"]=1;
  5130. //>>excludeEnd("ctx");
  5131. $3=$recv($4).__eq($self._x());
  5132. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5133. $ctx2.sendIdx["="]=2;
  5134. //>>excludeEnd("ctx");
  5135. $6=$recv(aPoint)._y();
  5136. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5137. $ctx2.sendIdx["y"]=1;
  5138. //>>excludeEnd("ctx");
  5139. $5=$recv($6).__eq($self._y());
  5140. return $recv($3).__and($5);
  5141. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5142. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  5143. //>>excludeEnd("ctx");
  5144. }));
  5145. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5146. }, function($ctx1) {$ctx1.fill(self,"=",{aPoint:aPoint},$globals.Point)});
  5147. //>>excludeEnd("ctx");
  5148. },
  5149. //>>excludeStart("ide", pragmas.excludeIdeData);
  5150. args: ["aPoint"],
  5151. source: "= aPoint\x0a\x09^ aPoint class = self class and: [\x0a\x09\x09(aPoint x = self x) & (aPoint y = self y) ]",
  5152. referencedClasses: [],
  5153. //>>excludeEnd("ide");
  5154. messageSends: ["and:", "=", "class", "&", "x", "y"]
  5155. }),
  5156. $globals.Point);
  5157. $core.addMethod(
  5158. $core.method({
  5159. selector: ">",
  5160. protocol: "comparing",
  5161. fn: function (aPoint){
  5162. var self=this,$self=this;
  5163. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5164. return $core.withContext(function($ctx1) {
  5165. //>>excludeEnd("ctx");
  5166. var $2,$1,$3;
  5167. $2=$self._x();
  5168. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5169. $ctx1.sendIdx["x"]=1;
  5170. //>>excludeEnd("ctx");
  5171. $1=$recv($2).__gt($recv(aPoint)._x());
  5172. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5173. $ctx1.sendIdx[">"]=1;
  5174. //>>excludeEnd("ctx");
  5175. return $recv($1)._and_((function(){
  5176. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5177. return $core.withContext(function($ctx2) {
  5178. //>>excludeEnd("ctx");
  5179. $3=$self._y();
  5180. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5181. $ctx2.sendIdx["y"]=1;
  5182. //>>excludeEnd("ctx");
  5183. return $recv($3).__gt($recv(aPoint)._y());
  5184. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5185. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  5186. //>>excludeEnd("ctx");
  5187. }));
  5188. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5189. }, function($ctx1) {$ctx1.fill(self,">",{aPoint:aPoint},$globals.Point)});
  5190. //>>excludeEnd("ctx");
  5191. },
  5192. //>>excludeStart("ide", pragmas.excludeIdeData);
  5193. args: ["aPoint"],
  5194. source: "> aPoint\x0a\x09^ self x > aPoint x and: [\x0a\x09\x09self y > aPoint y ]",
  5195. referencedClasses: [],
  5196. //>>excludeEnd("ide");
  5197. messageSends: ["and:", ">", "x", "y"]
  5198. }),
  5199. $globals.Point);
  5200. $core.addMethod(
  5201. $core.method({
  5202. selector: ">=",
  5203. protocol: "comparing",
  5204. fn: function (aPoint){
  5205. var self=this,$self=this;
  5206. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5207. return $core.withContext(function($ctx1) {
  5208. //>>excludeEnd("ctx");
  5209. var $2,$1,$3;
  5210. $2=$self._x();
  5211. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5212. $ctx1.sendIdx["x"]=1;
  5213. //>>excludeEnd("ctx");
  5214. $1=$recv($2).__gt_eq($recv(aPoint)._x());
  5215. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5216. $ctx1.sendIdx[">="]=1;
  5217. //>>excludeEnd("ctx");
  5218. return $recv($1)._and_((function(){
  5219. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5220. return $core.withContext(function($ctx2) {
  5221. //>>excludeEnd("ctx");
  5222. $3=$self._y();
  5223. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5224. $ctx2.sendIdx["y"]=1;
  5225. //>>excludeEnd("ctx");
  5226. return $recv($3).__gt_eq($recv(aPoint)._y());
  5227. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5228. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  5229. //>>excludeEnd("ctx");
  5230. }));
  5231. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5232. }, function($ctx1) {$ctx1.fill(self,">=",{aPoint:aPoint},$globals.Point)});
  5233. //>>excludeEnd("ctx");
  5234. },
  5235. //>>excludeStart("ide", pragmas.excludeIdeData);
  5236. args: ["aPoint"],
  5237. source: ">= aPoint\x0a\x09^ self x >= aPoint x and: [\x0a\x09\x09self y >= aPoint y ]",
  5238. referencedClasses: [],
  5239. //>>excludeEnd("ide");
  5240. messageSends: ["and:", ">=", "x", "y"]
  5241. }),
  5242. $globals.Point);
  5243. $core.addMethod(
  5244. $core.method({
  5245. selector: "angle",
  5246. protocol: "geometry",
  5247. fn: function (){
  5248. var self=this,$self=this;
  5249. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5250. return $core.withContext(function($ctx1) {
  5251. //>>excludeEnd("ctx");
  5252. return $recv($self._y())._arcTan_($self._x());
  5253. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5254. }, function($ctx1) {$ctx1.fill(self,"angle",{},$globals.Point)});
  5255. //>>excludeEnd("ctx");
  5256. },
  5257. //>>excludeStart("ide", pragmas.excludeIdeData);
  5258. args: [],
  5259. source: "angle\x0a\x09^ self y arcTan: self x",
  5260. referencedClasses: [],
  5261. //>>excludeEnd("ide");
  5262. messageSends: ["arcTan:", "y", "x"]
  5263. }),
  5264. $globals.Point);
  5265. $core.addMethod(
  5266. $core.method({
  5267. selector: "asPoint",
  5268. protocol: "converting",
  5269. fn: function (){
  5270. var self=this,$self=this;
  5271. return self;
  5272. },
  5273. //>>excludeStart("ide", pragmas.excludeIdeData);
  5274. args: [],
  5275. source: "asPoint\x0a\x09^ self",
  5276. referencedClasses: [],
  5277. //>>excludeEnd("ide");
  5278. messageSends: []
  5279. }),
  5280. $globals.Point);
  5281. $core.addMethod(
  5282. $core.method({
  5283. selector: "corner:",
  5284. protocol: "rectangle creation",
  5285. fn: function (aPoint){
  5286. var self=this,$self=this;
  5287. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5288. return $core.withContext(function($ctx1) {
  5289. //>>excludeEnd("ctx");
  5290. return $recv($globals.Rectangle)._origin_corner_(self,aPoint);
  5291. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5292. }, function($ctx1) {$ctx1.fill(self,"corner:",{aPoint:aPoint},$globals.Point)});
  5293. //>>excludeEnd("ctx");
  5294. },
  5295. //>>excludeStart("ide", pragmas.excludeIdeData);
  5296. args: ["aPoint"],
  5297. source: "corner: aPoint\x0a\x09^ Rectangle origin: self corner: aPoint",
  5298. referencedClasses: ["Rectangle"],
  5299. //>>excludeEnd("ide");
  5300. messageSends: ["origin:corner:"]
  5301. }),
  5302. $globals.Point);
  5303. $core.addMethod(
  5304. $core.method({
  5305. selector: "dist:",
  5306. protocol: "transforming",
  5307. fn: function (aPoint){
  5308. var self=this,$self=this;
  5309. var dx,dy;
  5310. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5311. return $core.withContext(function($ctx1) {
  5312. //>>excludeEnd("ctx");
  5313. var $2,$1;
  5314. dx=$recv($recv(aPoint)._x()).__minus($self["@x"]);
  5315. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5316. $ctx1.sendIdx["-"]=1;
  5317. //>>excludeEnd("ctx");
  5318. dy=$recv($recv(aPoint)._y()).__minus($self["@y"]);
  5319. $2=$recv(dx).__star(dx);
  5320. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5321. $ctx1.sendIdx["*"]=1;
  5322. //>>excludeEnd("ctx");
  5323. $1=$recv($2).__plus($recv(dy).__star(dy));
  5324. return $recv($1)._sqrt();
  5325. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5326. }, function($ctx1) {$ctx1.fill(self,"dist:",{aPoint:aPoint,dx:dx,dy:dy},$globals.Point)});
  5327. //>>excludeEnd("ctx");
  5328. },
  5329. //>>excludeStart("ide", pragmas.excludeIdeData);
  5330. args: ["aPoint"],
  5331. 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",
  5332. referencedClasses: [],
  5333. //>>excludeEnd("ide");
  5334. messageSends: ["-", "x", "y", "sqrt", "+", "*"]
  5335. }),
  5336. $globals.Point);
  5337. $core.addMethod(
  5338. $core.method({
  5339. selector: "dotProduct:",
  5340. protocol: "point functions",
  5341. fn: function (aPoint){
  5342. var self=this,$self=this;
  5343. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5344. return $core.withContext(function($ctx1) {
  5345. //>>excludeEnd("ctx");
  5346. var $1;
  5347. $1=$recv($self["@x"]).__star($recv(aPoint)._x());
  5348. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5349. $ctx1.sendIdx["*"]=1;
  5350. //>>excludeEnd("ctx");
  5351. return $recv($1).__plus($recv($self["@y"]).__star($recv(aPoint)._y()));
  5352. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5353. }, function($ctx1) {$ctx1.fill(self,"dotProduct:",{aPoint:aPoint},$globals.Point)});
  5354. //>>excludeEnd("ctx");
  5355. },
  5356. //>>excludeStart("ide", pragmas.excludeIdeData);
  5357. args: ["aPoint"],
  5358. source: "dotProduct: aPoint\x0a\x09^ (x * aPoint x) + (y * aPoint y)",
  5359. referencedClasses: [],
  5360. //>>excludeEnd("ide");
  5361. messageSends: ["+", "*", "x", "y"]
  5362. }),
  5363. $globals.Point);
  5364. $core.addMethod(
  5365. $core.method({
  5366. selector: "extent:",
  5367. protocol: "rectangle creation",
  5368. fn: function (aPoint){
  5369. var self=this,$self=this;
  5370. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5371. return $core.withContext(function($ctx1) {
  5372. //>>excludeEnd("ctx");
  5373. return $recv($globals.Rectangle)._origin_extent_(self,aPoint);
  5374. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5375. }, function($ctx1) {$ctx1.fill(self,"extent:",{aPoint:aPoint},$globals.Point)});
  5376. //>>excludeEnd("ctx");
  5377. },
  5378. //>>excludeStart("ide", pragmas.excludeIdeData);
  5379. args: ["aPoint"],
  5380. source: "extent: aPoint\x0a\x09^ Rectangle origin: self extent: aPoint",
  5381. referencedClasses: ["Rectangle"],
  5382. //>>excludeEnd("ide");
  5383. messageSends: ["origin:extent:"]
  5384. }),
  5385. $globals.Point);
  5386. $core.addMethod(
  5387. $core.method({
  5388. selector: "normal",
  5389. protocol: "point functions",
  5390. fn: function (){
  5391. var self=this,$self=this;
  5392. var n,d;
  5393. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5394. return $core.withContext(function($ctx1) {
  5395. //>>excludeEnd("ctx");
  5396. var $4,$3,$6,$5,$2,$1;
  5397. n=$recv($recv($self["@y"])._negated()).__at($self["@x"]);
  5398. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5399. $ctx1.sendIdx["@"]=1;
  5400. //>>excludeEnd("ctx");
  5401. $4=$recv(n)._x();
  5402. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5403. $ctx1.sendIdx["x"]=1;
  5404. //>>excludeEnd("ctx");
  5405. $3=$recv($4).__star($recv(n)._x());
  5406. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5407. $ctx1.sendIdx["*"]=1;
  5408. //>>excludeEnd("ctx");
  5409. $6=$recv(n)._y();
  5410. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5411. $ctx1.sendIdx["y"]=1;
  5412. //>>excludeEnd("ctx");
  5413. $5=$recv($6).__star($recv(n)._y());
  5414. d=$recv($3).__plus($5);
  5415. $2=d;
  5416. $1=$recv($2).__eq((0));
  5417. if($core.assert($1)){
  5418. return (-1).__at((0));
  5419. }
  5420. return $recv(n).__slash($recv(d)._sqrt());
  5421. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5422. }, function($ctx1) {$ctx1.fill(self,"normal",{n:n,d:d},$globals.Point)});
  5423. //>>excludeEnd("ctx");
  5424. },
  5425. //>>excludeStart("ide", pragmas.excludeIdeData);
  5426. args: [],
  5427. 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",
  5428. referencedClasses: [],
  5429. //>>excludeEnd("ide");
  5430. messageSends: ["@", "negated", "ifTrue:", "=", "+", "*", "x", "y", "/", "sqrt"]
  5431. }),
  5432. $globals.Point);
  5433. $core.addMethod(
  5434. $core.method({
  5435. selector: "normalized",
  5436. protocol: "point functions",
  5437. fn: function (){
  5438. var self=this,$self=this;
  5439. var r;
  5440. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5441. return $core.withContext(function($ctx1) {
  5442. //>>excludeEnd("ctx");
  5443. var $1,$2,$3;
  5444. r=$self._r();
  5445. $1=$recv(r).__eq((0));
  5446. if($core.assert($1)){
  5447. $2=$recv($globals.Point)._x_y_((0),(0));
  5448. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5449. $ctx1.sendIdx["x:y:"]=1;
  5450. //>>excludeEnd("ctx");
  5451. return $2;
  5452. } else {
  5453. $3=$recv($self["@x"]).__slash(r);
  5454. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5455. $ctx1.sendIdx["/"]=1;
  5456. //>>excludeEnd("ctx");
  5457. return $recv($globals.Point)._x_y_($3,$recv($self["@y"]).__slash(r));
  5458. }
  5459. return self;
  5460. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5461. }, function($ctx1) {$ctx1.fill(self,"normalized",{r:r},$globals.Point)});
  5462. //>>excludeEnd("ctx");
  5463. },
  5464. //>>excludeStart("ide", pragmas.excludeIdeData);
  5465. args: [],
  5466. 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 ]",
  5467. referencedClasses: ["Point"],
  5468. //>>excludeEnd("ide");
  5469. messageSends: ["r", "ifTrue:ifFalse:", "=", "x:y:", "/"]
  5470. }),
  5471. $globals.Point);
  5472. $core.addMethod(
  5473. $core.method({
  5474. selector: "printOn:",
  5475. protocol: "printing",
  5476. fn: function (aStream){
  5477. var self=this,$self=this;
  5478. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5479. return $core.withContext(function($ctx1) {
  5480. //>>excludeEnd("ctx");
  5481. var $1;
  5482. $recv($self["@x"])._printOn_(aStream);
  5483. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5484. $ctx1.sendIdx["printOn:"]=1;
  5485. //>>excludeEnd("ctx");
  5486. $recv(aStream)._nextPutAll_("@");
  5487. $1=$recv($recv($self["@y"])._notNil())._and_((function(){
  5488. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5489. return $core.withContext(function($ctx2) {
  5490. //>>excludeEnd("ctx");
  5491. return $recv($self["@y"])._negative();
  5492. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5493. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  5494. //>>excludeEnd("ctx");
  5495. }));
  5496. if($core.assert($1)){
  5497. $recv(aStream)._space();
  5498. }
  5499. $recv($self["@y"])._printOn_(aStream);
  5500. return self;
  5501. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5502. }, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},$globals.Point)});
  5503. //>>excludeEnd("ctx");
  5504. },
  5505. //>>excludeStart("ide", pragmas.excludeIdeData);
  5506. args: ["aStream"],
  5507. 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",
  5508. referencedClasses: [],
  5509. //>>excludeEnd("ide");
  5510. messageSends: ["printOn:", "nextPutAll:", "ifTrue:", "and:", "notNil", "negative", "space"]
  5511. }),
  5512. $globals.Point);
  5513. $core.addMethod(
  5514. $core.method({
  5515. selector: "r",
  5516. protocol: "polar coordinates",
  5517. fn: function (){
  5518. var self=this,$self=this;
  5519. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5520. return $core.withContext(function($ctx1) {
  5521. //>>excludeEnd("ctx");
  5522. var $2,$1;
  5523. $2=$recv($self["@x"]).__star($self["@x"]);
  5524. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5525. $ctx1.sendIdx["*"]=1;
  5526. //>>excludeEnd("ctx");
  5527. $1=$recv($2).__plus($recv($self["@y"]).__star($self["@y"]));
  5528. return $recv($1)._sqrt();
  5529. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5530. }, function($ctx1) {$ctx1.fill(self,"r",{},$globals.Point)});
  5531. //>>excludeEnd("ctx");
  5532. },
  5533. //>>excludeStart("ide", pragmas.excludeIdeData);
  5534. args: [],
  5535. source: "r\x0a\x09^ ((x * x) + (y * y)) sqrt",
  5536. referencedClasses: [],
  5537. //>>excludeEnd("ide");
  5538. messageSends: ["sqrt", "+", "*"]
  5539. }),
  5540. $globals.Point);
  5541. $core.addMethod(
  5542. $core.method({
  5543. selector: "rectangle:",
  5544. protocol: "rectangle creation",
  5545. fn: function (aPoint){
  5546. var self=this,$self=this;
  5547. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5548. return $core.withContext(function($ctx1) {
  5549. //>>excludeEnd("ctx");
  5550. return $recv($globals.Rectangle)._point_point_(self,aPoint);
  5551. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5552. }, function($ctx1) {$ctx1.fill(self,"rectangle:",{aPoint:aPoint},$globals.Point)});
  5553. //>>excludeEnd("ctx");
  5554. },
  5555. //>>excludeStart("ide", pragmas.excludeIdeData);
  5556. args: ["aPoint"],
  5557. source: "rectangle: aPoint\x0a\x09^ Rectangle point: self point: aPoint",
  5558. referencedClasses: ["Rectangle"],
  5559. //>>excludeEnd("ide");
  5560. messageSends: ["point:point:"]
  5561. }),
  5562. $globals.Point);
  5563. $core.addMethod(
  5564. $core.method({
  5565. selector: "translateBy:",
  5566. protocol: "transforming",
  5567. fn: function (delta){
  5568. var self=this,$self=this;
  5569. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5570. return $core.withContext(function($ctx1) {
  5571. //>>excludeEnd("ctx");
  5572. var $1;
  5573. $1=$recv($recv(delta)._x()).__plus($self["@x"]);
  5574. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5575. $ctx1.sendIdx["+"]=1;
  5576. //>>excludeEnd("ctx");
  5577. return $recv($1).__at($recv($recv(delta)._y()).__plus($self["@y"]));
  5578. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5579. }, function($ctx1) {$ctx1.fill(self,"translateBy:",{delta:delta},$globals.Point)});
  5580. //>>excludeEnd("ctx");
  5581. },
  5582. //>>excludeStart("ide", pragmas.excludeIdeData);
  5583. args: ["delta"],
  5584. source: "translateBy: delta\x0a\x09\x22Answer a Point translated by delta (an instance of Point).\x22\x0a\x09^ (delta x + x) @ (delta y + y)",
  5585. referencedClasses: [],
  5586. //>>excludeEnd("ide");
  5587. messageSends: ["@", "+", "x", "y"]
  5588. }),
  5589. $globals.Point);
  5590. $core.addMethod(
  5591. $core.method({
  5592. selector: "x",
  5593. protocol: "accessing",
  5594. fn: function (){
  5595. var self=this,$self=this;
  5596. return $self["@x"];
  5597. },
  5598. //>>excludeStart("ide", pragmas.excludeIdeData);
  5599. args: [],
  5600. source: "x\x0a\x09^ x",
  5601. referencedClasses: [],
  5602. //>>excludeEnd("ide");
  5603. messageSends: []
  5604. }),
  5605. $globals.Point);
  5606. $core.addMethod(
  5607. $core.method({
  5608. selector: "x:",
  5609. protocol: "accessing",
  5610. fn: function (aNumber){
  5611. var self=this,$self=this;
  5612. $self["@x"]=aNumber;
  5613. return self;
  5614. },
  5615. //>>excludeStart("ide", pragmas.excludeIdeData);
  5616. args: ["aNumber"],
  5617. source: "x: aNumber\x0a\x09x := aNumber",
  5618. referencedClasses: [],
  5619. //>>excludeEnd("ide");
  5620. messageSends: []
  5621. }),
  5622. $globals.Point);
  5623. $core.addMethod(
  5624. $core.method({
  5625. selector: "y",
  5626. protocol: "accessing",
  5627. fn: function (){
  5628. var self=this,$self=this;
  5629. return $self["@y"];
  5630. },
  5631. //>>excludeStart("ide", pragmas.excludeIdeData);
  5632. args: [],
  5633. source: "y\x0a\x09^ y",
  5634. referencedClasses: [],
  5635. //>>excludeEnd("ide");
  5636. messageSends: []
  5637. }),
  5638. $globals.Point);
  5639. $core.addMethod(
  5640. $core.method({
  5641. selector: "y:",
  5642. protocol: "accessing",
  5643. fn: function (aNumber){
  5644. var self=this,$self=this;
  5645. $self["@y"]=aNumber;
  5646. return self;
  5647. },
  5648. //>>excludeStart("ide", pragmas.excludeIdeData);
  5649. args: ["aNumber"],
  5650. source: "y: aNumber\x0a\x09y := aNumber",
  5651. referencedClasses: [],
  5652. //>>excludeEnd("ide");
  5653. messageSends: []
  5654. }),
  5655. $globals.Point);
  5656. $core.addMethod(
  5657. $core.method({
  5658. selector: "classTag",
  5659. protocol: "accessing",
  5660. fn: function (){
  5661. var self=this,$self=this;
  5662. return "magnitude";
  5663. },
  5664. //>>excludeStart("ide", pragmas.excludeIdeData);
  5665. args: [],
  5666. 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'",
  5667. referencedClasses: [],
  5668. //>>excludeEnd("ide");
  5669. messageSends: []
  5670. }),
  5671. $globals.Point.a$cls);
  5672. $core.addMethod(
  5673. $core.method({
  5674. selector: "x:y:",
  5675. protocol: "instance creation",
  5676. fn: function (aNumber,anotherNumber){
  5677. var self=this,$self=this;
  5678. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5679. return $core.withContext(function($ctx1) {
  5680. //>>excludeEnd("ctx");
  5681. var $1;
  5682. $1=$self._new();
  5683. $recv($1)._x_(aNumber);
  5684. $recv($1)._y_(anotherNumber);
  5685. return $recv($1)._yourself();
  5686. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5687. }, function($ctx1) {$ctx1.fill(self,"x:y:",{aNumber:aNumber,anotherNumber:anotherNumber},$globals.Point.a$cls)});
  5688. //>>excludeEnd("ctx");
  5689. },
  5690. //>>excludeStart("ide", pragmas.excludeIdeData);
  5691. args: ["aNumber", "anotherNumber"],
  5692. source: "x: aNumber y: anotherNumber\x0a\x09^ self new\x0a\x09\x09x: aNumber;\x0a\x09\x09y: anotherNumber;\x0a\x09\x09yourself",
  5693. referencedClasses: [],
  5694. //>>excludeEnd("ide");
  5695. messageSends: ["x:", "new", "y:", "yourself"]
  5696. }),
  5697. $globals.Point.a$cls);
  5698. $core.addClass("Random", $globals.Object, [], "Kernel-Objects");
  5699. //>>excludeStart("ide", pragmas.excludeIdeData);
  5700. $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'`.";
  5701. //>>excludeEnd("ide");
  5702. $core.addMethod(
  5703. $core.method({
  5704. selector: "next",
  5705. protocol: "accessing",
  5706. fn: function (){
  5707. var self=this,$self=this;
  5708. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5709. return $core.withContext(function($ctx1) {
  5710. //>>excludeEnd("ctx");
  5711. return Math.random();
  5712. return self;
  5713. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5714. }, function($ctx1) {$ctx1.fill(self,"next",{},$globals.Random)});
  5715. //>>excludeEnd("ctx");
  5716. },
  5717. //>>excludeStart("ide", pragmas.excludeIdeData);
  5718. args: [],
  5719. source: "next\x0a\x09<inlineJS: 'return Math.random()'>",
  5720. referencedClasses: [],
  5721. //>>excludeEnd("ide");
  5722. messageSends: []
  5723. }),
  5724. $globals.Random);
  5725. $core.addMethod(
  5726. $core.method({
  5727. selector: "next:",
  5728. protocol: "accessing",
  5729. fn: function (anInteger){
  5730. var self=this,$self=this;
  5731. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5732. return $core.withContext(function($ctx1) {
  5733. //>>excludeEnd("ctx");
  5734. return $recv((1)._to_(anInteger))._collect_((function(each){
  5735. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5736. return $core.withContext(function($ctx2) {
  5737. //>>excludeEnd("ctx");
  5738. return $self._next();
  5739. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5740. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  5741. //>>excludeEnd("ctx");
  5742. }));
  5743. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5744. }, function($ctx1) {$ctx1.fill(self,"next:",{anInteger:anInteger},$globals.Random)});
  5745. //>>excludeEnd("ctx");
  5746. },
  5747. //>>excludeStart("ide", pragmas.excludeIdeData);
  5748. args: ["anInteger"],
  5749. source: "next: anInteger\x0a\x09^ (1 to: anInteger) collect: [ :each | self next ]",
  5750. referencedClasses: [],
  5751. //>>excludeEnd("ide");
  5752. messageSends: ["collect:", "to:", "next"]
  5753. }),
  5754. $globals.Random);
  5755. $core.addClass("Rectangle", $globals.Object, ["origin", "corner"], "Kernel-Objects");
  5756. //>>excludeStart("ide", pragmas.excludeIdeData);
  5757. $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.";
  5758. //>>excludeEnd("ide");
  5759. $core.addMethod(
  5760. $core.method({
  5761. selector: "=",
  5762. protocol: "testing",
  5763. fn: function (aRectangle){
  5764. var self=this,$self=this;
  5765. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5766. return $core.withContext(function($ctx1) {
  5767. //>>excludeEnd("ctx");
  5768. var $1;
  5769. $1=$recv($self["@origin"]).__eq($recv(aRectangle)._origin());
  5770. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5771. $ctx1.sendIdx["="]=1;
  5772. //>>excludeEnd("ctx");
  5773. return $recv($1)._and_((function(){
  5774. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5775. return $core.withContext(function($ctx2) {
  5776. //>>excludeEnd("ctx");
  5777. return $recv($self["@corner"]).__eq($recv(aRectangle)._corner());
  5778. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5779. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  5780. //>>excludeEnd("ctx");
  5781. }));
  5782. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5783. }, function($ctx1) {$ctx1.fill(self,"=",{aRectangle:aRectangle},$globals.Rectangle)});
  5784. //>>excludeEnd("ctx");
  5785. },
  5786. //>>excludeStart("ide", pragmas.excludeIdeData);
  5787. args: ["aRectangle"],
  5788. source: "= aRectangle\x0a\x09^ origin = aRectangle origin and: [ corner = aRectangle corner ]",
  5789. referencedClasses: [],
  5790. //>>excludeEnd("ide");
  5791. messageSends: ["and:", "=", "origin", "corner"]
  5792. }),
  5793. $globals.Rectangle);
  5794. $core.addMethod(
  5795. $core.method({
  5796. selector: "containsPoint:",
  5797. protocol: "testing",
  5798. fn: function (aPoint){
  5799. var self=this,$self=this;
  5800. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5801. return $core.withContext(function($ctx1) {
  5802. //>>excludeEnd("ctx");
  5803. return $recv($recv($self["@origin"]).__lt_eq(aPoint))._and_((function(){
  5804. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5805. return $core.withContext(function($ctx2) {
  5806. //>>excludeEnd("ctx");
  5807. return $recv($self["@corner"]).__gt_eq(aPoint);
  5808. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5809. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  5810. //>>excludeEnd("ctx");
  5811. }));
  5812. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5813. }, function($ctx1) {$ctx1.fill(self,"containsPoint:",{aPoint:aPoint},$globals.Rectangle)});
  5814. //>>excludeEnd("ctx");
  5815. },
  5816. //>>excludeStart("ide", pragmas.excludeIdeData);
  5817. args: ["aPoint"],
  5818. source: "containsPoint: aPoint\x0a\x09^ origin <= aPoint and: [ corner >= aPoint ]",
  5819. referencedClasses: [],
  5820. //>>excludeEnd("ide");
  5821. messageSends: ["and:", "<=", ">="]
  5822. }),
  5823. $globals.Rectangle);
  5824. $core.addMethod(
  5825. $core.method({
  5826. selector: "containsRect:",
  5827. protocol: "testing",
  5828. fn: function (aRect){
  5829. var self=this,$self=this;
  5830. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5831. return $core.withContext(function($ctx1) {
  5832. //>>excludeEnd("ctx");
  5833. return $recv($recv($recv(aRect)._origin()).__gt_eq($self["@origin"]))._and_((function(){
  5834. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5835. return $core.withContext(function($ctx2) {
  5836. //>>excludeEnd("ctx");
  5837. return $recv($recv(aRect)._corner()).__lt_eq($self["@corner"]);
  5838. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5839. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  5840. //>>excludeEnd("ctx");
  5841. }));
  5842. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5843. }, function($ctx1) {$ctx1.fill(self,"containsRect:",{aRect:aRect},$globals.Rectangle)});
  5844. //>>excludeEnd("ctx");
  5845. },
  5846. //>>excludeStart("ide", pragmas.excludeIdeData);
  5847. args: ["aRect"],
  5848. source: "containsRect: aRect\x0a\x09^ aRect origin >= origin and: [ aRect corner <= corner ]",
  5849. referencedClasses: [],
  5850. //>>excludeEnd("ide");
  5851. messageSends: ["and:", ">=", "origin", "<=", "corner"]
  5852. }),
  5853. $globals.Rectangle);
  5854. $core.addMethod(
  5855. $core.method({
  5856. selector: "corner",
  5857. protocol: "accessing",
  5858. fn: function (){
  5859. var self=this,$self=this;
  5860. return $self["@corner"];
  5861. },
  5862. //>>excludeStart("ide", pragmas.excludeIdeData);
  5863. args: [],
  5864. source: "corner\x0a\x09^ corner",
  5865. referencedClasses: [],
  5866. //>>excludeEnd("ide");
  5867. messageSends: []
  5868. }),
  5869. $globals.Rectangle);
  5870. $core.addMethod(
  5871. $core.method({
  5872. selector: "origin",
  5873. protocol: "accessing",
  5874. fn: function (){
  5875. var self=this,$self=this;
  5876. return $self["@origin"];
  5877. },
  5878. //>>excludeStart("ide", pragmas.excludeIdeData);
  5879. args: [],
  5880. source: "origin\x0a\x09^ origin",
  5881. referencedClasses: [],
  5882. //>>excludeEnd("ide");
  5883. messageSends: []
  5884. }),
  5885. $globals.Rectangle);
  5886. $core.addMethod(
  5887. $core.method({
  5888. selector: "printOn:",
  5889. protocol: "testing",
  5890. fn: function (aStream){
  5891. var self=this,$self=this;
  5892. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5893. return $core.withContext(function($ctx1) {
  5894. //>>excludeEnd("ctx");
  5895. $recv($self["@origin"])._printOn_(aStream);
  5896. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5897. $ctx1.sendIdx["printOn:"]=1;
  5898. //>>excludeEnd("ctx");
  5899. $recv(aStream)._nextPutAll_(" corner: ");
  5900. $recv($self["@corner"])._printOn_(aStream);
  5901. return self;
  5902. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5903. }, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},$globals.Rectangle)});
  5904. //>>excludeEnd("ctx");
  5905. },
  5906. //>>excludeStart("ide", pragmas.excludeIdeData);
  5907. args: ["aStream"],
  5908. source: "printOn: aStream\x0a\x09origin printOn: aStream.\x0a\x09aStream nextPutAll: ' corner: '.\x0a\x09corner printOn: aStream.",
  5909. referencedClasses: [],
  5910. //>>excludeEnd("ide");
  5911. messageSends: ["printOn:", "nextPutAll:"]
  5912. }),
  5913. $globals.Rectangle);
  5914. $core.addMethod(
  5915. $core.method({
  5916. selector: "setPoint:point:",
  5917. protocol: "private",
  5918. fn: function (pt1,pt2){
  5919. var self=this,$self=this;
  5920. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5921. return $core.withContext(function($ctx1) {
  5922. //>>excludeEnd("ctx");
  5923. var $2,$3,$1,$5,$6,$4,$8,$7,$10,$9;
  5924. $2=$recv(pt1)._x();
  5925. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5926. $ctx1.sendIdx["x"]=1;
  5927. //>>excludeEnd("ctx");
  5928. $3=$recv(pt2)._x();
  5929. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5930. $ctx1.sendIdx["x"]=2;
  5931. //>>excludeEnd("ctx");
  5932. $1=$recv($2)._min_($3);
  5933. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5934. $ctx1.sendIdx["min:"]=1;
  5935. //>>excludeEnd("ctx");
  5936. $5=$recv(pt1)._y();
  5937. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5938. $ctx1.sendIdx["y"]=1;
  5939. //>>excludeEnd("ctx");
  5940. $6=$recv(pt2)._y();
  5941. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5942. $ctx1.sendIdx["y"]=2;
  5943. //>>excludeEnd("ctx");
  5944. $4=$recv($5)._min_($6);
  5945. $self["@origin"]=$recv($1).__at($4);
  5946. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5947. $ctx1.sendIdx["@"]=1;
  5948. //>>excludeEnd("ctx");
  5949. $8=$recv(pt1)._x();
  5950. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5951. $ctx1.sendIdx["x"]=3;
  5952. //>>excludeEnd("ctx");
  5953. $7=$recv($8)._max_($recv(pt2)._x());
  5954. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5955. $ctx1.sendIdx["max:"]=1;
  5956. //>>excludeEnd("ctx");
  5957. $10=$recv(pt1)._y();
  5958. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5959. $ctx1.sendIdx["y"]=3;
  5960. //>>excludeEnd("ctx");
  5961. $9=$recv($10)._max_($recv(pt2)._y());
  5962. $self["@corner"]=$recv($7).__at($9);
  5963. return self;
  5964. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5965. }, function($ctx1) {$ctx1.fill(self,"setPoint:point:",{pt1:pt1,pt2:pt2},$globals.Rectangle)});
  5966. //>>excludeEnd("ctx");
  5967. },
  5968. //>>excludeStart("ide", pragmas.excludeIdeData);
  5969. args: ["pt1", "pt2"],
  5970. 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).",
  5971. referencedClasses: [],
  5972. //>>excludeEnd("ide");
  5973. messageSends: ["@", "min:", "x", "y", "max:"]
  5974. }),
  5975. $globals.Rectangle);
  5976. $core.addMethod(
  5977. $core.method({
  5978. selector: "origin:corner:",
  5979. protocol: "instance creation",
  5980. fn: function (anOrigin,aCorner){
  5981. var self=this,$self=this;
  5982. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5983. return $core.withContext(function($ctx1) {
  5984. //>>excludeEnd("ctx");
  5985. return $recv($self._basicNew())._setPoint_point_(anOrigin,aCorner);
  5986. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5987. }, function($ctx1) {$ctx1.fill(self,"origin:corner:",{anOrigin:anOrigin,aCorner:aCorner},$globals.Rectangle.a$cls)});
  5988. //>>excludeEnd("ctx");
  5989. },
  5990. //>>excludeStart("ide", pragmas.excludeIdeData);
  5991. args: ["anOrigin", "aCorner"],
  5992. source: "origin: anOrigin corner: aCorner\x0a\x09^ self basicNew setPoint: anOrigin point: aCorner.",
  5993. referencedClasses: [],
  5994. //>>excludeEnd("ide");
  5995. messageSends: ["setPoint:point:", "basicNew"]
  5996. }),
  5997. $globals.Rectangle.a$cls);
  5998. $core.addMethod(
  5999. $core.method({
  6000. selector: "origin:extent:",
  6001. protocol: "instance creation",
  6002. fn: function (anOrigin,anExtent){
  6003. var self=this,$self=this;
  6004. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6005. return $core.withContext(function($ctx1) {
  6006. //>>excludeEnd("ctx");
  6007. return $recv($self._basicNew())._setPoint_point_(anOrigin,$recv(anOrigin).__plus(anExtent));
  6008. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6009. }, function($ctx1) {$ctx1.fill(self,"origin:extent:",{anOrigin:anOrigin,anExtent:anExtent},$globals.Rectangle.a$cls)});
  6010. //>>excludeEnd("ctx");
  6011. },
  6012. //>>excludeStart("ide", pragmas.excludeIdeData);
  6013. args: ["anOrigin", "anExtent"],
  6014. source: "origin: anOrigin extent: anExtent\x0a\x09^ self basicNew setPoint: anOrigin point: anOrigin + anExtent.",
  6015. referencedClasses: [],
  6016. //>>excludeEnd("ide");
  6017. messageSends: ["setPoint:point:", "basicNew", "+"]
  6018. }),
  6019. $globals.Rectangle.a$cls);
  6020. $core.addMethod(
  6021. $core.method({
  6022. selector: "point:point:",
  6023. protocol: "instance creation",
  6024. fn: function (anOrigin,aCorner){
  6025. var self=this,$self=this;
  6026. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6027. return $core.withContext(function($ctx1) {
  6028. //>>excludeEnd("ctx");
  6029. return $recv($self._basicNew())._setPoint_point_(anOrigin,aCorner);
  6030. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6031. }, function($ctx1) {$ctx1.fill(self,"point:point:",{anOrigin:anOrigin,aCorner:aCorner},$globals.Rectangle.a$cls)});
  6032. //>>excludeEnd("ctx");
  6033. },
  6034. //>>excludeStart("ide", pragmas.excludeIdeData);
  6035. args: ["anOrigin", "aCorner"],
  6036. source: "point: anOrigin point: aCorner\x0a\x09^ self basicNew setPoint: anOrigin point: aCorner.",
  6037. referencedClasses: [],
  6038. //>>excludeEnd("ide");
  6039. messageSends: ["setPoint:point:", "basicNew"]
  6040. }),
  6041. $globals.Rectangle.a$cls);
  6042. $core.addClass("UndefinedObject", $globals.Object, [], "Kernel-Objects");
  6043. //>>excludeStart("ide", pragmas.excludeIdeData);
  6044. $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`.";
  6045. //>>excludeEnd("ide");
  6046. $core.addMethod(
  6047. $core.method({
  6048. selector: "==",
  6049. protocol: "testing",
  6050. fn: function (anObject){
  6051. var self=this,$self=this;
  6052. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6053. return $core.withContext(function($ctx1) {
  6054. //>>excludeEnd("ctx");
  6055. return $recv(anObject)._isNil();
  6056. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6057. }, function($ctx1) {$ctx1.fill(self,"==",{anObject:anObject},$globals.UndefinedObject)});
  6058. //>>excludeEnd("ctx");
  6059. },
  6060. //>>excludeStart("ide", pragmas.excludeIdeData);
  6061. args: ["anObject"],
  6062. source: "== anObject\x0a\x09^ anObject isNil",
  6063. referencedClasses: [],
  6064. //>>excludeEnd("ide");
  6065. messageSends: ["isNil"]
  6066. }),
  6067. $globals.UndefinedObject);
  6068. $core.addMethod(
  6069. $core.method({
  6070. selector: "asJavaScriptObject",
  6071. protocol: "converting",
  6072. fn: function (){
  6073. var self=this,$self=this;
  6074. return null;
  6075. },
  6076. //>>excludeStart("ide", pragmas.excludeIdeData);
  6077. args: [],
  6078. source: "asJavaScriptObject\x0a\x09^ null",
  6079. referencedClasses: [],
  6080. //>>excludeEnd("ide");
  6081. messageSends: []
  6082. }),
  6083. $globals.UndefinedObject);
  6084. $core.addMethod(
  6085. $core.method({
  6086. selector: "deepCopy",
  6087. protocol: "copying",
  6088. fn: function (){
  6089. var self=this,$self=this;
  6090. return self;
  6091. },
  6092. //>>excludeStart("ide", pragmas.excludeIdeData);
  6093. args: [],
  6094. source: "deepCopy\x0a\x09^ self",
  6095. referencedClasses: [],
  6096. //>>excludeEnd("ide");
  6097. messageSends: []
  6098. }),
  6099. $globals.UndefinedObject);
  6100. $core.addMethod(
  6101. $core.method({
  6102. selector: "identityHash",
  6103. protocol: "accessing",
  6104. fn: function (){
  6105. var self=this,$self=this;
  6106. return "NIL";
  6107. },
  6108. //>>excludeStart("ide", pragmas.excludeIdeData);
  6109. args: [],
  6110. source: "identityHash\x0a\x09^ 'NIL'",
  6111. referencedClasses: [],
  6112. //>>excludeEnd("ide");
  6113. messageSends: []
  6114. }),
  6115. $globals.UndefinedObject);
  6116. $core.addMethod(
  6117. $core.method({
  6118. selector: "ifNil:",
  6119. protocol: "testing",
  6120. fn: function (aBlock){
  6121. var self=this,$self=this;
  6122. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6123. return $core.withContext(function($ctx1) {
  6124. //>>excludeEnd("ctx");
  6125. return $self._ifNil_ifNotNil_(aBlock,(function(){
  6126. }));
  6127. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6128. }, function($ctx1) {$ctx1.fill(self,"ifNil:",{aBlock:aBlock},$globals.UndefinedObject)});
  6129. //>>excludeEnd("ctx");
  6130. },
  6131. //>>excludeStart("ide", pragmas.excludeIdeData);
  6132. args: ["aBlock"],
  6133. source: "ifNil: aBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^ self ifNil: aBlock ifNotNil: []",
  6134. referencedClasses: [],
  6135. //>>excludeEnd("ide");
  6136. messageSends: ["ifNil:ifNotNil:"]
  6137. }),
  6138. $globals.UndefinedObject);
  6139. $core.addMethod(
  6140. $core.method({
  6141. selector: "ifNil:ifNotNil:",
  6142. protocol: "testing",
  6143. fn: function (aBlock,anotherBlock){
  6144. var self=this,$self=this;
  6145. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6146. return $core.withContext(function($ctx1) {
  6147. //>>excludeEnd("ctx");
  6148. return $recv(aBlock)._value();
  6149. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6150. }, function($ctx1) {$ctx1.fill(self,"ifNil:ifNotNil:",{aBlock:aBlock,anotherBlock:anotherBlock},$globals.UndefinedObject)});
  6151. //>>excludeEnd("ctx");
  6152. },
  6153. //>>excludeStart("ide", pragmas.excludeIdeData);
  6154. args: ["aBlock", "anotherBlock"],
  6155. source: "ifNil: aBlock ifNotNil: anotherBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^ aBlock value",
  6156. referencedClasses: [],
  6157. //>>excludeEnd("ide");
  6158. messageSends: ["value"]
  6159. }),
  6160. $globals.UndefinedObject);
  6161. $core.addMethod(
  6162. $core.method({
  6163. selector: "ifNotNil:",
  6164. protocol: "testing",
  6165. fn: function (aBlock){
  6166. var self=this,$self=this;
  6167. return self;
  6168. },
  6169. //>>excludeStart("ide", pragmas.excludeIdeData);
  6170. args: ["aBlock"],
  6171. source: "ifNotNil: aBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^ self",
  6172. referencedClasses: [],
  6173. //>>excludeEnd("ide");
  6174. messageSends: []
  6175. }),
  6176. $globals.UndefinedObject);
  6177. $core.addMethod(
  6178. $core.method({
  6179. selector: "ifNotNil:ifNil:",
  6180. protocol: "testing",
  6181. fn: function (aBlock,anotherBlock){
  6182. var self=this,$self=this;
  6183. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6184. return $core.withContext(function($ctx1) {
  6185. //>>excludeEnd("ctx");
  6186. return $recv(anotherBlock)._value();
  6187. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6188. }, function($ctx1) {$ctx1.fill(self,"ifNotNil:ifNil:",{aBlock:aBlock,anotherBlock:anotherBlock},$globals.UndefinedObject)});
  6189. //>>excludeEnd("ctx");
  6190. },
  6191. //>>excludeStart("ide", pragmas.excludeIdeData);
  6192. args: ["aBlock", "anotherBlock"],
  6193. source: "ifNotNil: aBlock ifNil: anotherBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^ anotherBlock value",
  6194. referencedClasses: [],
  6195. //>>excludeEnd("ide");
  6196. messageSends: ["value"]
  6197. }),
  6198. $globals.UndefinedObject);
  6199. $core.addMethod(
  6200. $core.method({
  6201. selector: "isImmutable",
  6202. protocol: "testing",
  6203. fn: function (){
  6204. var self=this,$self=this;
  6205. return true;
  6206. },
  6207. //>>excludeStart("ide", pragmas.excludeIdeData);
  6208. args: [],
  6209. source: "isImmutable\x0a\x09^ true",
  6210. referencedClasses: [],
  6211. //>>excludeEnd("ide");
  6212. messageSends: []
  6213. }),
  6214. $globals.UndefinedObject);
  6215. $core.addMethod(
  6216. $core.method({
  6217. selector: "isNil",
  6218. protocol: "testing",
  6219. fn: function (){
  6220. var self=this,$self=this;
  6221. return true;
  6222. },
  6223. //>>excludeStart("ide", pragmas.excludeIdeData);
  6224. args: [],
  6225. source: "isNil\x0a\x09^ true",
  6226. referencedClasses: [],
  6227. //>>excludeEnd("ide");
  6228. messageSends: []
  6229. }),
  6230. $globals.UndefinedObject);
  6231. $core.addMethod(
  6232. $core.method({
  6233. selector: "notNil",
  6234. protocol: "testing",
  6235. fn: function (){
  6236. var self=this,$self=this;
  6237. return false;
  6238. },
  6239. //>>excludeStart("ide", pragmas.excludeIdeData);
  6240. args: [],
  6241. source: "notNil\x0a\x09^ false",
  6242. referencedClasses: [],
  6243. //>>excludeEnd("ide");
  6244. messageSends: []
  6245. }),
  6246. $globals.UndefinedObject);
  6247. $core.addMethod(
  6248. $core.method({
  6249. selector: "printOn:",
  6250. protocol: "printing",
  6251. fn: function (aStream){
  6252. var self=this,$self=this;
  6253. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6254. return $core.withContext(function($ctx1) {
  6255. //>>excludeEnd("ctx");
  6256. $recv(aStream)._nextPutAll_("nil");
  6257. return self;
  6258. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6259. }, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},$globals.UndefinedObject)});
  6260. //>>excludeEnd("ctx");
  6261. },
  6262. //>>excludeStart("ide", pragmas.excludeIdeData);
  6263. args: ["aStream"],
  6264. source: "printOn: aStream\x0a\x09aStream nextPutAll: 'nil'",
  6265. referencedClasses: [],
  6266. //>>excludeEnd("ide");
  6267. messageSends: ["nextPutAll:"]
  6268. }),
  6269. $globals.UndefinedObject);
  6270. $core.addMethod(
  6271. $core.method({
  6272. selector: "shallowCopy",
  6273. protocol: "copying",
  6274. fn: function (){
  6275. var self=this,$self=this;
  6276. return self;
  6277. },
  6278. //>>excludeStart("ide", pragmas.excludeIdeData);
  6279. args: [],
  6280. source: "shallowCopy\x0a\x09^ self",
  6281. referencedClasses: [],
  6282. //>>excludeEnd("ide");
  6283. messageSends: []
  6284. }),
  6285. $globals.UndefinedObject);
  6286. $core.addMethod(
  6287. $core.method({
  6288. selector: "value",
  6289. protocol: "evaluating",
  6290. fn: function (){
  6291. var self=this,$self=this;
  6292. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6293. return $core.withContext(function($ctx1) {
  6294. //>>excludeEnd("ctx");
  6295. return null;
  6296. return self;
  6297. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6298. }, function($ctx1) {$ctx1.fill(self,"value",{},$globals.UndefinedObject)});
  6299. //>>excludeEnd("ctx");
  6300. },
  6301. //>>excludeStart("ide", pragmas.excludeIdeData);
  6302. args: [],
  6303. source: "value\x0a\x09<inlineJS: 'return null'>",
  6304. referencedClasses: [],
  6305. //>>excludeEnd("ide");
  6306. messageSends: []
  6307. }),
  6308. $globals.UndefinedObject);
  6309. $core.addMethod(
  6310. $core.method({
  6311. selector: "new",
  6312. protocol: "instance creation",
  6313. fn: function (){
  6314. var self=this,$self=this;
  6315. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6316. return $core.withContext(function($ctx1) {
  6317. //>>excludeEnd("ctx");
  6318. $self._error_("You cannot create new instances of UndefinedObject. Use nil");
  6319. return self;
  6320. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6321. }, function($ctx1) {$ctx1.fill(self,"new",{},$globals.UndefinedObject.a$cls)});
  6322. //>>excludeEnd("ctx");
  6323. },
  6324. //>>excludeStart("ide", pragmas.excludeIdeData);
  6325. args: [],
  6326. source: "new\x0a\x09\x09self error: 'You cannot create new instances of UndefinedObject. Use nil'",
  6327. referencedClasses: [],
  6328. //>>excludeEnd("ide");
  6329. messageSends: ["error:"]
  6330. }),
  6331. $globals.UndefinedObject.a$cls);
  6332. $core.setTraitComposition([{trait: $globals.TSubclassable}], $globals.UndefinedObject);
  6333. });