Kernel-Objects.js 193 KB

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