Kernel-Objects.js 169 KB

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