Kernel-Objects.js 170 KB

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