Kernel-Objects.js 193 KB

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