1
0

Kernel-Objects.js 169 KB

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