Kernel-Objects.js 191 KB

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