1
0

Kernel-Objects.js 228 KB

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