Kernel-Objects.js 193 KB

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