2
0

Kernel-Objects.js 168 KB

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