Kernel-Objects.js 159 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897
  1. smalltalk.addPackage('Kernel-Objects', {});
  2. smalltalk.addClass('Object', smalltalk.nil, [], 'Kernel-Objects');
  3. smalltalk.Object.comment=unescape('*Object%20is%20the%20root%20of%20the%20Smalltalk%20class%20system*.%20All%20classes%20in%20the%20system%20are%20subclasses%20of%20Object.%0A%0AObject%20provides%20default%20behavior%20common%20to%20all%20normal%20objects%2C%20such%20as%3A%20%0A%0A-%20access%0A-%20copying%0A-%20comparison%0A-%20error%20handling%0A-%20message%20sending%0A-%20reflection%0A%0AAlso%20utility%20messages%20that%20all%20objects%20should%20respond%20to%20are%20defined%20here.%0A%0AObject%20has%20no%20instance%20variable.%0A%0A%23%23Access%0A%0AInstance%20variables%20can%20be%20accessed%20with%20%60%23instVarAt%3A%60%20and%20%60%23instVarAt%3Aput%3A%60.%20%60Object%20%3E%3E%20instanceVariableNames%60%20answers%20a%20collection%20of%20all%20instance%20variable%20names.%0AAccessing%20JavaScript%20properties%20of%20an%20object%20is%20done%20through%20%60%23basicAt%3A%60%2C%20%60%23basicAt%3Aput%3A%60%20and%20%60basicDelete%3A%60.%0A%0A%23%23Copying%0A%0ACopying%20an%20object%20is%20handled%20by%20%60%23copy%60%20and%20%60%23deepCopy%60.%20The%20first%20one%20performs%20a%20shallow%20copy%20of%20the%20receiver%2C%20while%20the%20second%20one%20performs%20a%20deep%20copy.%0AThe%20hook%20method%20%60%23postCopy%60%20can%20be%20overriden%20in%20subclasses%20to%20copy%20fields%20as%20necessary%20to%20complete%20the%20full%20copy.%20It%20will%20be%20sent%20by%20the%20copy%20of%20the%20receiver.%0A%0A%23%23Comparison%0A%0AObjects%20understand%20equality%20%20%60%23%3D%60%20and%20identity%20%60%23%3D%3D%60%20comparison.%0A%0A%23%23Error%20handling%0A%0A-%20%60%23halt%60%20is%20the%20typical%20message%20to%20use%20for%20inserting%20breakpoints%20during%20debugging.%0A-%20%60%23error%3A%60%20throws%20a%20generic%20error%20exception%0A-%20%60%23doesNotUnderstand%3A%60%20handles%20the%20fact%20that%20there%20was%20an%20attempt%20to%20send%20the%20given%20message%20to%20the%20receiver%20but%20the%20receiver%20does%20not%20understand%20this%20message.%0A%20%20Overriding%20this%20message%20can%20be%20useful%20to%20implement%20proxies%20for%20example.')
  4. smalltalk.addMethod(
  5. unescape('__minus_gt'),
  6. smalltalk.method({
  7. selector: unescape('-%3E'),
  8. category: 'converting',
  9. fn: function (anObject) {
  10. var self = this;
  11. return smalltalk.send(smalltalk.Association || Association, "_key_value_", [self, anObject]);
  12. return self;
  13. },
  14. args: ["anObject"],
  15. source: unescape('-%3E%20anObject%0A%09%5EAssociation%20key%3A%20self%20value%3A%20anObject'),
  16. messageSends: ["key:value:"],
  17. referencedClasses: ["Association"]
  18. }),
  19. smalltalk.Object);
  20. smalltalk.addMethod(
  21. unescape('__eq'),
  22. smalltalk.method({
  23. selector: unescape('%3D'),
  24. category: 'comparing',
  25. fn: function (anObject) {
  26. var self = this;
  27. return smalltalk.send(self, "__eq_eq", [anObject]);
  28. return self;
  29. },
  30. args: ["anObject"],
  31. source: unescape('%3D%20anObject%0A%09%5Eself%20%3D%3D%20anObject'),
  32. messageSends: [unescape("%3D%3D")],
  33. referencedClasses: []
  34. }),
  35. smalltalk.Object);
  36. smalltalk.addMethod(
  37. unescape('__eq_eq'),
  38. smalltalk.method({
  39. selector: unescape('%3D%3D'),
  40. category: 'comparing',
  41. fn: function (anObject) {
  42. var self = this;
  43. return smalltalk.send(smalltalk.send(self, "_identityHash", []), "__eq", [smalltalk.send(anObject, "_identityHash", [])]);
  44. return self;
  45. },
  46. args: ["anObject"],
  47. source: unescape('%3D%3D%20anObject%0A%09%5Eself%20identityHash%20%3D%20anObject%20identityHash'),
  48. messageSends: [unescape("%3D"), "identityHash"],
  49. referencedClasses: []
  50. }),
  51. smalltalk.Object);
  52. smalltalk.addMethod(
  53. unescape('_asJSON'),
  54. smalltalk.method({
  55. selector: unescape('asJSON'),
  56. category: 'converting',
  57. fn: function (){
  58. var self=this;
  59. var variables=nil;
  60. (variables=smalltalk.send((smalltalk.HashedCollection || HashedCollection), "_new", []));
  61. smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_allInstanceVariableNames", []), "_do_", [(function(each){return smalltalk.send(variables, "_at_put_", [each, smalltalk.send(smalltalk.send(self, "_instVarAt_", [each]), "_asJSON", [])]);})]);
  62. return variables;
  63. return self;},
  64. args: [],
  65. source: unescape('asJSON%0A%09%7C%20variables%20%7C%0A%09variables%20%3A%3D%20HashedCollection%20new.%0A%09self%20class%20allInstanceVariableNames%20do%3A%20%5B%3Aeach%20%7C%0A%09%09variables%20at%3A%20each%20put%3A%20%28self%20instVarAt%3A%20each%29%20asJSON%5D.%0A%09%5Evariables'),
  66. messageSends: ["new", "do:", "allInstanceVariableNames", "class", "at:put:", "asJSON", "instVarAt:"],
  67. referencedClasses: ["HashedCollection"]
  68. }),
  69. smalltalk.Object);
  70. smalltalk.addMethod(
  71. unescape('_asJSONString'),
  72. smalltalk.method({
  73. selector: unescape('asJSONString'),
  74. category: 'converting',
  75. fn: function (){
  76. var self=this;
  77. return smalltalk.send((smalltalk.JSON || JSON), "_stringify_", [smalltalk.send(self, "_asJSON", [])]);
  78. return self;},
  79. args: [],
  80. source: unescape('asJSONString%0A%09%5EJSON%20stringify%3A%20self%20asJSON'),
  81. messageSends: ["stringify:", "asJSON"],
  82. referencedClasses: ["JSON"]
  83. }),
  84. smalltalk.Object);
  85. smalltalk.addMethod(
  86. unescape('_asJavascript'),
  87. smalltalk.method({
  88. selector: unescape('asJavascript'),
  89. category: 'converting',
  90. fn: function () {
  91. var self = this;
  92. return smalltalk.send(self, "_asString", []);
  93. return self;
  94. },
  95. args: [],
  96. source: unescape('asJavascript%0A%09%5Eself%20asString'),
  97. messageSends: ["asString"],
  98. referencedClasses: []
  99. }),
  100. smalltalk.Object);
  101. smalltalk.addMethod(
  102. unescape('_asString'),
  103. smalltalk.method({
  104. selector: unescape('asString'),
  105. category: 'converting',
  106. fn: function () {
  107. var self = this;
  108. return smalltalk.send(self, "_printString", []);
  109. return self;
  110. },
  111. args: [],
  112. source: unescape('asString%0A%09%5Eself%20printString'),
  113. messageSends: ["printString"],
  114. referencedClasses: []
  115. }),
  116. smalltalk.Object);
  117. smalltalk.addMethod(
  118. unescape('_basicAt_'),
  119. smalltalk.method({
  120. selector: unescape('basicAt%3A'),
  121. category: 'accessing',
  122. fn: function (aString) {
  123. var self = this;
  124. return self[aString];
  125. return self;
  126. },
  127. args: ["aString"],
  128. source: unescape('basicAt%3A%20aString%0A%09%3Creturn%20self%5BaString%5D%3E'),
  129. messageSends: [],
  130. referencedClasses: []
  131. }),
  132. smalltalk.Object);
  133. smalltalk.addMethod(
  134. unescape('_basicAt_put_'),
  135. smalltalk.method({
  136. selector: unescape('basicAt%3Aput%3A'),
  137. category: 'accessing',
  138. fn: function (aString, anObject) {
  139. var self = this;
  140. return self[aString] = anObject;
  141. return self;
  142. },
  143. args: ["aString", "anObject"],
  144. source: unescape('basicAt%3A%20aString%20put%3A%20anObject%0A%09%3Creturn%20self%5BaString%5D%20%3D%20anObject%3E'),
  145. messageSends: [],
  146. referencedClasses: []
  147. }),
  148. smalltalk.Object);
  149. smalltalk.addMethod(
  150. unescape('_basicDelete_'),
  151. smalltalk.method({
  152. selector: unescape('basicDelete%3A'),
  153. category: 'accessing',
  154. fn: function (aString) {
  155. var self = this;
  156. delete self[aString];
  157. return aString;
  158. return self;
  159. },
  160. args: ["aString"],
  161. source: unescape('basicDelete%3A%20aString%0A%20%20%20%20%3Cdelete%20self%5BaString%5D%3B%20return%20aString%3E'),
  162. messageSends: [],
  163. referencedClasses: []
  164. }),
  165. smalltalk.Object);
  166. smalltalk.addMethod(
  167. unescape('_basicPerform_'),
  168. smalltalk.method({
  169. selector: unescape('basicPerform%3A'),
  170. category: 'message handling',
  171. fn: function (aSymbol) {
  172. var self = this;
  173. return smalltalk.send(self, "_basicPerform_withArguments_", [aSymbol, []]);
  174. return self;
  175. },
  176. args: ["aSymbol"],
  177. source: unescape('basicPerform%3A%20aSymbol%20%0A%09%5Eself%20basicPerform%3A%20aSymbol%20withArguments%3A%20%23%28%29'),
  178. messageSends: ["basicPerform:withArguments:"],
  179. referencedClasses: []
  180. }),
  181. smalltalk.Object);
  182. smalltalk.addMethod(
  183. unescape('_basicPerform_withArguments_'),
  184. smalltalk.method({
  185. selector: unescape('basicPerform%3AwithArguments%3A'),
  186. category: 'message handling',
  187. fn: function (aSymbol, aCollection) {
  188. var self = this;
  189. return self[aSymbol].apply(self, aCollection);
  190. return self;
  191. },
  192. args: ["aSymbol", "aCollection"],
  193. source: unescape('basicPerform%3A%20aSymbol%20withArguments%3A%20aCollection%0A%09%3Creturn%20self%5BaSymbol%5D.apply%28self%2C%20aCollection%29%3B%3E'),
  194. messageSends: [],
  195. referencedClasses: []
  196. }),
  197. smalltalk.Object);
  198. smalltalk.addMethod(
  199. unescape('_class'),
  200. smalltalk.method({
  201. selector: unescape('class'),
  202. category: 'accessing',
  203. fn: function () {
  204. var self = this;
  205. return self.klass;
  206. return self;
  207. },
  208. args: [],
  209. source: unescape('class%0A%09%3Creturn%20self.klass%3E'),
  210. messageSends: [],
  211. referencedClasses: []
  212. }),
  213. smalltalk.Object);
  214. smalltalk.addMethod(
  215. unescape('_copy'),
  216. smalltalk.method({
  217. selector: unescape('copy'),
  218. category: 'copying',
  219. fn: function () {
  220. var self = this;
  221. return smalltalk.send(smalltalk.send(self, "_shallowCopy", []), "_postCopy", []);
  222. return self;
  223. },
  224. args: [],
  225. source: unescape('copy%0A%09%5Eself%20shallowCopy%20postCopy'),
  226. messageSends: ["postCopy", "shallowCopy"],
  227. referencedClasses: []
  228. }),
  229. smalltalk.Object);
  230. smalltalk.addMethod(
  231. unescape('_deepCopy'),
  232. smalltalk.method({
  233. selector: unescape('deepCopy'),
  234. category: 'copying',
  235. fn: function () {
  236. var self = this;
  237. var copy = self.klass._new();
  238. for (var i in self) {
  239. if (/^@.+/.test(i)) {
  240. copy[i] = self[i]._deepCopy();
  241. }
  242. }
  243. return copy;
  244. return self;
  245. },
  246. args: [],
  247. source: unescape('deepCopy%0A%09%3C%20%20%20%20%0A%09%20%20%20%20var%20copy%20%3D%20self.klass._new%28%29%3B%0A%09%20%20%20%20for%28var%20i%20in%20self%29%20%7B%0A%09%09if%28/%5E@.+/.test%28i%29%29%20%7B%0A%09%09%20%20%20%20copy%5Bi%5D%20%3D%20self%5Bi%5D._deepCopy%28%29%3B%0A%09%09%7D%0A%09%20%20%20%20%7D%0A%09%20%20%20%20return%20copy%3B%0A%09%3E'),
  248. messageSends: [],
  249. referencedClasses: []
  250. }),
  251. smalltalk.Object);
  252. smalltalk.addMethod(
  253. unescape('_deprecatedAPI'),
  254. smalltalk.method({
  255. selector: unescape('deprecatedAPI'),
  256. category: 'error handling',
  257. fn: function () {
  258. var self = this;
  259. smalltalk.send(typeof console == "undefined" ? nil : console, "_warn_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.getThisContext(), "_home", []), "_asString", []), "__comma", [unescape("%20is%20deprecated%21%20%28in%20")]), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.getThisContext(), "_home", []), "_home", []), "_asString", [])]), "__comma", [unescape("%29")])]);
  260. return self;
  261. },
  262. args: [],
  263. source: unescape('deprecatedAPI%0A%09%22Just%20a%20simple%20way%20to%20deprecate%20methods.%0A%09%23deprecatedAPI%20is%20in%20the%20%27error%20handling%27%20protocol%20even%20if%20it%20doesn%27t%20throw%20an%20error%2C%0A%09but%20it%20could%20in%20the%20future.%22%0A%09console%20warn%3A%20thisContext%20home%20asString%2C%20%27%20is%20deprecated%21%20%28in%20%27%2C%20thisContext%20home%20home%20asString%2C%20%27%29%27'),
  264. messageSends: ["warn:", unescape("%2C"), "asString", "home"],
  265. referencedClasses: []
  266. }),
  267. smalltalk.Object);
  268. smalltalk.addMethod(
  269. unescape('_doesNotUnderstand_'),
  270. smalltalk.method({
  271. selector: unescape('doesNotUnderstand%3A'),
  272. category: 'error handling',
  273. fn: function (aMessage) {
  274. var self = this;
  275. (function ($rec) {smalltalk.send($rec, "_receiver_", [self]);smalltalk.send($rec, "_message_", [aMessage]);return smalltalk.send($rec, "_signal", []);}(smalltalk.send(smalltalk.MessageNotUnderstood || MessageNotUnderstood, "_new", [])));
  276. return self;
  277. },
  278. args: ["aMessage"],
  279. source: unescape('doesNotUnderstand%3A%20aMessage%0A%09MessageNotUnderstood%20new%0A%09%09receiver%3A%20self%3B%0A%09%09message%3A%20aMessage%3B%0A%09%09signal'),
  280. messageSends: ["receiver:", "message:", "signal", "new"],
  281. referencedClasses: ["MessageNotUnderstood"]
  282. }),
  283. smalltalk.Object);
  284. smalltalk.addMethod(
  285. unescape('_error_'),
  286. smalltalk.method({
  287. selector: unescape('error%3A'),
  288. category: 'error handling',
  289. fn: function (aString) {
  290. var self = this;
  291. smalltalk.send(smalltalk.Error || Error, "_signal_", [aString]);
  292. return self;
  293. },
  294. args: ["aString"],
  295. source: unescape('error%3A%20aString%0A%09Error%20signal%3A%20aString'),
  296. messageSends: ["signal:"],
  297. referencedClasses: ["Error"]
  298. }),
  299. smalltalk.Object);
  300. smalltalk.addMethod(
  301. unescape('_halt'),
  302. smalltalk.method({
  303. selector: unescape('halt'),
  304. category: 'error handling',
  305. fn: function () {
  306. var self = this;
  307. smalltalk.send(self, "_error_", ["Halt encountered"]);
  308. return self;
  309. },
  310. args: [],
  311. source: unescape('halt%0A%09self%20error%3A%20%27Halt%20encountered%27'),
  312. messageSends: ["error:"],
  313. referencedClasses: []
  314. }),
  315. smalltalk.Object);
  316. smalltalk.addMethod(
  317. unescape('_identityHash'),
  318. smalltalk.method({
  319. selector: unescape('identityHash'),
  320. category: 'accessing',
  321. fn: function () {
  322. var self = this;
  323. return self.identityHash || (self.identityHash = smalltalk.nextId());
  324. return self;
  325. },
  326. args: [],
  327. source: unescape('identityHash%0A%09%3Creturn%20self.identityHash%20%7C%7C%20%28self.identityHash%20%3D%20smalltalk.nextId%28%29%29%3B%3E'),
  328. messageSends: [],
  329. referencedClasses: []
  330. }),
  331. smalltalk.Object);
  332. smalltalk.addMethod(
  333. unescape('_ifNil_'),
  334. smalltalk.method({
  335. selector: unescape('ifNil%3A'),
  336. category: 'testing',
  337. fn: function (aBlock) {
  338. var self = this;
  339. return self;
  340. return self;
  341. },
  342. args: ["aBlock"],
  343. source: unescape('ifNil%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5Eself'),
  344. messageSends: [],
  345. referencedClasses: []
  346. }),
  347. smalltalk.Object);
  348. smalltalk.addMethod(
  349. unescape('_ifNil_ifNotNil_'),
  350. smalltalk.method({
  351. selector: unescape('ifNil%3AifNotNil%3A'),
  352. category: 'testing',
  353. fn: function (aBlock, anotherBlock) {
  354. var self = this;
  355. return smalltalk.send(anotherBlock, "_value", []);
  356. return self;
  357. },
  358. args: ["aBlock", "anotherBlock"],
  359. source: unescape('ifNil%3A%20aBlock%20ifNotNil%3A%20anotherBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5EanotherBlock%20value'),
  360. messageSends: ["value"],
  361. referencedClasses: []
  362. }),
  363. smalltalk.Object);
  364. smalltalk.addMethod(
  365. unescape('_ifNotNil_'),
  366. smalltalk.method({
  367. selector: unescape('ifNotNil%3A'),
  368. category: 'testing',
  369. fn: function (aBlock) {
  370. var self = this;
  371. return smalltalk.send(aBlock, "_value", []);
  372. return self;
  373. },
  374. args: ["aBlock"],
  375. source: unescape('ifNotNil%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5EaBlock%20value'),
  376. messageSends: ["value"],
  377. referencedClasses: []
  378. }),
  379. smalltalk.Object);
  380. smalltalk.addMethod(
  381. unescape('_ifNotNil_ifNil_'),
  382. smalltalk.method({
  383. selector: unescape('ifNotNil%3AifNil%3A'),
  384. category: 'testing',
  385. fn: function (aBlock, anotherBlock) {
  386. var self = this;
  387. return smalltalk.send(aBlock, "_value", []);
  388. return self;
  389. },
  390. args: ["aBlock", "anotherBlock"],
  391. source: unescape('ifNotNil%3A%20aBlock%20ifNil%3A%20anotherBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5EaBlock%20value'),
  392. messageSends: ["value"],
  393. referencedClasses: []
  394. }),
  395. smalltalk.Object);
  396. smalltalk.addMethod(
  397. unescape('_initialize'),
  398. smalltalk.method({
  399. selector: unescape('initialize'),
  400. category: 'initialization',
  401. fn: function () {
  402. var self = this;
  403. return self;
  404. },
  405. args: [],
  406. source: unescape('initialize'),
  407. messageSends: [],
  408. referencedClasses: []
  409. }),
  410. smalltalk.Object);
  411. smalltalk.addMethod(
  412. unescape('_instVarAt_'),
  413. smalltalk.method({
  414. selector: unescape('instVarAt%3A'),
  415. category: 'accessing',
  416. fn: function (aSymbol) {
  417. var self = this;
  418. var varname = nil;
  419. varname = smalltalk.send(aSymbol, "_asString", []);
  420. return self["@" + varname];
  421. return self;
  422. },
  423. args: ["aSymbol"],
  424. source: unescape('instVarAt%3A%20aSymbol%0A%09%7C%20varname%20%7C%0A%09varname%20%3A%3D%20aSymbol%20asString.%0A%09%3Creturn%20self%5B%27@%27+varname%5D%3E'),
  425. messageSends: ["asString"],
  426. referencedClasses: []
  427. }),
  428. smalltalk.Object);
  429. smalltalk.addMethod(
  430. unescape('_instVarAt_put_'),
  431. smalltalk.method({
  432. selector: unescape('instVarAt%3Aput%3A'),
  433. category: 'accessing',
  434. fn: function (aSymbol, anObject) {
  435. var self = this;
  436. var varname = nil;
  437. varname = smalltalk.send(aSymbol, "_asString", []);
  438. self["@" + varname] = anObject;
  439. return self;
  440. },
  441. args: ["aSymbol", "anObject"],
  442. source: unescape('instVarAt%3A%20aSymbol%20put%3A%20anObject%0A%09%7C%20varname%20%7C%0A%09varname%20%3A%3D%20aSymbol%20asString.%0A%09%3Cself%5B%27@%27%20+%20varname%5D%20%3D%20anObject%3E'),
  443. messageSends: ["asString"],
  444. referencedClasses: []
  445. }),
  446. smalltalk.Object);
  447. smalltalk.addMethod(
  448. unescape('_isClass'),
  449. smalltalk.method({
  450. selector: unescape('isClass'),
  451. category: 'testing',
  452. fn: function () {
  453. var self = this;
  454. return false;
  455. return self;
  456. },
  457. args: [],
  458. source: unescape('isClass%0A%09%5Efalse'),
  459. messageSends: [],
  460. referencedClasses: []
  461. }),
  462. smalltalk.Object);
  463. smalltalk.addMethod(
  464. unescape('_isKindOf_'),
  465. smalltalk.method({
  466. selector: unescape('isKindOf%3A'),
  467. category: 'testing',
  468. fn: function (aClass) {
  469. var self = this;
  470. return ($receiver = smalltalk.send(self, "_isMemberOf_", [aClass])).klass === smalltalk.Boolean ? $receiver ? function () {return true;}() : function () {return smalltalk.send(smalltalk.send(self, "_class", []), "_inheritsFrom_", [aClass]);}() : smalltalk.send($receiver, "_ifTrue_ifFalse_", [function () {return true;}, function () {return smalltalk.send(smalltalk.send(self, "_class", []), "_inheritsFrom_", [aClass]);}]);
  471. return self;
  472. },
  473. args: ["aClass"],
  474. source: unescape('isKindOf%3A%20aClass%0A%09%5E%28self%20isMemberOf%3A%20aClass%29%0A%09%20%20%20%20ifTrue%3A%20%5Btrue%5D%0A%09%20%20%20%20ifFalse%3A%20%5Bself%20class%20inheritsFrom%3A%20aClass%5D'),
  475. messageSends: ["ifTrue:ifFalse:", "isMemberOf:", "inheritsFrom:", "class"],
  476. referencedClasses: []
  477. }),
  478. smalltalk.Object);
  479. smalltalk.addMethod(
  480. unescape('_isMemberOf_'),
  481. smalltalk.method({
  482. selector: unescape('isMemberOf%3A'),
  483. category: 'testing',
  484. fn: function (aClass) {
  485. var self = this;
  486. return smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [aClass]);
  487. return self;
  488. },
  489. args: ["aClass"],
  490. source: unescape('isMemberOf%3A%20aClass%0A%09%5Eself%20class%20%3D%20aClass'),
  491. messageSends: [unescape("%3D"), "class"],
  492. referencedClasses: []
  493. }),
  494. smalltalk.Object);
  495. smalltalk.addMethod(
  496. unescape('_isMetaclass'),
  497. smalltalk.method({
  498. selector: unescape('isMetaclass'),
  499. category: 'testing',
  500. fn: function () {
  501. var self = this;
  502. return false;
  503. return self;
  504. },
  505. args: [],
  506. source: unescape('isMetaclass%0A%09%5Efalse'),
  507. messageSends: [],
  508. referencedClasses: []
  509. }),
  510. smalltalk.Object);
  511. smalltalk.addMethod(
  512. unescape('_isNil'),
  513. smalltalk.method({
  514. selector: unescape('isNil'),
  515. category: 'testing',
  516. fn: function () {
  517. var self = this;
  518. return false;
  519. return self;
  520. },
  521. args: [],
  522. source: unescape('isNil%0A%09%5Efalse'),
  523. messageSends: [],
  524. referencedClasses: []
  525. }),
  526. smalltalk.Object);
  527. smalltalk.addMethod(
  528. unescape('_isNumber'),
  529. smalltalk.method({
  530. selector: unescape('isNumber'),
  531. category: 'testing',
  532. fn: function () {
  533. var self = this;
  534. return false;
  535. return self;
  536. },
  537. args: [],
  538. source: unescape('isNumber%0A%09%5Efalse'),
  539. messageSends: [],
  540. referencedClasses: []
  541. }),
  542. smalltalk.Object);
  543. smalltalk.addMethod(
  544. unescape('_isParseFailure'),
  545. smalltalk.method({
  546. selector: unescape('isParseFailure'),
  547. category: 'testing',
  548. fn: function () {
  549. var self = this;
  550. return false;
  551. return self;
  552. },
  553. args: [],
  554. source: unescape('isParseFailure%0A%09%5Efalse'),
  555. messageSends: [],
  556. referencedClasses: []
  557. }),
  558. smalltalk.Object);
  559. smalltalk.addMethod(
  560. unescape('_isString'),
  561. smalltalk.method({
  562. selector: unescape('isString'),
  563. category: 'testing',
  564. fn: function () {
  565. var self = this;
  566. return false;
  567. return self;
  568. },
  569. args: [],
  570. source: unescape('isString%0A%09%5Efalse'),
  571. messageSends: [],
  572. referencedClasses: []
  573. }),
  574. smalltalk.Object);
  575. smalltalk.addMethod(
  576. unescape('_isSymbol'),
  577. smalltalk.method({
  578. selector: unescape('isSymbol'),
  579. category: 'testing',
  580. fn: function () {
  581. var self = this;
  582. return false;
  583. return self;
  584. },
  585. args: [],
  586. source: unescape('isSymbol%0A%09%5Efalse'),
  587. messageSends: [],
  588. referencedClasses: []
  589. }),
  590. smalltalk.Object);
  591. smalltalk.addMethod(
  592. unescape('_log_block_'),
  593. smalltalk.method({
  594. selector: unescape('log%3Ablock%3A'),
  595. category: 'printing',
  596. fn: function (aString, aBlock) {
  597. var self = this;
  598. var result = nil;
  599. smalltalk.send(typeof console == "undefined" ? nil : console, "_log_", [smalltalk.send(smalltalk.send(aString, "__comma", [" time: "]), "__comma", [smalltalk.send(smalltalk.send(smalltalk.Date || Date, "_millisecondsToRun_", [function () {return result = smalltalk.send(aBlock, "_value", []);}]), "_printString", [])])]);
  600. return result;
  601. return self;
  602. },
  603. args: ["aString", "aBlock"],
  604. source: unescape('log%3A%20aString%20block%3A%20aBlock%0A%0A%09%7C%20result%20%7C%0A%09console%20log%3A%20%20aString%2C%20%20%27%20time%3A%20%27%2C%20%28Date%20millisecondsToRun%3A%20%5Bresult%20%3A%3D%20aBlock%20value%5D%29%20printString.%0A%09%5Eresult'),
  605. messageSends: ["log:", unescape("%2C"), "printString", "millisecondsToRun:", "value"],
  606. referencedClasses: ["Date"]
  607. }),
  608. smalltalk.Object);
  609. smalltalk.addMethod(
  610. unescape('_notNil'),
  611. smalltalk.method({
  612. selector: unescape('notNil'),
  613. category: 'testing',
  614. fn: function () {
  615. var self = this;
  616. return smalltalk.send(smalltalk.send(self, "_isNil", []), "_not", []);
  617. return self;
  618. },
  619. args: [],
  620. source: unescape('notNil%0A%09%5Eself%20isNil%20not'),
  621. messageSends: ["not", "isNil"],
  622. referencedClasses: []
  623. }),
  624. smalltalk.Object);
  625. smalltalk.addMethod(
  626. unescape('_perform_'),
  627. smalltalk.method({
  628. selector: unescape('perform%3A'),
  629. category: 'message handling',
  630. fn: function (aSymbol) {
  631. var self = this;
  632. return smalltalk.send(self, "_perform_withArguments_", [aSymbol, []]);
  633. return self;
  634. },
  635. args: ["aSymbol"],
  636. source: unescape('perform%3A%20aSymbol%0A%09%5Eself%20perform%3A%20aSymbol%20withArguments%3A%20%23%28%29'),
  637. messageSends: ["perform:withArguments:"],
  638. referencedClasses: []
  639. }),
  640. smalltalk.Object);
  641. smalltalk.addMethod(
  642. unescape('_perform_withArguments_'),
  643. smalltalk.method({
  644. selector: unescape('perform%3AwithArguments%3A'),
  645. category: 'message handling',
  646. fn: function (aSymbol, aCollection) {
  647. var self = this;
  648. return smalltalk.send(self, "_basicPerform_withArguments_", [smalltalk.send(aSymbol, "_asSelector", []), aCollection]);
  649. return self;
  650. },
  651. args: ["aSymbol", "aCollection"],
  652. source: unescape('perform%3A%20aSymbol%20withArguments%3A%20aCollection%0A%09%5Eself%20basicPerform%3A%20aSymbol%20asSelector%20withArguments%3A%20aCollection'),
  653. messageSends: ["basicPerform:withArguments:", "asSelector"],
  654. referencedClasses: []
  655. }),
  656. smalltalk.Object);
  657. smalltalk.addMethod(
  658. unescape('_postCopy'),
  659. smalltalk.method({
  660. selector: unescape('postCopy'),
  661. category: 'copying',
  662. fn: function () {
  663. var self = this;
  664. return self;
  665. },
  666. args: [],
  667. source: unescape('postCopy'),
  668. messageSends: [],
  669. referencedClasses: []
  670. }),
  671. smalltalk.Object);
  672. smalltalk.addMethod(
  673. unescape('_printNl'),
  674. smalltalk.method({
  675. selector: unescape('printNl'),
  676. category: 'printing',
  677. fn: function () {
  678. var self = this;
  679. console.log(self);
  680. return self;
  681. },
  682. args: [],
  683. source: unescape('printNl%0A%09%3Cconsole.log%28self%29%3E'),
  684. messageSends: [],
  685. referencedClasses: []
  686. }),
  687. smalltalk.Object);
  688. smalltalk.addMethod(
  689. unescape('_printString'),
  690. smalltalk.method({
  691. selector: unescape('printString'),
  692. category: 'printing',
  693. fn: function () {
  694. var self = this;
  695. return smalltalk.send("a ", "__comma", [smalltalk.send(smalltalk.send(self, "_class", []), "_name", [])]);
  696. return self;
  697. },
  698. args: [],
  699. source: unescape('printString%0A%09%5E%27a%20%27%2C%20self%20class%20name'),
  700. messageSends: [unescape("%2C"), "name", "class"],
  701. referencedClasses: []
  702. }),
  703. smalltalk.Object);
  704. smalltalk.addMethod(
  705. unescape('_shallowCopy'),
  706. smalltalk.method({
  707. selector: unescape('shallowCopy'),
  708. category: 'copying',
  709. fn: function () {
  710. var self = this;
  711. var copy = self.klass._new();
  712. for (var i in self) {
  713. if (/^@.+/.test(i)) {
  714. copy[i] = self[i];
  715. }
  716. }
  717. return copy;
  718. return self;
  719. },
  720. args: [],
  721. source: unescape('shallowCopy%0A%09%3C%0A%09%20%20%20%20var%20copy%20%3D%20self.klass._new%28%29%3B%0A%09%20%20%20%20for%28var%20i%20in%20self%29%20%7B%0A%09%09if%28/%5E@.+/.test%28i%29%29%20%7B%0A%09%09%20%20%20%20copy%5Bi%5D%20%3D%20self%5Bi%5D%3B%0A%09%09%7D%0A%09%20%20%20%20%7D%0A%09%20%20%20%20return%20copy%3B%0A%09%3E'),
  722. messageSends: [],
  723. referencedClasses: []
  724. }),
  725. smalltalk.Object);
  726. smalltalk.addMethod(
  727. unescape('_shouldNotImplement'),
  728. smalltalk.method({
  729. selector: unescape('shouldNotImplement'),
  730. category: 'error handling',
  731. fn: function () {
  732. var self = this;
  733. smalltalk.send(self, "_error_", [smalltalk.send("This method should not be implemented in ", "__comma", [smalltalk.send(smalltalk.send(self, "_class", []), "_name", [])])]);
  734. return self;
  735. },
  736. args: [],
  737. source: unescape('shouldNotImplement%0A%09self%20error%3A%20%27This%20method%20should%20not%20be%20implemented%20in%20%27%2C%20self%20class%20name'),
  738. messageSends: ["error:", unescape("%2C"), "name", "class"],
  739. referencedClasses: []
  740. }),
  741. smalltalk.Object);
  742. smalltalk.addMethod(
  743. unescape('_size'),
  744. smalltalk.method({
  745. selector: unescape('size'),
  746. category: 'accessing',
  747. fn: function () {
  748. var self = this;
  749. smalltalk.send(self, "_error_", ["Object not indexable"]);
  750. return self;
  751. },
  752. args: [],
  753. source: unescape('size%0A%09self%20error%3A%20%27Object%20not%20indexable%27'),
  754. messageSends: ["error:"],
  755. referencedClasses: []
  756. }),
  757. smalltalk.Object);
  758. smalltalk.addMethod(
  759. unescape('_storeOn_'),
  760. smalltalk.method({
  761. selector: unescape('storeOn%3A'),
  762. category: 'printing',
  763. fn: function (aStream) {
  764. var self = this;
  765. smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(self, "_printString", [])]);
  766. return self;
  767. },
  768. args: ["aStream"],
  769. source: unescape('storeOn%3A%20aStream%0A%09aStream%20nextPutAll%3A%20self%20printString'),
  770. messageSends: ["nextPutAll:", "printString"],
  771. referencedClasses: []
  772. }),
  773. smalltalk.Object);
  774. smalltalk.addMethod(
  775. unescape('_storeString'),
  776. smalltalk.method({
  777. selector: unescape('storeString'),
  778. category: 'printing',
  779. fn: function () {
  780. var self = this;
  781. return smalltalk.send(smalltalk.String || String, "_streamContents_", [function (s) {return smalltalk.send(self, "_storeOn_", [s]);}]);
  782. return self;
  783. },
  784. args: [],
  785. source: unescape('storeString%0A%09%22Answer%20a%20String%20representation%20of%20the%20receiver%20from%20which%20the%20receiver%20%0A%09can%20be%20reconstructed.%22%0A%0A%09%5E%20String%20streamContents%3A%20%5B%3As%20%7C%20self%20storeOn%3A%20s%5D'),
  786. messageSends: ["streamContents:", "storeOn:"],
  787. referencedClasses: ["String"]
  788. }),
  789. smalltalk.Object);
  790. smalltalk.addMethod(
  791. unescape('_subclassResponsibility'),
  792. smalltalk.method({
  793. selector: unescape('subclassResponsibility'),
  794. category: 'error handling',
  795. fn: function () {
  796. var self = this;
  797. smalltalk.send(self, "_error_", ["This method is a responsibility of a subclass"]);
  798. return self;
  799. },
  800. args: [],
  801. source: unescape('subclassResponsibility%0A%09self%20error%3A%20%27This%20method%20is%20a%20responsibility%20of%20a%20subclass%27'),
  802. messageSends: ["error:"],
  803. referencedClasses: []
  804. }),
  805. smalltalk.Object);
  806. smalltalk.addMethod(
  807. unescape('_try_catch_'),
  808. smalltalk.method({
  809. selector: unescape('try%3Acatch%3A'),
  810. category: 'error handling',
  811. fn: function (aBlock, anotherBlock) {
  812. var self = this;
  813. try {
  814. result = aBlock();
  815. } catch (e) {
  816. result = anotherBlock(e);
  817. }
  818. return result;
  819. return self;
  820. },
  821. args: ["aBlock", "anotherBlock"],
  822. source: unescape('try%3A%20aBlock%20catch%3A%20anotherBlock%0A%09%3Ctry%7Bresult%20%3D%20aBlock%28%29%7D%20catch%28e%29%20%7Bresult%20%3D%20anotherBlock%28e%29%7D%3B%0A%09return%20result%3B%3E'),
  823. messageSends: [],
  824. referencedClasses: []
  825. }),
  826. smalltalk.Object);
  827. smalltalk.addMethod(
  828. unescape('_yourself'),
  829. smalltalk.method({
  830. selector: unescape('yourself'),
  831. category: 'accessing',
  832. fn: function () {
  833. var self = this;
  834. return self;
  835. return self;
  836. },
  837. args: [],
  838. source: unescape('yourself%0A%09%5Eself'),
  839. messageSends: [],
  840. referencedClasses: []
  841. }),
  842. smalltalk.Object);
  843. smalltalk.addMethod(
  844. unescape('_%7E_eq'),
  845. smalltalk.method({
  846. selector: unescape('%7E%3D'),
  847. category: 'comparing',
  848. fn: function (anObject) {
  849. var self = this;
  850. return smalltalk.send(smalltalk.send(self, "__eq", [anObject]), "__eq", [false]);
  851. return self;
  852. },
  853. args: ["anObject"],
  854. source: unescape('%7E%3D%20anObject%0A%09%5E%28self%20%3D%20anObject%29%20%3D%20false'),
  855. messageSends: [unescape("%3D")],
  856. referencedClasses: []
  857. }),
  858. smalltalk.Object);
  859. smalltalk.addMethod(
  860. unescape('_%7E%7E'),
  861. smalltalk.method({
  862. selector: unescape('%7E%7E'),
  863. category: 'comparing',
  864. fn: function (anObject) {
  865. var self = this;
  866. return smalltalk.send(smalltalk.send(self, "__eq_eq", [anObject]), "__eq", [false]);
  867. return self;
  868. },
  869. args: ["anObject"],
  870. source: unescape('%7E%7E%20anObject%0A%09%5E%28self%20%3D%3D%20anObject%29%20%3D%20false'),
  871. messageSends: [unescape("%3D"), unescape("%3D%3D")],
  872. referencedClasses: []
  873. }),
  874. smalltalk.Object);
  875. smalltalk.addMethod(
  876. unescape('_initialize'),
  877. smalltalk.method({
  878. selector: unescape('initialize'),
  879. category: 'initialization',
  880. fn: function () {
  881. var self = this;
  882. return self;
  883. },
  884. args: [],
  885. source: unescape('initialize%0A%09%22no%20op%22'),
  886. messageSends: [],
  887. referencedClasses: []
  888. }),
  889. smalltalk.Object.klass);
  890. smalltalk.addClass('Boolean', smalltalk.Object, [], 'Kernel-Objects');
  891. smalltalk.Boolean.comment=unescape('Boolean%20wraps%20the%20JavaScript%20%60Boolean%28%29%60%20constructor.%20The%20%60true%60%20and%20%60false%60%20objects%20are%20the%20JavaScript%20boolean%20objects.%0A%0ABoolean%20defines%20the%20protocol%20for%20logic%20testing%20operations%20and%20conditional%20control%20structures%20for%20the%20logical%20values.%0ABoolean%20instances%20are%20weither%20%60true%60%20or%20%60false%60.')
  892. smalltalk.addMethod(
  893. unescape('_%26'),
  894. smalltalk.method({
  895. selector: unescape('%26'),
  896. category: 'controlling',
  897. fn: function (aBoolean) {
  898. var self = this;
  899. if (self == true) {
  900. return aBoolean;
  901. } else {
  902. return false;
  903. }
  904. return self;
  905. },
  906. args: ["aBoolean"],
  907. source: unescape('%26%20aBoolean%0A%09%3C%0A%09%20%20%20%20if%28self%20%3D%3D%20true%29%20%7B%0A%09%09return%20aBoolean%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20false%3B%0A%09%20%20%20%20%7D%0A%09%3E'),
  908. messageSends: [],
  909. referencedClasses: []
  910. }),
  911. smalltalk.Boolean);
  912. smalltalk.addMethod(
  913. unescape('__eq'),
  914. smalltalk.method({
  915. selector: unescape('%3D'),
  916. category: 'comparing',
  917. fn: function (aBoolean) {
  918. var self = this;
  919. try {
  920. ($receiver = smalltalk.send(smalltalk.send(aBoolean, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean ? !$receiver ? function () {return function () {throw {name: "stReturn", selector: "__eq", fn: function () {return false;}};}();}() : nil : smalltalk.send($receiver, "_ifFalse_", [function () {return function () {throw {name: "stReturn", selector: "__eq", fn: function () {return false;}};}();}]);
  921. return Boolean(self == true) == aBoolean;
  922. return self;
  923. } catch (e) {
  924. if (e.name === "stReturn" && e.selector === "__eq") {
  925. return e.fn();
  926. }
  927. throw e;
  928. }
  929. },
  930. args: ["aBoolean"],
  931. source: unescape('%3D%20aBoolean%0A%09aBoolean%20class%20%3D%20self%20class%20ifFalse%3A%20%5B%5Efalse%5D.%0A%09%3Creturn%20Boolean%28self%20%3D%3D%20true%29%20%3D%3D%20aBoolean%3E'),
  932. messageSends: ["ifFalse:", unescape("%3D"), "class"],
  933. referencedClasses: []
  934. }),
  935. smalltalk.Boolean);
  936. smalltalk.addMethod(
  937. unescape('_and_'),
  938. smalltalk.method({
  939. selector: unescape('and%3A'),
  940. category: 'controlling',
  941. fn: function (aBlock) {
  942. var self = this;
  943. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [aBlock, function () {return false;}]);
  944. return self;
  945. },
  946. args: ["aBlock"],
  947. source: unescape('and%3A%20aBlock%0A%09%5Eself%20%3D%20true%0A%09%20%20%20%20ifTrue%3A%20aBlock%0A%09%20%20%20%20ifFalse%3A%20%5Bfalse%5D'),
  948. messageSends: ["ifTrue:ifFalse:", unescape("%3D")],
  949. referencedClasses: []
  950. }),
  951. smalltalk.Boolean);
  952. smalltalk.addMethod(
  953. unescape('_asJSON'),
  954. smalltalk.method({
  955. selector: unescape('asJSON'),
  956. category: 'converting',
  957. fn: function (){
  958. var self=this;
  959. return self;
  960. return self;},
  961. args: [],
  962. source: unescape('asJSON%0A%09%5Eself'),
  963. messageSends: [],
  964. referencedClasses: []
  965. }),
  966. smalltalk.Boolean);
  967. smalltalk.addMethod(
  968. unescape('_deepCopy'),
  969. smalltalk.method({
  970. selector: unescape('deepCopy'),
  971. category: 'copying',
  972. fn: function () {
  973. var self = this;
  974. return self;
  975. return self;
  976. },
  977. args: [],
  978. source: unescape('deepCopy%0A%09%5Eself'),
  979. messageSends: [],
  980. referencedClasses: []
  981. }),
  982. smalltalk.Boolean);
  983. smalltalk.addMethod(
  984. unescape('_ifFalse_'),
  985. smalltalk.method({
  986. selector: unescape('ifFalse%3A'),
  987. category: 'controlling',
  988. fn: function (aBlock) {
  989. var self = this;
  990. return smalltalk.send(self, "_ifTrue_ifFalse_", [function () {return nil;}, aBlock]);
  991. return self;
  992. },
  993. args: ["aBlock"],
  994. source: unescape('ifFalse%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5Eself%20ifTrue%3A%20%5B%5D%20ifFalse%3A%20aBlock'),
  995. messageSends: ["ifTrue:ifFalse:"],
  996. referencedClasses: []
  997. }),
  998. smalltalk.Boolean);
  999. smalltalk.addMethod(
  1000. unescape('_ifFalse_ifTrue_'),
  1001. smalltalk.method({
  1002. selector: unescape('ifFalse%3AifTrue%3A'),
  1003. category: 'controlling',
  1004. fn: function (aBlock, anotherBlock) {
  1005. var self = this;
  1006. return smalltalk.send(self, "_ifTrue_ifFalse_", [anotherBlock, aBlock]);
  1007. return self;
  1008. },
  1009. args: ["aBlock", "anotherBlock"],
  1010. source: unescape('ifFalse%3A%20aBlock%20ifTrue%3A%20anotherBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5Eself%20ifTrue%3A%20anotherBlock%20ifFalse%3A%20aBlock'),
  1011. messageSends: ["ifTrue:ifFalse:"],
  1012. referencedClasses: []
  1013. }),
  1014. smalltalk.Boolean);
  1015. smalltalk.addMethod(
  1016. unescape('_ifTrue_'),
  1017. smalltalk.method({
  1018. selector: unescape('ifTrue%3A'),
  1019. category: 'controlling',
  1020. fn: function (aBlock) {
  1021. var self = this;
  1022. return smalltalk.send(self, "_ifTrue_ifFalse_", [aBlock, function () {return nil;}]);
  1023. return self;
  1024. },
  1025. args: ["aBlock"],
  1026. source: unescape('ifTrue%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5Eself%20ifTrue%3A%20aBlock%20ifFalse%3A%20%5B%5D'),
  1027. messageSends: ["ifTrue:ifFalse:"],
  1028. referencedClasses: []
  1029. }),
  1030. smalltalk.Boolean);
  1031. smalltalk.addMethod(
  1032. unescape('_ifTrue_ifFalse_'),
  1033. smalltalk.method({
  1034. selector: unescape('ifTrue%3AifFalse%3A'),
  1035. category: 'controlling',
  1036. fn: function (aBlock, anotherBlock) {
  1037. var self = this;
  1038. if (self == true) {
  1039. return aBlock();
  1040. } else {
  1041. return anotherBlock();
  1042. }
  1043. return self;
  1044. },
  1045. args: ["aBlock", "anotherBlock"],
  1046. source: unescape('ifTrue%3A%20aBlock%20ifFalse%3A%20anotherBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3C%0A%09%20%20%20%20if%28self%20%3D%3D%20true%29%20%7B%0A%09%09return%20aBlock%28%29%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20anotherBlock%28%29%3B%0A%09%20%20%20%20%7D%0A%09%3E'),
  1047. messageSends: [],
  1048. referencedClasses: []
  1049. }),
  1050. smalltalk.Boolean);
  1051. smalltalk.addMethod(
  1052. unescape('_not'),
  1053. smalltalk.method({
  1054. selector: unescape('not'),
  1055. category: 'controlling',
  1056. fn: function () {
  1057. var self = this;
  1058. return smalltalk.send(self, "__eq", [false]);
  1059. return self;
  1060. },
  1061. args: [],
  1062. source: unescape('not%0A%09%5Eself%20%3D%20false'),
  1063. messageSends: [unescape("%3D")],
  1064. referencedClasses: []
  1065. }),
  1066. smalltalk.Boolean);
  1067. smalltalk.addMethod(
  1068. unescape('_or_'),
  1069. smalltalk.method({
  1070. selector: unescape('or%3A'),
  1071. category: 'controlling',
  1072. fn: function (aBlock) {
  1073. var self = this;
  1074. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [function () {return true;}, aBlock]);
  1075. return self;
  1076. },
  1077. args: ["aBlock"],
  1078. source: unescape('or%3A%20aBlock%0A%09%5Eself%20%3D%20true%0A%09%20%20%20%20ifTrue%3A%20%5Btrue%5D%0A%09%20%20%20%20ifFalse%3A%20aBlock'),
  1079. messageSends: ["ifTrue:ifFalse:", unescape("%3D")],
  1080. referencedClasses: []
  1081. }),
  1082. smalltalk.Boolean);
  1083. smalltalk.addMethod(
  1084. unescape('_printString'),
  1085. smalltalk.method({
  1086. selector: unescape('printString'),
  1087. category: 'printing',
  1088. fn: function () {
  1089. var self = this;
  1090. return self.toString();
  1091. return self;
  1092. },
  1093. args: [],
  1094. source: unescape('printString%0A%09%3Creturn%20self.toString%28%29%3E'),
  1095. messageSends: [],
  1096. referencedClasses: []
  1097. }),
  1098. smalltalk.Boolean);
  1099. smalltalk.addMethod(
  1100. unescape('_shallowCopy'),
  1101. smalltalk.method({
  1102. selector: unescape('shallowCopy'),
  1103. category: 'copying',
  1104. fn: function () {
  1105. var self = this;
  1106. return self;
  1107. return self;
  1108. },
  1109. args: [],
  1110. source: unescape('shallowCopy%0A%09%5Eself'),
  1111. messageSends: [],
  1112. referencedClasses: []
  1113. }),
  1114. smalltalk.Boolean);
  1115. smalltalk.addMethod(
  1116. unescape('_%7C'),
  1117. smalltalk.method({
  1118. selector: unescape('%7C'),
  1119. category: 'controlling',
  1120. fn: function (aBoolean) {
  1121. var self = this;
  1122. if (self == true) {
  1123. return true;
  1124. } else {
  1125. return aBoolean;
  1126. }
  1127. return self;
  1128. },
  1129. args: ["aBoolean"],
  1130. source: unescape('%7C%20aBoolean%0A%09%3C%0A%09%20%20%20%20if%28self%20%3D%3D%20true%29%20%7B%0A%09%09return%20true%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20aBoolean%3B%0A%09%20%20%20%20%7D%0A%09%3E'),
  1131. messageSends: [],
  1132. referencedClasses: []
  1133. }),
  1134. smalltalk.Boolean);
  1135. smalltalk.addClass('Date', smalltalk.Object, [], 'Kernel-Objects');
  1136. smalltalk.Date.comment=unescape('The%20Date%20class%20is%20used%20to%20work%20with%20dates%20and%20times.%20Therefore%20%60Date%20today%60%20and%20%60Date%20now%60%20are%20both%20valid%20in%0AAmber%20and%20answer%20the%20same%20date%20object.%0A%0ADate%20wraps%20the%20%60Date%28%29%60%20JavaScript%20constructor%2C%20and%20Smalltalk%20date%20objects%20are%20JavaScript%20date%20objects.')
  1137. smalltalk.addMethod(
  1138. unescape('__plus'),
  1139. smalltalk.method({
  1140. selector: unescape('+'),
  1141. category: 'arithmetic',
  1142. fn: function (aDate) {
  1143. var self = this;
  1144. return self + aDate;
  1145. return self;
  1146. },
  1147. args: ["aDate"],
  1148. source: unescape('+%20aDate%0A%09%3Creturn%20self%20+%20aDate%3E'),
  1149. messageSends: [],
  1150. referencedClasses: []
  1151. }),
  1152. smalltalk.Date);
  1153. smalltalk.addMethod(
  1154. unescape('__minus'),
  1155. smalltalk.method({
  1156. selector: unescape('-'),
  1157. category: 'arithmetic',
  1158. fn: function (aDate) {
  1159. var self = this;
  1160. return self - aDate;
  1161. return self;
  1162. },
  1163. args: ["aDate"],
  1164. source: unescape('-%20aDate%0A%09%3Creturn%20self%20-%20aDate%3E'),
  1165. messageSends: [],
  1166. referencedClasses: []
  1167. }),
  1168. smalltalk.Date);
  1169. smalltalk.addMethod(
  1170. unescape('__lt'),
  1171. smalltalk.method({
  1172. selector: unescape('%3C'),
  1173. category: 'comparing',
  1174. fn: function (aDate) {
  1175. var self = this;
  1176. return self < aDate;
  1177. return self;
  1178. },
  1179. args: ["aDate"],
  1180. source: unescape('%3C%20aDate%0A%09%3Creturn%20self%20%3C%20aDate%3E'),
  1181. messageSends: [],
  1182. referencedClasses: []
  1183. }),
  1184. smalltalk.Date);
  1185. smalltalk.addMethod(
  1186. unescape('__lt_eq'),
  1187. smalltalk.method({
  1188. selector: unescape('%3C%3D'),
  1189. category: 'comparing',
  1190. fn: function (aDate) {
  1191. var self = this;
  1192. return self <= aDate;
  1193. return self;
  1194. },
  1195. args: ["aDate"],
  1196. source: unescape('%3C%3D%20aDate%0A%09%3Creturn%20self%20%3C%3D%20aDate%3E'),
  1197. messageSends: [],
  1198. referencedClasses: []
  1199. }),
  1200. smalltalk.Date);
  1201. smalltalk.addMethod(
  1202. unescape('__gt'),
  1203. smalltalk.method({
  1204. selector: unescape('%3E'),
  1205. category: 'comparing',
  1206. fn: function (aDate) {
  1207. var self = this;
  1208. return self > aDate;
  1209. return self;
  1210. },
  1211. args: ["aDate"],
  1212. source: unescape('%3E%20aDate%0A%09%3Creturn%20self%20%3E%3E%20aDate%3E'),
  1213. messageSends: [],
  1214. referencedClasses: []
  1215. }),
  1216. smalltalk.Date);
  1217. smalltalk.addMethod(
  1218. unescape('__gt_eq'),
  1219. smalltalk.method({
  1220. selector: unescape('%3E%3D'),
  1221. category: 'comparing',
  1222. fn: function (aDate) {
  1223. var self = this;
  1224. return self >= aDate;
  1225. return self;
  1226. },
  1227. args: ["aDate"],
  1228. source: unescape('%3E%3D%20aDate%0A%09%3Creturn%20self%20%3E%3E%3D%20aDate%3E'),
  1229. messageSends: [],
  1230. referencedClasses: []
  1231. }),
  1232. smalltalk.Date);
  1233. smalltalk.addMethod(
  1234. unescape('_asDateString'),
  1235. smalltalk.method({
  1236. selector: unescape('asDateString'),
  1237. category: 'converting',
  1238. fn: function () {
  1239. var self = this;
  1240. return self.toDateString();
  1241. return self;
  1242. },
  1243. args: [],
  1244. source: unescape('asDateString%0A%09%3Creturn%20self.toDateString%28%29%3E'),
  1245. messageSends: [],
  1246. referencedClasses: []
  1247. }),
  1248. smalltalk.Date);
  1249. smalltalk.addMethod(
  1250. unescape('_asLocaleString'),
  1251. smalltalk.method({
  1252. selector: unescape('asLocaleString'),
  1253. category: 'converting',
  1254. fn: function () {
  1255. var self = this;
  1256. return self.toLocaleString();
  1257. return self;
  1258. },
  1259. args: [],
  1260. source: unescape('asLocaleString%0A%09%3Creturn%20self.toLocaleString%28%29%3E'),
  1261. messageSends: [],
  1262. referencedClasses: []
  1263. }),
  1264. smalltalk.Date);
  1265. smalltalk.addMethod(
  1266. unescape('_asMilliseconds'),
  1267. smalltalk.method({
  1268. selector: unescape('asMilliseconds'),
  1269. category: 'converting',
  1270. fn: function () {
  1271. var self = this;
  1272. return smalltalk.send(self, "_time", []);
  1273. return self;
  1274. },
  1275. args: [],
  1276. source: unescape('asMilliseconds%0A%09%5Eself%20time'),
  1277. messageSends: ["time"],
  1278. referencedClasses: []
  1279. }),
  1280. smalltalk.Date);
  1281. smalltalk.addMethod(
  1282. unescape('_asNumber'),
  1283. smalltalk.method({
  1284. selector: unescape('asNumber'),
  1285. category: 'converting',
  1286. fn: function () {
  1287. var self = this;
  1288. return smalltalk.send(self, "_asMilliseconds", []);
  1289. return self;
  1290. },
  1291. args: [],
  1292. source: unescape('asNumber%0A%09%5Eself%20asMilliseconds'),
  1293. messageSends: ["asMilliseconds"],
  1294. referencedClasses: []
  1295. }),
  1296. smalltalk.Date);
  1297. smalltalk.addMethod(
  1298. unescape('_asString'),
  1299. smalltalk.method({
  1300. selector: unescape('asString'),
  1301. category: 'converting',
  1302. fn: function () {
  1303. var self = this;
  1304. return self.toString();
  1305. return self;
  1306. },
  1307. args: [],
  1308. source: unescape('asString%0A%09%3Creturn%20self.toString%28%29%3E'),
  1309. messageSends: [],
  1310. referencedClasses: []
  1311. }),
  1312. smalltalk.Date);
  1313. smalltalk.addMethod(
  1314. unescape('_asTimeString'),
  1315. smalltalk.method({
  1316. selector: unescape('asTimeString'),
  1317. category: 'converting',
  1318. fn: function () {
  1319. var self = this;
  1320. return self.toTimeString();
  1321. return self;
  1322. },
  1323. args: [],
  1324. source: unescape('asTimeString%0A%09%3Creturn%20self.toTimeString%28%29%3E'),
  1325. messageSends: [],
  1326. referencedClasses: []
  1327. }),
  1328. smalltalk.Date);
  1329. smalltalk.addMethod(
  1330. unescape('_day'),
  1331. smalltalk.method({
  1332. selector: unescape('day'),
  1333. category: 'accessing',
  1334. fn: function () {
  1335. var self = this;
  1336. return smalltalk.send(self, "_dayOfWeek", []);
  1337. return self;
  1338. },
  1339. args: [],
  1340. source: unescape('day%0A%09%5Eself%20dayOfWeek'),
  1341. messageSends: ["dayOfWeek"],
  1342. referencedClasses: []
  1343. }),
  1344. smalltalk.Date);
  1345. smalltalk.addMethod(
  1346. unescape('_day_'),
  1347. smalltalk.method({
  1348. selector: unescape('day%3A'),
  1349. category: 'accessing',
  1350. fn: function (aNumber) {
  1351. var self = this;
  1352. smalltalk.send(self, "_day_", [aNumber]);
  1353. return self;
  1354. },
  1355. args: ["aNumber"],
  1356. source: unescape('day%3A%20aNumber%0A%09self%20day%3A%20aNumber'),
  1357. messageSends: ["day:"],
  1358. referencedClasses: []
  1359. }),
  1360. smalltalk.Date);
  1361. smalltalk.addMethod(
  1362. unescape('_dayOfMonth'),
  1363. smalltalk.method({
  1364. selector: unescape('dayOfMonth'),
  1365. category: 'accessing',
  1366. fn: function () {
  1367. var self = this;
  1368. return self.getDate();
  1369. return self;
  1370. },
  1371. args: [],
  1372. source: unescape('dayOfMonth%0A%09%3Creturn%20self.getDate%28%29%3E'),
  1373. messageSends: [],
  1374. referencedClasses: []
  1375. }),
  1376. smalltalk.Date);
  1377. smalltalk.addMethod(
  1378. unescape('_dayOfMonth_'),
  1379. smalltalk.method({
  1380. selector: unescape('dayOfMonth%3A'),
  1381. category: 'accessing',
  1382. fn: function (aNumber) {
  1383. var self = this;
  1384. self.setDate(aNumber);
  1385. return self;
  1386. },
  1387. args: ["aNumber"],
  1388. source: unescape('dayOfMonth%3A%20aNumber%0A%09%3Cself.setDate%28aNumber%29%3E'),
  1389. messageSends: [],
  1390. referencedClasses: []
  1391. }),
  1392. smalltalk.Date);
  1393. smalltalk.addMethod(
  1394. unescape('_dayOfWeek'),
  1395. smalltalk.method({
  1396. selector: unescape('dayOfWeek'),
  1397. category: 'accessing',
  1398. fn: function () {
  1399. var self = this;
  1400. return self.getDay() + 1;
  1401. return self;
  1402. },
  1403. args: [],
  1404. source: unescape('dayOfWeek%0A%09%3Creturn%20self.getDay%28%29%20+%201%3E'),
  1405. messageSends: [],
  1406. referencedClasses: []
  1407. }),
  1408. smalltalk.Date);
  1409. smalltalk.addMethod(
  1410. unescape('_dayOfWeek_'),
  1411. smalltalk.method({
  1412. selector: unescape('dayOfWeek%3A'),
  1413. category: 'accessing',
  1414. fn: function (aNumber) {
  1415. var self = this;
  1416. return self.setDay(aNumber - 1);
  1417. return self;
  1418. },
  1419. args: ["aNumber"],
  1420. source: unescape('dayOfWeek%3A%20aNumber%0A%09%3Creturn%20self.setDay%28aNumber%20-%201%29%3E'),
  1421. messageSends: [],
  1422. referencedClasses: []
  1423. }),
  1424. smalltalk.Date);
  1425. smalltalk.addMethod(
  1426. unescape('_hours'),
  1427. smalltalk.method({
  1428. selector: unescape('hours'),
  1429. category: 'accessing',
  1430. fn: function () {
  1431. var self = this;
  1432. return self.getHours();
  1433. return self;
  1434. },
  1435. args: [],
  1436. source: unescape('hours%0A%09%3Creturn%20self.getHours%28%29%3E'),
  1437. messageSends: [],
  1438. referencedClasses: []
  1439. }),
  1440. smalltalk.Date);
  1441. smalltalk.addMethod(
  1442. unescape('_hours_'),
  1443. smalltalk.method({
  1444. selector: unescape('hours%3A'),
  1445. category: 'accessing',
  1446. fn: function (aNumber) {
  1447. var self = this;
  1448. self.setHours(aNumber);
  1449. return self;
  1450. },
  1451. args: ["aNumber"],
  1452. source: unescape('hours%3A%20aNumber%0A%09%3Cself.setHours%28aNumber%29%3E'),
  1453. messageSends: [],
  1454. referencedClasses: []
  1455. }),
  1456. smalltalk.Date);
  1457. smalltalk.addMethod(
  1458. unescape('_milliseconds'),
  1459. smalltalk.method({
  1460. selector: unescape('milliseconds'),
  1461. category: 'accessing',
  1462. fn: function () {
  1463. var self = this;
  1464. return self.getMilliseconds();
  1465. return self;
  1466. },
  1467. args: [],
  1468. source: unescape('milliseconds%0A%09%3Creturn%20self.getMilliseconds%28%29%3E'),
  1469. messageSends: [],
  1470. referencedClasses: []
  1471. }),
  1472. smalltalk.Date);
  1473. smalltalk.addMethod(
  1474. unescape('_milliseconds_'),
  1475. smalltalk.method({
  1476. selector: unescape('milliseconds%3A'),
  1477. category: 'accessing',
  1478. fn: function (aNumber) {
  1479. var self = this;
  1480. self.setMilliseconds(aNumber);
  1481. return self;
  1482. },
  1483. args: ["aNumber"],
  1484. source: unescape('milliseconds%3A%20aNumber%0A%09%3Cself.setMilliseconds%28aNumber%29%3E'),
  1485. messageSends: [],
  1486. referencedClasses: []
  1487. }),
  1488. smalltalk.Date);
  1489. smalltalk.addMethod(
  1490. unescape('_minutes'),
  1491. smalltalk.method({
  1492. selector: unescape('minutes'),
  1493. category: 'accessing',
  1494. fn: function () {
  1495. var self = this;
  1496. return self.getMinutes();
  1497. return self;
  1498. },
  1499. args: [],
  1500. source: unescape('minutes%0A%09%3Creturn%20self.getMinutes%28%29%3E'),
  1501. messageSends: [],
  1502. referencedClasses: []
  1503. }),
  1504. smalltalk.Date);
  1505. smalltalk.addMethod(
  1506. unescape('_minutes_'),
  1507. smalltalk.method({
  1508. selector: unescape('minutes%3A'),
  1509. category: 'accessing',
  1510. fn: function (aNumber) {
  1511. var self = this;
  1512. self.setMinutes(aNumber);
  1513. return self;
  1514. },
  1515. args: ["aNumber"],
  1516. source: unescape('minutes%3A%20aNumber%0A%09%3Cself.setMinutes%28aNumber%29%3E'),
  1517. messageSends: [],
  1518. referencedClasses: []
  1519. }),
  1520. smalltalk.Date);
  1521. smalltalk.addMethod(
  1522. unescape('_month'),
  1523. smalltalk.method({
  1524. selector: unescape('month'),
  1525. category: 'accessing',
  1526. fn: function () {
  1527. var self = this;
  1528. return self.getMonth() + 1;
  1529. return self;
  1530. },
  1531. args: [],
  1532. source: unescape('month%0A%09%3Creturn%20self.getMonth%28%29%20+%201%3E'),
  1533. messageSends: [],
  1534. referencedClasses: []
  1535. }),
  1536. smalltalk.Date);
  1537. smalltalk.addMethod(
  1538. unescape('_month_'),
  1539. smalltalk.method({
  1540. selector: unescape('month%3A'),
  1541. category: 'accessing',
  1542. fn: function (aNumber) {
  1543. var self = this;
  1544. self.setMonth(aNumber - 1);
  1545. return self;
  1546. },
  1547. args: ["aNumber"],
  1548. source: unescape('month%3A%20aNumber%0A%09%3Cself.setMonth%28aNumber%20-%201%29%3E'),
  1549. messageSends: [],
  1550. referencedClasses: []
  1551. }),
  1552. smalltalk.Date);
  1553. smalltalk.addMethod(
  1554. unescape('_printString'),
  1555. smalltalk.method({
  1556. selector: unescape('printString'),
  1557. category: 'printing',
  1558. fn: function () {
  1559. var self = this;
  1560. return smalltalk.send(self, "_asString", []);
  1561. return self;
  1562. },
  1563. args: [],
  1564. source: unescape('printString%0A%09%5Eself%20asString'),
  1565. messageSends: ["asString"],
  1566. referencedClasses: []
  1567. }),
  1568. smalltalk.Date);
  1569. smalltalk.addMethod(
  1570. unescape('_seconds'),
  1571. smalltalk.method({
  1572. selector: unescape('seconds'),
  1573. category: 'accessing',
  1574. fn: function () {
  1575. var self = this;
  1576. return self.getSeconds();
  1577. return self;
  1578. },
  1579. args: [],
  1580. source: unescape('seconds%0A%09%3Creturn%20self.getSeconds%28%29%3E'),
  1581. messageSends: [],
  1582. referencedClasses: []
  1583. }),
  1584. smalltalk.Date);
  1585. smalltalk.addMethod(
  1586. unescape('_seconds_'),
  1587. smalltalk.method({
  1588. selector: unescape('seconds%3A'),
  1589. category: 'accessing',
  1590. fn: function (aNumber) {
  1591. var self = this;
  1592. self.setSeconds(aNumber);
  1593. return self;
  1594. },
  1595. args: ["aNumber"],
  1596. source: unescape('seconds%3A%20aNumber%0A%09%3Cself.setSeconds%28aNumber%29%3E'),
  1597. messageSends: [],
  1598. referencedClasses: []
  1599. }),
  1600. smalltalk.Date);
  1601. smalltalk.addMethod(
  1602. unescape('_time'),
  1603. smalltalk.method({
  1604. selector: unescape('time'),
  1605. category: 'accessing',
  1606. fn: function () {
  1607. var self = this;
  1608. return self.getTime();
  1609. return self;
  1610. },
  1611. args: [],
  1612. source: unescape('time%0A%09%3Creturn%20self.getTime%28%29%3E'),
  1613. messageSends: [],
  1614. referencedClasses: []
  1615. }),
  1616. smalltalk.Date);
  1617. smalltalk.addMethod(
  1618. unescape('_time_'),
  1619. smalltalk.method({
  1620. selector: unescape('time%3A'),
  1621. category: 'accessing',
  1622. fn: function (aNumber) {
  1623. var self = this;
  1624. self.setTime(aNumber);
  1625. return self;
  1626. },
  1627. args: ["aNumber"],
  1628. source: unescape('time%3A%20aNumber%0A%09%3Cself.setTime%28aNumber%29%3E'),
  1629. messageSends: [],
  1630. referencedClasses: []
  1631. }),
  1632. smalltalk.Date);
  1633. smalltalk.addMethod(
  1634. unescape('_year'),
  1635. smalltalk.method({
  1636. selector: unescape('year'),
  1637. category: 'accessing',
  1638. fn: function () {
  1639. var self = this;
  1640. return self.getFullYear();
  1641. return self;
  1642. },
  1643. args: [],
  1644. source: unescape('year%0A%09%3Creturn%20self.getFullYear%28%29%3E'),
  1645. messageSends: [],
  1646. referencedClasses: []
  1647. }),
  1648. smalltalk.Date);
  1649. smalltalk.addMethod(
  1650. unescape('_year_'),
  1651. smalltalk.method({
  1652. selector: unescape('year%3A'),
  1653. category: 'accessing',
  1654. fn: function (aNumber) {
  1655. var self = this;
  1656. self.setFullYear(aNumber);
  1657. return self;
  1658. },
  1659. args: ["aNumber"],
  1660. source: unescape('year%3A%20aNumber%0A%09%3Cself.setFullYear%28aNumber%29%3E'),
  1661. messageSends: [],
  1662. referencedClasses: []
  1663. }),
  1664. smalltalk.Date);
  1665. smalltalk.addMethod(
  1666. unescape('_fromMilliseconds_'),
  1667. smalltalk.method({
  1668. selector: unescape('fromMilliseconds%3A'),
  1669. category: 'instance creation',
  1670. fn: function (aNumber) {
  1671. var self = this;
  1672. return smalltalk.send(self, "_new_", [aNumber]);
  1673. return self;
  1674. },
  1675. args: ["aNumber"],
  1676. source: unescape('fromMilliseconds%3A%20aNumber%0A%09%5Eself%20new%3A%20aNumber'),
  1677. messageSends: ["new:"],
  1678. referencedClasses: []
  1679. }),
  1680. smalltalk.Date.klass);
  1681. smalltalk.addMethod(
  1682. unescape('_fromSeconds_'),
  1683. smalltalk.method({
  1684. selector: unescape('fromSeconds%3A'),
  1685. category: 'instance creation',
  1686. fn: function (aNumber) {
  1687. var self = this;
  1688. return smalltalk.send(self, "_fromMilliseconds_", [($receiver = aNumber).klass === smalltalk.Number ? $receiver * 1000 : smalltalk.send($receiver, "__star", [1000])]);
  1689. return self;
  1690. },
  1691. args: ["aNumber"],
  1692. source: unescape('fromSeconds%3A%20aNumber%0A%09%5Eself%20fromMilliseconds%3A%20aNumber%20*%201000'),
  1693. messageSends: ["fromMilliseconds:", unescape("*")],
  1694. referencedClasses: []
  1695. }),
  1696. smalltalk.Date.klass);
  1697. smalltalk.addMethod(
  1698. unescape('_fromString_'),
  1699. smalltalk.method({
  1700. selector: unescape('fromString%3A'),
  1701. category: 'instance creation',
  1702. fn: function (aString) {
  1703. var self = this;
  1704. return smalltalk.send(self, "_new_", [aString]);
  1705. return self;
  1706. },
  1707. args: ["aString"],
  1708. source: unescape('fromString%3A%20aString%0A%09%22Example%3A%20Date%20fromString%28%272011/04/15%2000%3A00%3A00%27%29%22%0A%09%5Eself%20new%3A%20aString'),
  1709. messageSends: ["new:"],
  1710. referencedClasses: []
  1711. }),
  1712. smalltalk.Date.klass);
  1713. smalltalk.addMethod(
  1714. unescape('_millisecondsToRun_'),
  1715. smalltalk.method({
  1716. selector: unescape('millisecondsToRun%3A'),
  1717. category: 'instance creation',
  1718. fn: function (aBlock) {
  1719. var self = this;
  1720. var t = nil;
  1721. t = smalltalk.send(smalltalk.Date || Date, "_now", []);
  1722. smalltalk.send(aBlock, "_value", []);
  1723. return ($receiver = smalltalk.send(smalltalk.Date || Date, "_now", [])).klass === smalltalk.Number ? $receiver - t : smalltalk.send($receiver, "__minus", [t]);
  1724. return self;
  1725. },
  1726. args: ["aBlock"],
  1727. source: unescape('millisecondsToRun%3A%20aBlock%0A%09%7C%20t%20%7C%0A%09t%20%3A%3D%20Date%20now.%0A%09aBlock%20value.%0A%09%5EDate%20now%20-%20t'),
  1728. messageSends: ["now", "value", unescape("-")],
  1729. referencedClasses: ["Date"]
  1730. }),
  1731. smalltalk.Date.klass);
  1732. smalltalk.addMethod(
  1733. unescape('_new_'),
  1734. smalltalk.method({
  1735. selector: unescape('new%3A'),
  1736. category: 'instance creation',
  1737. fn: function (anObject) {
  1738. var self = this;
  1739. return new Date(anObject);
  1740. return self;
  1741. },
  1742. args: ["anObject"],
  1743. source: unescape('new%3A%20anObject%0A%09%3Creturn%20new%20Date%28anObject%29%3E'),
  1744. messageSends: [],
  1745. referencedClasses: []
  1746. }),
  1747. smalltalk.Date.klass);
  1748. smalltalk.addMethod(
  1749. unescape('_now'),
  1750. smalltalk.method({
  1751. selector: unescape('now'),
  1752. category: 'instance creation',
  1753. fn: function () {
  1754. var self = this;
  1755. return smalltalk.send(self, "_today", []);
  1756. return self;
  1757. },
  1758. args: [],
  1759. source: unescape('now%0A%09%5Eself%20today'),
  1760. messageSends: ["today"],
  1761. referencedClasses: []
  1762. }),
  1763. smalltalk.Date.klass);
  1764. smalltalk.addMethod(
  1765. unescape('_today'),
  1766. smalltalk.method({
  1767. selector: unescape('today'),
  1768. category: 'instance creation',
  1769. fn: function () {
  1770. var self = this;
  1771. return smalltalk.send(self, "_new", []);
  1772. return self;
  1773. },
  1774. args: [],
  1775. source: unescape('today%0A%09%5Eself%20new'),
  1776. messageSends: ["new"],
  1777. referencedClasses: []
  1778. }),
  1779. smalltalk.Date.klass);
  1780. smalltalk.addClass('Date', smalltalk.Object, [], 'Kernel-Objects');
  1781. smalltalk.Date.comment=unescape('The%20Date%20class%20is%20used%20to%20work%20with%20dates%20and%20times.%20Therefore%20%60Date%20today%60%20and%20%60Date%20now%60%20are%20both%20valid%20in%0AAmber%20and%20answer%20the%20same%20date%20object.%0A%0ADate%20wraps%20the%20%60Date%28%29%60%20JavaScript%20constructor%2C%20and%20Smalltalk%20date%20objects%20are%20JavaScript%20date%20objects.')
  1782. smalltalk.addMethod(
  1783. unescape('__plus'),
  1784. smalltalk.method({
  1785. selector: unescape('+'),
  1786. category: 'arithmetic',
  1787. fn: function (aDate) {
  1788. var self = this;
  1789. return self + aDate;
  1790. return self;
  1791. },
  1792. args: ["aDate"],
  1793. source: unescape('+%20aDate%0A%09%3Creturn%20self%20+%20aDate%3E'),
  1794. messageSends: [],
  1795. referencedClasses: []
  1796. }),
  1797. smalltalk.Date);
  1798. smalltalk.addMethod(
  1799. unescape('__minus'),
  1800. smalltalk.method({
  1801. selector: unescape('-'),
  1802. category: 'arithmetic',
  1803. fn: function (aDate) {
  1804. var self = this;
  1805. return self - aDate;
  1806. return self;
  1807. },
  1808. args: ["aDate"],
  1809. source: unescape('-%20aDate%0A%09%3Creturn%20self%20-%20aDate%3E'),
  1810. messageSends: [],
  1811. referencedClasses: []
  1812. }),
  1813. smalltalk.Date);
  1814. smalltalk.addMethod(
  1815. unescape('__lt'),
  1816. smalltalk.method({
  1817. selector: unescape('%3C'),
  1818. category: 'comparing',
  1819. fn: function (aDate) {
  1820. var self = this;
  1821. return self < aDate;
  1822. return self;
  1823. },
  1824. args: ["aDate"],
  1825. source: unescape('%3C%20aDate%0A%09%3Creturn%20self%20%3C%20aDate%3E'),
  1826. messageSends: [],
  1827. referencedClasses: []
  1828. }),
  1829. smalltalk.Date);
  1830. smalltalk.addMethod(
  1831. unescape('__lt_eq'),
  1832. smalltalk.method({
  1833. selector: unescape('%3C%3D'),
  1834. category: 'comparing',
  1835. fn: function (aDate) {
  1836. var self = this;
  1837. return self <= aDate;
  1838. return self;
  1839. },
  1840. args: ["aDate"],
  1841. source: unescape('%3C%3D%20aDate%0A%09%3Creturn%20self%20%3C%3D%20aDate%3E'),
  1842. messageSends: [],
  1843. referencedClasses: []
  1844. }),
  1845. smalltalk.Date);
  1846. smalltalk.addMethod(
  1847. unescape('__gt'),
  1848. smalltalk.method({
  1849. selector: unescape('%3E'),
  1850. category: 'comparing',
  1851. fn: function (aDate) {
  1852. var self = this;
  1853. return self > aDate;
  1854. return self;
  1855. },
  1856. args: ["aDate"],
  1857. source: unescape('%3E%20aDate%0A%09%3Creturn%20self%20%3E%3E%20aDate%3E'),
  1858. messageSends: [],
  1859. referencedClasses: []
  1860. }),
  1861. smalltalk.Date);
  1862. smalltalk.addMethod(
  1863. unescape('__gt_eq'),
  1864. smalltalk.method({
  1865. selector: unescape('%3E%3D'),
  1866. category: 'comparing',
  1867. fn: function (aDate) {
  1868. var self = this;
  1869. return self >= aDate;
  1870. return self;
  1871. },
  1872. args: ["aDate"],
  1873. source: unescape('%3E%3D%20aDate%0A%09%3Creturn%20self%20%3E%3E%3D%20aDate%3E'),
  1874. messageSends: [],
  1875. referencedClasses: []
  1876. }),
  1877. smalltalk.Date);
  1878. smalltalk.addMethod(
  1879. unescape('_asDateString'),
  1880. smalltalk.method({
  1881. selector: unescape('asDateString'),
  1882. category: 'converting',
  1883. fn: function () {
  1884. var self = this;
  1885. return self.toDateString();
  1886. return self;
  1887. },
  1888. args: [],
  1889. source: unescape('asDateString%0A%09%3Creturn%20self.toDateString%28%29%3E'),
  1890. messageSends: [],
  1891. referencedClasses: []
  1892. }),
  1893. smalltalk.Date);
  1894. smalltalk.addMethod(
  1895. unescape('_asLocaleString'),
  1896. smalltalk.method({
  1897. selector: unescape('asLocaleString'),
  1898. category: 'converting',
  1899. fn: function () {
  1900. var self = this;
  1901. return self.toLocaleString();
  1902. return self;
  1903. },
  1904. args: [],
  1905. source: unescape('asLocaleString%0A%09%3Creturn%20self.toLocaleString%28%29%3E'),
  1906. messageSends: [],
  1907. referencedClasses: []
  1908. }),
  1909. smalltalk.Date);
  1910. smalltalk.addMethod(
  1911. unescape('_asMilliseconds'),
  1912. smalltalk.method({
  1913. selector: unescape('asMilliseconds'),
  1914. category: 'converting',
  1915. fn: function () {
  1916. var self = this;
  1917. return smalltalk.send(self, "_time", []);
  1918. return self;
  1919. },
  1920. args: [],
  1921. source: unescape('asMilliseconds%0A%09%5Eself%20time'),
  1922. messageSends: ["time"],
  1923. referencedClasses: []
  1924. }),
  1925. smalltalk.Date);
  1926. smalltalk.addMethod(
  1927. unescape('_asNumber'),
  1928. smalltalk.method({
  1929. selector: unescape('asNumber'),
  1930. category: 'converting',
  1931. fn: function () {
  1932. var self = this;
  1933. return smalltalk.send(self, "_asMilliseconds", []);
  1934. return self;
  1935. },
  1936. args: [],
  1937. source: unescape('asNumber%0A%09%5Eself%20asMilliseconds'),
  1938. messageSends: ["asMilliseconds"],
  1939. referencedClasses: []
  1940. }),
  1941. smalltalk.Date);
  1942. smalltalk.addMethod(
  1943. unescape('_asString'),
  1944. smalltalk.method({
  1945. selector: unescape('asString'),
  1946. category: 'converting',
  1947. fn: function () {
  1948. var self = this;
  1949. return self.toString();
  1950. return self;
  1951. },
  1952. args: [],
  1953. source: unescape('asString%0A%09%3Creturn%20self.toString%28%29%3E'),
  1954. messageSends: [],
  1955. referencedClasses: []
  1956. }),
  1957. smalltalk.Date);
  1958. smalltalk.addMethod(
  1959. unescape('_asTimeString'),
  1960. smalltalk.method({
  1961. selector: unescape('asTimeString'),
  1962. category: 'converting',
  1963. fn: function () {
  1964. var self = this;
  1965. return self.toTimeString();
  1966. return self;
  1967. },
  1968. args: [],
  1969. source: unescape('asTimeString%0A%09%3Creturn%20self.toTimeString%28%29%3E'),
  1970. messageSends: [],
  1971. referencedClasses: []
  1972. }),
  1973. smalltalk.Date);
  1974. smalltalk.addMethod(
  1975. unescape('_day'),
  1976. smalltalk.method({
  1977. selector: unescape('day'),
  1978. category: 'accessing',
  1979. fn: function () {
  1980. var self = this;
  1981. return smalltalk.send(self, "_dayOfWeek", []);
  1982. return self;
  1983. },
  1984. args: [],
  1985. source: unescape('day%0A%09%5Eself%20dayOfWeek'),
  1986. messageSends: ["dayOfWeek"],
  1987. referencedClasses: []
  1988. }),
  1989. smalltalk.Date);
  1990. smalltalk.addMethod(
  1991. unescape('_day_'),
  1992. smalltalk.method({
  1993. selector: unescape('day%3A'),
  1994. category: 'accessing',
  1995. fn: function (aNumber) {
  1996. var self = this;
  1997. smalltalk.send(self, "_day_", [aNumber]);
  1998. return self;
  1999. },
  2000. args: ["aNumber"],
  2001. source: unescape('day%3A%20aNumber%0A%09self%20day%3A%20aNumber'),
  2002. messageSends: ["day:"],
  2003. referencedClasses: []
  2004. }),
  2005. smalltalk.Date);
  2006. smalltalk.addMethod(
  2007. unescape('_dayOfMonth'),
  2008. smalltalk.method({
  2009. selector: unescape('dayOfMonth'),
  2010. category: 'accessing',
  2011. fn: function () {
  2012. var self = this;
  2013. return self.getDate();
  2014. return self;
  2015. },
  2016. args: [],
  2017. source: unescape('dayOfMonth%0A%09%3Creturn%20self.getDate%28%29%3E'),
  2018. messageSends: [],
  2019. referencedClasses: []
  2020. }),
  2021. smalltalk.Date);
  2022. smalltalk.addMethod(
  2023. unescape('_dayOfMonth_'),
  2024. smalltalk.method({
  2025. selector: unescape('dayOfMonth%3A'),
  2026. category: 'accessing',
  2027. fn: function (aNumber) {
  2028. var self = this;
  2029. self.setDate(aNumber);
  2030. return self;
  2031. },
  2032. args: ["aNumber"],
  2033. source: unescape('dayOfMonth%3A%20aNumber%0A%09%3Cself.setDate%28aNumber%29%3E'),
  2034. messageSends: [],
  2035. referencedClasses: []
  2036. }),
  2037. smalltalk.Date);
  2038. smalltalk.addMethod(
  2039. unescape('_dayOfWeek'),
  2040. smalltalk.method({
  2041. selector: unescape('dayOfWeek'),
  2042. category: 'accessing',
  2043. fn: function () {
  2044. var self = this;
  2045. return self.getDay() + 1;
  2046. return self;
  2047. },
  2048. args: [],
  2049. source: unescape('dayOfWeek%0A%09%3Creturn%20self.getDay%28%29%20+%201%3E'),
  2050. messageSends: [],
  2051. referencedClasses: []
  2052. }),
  2053. smalltalk.Date);
  2054. smalltalk.addMethod(
  2055. unescape('_dayOfWeek_'),
  2056. smalltalk.method({
  2057. selector: unescape('dayOfWeek%3A'),
  2058. category: 'accessing',
  2059. fn: function (aNumber) {
  2060. var self = this;
  2061. return self.setDay(aNumber - 1);
  2062. return self;
  2063. },
  2064. args: ["aNumber"],
  2065. source: unescape('dayOfWeek%3A%20aNumber%0A%09%3Creturn%20self.setDay%28aNumber%20-%201%29%3E'),
  2066. messageSends: [],
  2067. referencedClasses: []
  2068. }),
  2069. smalltalk.Date);
  2070. smalltalk.addMethod(
  2071. unescape('_hours'),
  2072. smalltalk.method({
  2073. selector: unescape('hours'),
  2074. category: 'accessing',
  2075. fn: function () {
  2076. var self = this;
  2077. return self.getHours();
  2078. return self;
  2079. },
  2080. args: [],
  2081. source: unescape('hours%0A%09%3Creturn%20self.getHours%28%29%3E'),
  2082. messageSends: [],
  2083. referencedClasses: []
  2084. }),
  2085. smalltalk.Date);
  2086. smalltalk.addMethod(
  2087. unescape('_hours_'),
  2088. smalltalk.method({
  2089. selector: unescape('hours%3A'),
  2090. category: 'accessing',
  2091. fn: function (aNumber) {
  2092. var self = this;
  2093. self.setHours(aNumber);
  2094. return self;
  2095. },
  2096. args: ["aNumber"],
  2097. source: unescape('hours%3A%20aNumber%0A%09%3Cself.setHours%28aNumber%29%3E'),
  2098. messageSends: [],
  2099. referencedClasses: []
  2100. }),
  2101. smalltalk.Date);
  2102. smalltalk.addMethod(
  2103. unescape('_milliseconds'),
  2104. smalltalk.method({
  2105. selector: unescape('milliseconds'),
  2106. category: 'accessing',
  2107. fn: function () {
  2108. var self = this;
  2109. return self.getMilliseconds();
  2110. return self;
  2111. },
  2112. args: [],
  2113. source: unescape('milliseconds%0A%09%3Creturn%20self.getMilliseconds%28%29%3E'),
  2114. messageSends: [],
  2115. referencedClasses: []
  2116. }),
  2117. smalltalk.Date);
  2118. smalltalk.addMethod(
  2119. unescape('_milliseconds_'),
  2120. smalltalk.method({
  2121. selector: unescape('milliseconds%3A'),
  2122. category: 'accessing',
  2123. fn: function (aNumber) {
  2124. var self = this;
  2125. self.setMilliseconds(aNumber);
  2126. return self;
  2127. },
  2128. args: ["aNumber"],
  2129. source: unescape('milliseconds%3A%20aNumber%0A%09%3Cself.setMilliseconds%28aNumber%29%3E'),
  2130. messageSends: [],
  2131. referencedClasses: []
  2132. }),
  2133. smalltalk.Date);
  2134. smalltalk.addMethod(
  2135. unescape('_minutes'),
  2136. smalltalk.method({
  2137. selector: unescape('minutes'),
  2138. category: 'accessing',
  2139. fn: function () {
  2140. var self = this;
  2141. return self.getMinutes();
  2142. return self;
  2143. },
  2144. args: [],
  2145. source: unescape('minutes%0A%09%3Creturn%20self.getMinutes%28%29%3E'),
  2146. messageSends: [],
  2147. referencedClasses: []
  2148. }),
  2149. smalltalk.Date);
  2150. smalltalk.addMethod(
  2151. unescape('_minutes_'),
  2152. smalltalk.method({
  2153. selector: unescape('minutes%3A'),
  2154. category: 'accessing',
  2155. fn: function (aNumber) {
  2156. var self = this;
  2157. self.setMinutes(aNumber);
  2158. return self;
  2159. },
  2160. args: ["aNumber"],
  2161. source: unescape('minutes%3A%20aNumber%0A%09%3Cself.setMinutes%28aNumber%29%3E'),
  2162. messageSends: [],
  2163. referencedClasses: []
  2164. }),
  2165. smalltalk.Date);
  2166. smalltalk.addMethod(
  2167. unescape('_month'),
  2168. smalltalk.method({
  2169. selector: unescape('month'),
  2170. category: 'accessing',
  2171. fn: function () {
  2172. var self = this;
  2173. return self.getMonth() + 1;
  2174. return self;
  2175. },
  2176. args: [],
  2177. source: unescape('month%0A%09%3Creturn%20self.getMonth%28%29%20+%201%3E'),
  2178. messageSends: [],
  2179. referencedClasses: []
  2180. }),
  2181. smalltalk.Date);
  2182. smalltalk.addMethod(
  2183. unescape('_month_'),
  2184. smalltalk.method({
  2185. selector: unescape('month%3A'),
  2186. category: 'accessing',
  2187. fn: function (aNumber) {
  2188. var self = this;
  2189. self.setMonth(aNumber - 1);
  2190. return self;
  2191. },
  2192. args: ["aNumber"],
  2193. source: unescape('month%3A%20aNumber%0A%09%3Cself.setMonth%28aNumber%20-%201%29%3E'),
  2194. messageSends: [],
  2195. referencedClasses: []
  2196. }),
  2197. smalltalk.Date);
  2198. smalltalk.addMethod(
  2199. unescape('_printString'),
  2200. smalltalk.method({
  2201. selector: unescape('printString'),
  2202. category: 'printing',
  2203. fn: function () {
  2204. var self = this;
  2205. return smalltalk.send(self, "_asString", []);
  2206. return self;
  2207. },
  2208. args: [],
  2209. source: unescape('printString%0A%09%5Eself%20asString'),
  2210. messageSends: ["asString"],
  2211. referencedClasses: []
  2212. }),
  2213. smalltalk.Date);
  2214. smalltalk.addMethod(
  2215. unescape('_seconds'),
  2216. smalltalk.method({
  2217. selector: unescape('seconds'),
  2218. category: 'accessing',
  2219. fn: function () {
  2220. var self = this;
  2221. return self.getSeconds();
  2222. return self;
  2223. },
  2224. args: [],
  2225. source: unescape('seconds%0A%09%3Creturn%20self.getSeconds%28%29%3E'),
  2226. messageSends: [],
  2227. referencedClasses: []
  2228. }),
  2229. smalltalk.Date);
  2230. smalltalk.addMethod(
  2231. unescape('_seconds_'),
  2232. smalltalk.method({
  2233. selector: unescape('seconds%3A'),
  2234. category: 'accessing',
  2235. fn: function (aNumber) {
  2236. var self = this;
  2237. self.setSeconds(aNumber);
  2238. return self;
  2239. },
  2240. args: ["aNumber"],
  2241. source: unescape('seconds%3A%20aNumber%0A%09%3Cself.setSeconds%28aNumber%29%3E'),
  2242. messageSends: [],
  2243. referencedClasses: []
  2244. }),
  2245. smalltalk.Date);
  2246. smalltalk.addMethod(
  2247. unescape('_time'),
  2248. smalltalk.method({
  2249. selector: unescape('time'),
  2250. category: 'accessing',
  2251. fn: function () {
  2252. var self = this;
  2253. return self.getTime();
  2254. return self;
  2255. },
  2256. args: [],
  2257. source: unescape('time%0A%09%3Creturn%20self.getTime%28%29%3E'),
  2258. messageSends: [],
  2259. referencedClasses: []
  2260. }),
  2261. smalltalk.Date);
  2262. smalltalk.addMethod(
  2263. unescape('_time_'),
  2264. smalltalk.method({
  2265. selector: unescape('time%3A'),
  2266. category: 'accessing',
  2267. fn: function (aNumber) {
  2268. var self = this;
  2269. self.setTime(aNumber);
  2270. return self;
  2271. },
  2272. args: ["aNumber"],
  2273. source: unescape('time%3A%20aNumber%0A%09%3Cself.setTime%28aNumber%29%3E'),
  2274. messageSends: [],
  2275. referencedClasses: []
  2276. }),
  2277. smalltalk.Date);
  2278. smalltalk.addMethod(
  2279. unescape('_year'),
  2280. smalltalk.method({
  2281. selector: unescape('year'),
  2282. category: 'accessing',
  2283. fn: function () {
  2284. var self = this;
  2285. return self.getFullYear();
  2286. return self;
  2287. },
  2288. args: [],
  2289. source: unescape('year%0A%09%3Creturn%20self.getFullYear%28%29%3E'),
  2290. messageSends: [],
  2291. referencedClasses: []
  2292. }),
  2293. smalltalk.Date);
  2294. smalltalk.addMethod(
  2295. unescape('_year_'),
  2296. smalltalk.method({
  2297. selector: unescape('year%3A'),
  2298. category: 'accessing',
  2299. fn: function (aNumber) {
  2300. var self = this;
  2301. self.setFullYear(aNumber);
  2302. return self;
  2303. },
  2304. args: ["aNumber"],
  2305. source: unescape('year%3A%20aNumber%0A%09%3Cself.setFullYear%28aNumber%29%3E'),
  2306. messageSends: [],
  2307. referencedClasses: []
  2308. }),
  2309. smalltalk.Date);
  2310. smalltalk.addMethod(
  2311. unescape('_fromMilliseconds_'),
  2312. smalltalk.method({
  2313. selector: unescape('fromMilliseconds%3A'),
  2314. category: 'instance creation',
  2315. fn: function (aNumber) {
  2316. var self = this;
  2317. return smalltalk.send(self, "_new_", [aNumber]);
  2318. return self;
  2319. },
  2320. args: ["aNumber"],
  2321. source: unescape('fromMilliseconds%3A%20aNumber%0A%09%5Eself%20new%3A%20aNumber'),
  2322. messageSends: ["new:"],
  2323. referencedClasses: []
  2324. }),
  2325. smalltalk.Date.klass);
  2326. smalltalk.addMethod(
  2327. unescape('_fromSeconds_'),
  2328. smalltalk.method({
  2329. selector: unescape('fromSeconds%3A'),
  2330. category: 'instance creation',
  2331. fn: function (aNumber) {
  2332. var self = this;
  2333. return smalltalk.send(self, "_fromMilliseconds_", [($receiver = aNumber).klass === smalltalk.Number ? $receiver * 1000 : smalltalk.send($receiver, "__star", [1000])]);
  2334. return self;
  2335. },
  2336. args: ["aNumber"],
  2337. source: unescape('fromSeconds%3A%20aNumber%0A%09%5Eself%20fromMilliseconds%3A%20aNumber%20*%201000'),
  2338. messageSends: ["fromMilliseconds:", unescape("*")],
  2339. referencedClasses: []
  2340. }),
  2341. smalltalk.Date.klass);
  2342. smalltalk.addMethod(
  2343. unescape('_fromString_'),
  2344. smalltalk.method({
  2345. selector: unescape('fromString%3A'),
  2346. category: 'instance creation',
  2347. fn: function (aString) {
  2348. var self = this;
  2349. return smalltalk.send(self, "_new_", [aString]);
  2350. return self;
  2351. },
  2352. args: ["aString"],
  2353. source: unescape('fromString%3A%20aString%0A%09%22Example%3A%20Date%20fromString%28%272011/04/15%2000%3A00%3A00%27%29%22%0A%09%5Eself%20new%3A%20aString'),
  2354. messageSends: ["new:"],
  2355. referencedClasses: []
  2356. }),
  2357. smalltalk.Date.klass);
  2358. smalltalk.addMethod(
  2359. unescape('_millisecondsToRun_'),
  2360. smalltalk.method({
  2361. selector: unescape('millisecondsToRun%3A'),
  2362. category: 'instance creation',
  2363. fn: function (aBlock) {
  2364. var self = this;
  2365. var t = nil;
  2366. t = smalltalk.send(smalltalk.Date || Date, "_now", []);
  2367. smalltalk.send(aBlock, "_value", []);
  2368. return ($receiver = smalltalk.send(smalltalk.Date || Date, "_now", [])).klass === smalltalk.Number ? $receiver - t : smalltalk.send($receiver, "__minus", [t]);
  2369. return self;
  2370. },
  2371. args: ["aBlock"],
  2372. source: unescape('millisecondsToRun%3A%20aBlock%0A%09%7C%20t%20%7C%0A%09t%20%3A%3D%20Date%20now.%0A%09aBlock%20value.%0A%09%5EDate%20now%20-%20t'),
  2373. messageSends: ["now", "value", unescape("-")],
  2374. referencedClasses: ["Date"]
  2375. }),
  2376. smalltalk.Date.klass);
  2377. smalltalk.addMethod(
  2378. unescape('_new_'),
  2379. smalltalk.method({
  2380. selector: unescape('new%3A'),
  2381. category: 'instance creation',
  2382. fn: function (anObject) {
  2383. var self = this;
  2384. return new Date(anObject);
  2385. return self;
  2386. },
  2387. args: ["anObject"],
  2388. source: unescape('new%3A%20anObject%0A%09%3Creturn%20new%20Date%28anObject%29%3E'),
  2389. messageSends: [],
  2390. referencedClasses: []
  2391. }),
  2392. smalltalk.Date.klass);
  2393. smalltalk.addMethod(
  2394. unescape('_now'),
  2395. smalltalk.method({
  2396. selector: unescape('now'),
  2397. category: 'instance creation',
  2398. fn: function () {
  2399. var self = this;
  2400. return smalltalk.send(self, "_today", []);
  2401. return self;
  2402. },
  2403. args: [],
  2404. source: unescape('now%0A%09%5Eself%20today'),
  2405. messageSends: ["today"],
  2406. referencedClasses: []
  2407. }),
  2408. smalltalk.Date.klass);
  2409. smalltalk.addMethod(
  2410. unescape('_today'),
  2411. smalltalk.method({
  2412. selector: unescape('today'),
  2413. category: 'instance creation',
  2414. fn: function () {
  2415. var self = this;
  2416. return smalltalk.send(self, "_new", []);
  2417. return self;
  2418. },
  2419. args: [],
  2420. source: unescape('today%0A%09%5Eself%20new'),
  2421. messageSends: ["new"],
  2422. referencedClasses: []
  2423. }),
  2424. smalltalk.Date.klass);
  2425. smalltalk.addClass('JSObjectProxy', smalltalk.Object, ['jsObject'], 'Kernel-Objects');
  2426. smalltalk.JSObjectProxy.comment=unescape('JSObjectProxy%20handles%20sending%20messages%20to%20JavaScript%20object%2C%20therefore%20accessing%20JavaScript%20objects%20from%20Amber%20is%20transparent.%0AJSOjbectProxy%20makes%20intensive%20use%20of%20%60%23doesNotUnderstand%3A%60.%0A%0A%23%23%20Examples%0A%0AJSObjectProxy%20objects%20are%20instanciated%20by%20Amber%20when%20a%20Smalltalk%20message%20is%20sent%20to%20a%20JavaScript%20object.%0A%0A%20%20%20%20window%20alert%3A%20%27hello%20world%27.%0A%20%20%20%20window%20inspect.%0A%20%20%20%20%28window%20jQuery%3A%20%27body%27%29%20append%3A%20%27hello%20world%27%0A%0ASmalltalk%20messages%20sends%20are%20converted%20to%20JavaScript%20function%20calls%20or%20object%20property%20access%20_%28in%20this%20order%29_.%20If%20n%20one%20of%20them%20match%2C%20a%20%60MessageNotUnderstood%60%20error%20will%20be%20thrown.%20%0A%0A%23%23%20Message%20conversion%20rules%0A%0A-%20%60someUser%20name%60%20becomes%20%20%60someUser.name%60%0A-%20%60someUser%20name%3A%20%27John%27%60%20becomes%20%60someUser%20name%20%3D%20%22John%22%60%0A-%20%60console%20log%3A%20%27hello%20world%27%60%20becomes%20%60console.log%28%27hello%20world%27%29%60%0A-%20%60%28window%20jQuery%3A%20%27foo%27%29%20css%3A%20%27background%27%20color%3A%20%27red%27%60%20becomes%20%60window.jQuery%28%27foo%27%29.css%28%27background%27%2C%20%27red%27%29%60%0A%0A__Note%3A__%20For%20keyword-based%20messages%2C%20only%20the%20first%20keyword%20is%20kept%3A%20%60window%20foo%3A%201%20bar%3A%202%60%20is%20equivalent%20to%20%60window%20foo%3A%201%20baz%3A%202%60.')
  2427. smalltalk.addMethod(
  2428. unescape('_at_'),
  2429. smalltalk.method({
  2430. selector: unescape('at%3A'),
  2431. category: 'accessing',
  2432. fn: function (aSymbol) {
  2433. var self = this;
  2434. var attr = nil;
  2435. attr = smalltalk.send(aSymbol, "_asString", []);
  2436. return self['@jsObject'][attr];
  2437. return self;
  2438. },
  2439. args: ["aSymbol"],
  2440. source: unescape('at%3A%20aSymbol%0A%09%7C%20attr%20%7C%0A%09attr%20%3A%3D%20aSymbol%20asString.%0A%09%3Creturn%20self%5B%27@jsObject%27%5D%5Battr%5D%3E'),
  2441. messageSends: ["asString"],
  2442. referencedClasses: []
  2443. }),
  2444. smalltalk.JSObjectProxy);
  2445. smalltalk.addMethod(
  2446. unescape('_at_put_'),
  2447. smalltalk.method({
  2448. selector: unescape('at%3Aput%3A'),
  2449. category: 'accessing',
  2450. fn: function (aSymbol, anObject) {
  2451. var self = this;
  2452. var attr = nil;
  2453. attr = smalltalk.send(aSymbol, "_asString", []);
  2454. self['@jsObject'][attr] = anObject;
  2455. return self;
  2456. },
  2457. args: ["aSymbol", "anObject"],
  2458. source: unescape('at%3A%20aSymbol%20put%3A%20anObject%0A%09%7C%20attr%20%7C%0A%09attr%20%3A%3D%20aSymbol%20asString.%0A%09%3Cself%5B%27@jsObject%27%5D%5Battr%5D%20%3D%20anObject%3E'),
  2459. messageSends: ["asString"],
  2460. referencedClasses: []
  2461. }),
  2462. smalltalk.JSObjectProxy);
  2463. smalltalk.addMethod(
  2464. unescape('_doesNotUnderstand_'),
  2465. smalltalk.method({
  2466. selector: unescape('doesNotUnderstand%3A'),
  2467. category: 'proxy',
  2468. fn: function (aMessage) {
  2469. var self = this;
  2470. var obj = nil;
  2471. var selector = nil;
  2472. var jsSelector = nil;
  2473. var arguments = nil;
  2474. obj = smalltalk.send(self, "_jsObject", []);
  2475. selector = smalltalk.send(aMessage, "_selector", []);
  2476. jsSelector = smalltalk.send(selector, "_asJavaScriptSelector", []);
  2477. arguments = smalltalk.send(aMessage, "_arguments", []);
  2478. if (obj[jsSelector] != undefined) {
  2479. return smalltalk.send(obj, jsSelector, arguments);
  2480. }
  2481. smalltalk.send(self, "_doesNotUnderstand_", [aMessage], smalltalk.Object);
  2482. return self;
  2483. },
  2484. args: ["aMessage"],
  2485. source: unescape('doesNotUnderstand%3A%20aMessage%0A%09%7C%20obj%20selector%20jsSelector%20arguments%20%7C%0A%09obj%20%3A%3D%20self%20jsObject.%0A%09selector%20%3A%3D%20aMessage%20selector.%0A%09jsSelector%20%3A%3D%20selector%20asJavaScriptSelector.%0A%09arguments%20%3A%3D%20aMessage%20arguments.%0A%09%3Cif%28obj%5BjsSelector%5D%20%21%3D%20undefined%29%20%7Breturn%20smalltalk.send%28obj%2C%20jsSelector%2C%20arguments%29%7D%3E.%0A%09super%20doesNotUnderstand%3A%20aMessage'),
  2486. messageSends: ["jsObject", "selector", "asJavaScriptSelector", "arguments", "doesNotUnderstand:"],
  2487. referencedClasses: []
  2488. }),
  2489. smalltalk.JSObjectProxy);
  2490. smalltalk.addMethod(
  2491. unescape('_inspectOn_'),
  2492. smalltalk.method({
  2493. selector: unescape('inspectOn%3A'),
  2494. category: 'proxy',
  2495. fn: function (anInspector) {
  2496. var self = this;
  2497. var variables = nil;
  2498. variables = smalltalk.send(smalltalk.Dictionary || Dictionary, "_new", []);
  2499. smalltalk.send(variables, "_at_put_", [unescape("%23self"), smalltalk.send(self, "_jsObject", [])]);
  2500. smalltalk.send(anInspector, "_setLabel_", [smalltalk.send(self, "_printString", [])]);
  2501. for (var i in self['@jsObject']) {
  2502. variables._at_put_(i, self['@jsObject'][i]);
  2503. }
  2504. smalltalk.send(anInspector, "_setVariables_", [variables]);
  2505. return self;
  2506. },
  2507. args: ["anInspector"],
  2508. source: unescape('inspectOn%3A%20anInspector%0A%09%7C%20variables%20%7C%0A%09variables%20%3A%3D%20Dictionary%20new.%0A%09variables%20at%3A%20%27%23self%27%20put%3A%20self%20jsObject.%0A%09anInspector%20setLabel%3A%20self%20printString.%0A%09%3Cfor%28var%20i%20in%20self%5B%27@jsObject%27%5D%29%20%7B%0A%09%09variables._at_put_%28i%2C%20self%5B%27@jsObject%27%5D%5Bi%5D%29%3B%0A%09%7D%3E.%0A%09anInspector%20setVariables%3A%20variables'),
  2509. messageSends: ["new", "at:put:", "jsObject", "setLabel:", "printString", "setVariables:"],
  2510. referencedClasses: ["Dictionary"]
  2511. }),
  2512. smalltalk.JSObjectProxy);
  2513. smalltalk.addMethod(
  2514. unescape('_jsObject'),
  2515. smalltalk.method({
  2516. selector: unescape('jsObject'),
  2517. category: 'accessing',
  2518. fn: function () {
  2519. var self = this;
  2520. return self['@jsObject'];
  2521. return self;
  2522. },
  2523. args: [],
  2524. source: unescape('jsObject%0A%09%5EjsObject'),
  2525. messageSends: [],
  2526. referencedClasses: []
  2527. }),
  2528. smalltalk.JSObjectProxy);
  2529. smalltalk.addMethod(
  2530. unescape('_jsObject_'),
  2531. smalltalk.method({
  2532. selector: unescape('jsObject%3A'),
  2533. category: 'accessing',
  2534. fn: function (aJSObject) {
  2535. var self = this;
  2536. self['@jsObject'] = aJSObject;
  2537. return self;
  2538. },
  2539. args: ["aJSObject"],
  2540. source: unescape('jsObject%3A%20aJSObject%0A%09jsObject%20%3A%3D%20aJSObject'),
  2541. messageSends: [],
  2542. referencedClasses: []
  2543. }),
  2544. smalltalk.JSObjectProxy);
  2545. smalltalk.addMethod(
  2546. unescape('_printString'),
  2547. smalltalk.method({
  2548. selector: unescape('printString'),
  2549. category: 'proxy',
  2550. fn: function () {
  2551. var self = this;
  2552. return smalltalk.send(smalltalk.send(self, "_jsObject", []), "_toString", []);
  2553. return self;
  2554. },
  2555. args: [],
  2556. source: unescape('printString%0A%09%5Eself%20jsObject%20toString'),
  2557. messageSends: ["toString", "jsObject"],
  2558. referencedClasses: []
  2559. }),
  2560. smalltalk.JSObjectProxy);
  2561. smalltalk.addMethod(
  2562. unescape('_on_'),
  2563. smalltalk.method({
  2564. selector: unescape('on%3A'),
  2565. category: 'instance creation',
  2566. fn: function (aJSObject) {
  2567. var self = this;
  2568. return function ($rec) {smalltalk.send($rec, "_jsObject_", [aJSObject]);return smalltalk.send($rec, "_yourself", []);}(smalltalk.send(self, "_new", []));
  2569. return self;
  2570. },
  2571. args: ["aJSObject"],
  2572. source: unescape('on%3A%20aJSObject%0A%09%5Eself%20new%0A%09%09jsObject%3A%20aJSObject%3B%0A%09%09yourself'),
  2573. messageSends: ["jsObject:", "yourself", "new"],
  2574. referencedClasses: []
  2575. }),
  2576. smalltalk.JSObjectProxy.klass);
  2577. smalltalk.addClass('Number', smalltalk.Object, [], 'Kernel-Objects');
  2578. smalltalk.Number.comment=unescape('Number%20holds%20the%20most%20general%20methods%20for%20dealing%20with%20numbers.%20%20%0ANumber%20is%20directly%20mapped%20to%20JavaScript%20Number.%0A%0AMost%20arithmetic%20methods%20like%20%60%23+%60%20%60%23/%60%20%60%23-%60%20%60%23max%3A%60%20are%20directly%20inlined%20into%20javascript.%20%0A%0A%23%23Enumerating%0AA%20Number%20can%20be%20used%20to%20evaluate%20a%20Block%20a%20fixed%20number%20of%20times%3A%0A%0A%095%20timesRepeat%3A%20%5BTranscript%20show%3A%20%27This%20will%20be%20printed%205%20times%27%3B%20cr%5D.%0A%09%0A%091%20to%3A%205%20do%3A%20%5B%3AaNumber%7C%20Transcript%20show%3A%20aNumber%20asString%3B%20cr%5D.%0A%09%0A%091%20to%3A%2010%20by%3A%202%20do%3A%20%5B%3AaNumber%7C%20Transcript%20show%3A%20aNumber%20asString%3B%20cr%5D.')
  2579. smalltalk.addMethod(
  2580. unescape('__star'),
  2581. smalltalk.method({
  2582. selector: unescape('*'),
  2583. category: 'arithmetic',
  2584. fn: function (aNumber) {
  2585. var self = this;
  2586. return self * aNumber;
  2587. return self;
  2588. },
  2589. args: ["aNumber"],
  2590. source: unescape('*%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20*%20aNumber%3E'),
  2591. messageSends: [],
  2592. referencedClasses: []
  2593. }),
  2594. smalltalk.Number);
  2595. smalltalk.addMethod(
  2596. unescape('__plus'),
  2597. smalltalk.method({
  2598. selector: unescape('+'),
  2599. category: 'arithmetic',
  2600. fn: function (aNumber) {
  2601. var self = this;
  2602. return self + aNumber;
  2603. return self;
  2604. },
  2605. args: ["aNumber"],
  2606. source: unescape('+%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20+%20aNumber%3E'),
  2607. messageSends: [],
  2608. referencedClasses: []
  2609. }),
  2610. smalltalk.Number);
  2611. smalltalk.addMethod(
  2612. unescape('__minus'),
  2613. smalltalk.method({
  2614. selector: unescape('-'),
  2615. category: 'arithmetic',
  2616. fn: function (aNumber) {
  2617. var self = this;
  2618. return self - aNumber;
  2619. return self;
  2620. },
  2621. args: ["aNumber"],
  2622. source: unescape('-%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20-%20aNumber%3E'),
  2623. messageSends: [],
  2624. referencedClasses: []
  2625. }),
  2626. smalltalk.Number);
  2627. smalltalk.addMethod(
  2628. unescape('__slash'),
  2629. smalltalk.method({
  2630. selector: unescape('/'),
  2631. category: 'arithmetic',
  2632. fn: function (aNumber) {
  2633. var self = this;
  2634. return self / aNumber;
  2635. return self;
  2636. },
  2637. args: ["aNumber"],
  2638. source: unescape('/%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20/%20aNumber%3E'),
  2639. messageSends: [],
  2640. referencedClasses: []
  2641. }),
  2642. smalltalk.Number);
  2643. smalltalk.addMethod(
  2644. unescape('__lt'),
  2645. smalltalk.method({
  2646. selector: unescape('%3C'),
  2647. category: 'comparing',
  2648. fn: function (aNumber) {
  2649. var self = this;
  2650. return self < aNumber;
  2651. return self;
  2652. },
  2653. args: ["aNumber"],
  2654. source: unescape('%3C%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20%3C%20aNumber%3E'),
  2655. messageSends: [],
  2656. referencedClasses: []
  2657. }),
  2658. smalltalk.Number);
  2659. smalltalk.addMethod(
  2660. unescape('__lt_eq'),
  2661. smalltalk.method({
  2662. selector: unescape('%3C%3D'),
  2663. category: 'comparing',
  2664. fn: function (aNumber) {
  2665. var self = this;
  2666. return self <= aNumber;
  2667. return self;
  2668. },
  2669. args: ["aNumber"],
  2670. source: unescape('%3C%3D%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20%3C%3D%20aNumber%3E'),
  2671. messageSends: [],
  2672. referencedClasses: []
  2673. }),
  2674. smalltalk.Number);
  2675. smalltalk.addMethod(
  2676. unescape('__eq'),
  2677. smalltalk.method({
  2678. selector: unescape('%3D'),
  2679. category: 'comparing',
  2680. fn: function (aNumber) {
  2681. var self = this;
  2682. try {
  2683. ($receiver = smalltalk.send(aNumber, "_isNumber", [])).klass === smalltalk.Boolean ? !$receiver ? function () {return function () {throw {name: "stReturn", selector: "__eq", fn: function () {return false;}};}();}() : nil : smalltalk.send($receiver, "_ifFalse_", [function () {return function () {throw {name: "stReturn", selector: "__eq", fn: function () {return false;}};}();}]);
  2684. return Number(self) == aNumber;
  2685. return self;
  2686. } catch (e) {
  2687. if (e.name === "stReturn" && e.selector === "__eq") {
  2688. return e.fn();
  2689. }
  2690. throw e;
  2691. }
  2692. },
  2693. args: ["aNumber"],
  2694. source: unescape('%3D%20aNumber%0A%09aNumber%20isNumber%20ifFalse%3A%20%5B%5Efalse%5D.%20%0A%09%3Creturn%20Number%28self%29%20%3D%3D%20aNumber%3E'),
  2695. messageSends: ["ifFalse:", "isNumber"],
  2696. referencedClasses: []
  2697. }),
  2698. smalltalk.Number);
  2699. smalltalk.addMethod(
  2700. unescape('__gt'),
  2701. smalltalk.method({
  2702. selector: unescape('%3E'),
  2703. category: 'comparing',
  2704. fn: function (aNumber) {
  2705. var self = this;
  2706. return self > aNumber;
  2707. return self;
  2708. },
  2709. args: ["aNumber"],
  2710. source: unescape('%3E%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20%3E%3E%20aNumber%3E'),
  2711. messageSends: [],
  2712. referencedClasses: []
  2713. }),
  2714. smalltalk.Number);
  2715. smalltalk.addMethod(
  2716. unescape('__gt_eq'),
  2717. smalltalk.method({
  2718. selector: unescape('%3E%3D'),
  2719. category: 'comparing',
  2720. fn: function (aNumber) {
  2721. var self = this;
  2722. return self >= aNumber;
  2723. return self;
  2724. },
  2725. args: ["aNumber"],
  2726. source: unescape('%3E%3D%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20%3E%3E%3D%20aNumber%3E'),
  2727. messageSends: [],
  2728. referencedClasses: []
  2729. }),
  2730. smalltalk.Number);
  2731. smalltalk.addMethod(
  2732. unescape('__at'),
  2733. smalltalk.method({
  2734. selector: unescape('@'),
  2735. category: 'converting',
  2736. fn: function (aNumber) {
  2737. var self = this;
  2738. return smalltalk.send(smalltalk.Point || Point, "_x_y_", [self, aNumber]);
  2739. return self;
  2740. },
  2741. args: ["aNumber"],
  2742. source: unescape('@%20aNumber%0A%09%5EPoint%20x%3A%20self%20y%3A%20aNumber'),
  2743. messageSends: ["x:y:"],
  2744. referencedClasses: ["Point"]
  2745. }),
  2746. smalltalk.Number);
  2747. smalltalk.addMethod(
  2748. unescape('_%5C%5C'),
  2749. smalltalk.method({
  2750. selector: unescape('%5C%5C'),
  2751. category: 'arithmetic',
  2752. fn: function (aNumber) {
  2753. var self = this;
  2754. return self % aNumber;
  2755. return self;
  2756. },
  2757. args: ["aNumber"],
  2758. source: unescape('%5C%5C%20aNumber%0A%09%3Creturn%20self%20%25%20aNumber%3E'),
  2759. messageSends: [],
  2760. referencedClasses: []
  2761. }),
  2762. smalltalk.Number);
  2763. smalltalk.addMethod(
  2764. unescape('_asJSON'),
  2765. smalltalk.method({
  2766. selector: unescape('asJSON'),
  2767. category: 'converting',
  2768. fn: function (){
  2769. var self=this;
  2770. return self;
  2771. return self;},
  2772. args: [],
  2773. source: unescape('asJSON%0A%09%5Eself'),
  2774. messageSends: [],
  2775. referencedClasses: []
  2776. }),
  2777. smalltalk.Number);
  2778. smalltalk.addMethod(
  2779. unescape('_asJavascript'),
  2780. smalltalk.method({
  2781. selector: unescape('asJavascript'),
  2782. category: 'converting',
  2783. fn: function () {
  2784. var self = this;
  2785. return smalltalk.send(smalltalk.send(unescape("%28"), "__comma", [smalltalk.send(self, "_printString", [])]), "__comma", [unescape("%29")]);
  2786. return self;
  2787. },
  2788. args: [],
  2789. source: unescape('asJavascript%0A%09%5E%27%28%27%2C%20self%20printString%2C%20%27%29%27'),
  2790. messageSends: [unescape("%2C"), "printString"],
  2791. referencedClasses: []
  2792. }),
  2793. smalltalk.Number);
  2794. smalltalk.addMethod(
  2795. unescape('_asPoint'),
  2796. smalltalk.method({
  2797. selector: unescape('asPoint'),
  2798. category: 'converting',
  2799. fn: function () {
  2800. var self = this;
  2801. return smalltalk.send(smalltalk.Point || Point, "_x_y_", [self, self]);
  2802. return self;
  2803. },
  2804. args: [],
  2805. source: unescape('asPoint%0A%09%5EPoint%20x%3A%20self%20y%3A%20self'),
  2806. messageSends: ["x:y:"],
  2807. referencedClasses: ["Point"]
  2808. }),
  2809. smalltalk.Number);
  2810. smalltalk.addMethod(
  2811. unescape('_asString'),
  2812. smalltalk.method({
  2813. selector: unescape('asString'),
  2814. category: 'converting',
  2815. fn: function () {
  2816. var self = this;
  2817. return smalltalk.send(self, "_printString", []);
  2818. return self;
  2819. },
  2820. args: [],
  2821. source: unescape('asString%0A%09%5Eself%20printString'),
  2822. messageSends: ["printString"],
  2823. referencedClasses: []
  2824. }),
  2825. smalltalk.Number);
  2826. smalltalk.addMethod(
  2827. unescape('_atRandom'),
  2828. smalltalk.method({
  2829. selector: unescape('atRandom'),
  2830. category: 'converting',
  2831. fn: function () {
  2832. var self = this;
  2833. return ($receiver = smalltalk.send(($receiver = smalltalk.send(smalltalk.send(smalltalk.Random || Random, "_new", []), "_next", [])).klass === smalltalk.Number ? $receiver * self : smalltalk.send($receiver, "__star", [self]), "_truncated", [])).klass === smalltalk.Number ? $receiver + 1 : smalltalk.send($receiver, "__plus", [1]);
  2834. return self;
  2835. },
  2836. args: [],
  2837. source: unescape('atRandom%0A%20%20%20%20%5E%28Random%20new%20next%20*%20self%29%20truncated%20+%201'),
  2838. messageSends: [unescape("+"), "truncated", unescape("*"), "next", "new"],
  2839. referencedClasses: ["Random"]
  2840. }),
  2841. smalltalk.Number);
  2842. smalltalk.addMethod(
  2843. unescape('_clearInterval'),
  2844. smalltalk.method({
  2845. selector: unescape('clearInterval'),
  2846. category: 'timeouts/intervals',
  2847. fn: function () {
  2848. var self = this;
  2849. clearInterval(Number(self));
  2850. return self;
  2851. },
  2852. args: [],
  2853. source: unescape('clearInterval%0A%09%3CclearInterval%28Number%28self%29%29%3E'),
  2854. messageSends: [],
  2855. referencedClasses: []
  2856. }),
  2857. smalltalk.Number);
  2858. smalltalk.addMethod(
  2859. unescape('_clearTimeout'),
  2860. smalltalk.method({
  2861. selector: unescape('clearTimeout'),
  2862. category: 'timeouts/intervals',
  2863. fn: function () {
  2864. var self = this;
  2865. clearTimeout(Number(self));
  2866. return self;
  2867. },
  2868. args: [],
  2869. source: unescape('clearTimeout%0A%09%3CclearTimeout%28Number%28self%29%29%3E'),
  2870. messageSends: [],
  2871. referencedClasses: []
  2872. }),
  2873. smalltalk.Number);
  2874. smalltalk.addMethod(
  2875. unescape('_copy'),
  2876. smalltalk.method({
  2877. selector: unescape('copy'),
  2878. category: 'copying',
  2879. fn: function () {
  2880. var self = this;
  2881. return self;
  2882. return self;
  2883. },
  2884. args: [],
  2885. source: unescape('copy%0A%09%5Eself'),
  2886. messageSends: [],
  2887. referencedClasses: []
  2888. }),
  2889. smalltalk.Number);
  2890. smalltalk.addMethod(
  2891. unescape('_deepCopy'),
  2892. smalltalk.method({
  2893. selector: unescape('deepCopy'),
  2894. category: 'copying',
  2895. fn: function () {
  2896. var self = this;
  2897. return smalltalk.send(self, "_copy", []);
  2898. return self;
  2899. },
  2900. args: [],
  2901. source: unescape('deepCopy%0A%09%5Eself%20copy'),
  2902. messageSends: ["copy"],
  2903. referencedClasses: []
  2904. }),
  2905. smalltalk.Number);
  2906. smalltalk.addMethod(
  2907. unescape('_even'),
  2908. smalltalk.method({
  2909. selector: unescape('even'),
  2910. category: 'testing',
  2911. fn: function () {
  2912. var self = this;
  2913. return smalltalk.send(0, "__eq", [smalltalk.send(self, "_\\\\", [2])]);
  2914. return self;
  2915. },
  2916. args: [],
  2917. source: unescape('even%0A%09%5E%200%20%3D%20%28self%20%5C%5C%202%29'),
  2918. messageSends: [unescape("%3D"), unescape("%5C%5C%5C%5C")],
  2919. referencedClasses: []
  2920. }),
  2921. smalltalk.Number);
  2922. smalltalk.addMethod(
  2923. unescape('_identityHash'),
  2924. smalltalk.method({
  2925. selector: unescape('identityHash'),
  2926. category: 'accessing',
  2927. fn: function () {
  2928. var self = this;
  2929. return smalltalk.send(smalltalk.send(self, "_asString", []), "__comma", ["n"]);
  2930. return self;
  2931. },
  2932. args: [],
  2933. source: unescape('identityHash%0A%09%5Eself%20asString%2C%20%27n%27'),
  2934. messageSends: [unescape("%2C"), "asString"],
  2935. referencedClasses: []
  2936. }),
  2937. smalltalk.Number);
  2938. smalltalk.addMethod(
  2939. unescape('_isNumber'),
  2940. smalltalk.method({
  2941. selector: unescape('isNumber'),
  2942. category: 'testing',
  2943. fn: function () {
  2944. var self = this;
  2945. return true;
  2946. return self;
  2947. },
  2948. args: [],
  2949. source: unescape('isNumber%0A%09%5Etrue'),
  2950. messageSends: [],
  2951. referencedClasses: []
  2952. }),
  2953. smalltalk.Number);
  2954. smalltalk.addMethod(
  2955. unescape('_isZero'),
  2956. smalltalk.method({
  2957. selector: unescape('isZero'),
  2958. category: 'testing',
  2959. fn: function () {
  2960. var self = this;
  2961. return smalltalk.send(self, "__eq", [0]);
  2962. return self;
  2963. },
  2964. args: [],
  2965. source: unescape('isZero%0A%09%5Eself%20%3D%200'),
  2966. messageSends: [unescape("%3D")],
  2967. referencedClasses: []
  2968. }),
  2969. smalltalk.Number);
  2970. smalltalk.addMethod(
  2971. unescape('_max_'),
  2972. smalltalk.method({
  2973. selector: unescape('max%3A'),
  2974. category: 'arithmetic',
  2975. fn: function (aNumber) {
  2976. var self = this;
  2977. return Math.max(self, aNumber);
  2978. return self;
  2979. },
  2980. args: ["aNumber"],
  2981. source: unescape('max%3A%20aNumber%0A%09%3Creturn%20Math.max%28self%2C%20aNumber%29%3B%3E'),
  2982. messageSends: [],
  2983. referencedClasses: []
  2984. }),
  2985. smalltalk.Number);
  2986. smalltalk.addMethod(
  2987. unescape('_min_'),
  2988. smalltalk.method({
  2989. selector: unescape('min%3A'),
  2990. category: 'arithmetic',
  2991. fn: function (aNumber) {
  2992. var self = this;
  2993. return Math.min(self, aNumber);
  2994. return self;
  2995. },
  2996. args: ["aNumber"],
  2997. source: unescape('min%3A%20aNumber%0A%09%3Creturn%20Math.min%28self%2C%20aNumber%29%3B%3E'),
  2998. messageSends: [],
  2999. referencedClasses: []
  3000. }),
  3001. smalltalk.Number);
  3002. smalltalk.addMethod(
  3003. unescape('_negated'),
  3004. smalltalk.method({
  3005. selector: unescape('negated'),
  3006. category: 'arithmetic',
  3007. fn: function () {
  3008. var self = this;
  3009. return 0 - self;
  3010. return self;
  3011. },
  3012. args: [],
  3013. source: unescape('negated%0A%09%5E0%20-%20self'),
  3014. messageSends: [unescape("-")],
  3015. referencedClasses: []
  3016. }),
  3017. smalltalk.Number);
  3018. smalltalk.addMethod(
  3019. unescape('_negative'),
  3020. smalltalk.method({
  3021. selector: unescape('negative'),
  3022. category: 'testing',
  3023. fn: function () {
  3024. var self = this;
  3025. return self < 0;
  3026. return self;
  3027. },
  3028. args: [],
  3029. source: unescape('negative%0A%09%22Answer%20whether%20the%20receiver%20is%20mathematically%20negative.%22%0A%0A%09%5E%20self%20%3C%200'),
  3030. messageSends: [unescape("%3C")],
  3031. referencedClasses: []
  3032. }),
  3033. smalltalk.Number);
  3034. smalltalk.addMethod(
  3035. unescape('_odd'),
  3036. smalltalk.method({
  3037. selector: unescape('odd'),
  3038. category: 'testing',
  3039. fn: function () {
  3040. var self = this;
  3041. return smalltalk.send(smalltalk.send(self, "_even", []), "_not", []);
  3042. return self;
  3043. },
  3044. args: [],
  3045. source: unescape('odd%0A%09%5E%20self%20even%20not'),
  3046. messageSends: ["not", "even"],
  3047. referencedClasses: []
  3048. }),
  3049. smalltalk.Number);
  3050. smalltalk.addMethod(
  3051. unescape('_positive'),
  3052. smalltalk.method({
  3053. selector: unescape('positive'),
  3054. category: 'testing',
  3055. fn: function () {
  3056. var self = this;
  3057. return self >= 0;
  3058. return self;
  3059. },
  3060. args: [],
  3061. source: unescape('positive%0A%09%22Answer%20whether%20the%20receiver%20is%20positive%20or%20equal%20to%200.%20%28ST-80%20protocol%29.%22%0A%0A%09%5E%20self%20%3E%3D%200'),
  3062. messageSends: [unescape("%3E%3D")],
  3063. referencedClasses: []
  3064. }),
  3065. smalltalk.Number);
  3066. smalltalk.addMethod(
  3067. unescape('_printShowingDecimalPlaces_'),
  3068. smalltalk.method({
  3069. selector: unescape('printShowingDecimalPlaces%3A'),
  3070. category: 'printing',
  3071. fn: function (placesDesired) {
  3072. var self = this;
  3073. return self.toFixed(placesDesired);
  3074. return self;
  3075. },
  3076. args: ["placesDesired"],
  3077. source: unescape('printShowingDecimalPlaces%3A%20placesDesired%0A%09%3Creturn%20self.toFixed%28placesDesired%29%3E'),
  3078. messageSends: [],
  3079. referencedClasses: []
  3080. }),
  3081. smalltalk.Number);
  3082. smalltalk.addMethod(
  3083. unescape('_printString'),
  3084. smalltalk.method({
  3085. selector: unescape('printString'),
  3086. category: 'printing',
  3087. fn: function () {
  3088. var self = this;
  3089. return String(self);
  3090. return self;
  3091. },
  3092. args: [],
  3093. source: unescape('printString%0A%09%3Creturn%20String%28self%29%3E'),
  3094. messageSends: [],
  3095. referencedClasses: []
  3096. }),
  3097. smalltalk.Number);
  3098. smalltalk.addMethod(
  3099. unescape('_rounded'),
  3100. smalltalk.method({
  3101. selector: unescape('rounded'),
  3102. category: 'converting',
  3103. fn: function () {
  3104. var self = this;
  3105. return Math.round(self);
  3106. return self;
  3107. },
  3108. args: [],
  3109. source: unescape('rounded%0A%09%3Creturn%20Math.round%28self%29%3B%3E'),
  3110. messageSends: [],
  3111. referencedClasses: []
  3112. }),
  3113. smalltalk.Number);
  3114. smalltalk.addMethod(
  3115. unescape('_sqrt'),
  3116. smalltalk.method({
  3117. selector: unescape('sqrt'),
  3118. category: 'arithmetic',
  3119. fn: function () {
  3120. var self = this;
  3121. return Math.sqrt(self);
  3122. return self;
  3123. },
  3124. args: [],
  3125. source: unescape('sqrt%0A%09%3Creturn%20Math.sqrt%28self%29%3E'),
  3126. messageSends: [],
  3127. referencedClasses: []
  3128. }),
  3129. smalltalk.Number);
  3130. smalltalk.addMethod(
  3131. unescape('_squared'),
  3132. smalltalk.method({
  3133. selector: unescape('squared'),
  3134. category: 'arithmetic',
  3135. fn: function () {
  3136. var self = this;
  3137. return self * self;
  3138. return self;
  3139. },
  3140. args: [],
  3141. source: unescape('squared%0A%09%5Eself%20*%20self'),
  3142. messageSends: [unescape("*")],
  3143. referencedClasses: []
  3144. }),
  3145. smalltalk.Number);
  3146. smalltalk.addMethod(
  3147. unescape('_timesRepeat_'),
  3148. smalltalk.method({
  3149. selector: unescape('timesRepeat%3A'),
  3150. category: 'enumerating',
  3151. fn: function (aBlock) {
  3152. var self = this;
  3153. var integer = nil;
  3154. var count = nil;
  3155. integer = smalltalk.send(self, "_truncated", []);
  3156. count = 1;
  3157. (function () {while (!function () {return ($receiver = count).klass === smalltalk.Number ? $receiver > self : smalltalk.send($receiver, "__gt", [self]);}()) {(function () {smalltalk.send(aBlock, "_value", []);return count = ($receiver = count).klass === smalltalk.Number ? $receiver + 1 : smalltalk.send($receiver, "__plus", [1]);}());}}());
  3158. return self;
  3159. },
  3160. args: ["aBlock"],
  3161. source: unescape('timesRepeat%3A%20aBlock%0A%09%7C%20integer%20count%20%7C%0A%09integer%20%3A%3D%20self%20truncated.%0A%09count%20%3A%3D%201.%0A%09%5Bcount%20%3E%20self%5D%20whileFalse%3A%20%5B%0A%09%20%20%20%20aBlock%20value.%0A%09%20%20%20%20count%20%3A%3D%20count%20+%201%5D'),
  3162. messageSends: ["truncated", "whileFalse:", unescape("%3E"), "value", unescape("+")],
  3163. referencedClasses: []
  3164. }),
  3165. smalltalk.Number);
  3166. smalltalk.addMethod(
  3167. unescape('_to_'),
  3168. smalltalk.method({
  3169. selector: unescape('to%3A'),
  3170. category: 'converting',
  3171. fn: function (aNumber) {
  3172. var self = this;
  3173. var array = nil;
  3174. var first = nil;
  3175. var last = nil;
  3176. var count = nil;
  3177. first = smalltalk.send(self, "_truncated", []);
  3178. last = ($receiver = smalltalk.send(aNumber, "_truncated", [])).klass === smalltalk.Number ? $receiver + 1 : smalltalk.send($receiver, "__plus", [1]);
  3179. count = 1;
  3180. array = smalltalk.send(smalltalk.Array || Array, "_new", []);
  3181. smalltalk.send(($receiver = last).klass === smalltalk.Number ? $receiver - first : smalltalk.send($receiver, "__minus", [first]), "_timesRepeat_", [function () {smalltalk.send(array, "_at_put_", [count, first]);count = ($receiver = count).klass === smalltalk.Number ? $receiver + 1 : smalltalk.send($receiver, "__plus", [1]);return first = ($receiver = first).klass === smalltalk.Number ? $receiver + 1 : smalltalk.send($receiver, "__plus", [1]);}]);
  3182. return array;
  3183. return self;
  3184. },
  3185. args: ["aNumber"],
  3186. source: unescape('to%3A%20aNumber%0A%09%7C%20array%20first%20last%20count%20%7C%0A%09first%20%3A%3D%20self%20truncated.%0A%09last%20%3A%3D%20aNumber%20truncated%20+%201.%0A%09count%20%3A%3D%201.%0A%09array%20%3A%3D%20Array%20new.%0A%09%28last%20-%20first%29%20timesRepeat%3A%20%5B%0A%09%20%20%20%20array%20at%3A%20count%20put%3A%20first.%0A%09%20%20%20%20count%20%3A%3D%20count%20+%201.%0A%09%20%20%20%20first%20%3A%3D%20first%20+%201%5D.%0A%09%5Earray'),
  3187. messageSends: ["truncated", unescape("+"), "new", "timesRepeat:", unescape("-"), "at:put:"],
  3188. referencedClasses: ["Array"]
  3189. }),
  3190. smalltalk.Number);
  3191. smalltalk.addMethod(
  3192. unescape('_to_by_'),
  3193. smalltalk.method({
  3194. selector: unescape('to%3Aby%3A'),
  3195. category: 'converting',
  3196. fn: function (stop, step) {
  3197. var self = this;
  3198. var array = nil;
  3199. var value = nil;
  3200. var pos = nil;
  3201. value = self;
  3202. array = smalltalk.send(smalltalk.Array || Array, "_new", []);
  3203. pos = 1;
  3204. ($receiver = smalltalk.send(step, "__eq", [0])).klass === smalltalk.Boolean ? $receiver ? function () {return smalltalk.send(self, "_error_", [unescape("step%20must%20be%20non-zero")]);}() : nil : smalltalk.send($receiver, "_ifTrue_", [function () {return smalltalk.send(self, "_error_", [unescape("step%20must%20be%20non-zero")]);}]);
  3205. ($receiver = ($receiver = step).klass === smalltalk.Number ? $receiver < 0 : smalltalk.send($receiver, "__lt", [0])).klass === smalltalk.Boolean ? $receiver ? function () {return function () {while (function () {return ($receiver = value).klass === smalltalk.Number ? $receiver >= stop : smalltalk.send($receiver, "__gt_eq", [stop]);}()) {(function () {smalltalk.send(array, "_at_put_", [pos, value]);pos = ($receiver = pos).klass === smalltalk.Number ? $receiver + 1 : smalltalk.send($receiver, "__plus", [1]);return value = ($receiver = value).klass === smalltalk.Number ? $receiver + step : smalltalk.send($receiver, "__plus", [step]);}());}}();}() : function () {return function () {while (function () {return ($receiver = value).klass === smalltalk.Number ? $receiver <= stop : smalltalk.send($receiver, "__lt_eq", [stop]);}()) {(function () {smalltalk.send(array, "_at_put_", [pos, value]);pos = ($receiver = pos).klass === smalltalk.Number ? $receiver + 1 : smalltalk.send($receiver, "__plus", [1]);return value = ($receiver = value).klass === smalltalk.Number ? $receiver + step : smalltalk.send($receiver, "__plus", [step]);}());}}();}() : smalltalk.send($receiver, "_ifTrue_ifFalse_", [function () {return function () {while (function () {return ($receiver = value).klass === smalltalk.Number ? $receiver >= stop : smalltalk.send($receiver, "__gt_eq", [stop]);}()) {(function () {smalltalk.send(array, "_at_put_", [pos, value]);pos = ($receiver = pos).klass === smalltalk.Number ? $receiver + 1 : smalltalk.send($receiver, "__plus", [1]);return value = ($receiver = value).klass === smalltalk.Number ? $receiver + step : smalltalk.send($receiver, "__plus", [step]);}());}}();}, function () {return function () {while (function () {return ($receiver = value).klass === smalltalk.Number ? $receiver <= stop : smalltalk.send($receiver, "__lt_eq", [stop]);}()) {(function () {smalltalk.send(array, "_at_put_", [pos, value]);pos = ($receiver = pos).klass === smalltalk.Number ? $receiver + 1 : smalltalk.send($receiver, "__plus", [1]);return value = ($receiver = value).klass === smalltalk.Number ? $receiver + step : smalltalk.send($receiver, "__plus", [step]);}());}}();}]);
  3206. return array;
  3207. return self;
  3208. },
  3209. args: ["stop", "step"],
  3210. source: unescape('to%3A%20stop%20by%3A%20step%0A%09%7C%20array%20value%20pos%20%7C%0A%09value%20%3A%3D%20self.%0A%09array%20%3A%3D%20Array%20new.%0A%09pos%20%3A%3D%201.%0A%09step%20%3D%200%20ifTrue%3A%20%5Bself%20error%3A%20%27step%20must%20be%20non-zero%27%5D.%0A%09step%20%3C%200%0A%09%09ifTrue%3A%20%5B%5B%20value%20%3E%3D%20stop%20%5D%20whileTrue%3A%20%5B%0A%09%20%20%20%20%09%09%09array%20at%3A%20pos%20put%3A%20value.%0A%09%20%20%20%20%09%09%09pos%20%3A%3D%20pos%20+%201.%0A%09%20%20%20%20%09%09%09value%20%3A%3D%20value%20+%20step%5D%5D%0A%09%09ifFalse%3A%20%5B%5B%20value%20%3C%3D%20stop%20%5D%20whileTrue%3A%20%5B%0A%09%20%20%20%20%09%09%09array%20at%3A%20pos%20put%3A%20value.%0A%09%20%20%09%09%09pos%20%3A%3D%20pos%20+%201.%0A%09%20%20%20%20%09%09%09value%20%3A%3D%20value%20+%20step%5D%5D.%0A%09%5Earray'),
  3211. messageSends: ["new", "ifTrue:", unescape("%3D"), "error:", "ifTrue:ifFalse:", unescape("%3C"), "whileTrue:", unescape("%3E%3D"), "at:put:", unescape("+"), unescape("%3C%3D")],
  3212. referencedClasses: ["Array"]
  3213. }),
  3214. smalltalk.Number);
  3215. smalltalk.addMethod(
  3216. unescape('_to_by_do_'),
  3217. smalltalk.method({
  3218. selector: unescape('to%3Aby%3Ado%3A'),
  3219. category: 'enumerating',
  3220. fn: function (stop, step, aBlock) {
  3221. var self = this;
  3222. var value = nil;
  3223. value = self;
  3224. ($receiver = smalltalk.send(step, "__eq", [0])).klass === smalltalk.Boolean ? $receiver ? function () {return smalltalk.send(self, "_error_", [unescape("step%20must%20be%20non-zero")]);}() : nil : smalltalk.send($receiver, "_ifTrue_", [function () {return smalltalk.send(self, "_error_", [unescape("step%20must%20be%20non-zero")]);}]);
  3225. ($receiver = ($receiver = step).klass === smalltalk.Number ? $receiver < 0 : smalltalk.send($receiver, "__lt", [0])).klass === smalltalk.Boolean ? $receiver ? function () {return function () {while (function () {return ($receiver = value).klass === smalltalk.Number ? $receiver >= stop : smalltalk.send($receiver, "__gt_eq", [stop]);}()) {(function () {smalltalk.send(aBlock, "_value_", [value]);return value = ($receiver = value).klass === smalltalk.Number ? $receiver + step : smalltalk.send($receiver, "__plus", [step]);}());}}();}() : function () {return function () {while (function () {return ($receiver = value).klass === smalltalk.Number ? $receiver <= stop : smalltalk.send($receiver, "__lt_eq", [stop]);}()) {(function () {smalltalk.send(aBlock, "_value_", [value]);return value = ($receiver = value).klass === smalltalk.Number ? $receiver + step : smalltalk.send($receiver, "__plus", [step]);}());}}();}() : smalltalk.send($receiver, "_ifTrue_ifFalse_", [function () {return function () {while (function () {return ($receiver = value).klass === smalltalk.Number ? $receiver >= stop : smalltalk.send($receiver, "__gt_eq", [stop]);}()) {(function () {smalltalk.send(aBlock, "_value_", [value]);return value = ($receiver = value).klass === smalltalk.Number ? $receiver + step : smalltalk.send($receiver, "__plus", [step]);}());}}();}, function () {return function () {while (function () {return ($receiver = value).klass === smalltalk.Number ? $receiver <= stop : smalltalk.send($receiver, "__lt_eq", [stop]);}()) {(function () {smalltalk.send(aBlock, "_value_", [value]);return value = ($receiver = value).klass === smalltalk.Number ? $receiver + step : smalltalk.send($receiver, "__plus", [step]);}());}}();}]);
  3226. return self;
  3227. },
  3228. args: ["stop", "step", "aBlock"],
  3229. source: unescape('to%3A%20stop%20by%3A%20step%20do%3A%20aBlock%0A%09%7C%20value%20%7C%0A%09value%20%3A%3D%20self.%0A%09step%20%3D%200%20ifTrue%3A%20%5Bself%20error%3A%20%27step%20must%20be%20non-zero%27%5D.%0A%09step%20%3C%200%0A%09%09ifTrue%3A%20%5B%5B%20value%20%3E%3D%20stop%20%5D%20whileTrue%3A%20%5B%0A%09%20%20%20%20%09%09%09aBlock%20value%3A%20value.%0A%09%20%20%20%20%09%09%09value%20%3A%3D%20value%20+%20step%5D%5D%0A%09%09ifFalse%3A%20%5B%5B%20value%20%3C%3D%20stop%20%5D%20whileTrue%3A%20%5B%0A%09%20%20%20%20%09%09%09aBlock%20value%3A%20value.%0A%09%20%20%20%20%09%09%09value%20%3A%3D%20value%20+%20step%5D%5D'),
  3230. messageSends: ["ifTrue:", unescape("%3D"), "error:", "ifTrue:ifFalse:", unescape("%3C"), "whileTrue:", unescape("%3E%3D"), "value:", unescape("+"), unescape("%3C%3D")],
  3231. referencedClasses: []
  3232. }),
  3233. smalltalk.Number);
  3234. smalltalk.addMethod(
  3235. unescape('_to_do_'),
  3236. smalltalk.method({
  3237. selector: unescape('to%3Ado%3A'),
  3238. category: 'enumerating',
  3239. fn: function (stop, aBlock) {
  3240. var self = this;
  3241. var nextValue = nil;
  3242. nextValue = self;
  3243. (function () {while (function () {return ($receiver = nextValue).klass === smalltalk.Number ? $receiver <= stop : smalltalk.send($receiver, "__lt_eq", [stop]);}()) {(function () {smalltalk.send(aBlock, "_value_", [nextValue]);return nextValue = ($receiver = nextValue).klass === smalltalk.Number ? $receiver + 1 : smalltalk.send($receiver, "__plus", [1]);}());}}());
  3244. return self;
  3245. },
  3246. args: ["stop", "aBlock"],
  3247. source: unescape('to%3A%20stop%20do%3A%20aBlock%0A%09%22Evaluate%20aBlock%20for%20each%20number%20from%20self%20to%20aNumber.%22%0A%09%7C%20nextValue%20%7C%0A%09nextValue%20%3A%3D%20self.%0A%09%5BnextValue%20%3C%3D%20stop%5D%0A%09%09whileTrue%3A%20%0A%09%09%09%5BaBlock%20value%3A%20nextValue.%0A%09%09%09nextValue%20%3A%3D%20nextValue%20+%201%5D'),
  3248. messageSends: ["whileTrue:", unescape("%3C%3D"), "value:", unescape("+")],
  3249. referencedClasses: []
  3250. }),
  3251. smalltalk.Number);
  3252. smalltalk.addMethod(
  3253. unescape('_truncated'),
  3254. smalltalk.method({
  3255. selector: unescape('truncated'),
  3256. category: 'converting',
  3257. fn: function () {
  3258. var self = this;
  3259. var result = nil;
  3260. ($receiver = self >= 0).klass === smalltalk.Boolean ? $receiver ? function () {return result = Math.floor(self);}() : function () {return result = Math.floor(self * -1) * -1;}() : smalltalk.send($receiver, "_ifTrue_ifFalse_", [function () {return result = Math.floor(self);}, function () {return result = Math.floor(self * -1) * -1;}]);
  3261. return result;
  3262. return self;
  3263. },
  3264. args: [],
  3265. source: unescape('truncated%0A%7Cresult%7C%0A%0A%20%20%20%20self%20%3E%3D%200%20%0A%20%20%20%20%20%20%20%20ifTrue%3A%20%5B%3Cresult%20%3D%20Math.floor%28self%29%3B%3E%5D%0A%20%20%20%20%20%20%20%20ifFalse%3A%20%5B%3Cresult%20%3D%20%28Math.floor%28self%20*%20%28-1%29%29%20*%20%28-1%29%29%3B%3E%5D.%0A%0A%20%20%20%20%5E%20result'),
  3266. messageSends: ["ifTrue:ifFalse:", unescape("%3E%3D")],
  3267. referencedClasses: []
  3268. }),
  3269. smalltalk.Number);
  3270. smalltalk.addMethod(
  3271. unescape('_pi'),
  3272. smalltalk.method({
  3273. selector: unescape('pi'),
  3274. category: 'instance creation',
  3275. fn: function () {
  3276. var self = this;
  3277. return Math.PI;
  3278. return self;
  3279. },
  3280. args: [],
  3281. source: unescape('pi%0A%09%3Creturn%20Math.PI%3E'),
  3282. messageSends: [],
  3283. referencedClasses: []
  3284. }),
  3285. smalltalk.Number.klass);
  3286. smalltalk.addClass('Package', smalltalk.Object, ['commitPathJs', 'commitPathSt'], 'Kernel-Objects');
  3287. smalltalk.Package.comment=unescape('A%20Package%20is%20similar%20to%20a%20%22class%20category%22%20typically%20found%20in%20other%20Smalltalks%20like%20Pharo%20or%20Squeak.%20Amber%20does%20not%20have%20class%20categories%20anymore%2C%20it%20had%20in%20the%20beginning%20but%20now%20each%20class%20in%20the%20system%20knows%20which%20package%20it%20belongs%20to.%0A%0AA%20Package%20has%20a%20name%2C%20an%20Array%20of%20%22requires%22%2C%20a%20comment%20and%20a%20Dictionary%20with%20other%20optional%20key%20value%20attributes.%20A%20Package%20can%20also%20be%20queried%20for%20its%20classes%2C%20but%20it%20will%20then%20resort%20to%20a%20reverse%20scan%20of%20all%20classes%20to%20find%20them.%0APackages%20are%20manipulated%20through%20%22Smalltalk%20current%22%2C%20like%20for%20example%20finding%20one%20based%20on%20a%20name%3A%0A%0A%09Smalltalk%20current%20packageAt%3A%20%27Kernel%27%0A%0A...but%20you%20can%20also%20use%3A%0A%0A%09Package%20named%3A%20%27Kernel%27%0A%0AA%20Package%20differs%20slightly%20from%20a%20Monticello%20package%20which%20can%20span%20multiple%20class%20categories%20using%20a%20naming%20convention%20based%20on%20hyphenation.%20But%20just%20as%20in%20Monticello%20a%20Package%20supports%20%22class%20extensions%22%20so%20a%20Package%0Acan%20define%20behaviors%20in%20foreign%20classes%20using%20a%20naming%20convention%20for%20method%20categories%20where%20the%20category%20starts%20with%20an%20asterisk%20and%20then%20the%20name%20of%20the%20owning%20package%20follows.%20This%20can%20easily%20be%20seen%20in%20for%20example%20class%0AString%20where%20the%20method%20category%20%22*IDE%22%20defines%20%23inspectOn%3A%20which%20thus%20is%20a%20method%20belonging%20to%20the%20IDE%20package.%0A%0AYou%20can%20fetch%20a%20package%20from%20the%20server%3A%0A%0A%09Package%20fetch%3A%20%27Additional-Examples%27')
  3288. smalltalk.addMethod(
  3289. unescape('_classes'),
  3290. smalltalk.method({
  3291. selector: unescape('classes'),
  3292. category: 'classes',
  3293. fn: function () {
  3294. var self = this;
  3295. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []), "_classes", []), "_select_", [function (c) {return smalltalk.send(smalltalk.send(c, "_package", []), "__eq_eq", [self]);}]);
  3296. return self;
  3297. },
  3298. args: [],
  3299. source: unescape('classes%0A%09%22We%20need%20to%20do%20a%20reverse%20scan.%22%0A%09%5ESmalltalk%20current%20classes%20select%3A%20%5B%3Ac%20%7C%20c%20package%20%3D%3D%20self%5D'),
  3300. messageSends: ["select:", "classes", "current", unescape("%3D%3D"), "package"],
  3301. referencedClasses: ["Smalltalk"]
  3302. }),
  3303. smalltalk.Package);
  3304. smalltalk.addMethod(
  3305. unescape('_commitPathJs'),
  3306. smalltalk.method({
  3307. selector: unescape('commitPathJs'),
  3308. category: 'accessing',
  3309. fn: function () {
  3310. var self = this;
  3311. return ($receiver = self['@commitPathJs']) == nil ||
  3312. $receiver == undefined ? function () {return smalltalk.send(smalltalk.send(self, "_class", []), "_defaultCommitPathJs", []);}() : $receiver;
  3313. return self;
  3314. },
  3315. args: [],
  3316. source: unescape('commitPathJs%0A%09%5E%20commitPathJs%20ifNil%3A%20%5Bself%20class%20defaultCommitPathJs%5D'),
  3317. messageSends: ["ifNil:", "defaultCommitPathJs", "class"],
  3318. referencedClasses: []
  3319. }),
  3320. smalltalk.Package);
  3321. smalltalk.addMethod(
  3322. unescape('_commitPathJs_'),
  3323. smalltalk.method({
  3324. selector: unescape('commitPathJs%3A'),
  3325. category: 'accessing',
  3326. fn: function (aString) {
  3327. var self = this;
  3328. self['@commitPathJs'] = aString;
  3329. return self;
  3330. },
  3331. args: ["aString"],
  3332. source: unescape('commitPathJs%3A%20aString%0A%09commitPathJs%A0%3A%3D%20aString'),
  3333. messageSends: [],
  3334. referencedClasses: []
  3335. }),
  3336. smalltalk.Package);
  3337. smalltalk.addMethod(
  3338. unescape('_commitPathSt'),
  3339. smalltalk.method({
  3340. selector: unescape('commitPathSt'),
  3341. category: 'accessing',
  3342. fn: function () {
  3343. var self = this;
  3344. return ($receiver = self['@commitPathSt']) == nil ||
  3345. $receiver == undefined ? function () {return smalltalk.send(smalltalk.send(self, "_class", []), "_defaultCommitPathSt", []);}() : $receiver;
  3346. return self;
  3347. },
  3348. args: [],
  3349. source: unescape('commitPathSt%0A%09%5E%20commitPathSt%20ifNil%3A%20%5Bself%20class%20defaultCommitPathSt%5D'),
  3350. messageSends: ["ifNil:", "defaultCommitPathSt", "class"],
  3351. referencedClasses: []
  3352. }),
  3353. smalltalk.Package);
  3354. smalltalk.addMethod(
  3355. unescape('_commitPathSt_'),
  3356. smalltalk.method({
  3357. selector: unescape('commitPathSt%3A'),
  3358. category: 'accessing',
  3359. fn: function (aString) {
  3360. var self = this;
  3361. self['@commitPathSt'] = aString;
  3362. return self;
  3363. },
  3364. args: ["aString"],
  3365. source: unescape('commitPathSt%3A%20aString%0A%09commitPathSt%A0%3A%3D%20aString'),
  3366. messageSends: [],
  3367. referencedClasses: []
  3368. }),
  3369. smalltalk.Package);
  3370. smalltalk.addMethod(
  3371. unescape('_dependencies'),
  3372. smalltalk.method({
  3373. selector: unescape('dependencies'),
  3374. category: 'accessing',
  3375. fn: function () {
  3376. var self = this;
  3377. return smalltalk.send(self, "_propertyAt_ifAbsent_", ["dependencies", function () {return [];}]);
  3378. return self;
  3379. },
  3380. args: [],
  3381. source: unescape('dependencies%0A%09%5Eself%20propertyAt%3A%20%27dependencies%27%20ifAbsent%3A%20%5B%23%28%29%5D'),
  3382. messageSends: ["propertyAt:ifAbsent:"],
  3383. referencedClasses: []
  3384. }),
  3385. smalltalk.Package);
  3386. smalltalk.addMethod(
  3387. unescape('_dependencies_'),
  3388. smalltalk.method({
  3389. selector: unescape('dependencies%3A'),
  3390. category: 'accessing',
  3391. fn: function (anArray) {
  3392. var self = this;
  3393. return smalltalk.send(self, "_propertyAt_put_", ["dependencies", anArray]);
  3394. return self;
  3395. },
  3396. args: ["anArray"],
  3397. source: unescape('dependencies%3A%20anArray%0A%09%5Eself%20propertyAt%3A%20%27dependencies%27%20put%3A%20anArray'),
  3398. messageSends: ["propertyAt:put:"],
  3399. referencedClasses: []
  3400. }),
  3401. smalltalk.Package);
  3402. smalltalk.addMethod(
  3403. unescape('_jsProperties'),
  3404. smalltalk.method({
  3405. selector: unescape('jsProperties'),
  3406. category: 'private',
  3407. fn: function () {
  3408. var self = this;
  3409. return self.properties;
  3410. return self;
  3411. },
  3412. args: [],
  3413. source: unescape('jsProperties%0A%09%3Creturn%20self.properties%3E'),
  3414. messageSends: [],
  3415. referencedClasses: []
  3416. }),
  3417. smalltalk.Package);
  3418. smalltalk.addMethod(
  3419. unescape('_jsProperties_'),
  3420. smalltalk.method({
  3421. selector: unescape('jsProperties%3A'),
  3422. category: 'private',
  3423. fn: function (aJSObject) {
  3424. var self = this;
  3425. return self.properties = aJSObject;
  3426. return self;
  3427. },
  3428. args: ["aJSObject"],
  3429. source: unescape('jsProperties%3A%20aJSObject%0A%09%3Creturn%20self.properties%20%3D%20aJSObject%3E'),
  3430. messageSends: [],
  3431. referencedClasses: []
  3432. }),
  3433. smalltalk.Package);
  3434. smalltalk.addMethod(
  3435. unescape('_name'),
  3436. smalltalk.method({
  3437. selector: unescape('name'),
  3438. category: 'accessing',
  3439. fn: function () {
  3440. var self = this;
  3441. return self.pkgName;
  3442. return self;
  3443. },
  3444. args: [],
  3445. source: unescape('name%0A%09%3Creturn%20self.pkgName%3E'),
  3446. messageSends: [],
  3447. referencedClasses: []
  3448. }),
  3449. smalltalk.Package);
  3450. smalltalk.addMethod(
  3451. unescape('_name_'),
  3452. smalltalk.method({
  3453. selector: unescape('name%3A'),
  3454. category: 'accessing',
  3455. fn: function (aString) {
  3456. var self = this;
  3457. self.pkgName = aString;
  3458. return self;
  3459. },
  3460. args: ["aString"],
  3461. source: unescape('name%3A%20aString%0A%09%3Cself.pkgName%20%3D%20aString%3E'),
  3462. messageSends: [],
  3463. referencedClasses: []
  3464. }),
  3465. smalltalk.Package);
  3466. smalltalk.addMethod(
  3467. unescape('_printString'),
  3468. smalltalk.method({
  3469. selector: unescape('printString'),
  3470. category: 'printing',
  3471. fn: function () {
  3472. var self = this;
  3473. return smalltalk.send(self, "_name", []);
  3474. return self;
  3475. },
  3476. args: [],
  3477. source: unescape('printString%0A%09%5Eself%20name'),
  3478. messageSends: ["name"],
  3479. referencedClasses: []
  3480. }),
  3481. smalltalk.Package);
  3482. smalltalk.addMethod(
  3483. unescape('_properties'),
  3484. smalltalk.method({
  3485. selector: unescape('properties'),
  3486. category: 'accessing',
  3487. fn: function () {
  3488. var self = this;
  3489. return smalltalk.send(smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []), "_readJSObject_", [smalltalk.send(self, "_basicAt_", ["properties"])]);
  3490. return self;
  3491. },
  3492. args: [],
  3493. source: unescape('properties%0A%09%5ESmalltalk%20current%20readJSObject%3A%20%28self%20basicAt%3A%20%27properties%27%29'),
  3494. messageSends: ["readJSObject:", "current", "basicAt:"],
  3495. referencedClasses: ["Smalltalk"]
  3496. }),
  3497. smalltalk.Package);
  3498. smalltalk.addMethod(
  3499. unescape('_properties_'),
  3500. smalltalk.method({
  3501. selector: unescape('properties%3A'),
  3502. category: 'accessing',
  3503. fn: function (aDict) {
  3504. var self = this;
  3505. var object = nil;
  3506. object = {};
  3507. smalltalk.send(aDict, "_keysAndValuesDo_", [function (key, value) {return object[key] = value;}]);
  3508. return self.properties = object;
  3509. return self;
  3510. },
  3511. args: ["aDict"],
  3512. source: unescape('properties%3A%20aDict%0A%09%22We%20store%20it%20as%20a%20javascript%20object.%22%0A%09%0A%09%7C%20object%20%7C%0A%09%3Cobject%20%3D%20%7B%7D%3B%3E.%0A%09aDict%20keysAndValuesDo%3A%20%5B%3Akey%20%3Avalue%20%7C%0A%09%09%3Cobject%5Bkey%5D%20%3D%20value%3E.%0A%09%5D.%0A%09%3Creturn%20self.properties%20%3D%20object%3E'),
  3513. messageSends: ["keysAndValuesDo:"],
  3514. referencedClasses: []
  3515. }),
  3516. smalltalk.Package);
  3517. smalltalk.addMethod(
  3518. unescape('_propertiesAsJSON'),
  3519. smalltalk.method({
  3520. selector: unescape('propertiesAsJSON'),
  3521. category: 'private',
  3522. fn: function () {
  3523. var self = this;
  3524. return JSON.stringify(self.properties);
  3525. return self;
  3526. },
  3527. args: [],
  3528. source: unescape('propertiesAsJSON%0A%09%3Creturn%20JSON.stringify%28self.properties%29%3E'),
  3529. messageSends: [],
  3530. referencedClasses: []
  3531. }),
  3532. smalltalk.Package);
  3533. smalltalk.addMethod(
  3534. unescape('_propertyAt_'),
  3535. smalltalk.method({
  3536. selector: unescape('propertyAt%3A'),
  3537. category: 'properties',
  3538. fn: function (key) {
  3539. var self = this;
  3540. return self.properties[key];
  3541. return self;
  3542. },
  3543. args: ["key"],
  3544. source: unescape('propertyAt%3A%20key%0A%0A%09%3Creturn%20self.properties%5Bkey%5D%3E'),
  3545. messageSends: [],
  3546. referencedClasses: []
  3547. }),
  3548. smalltalk.Package);
  3549. smalltalk.addMethod(
  3550. unescape('_propertyAt_ifAbsent_'),
  3551. smalltalk.method({
  3552. selector: unescape('propertyAt%3AifAbsent%3A'),
  3553. category: 'properties',
  3554. fn: function (key, block) {
  3555. var self = this;
  3556. return ($receiver = smalltalk.send(self, "_propertyAt_", [key])) == nil ||
  3557. $receiver == undefined ? function () {return smalltalk.send(block, "_value", []);}() : $receiver;
  3558. return self;
  3559. },
  3560. args: ["key", "block"],
  3561. source: unescape('propertyAt%3A%20key%20ifAbsent%3A%20block%0A%0A%09%5E%28self%20propertyAt%3A%20key%29%20ifNil%3A%20%5Bblock%20value%5D'),
  3562. messageSends: ["ifNil:", "propertyAt:", "value"],
  3563. referencedClasses: []
  3564. }),
  3565. smalltalk.Package);
  3566. smalltalk.addMethod(
  3567. unescape('_propertyAt_put_'),
  3568. smalltalk.method({
  3569. selector: unescape('propertyAt%3Aput%3A'),
  3570. category: 'properties',
  3571. fn: function (key, value) {
  3572. var self = this;
  3573. return self.properties[key] = value;
  3574. return self;
  3575. },
  3576. args: ["key", "value"],
  3577. source: unescape('propertyAt%3A%20key%20put%3A%20value%0A%0A%09%3Creturn%20self.properties%5Bkey%5D%20%3D%20value%3E'),
  3578. messageSends: [],
  3579. referencedClasses: []
  3580. }),
  3581. smalltalk.Package);
  3582. smalltalk.addMethod(
  3583. unescape('_sortedClasses'),
  3584. smalltalk.method({
  3585. selector: unescape('sortedClasses'),
  3586. category: 'classes',
  3587. fn: function (){
  3588. var self=this;
  3589. return smalltalk.send(smalltalk.send(self, "_class", []), "_sortedClasses_", [smalltalk.send(self, "_classes", [])]);
  3590. return self;},
  3591. args: [],
  3592. source: unescape('sortedClasses%0A%09%22Answer%20all%20classes%20in%20the%20receiver%2C%20sorted%20by%20superclass/subclasses%20and%20by%20class%20name%20for%20common%20subclasses%20%28Issue%20%23143%29%22%0A%0A%09%5Eself%20class%20sortedClasses%3A%20self%20classes'),
  3593. messageSends: ["sortedClasses:", "class", "classes"],
  3594. referencedClasses: []
  3595. }),
  3596. smalltalk.Package);
  3597. smalltalk.Package.klass.iVarNames = ['defaultCommitPathJs','defaultCommitPathSt'];
  3598. smalltalk.addMethod(
  3599. unescape('_commitToLocalStorage_'),
  3600. smalltalk.method({
  3601. selector: unescape('commitToLocalStorage%3A'),
  3602. category: 'loading-storing',
  3603. fn: function (aPackageName) {
  3604. var self = this;
  3605. var key = nil;
  3606. var sourceCode = nil;
  3607. key = smalltalk.send("smalltalk.packages.", "__comma", [aPackageName]);
  3608. sourceCode = smalltalk.send(smalltalk.send(smalltalk.Exporter || Exporter, "_new", []), "_exportPackage_", [aPackageName]);
  3609. localStorage[key] = escape(sourceCode);
  3610. return self;
  3611. },
  3612. args: ["aPackageName"],
  3613. source: unescape('commitToLocalStorage%3A%20aPackageName%0A%09%7C%20key%20sourceCode%20%7C%0A%09key%20%3A%3D%20%27smalltalk.packages.%27%20%2C%20aPackageName.%0A%09sourceCode%20%3A%3D%20Exporter%20new%20exportPackage%3A%20aPackageName.%0A%09%3ClocalStorage%5Bkey%5D%20%3D%20escape%28sourceCode%29%3E'),
  3614. messageSends: [unescape("%2C"), "exportPackage:", "new"],
  3615. referencedClasses: ["Exporter"]
  3616. }),
  3617. smalltalk.Package.klass);
  3618. smalltalk.addMethod(
  3619. unescape('_defaultCommitPathJs'),
  3620. smalltalk.method({
  3621. selector: unescape('defaultCommitPathJs'),
  3622. category: 'commit paths',
  3623. fn: function () {
  3624. var self = this;
  3625. return ($receiver = self['@defaultCommitPathJs']) == nil ||
  3626. $receiver == undefined ? function () {return self['@defaultCommitPathJs'] = "js";}() : $receiver;
  3627. return self;
  3628. },
  3629. args: [],
  3630. source: unescape('defaultCommitPathJs%0A%09%5E%20defaultCommitPathJs%20ifNil%3A%20%5B%20defaultCommitPathJs%20%3A%3D%20%27js%27%5D'),
  3631. messageSends: ["ifNil:"],
  3632. referencedClasses: []
  3633. }),
  3634. smalltalk.Package.klass);
  3635. smalltalk.addMethod(
  3636. unescape('_defaultCommitPathJs_'),
  3637. smalltalk.method({
  3638. selector: unescape('defaultCommitPathJs%3A'),
  3639. category: 'commit paths',
  3640. fn: function (aString) {
  3641. var self = this;
  3642. self['@defaultCommitPathJs'] = aString;
  3643. return self;
  3644. },
  3645. args: ["aString"],
  3646. source: unescape('defaultCommitPathJs%3A%20aString%0A%09defaultCommitPathJs%20%3A%3D%20aString'),
  3647. messageSends: [],
  3648. referencedClasses: []
  3649. }),
  3650. smalltalk.Package.klass);
  3651. smalltalk.addMethod(
  3652. unescape('_defaultCommitPathSt'),
  3653. smalltalk.method({
  3654. selector: unescape('defaultCommitPathSt'),
  3655. category: 'commit paths',
  3656. fn: function () {
  3657. var self = this;
  3658. return ($receiver = self['@defaultCommitPathSt']) == nil ||
  3659. $receiver == undefined ? function () {return self['@defaultCommitPathSt'] = "st";}() : $receiver;
  3660. return self;
  3661. },
  3662. args: [],
  3663. source: unescape('defaultCommitPathSt%0A%09%5E%20defaultCommitPathSt%20ifNil%3A%20%5B%20defaultCommitPathSt%20%3A%3D%20%27st%27%5D'),
  3664. messageSends: ["ifNil:"],
  3665. referencedClasses: []
  3666. }),
  3667. smalltalk.Package.klass);
  3668. smalltalk.addMethod(
  3669. unescape('_defaultCommitPathSt_'),
  3670. smalltalk.method({
  3671. selector: unescape('defaultCommitPathSt%3A'),
  3672. category: 'commit paths',
  3673. fn: function (aString) {
  3674. var self = this;
  3675. self['@defaultCommitPathSt'] = aString;
  3676. return self;
  3677. },
  3678. args: ["aString"],
  3679. source: unescape('defaultCommitPathSt%3A%20aString%0A%09defaultCommitPathSt%20%3A%3D%20aString'),
  3680. messageSends: [],
  3681. referencedClasses: []
  3682. }),
  3683. smalltalk.Package.klass);
  3684. smalltalk.addMethod(
  3685. unescape('_fetch_'),
  3686. smalltalk.method({
  3687. selector: unescape('fetch%3A'),
  3688. category: 'loading-storing',
  3689. fn: function (aPackageName) {
  3690. var self = this;
  3691. smalltalk.send(self, "_fetch_prefix_", [aPackageName, smalltalk.send(smalltalk.send(self, "_defaultCommitPathJs", []), "__comma", [unescape("/")])]);
  3692. return self;
  3693. },
  3694. args: ["aPackageName"],
  3695. source: unescape('fetch%3A%20aPackageName%0A%09self%20fetch%3A%20aPackageName%20prefix%3A%20self%20defaultCommitPathJs%2C%20%27/%27'),
  3696. messageSends: ["fetch:prefix:", unescape("%2C"), "defaultCommitPathJs"],
  3697. referencedClasses: []
  3698. }),
  3699. smalltalk.Package.klass);
  3700. smalltalk.addMethod(
  3701. unescape('_fetch_prefix_'),
  3702. smalltalk.method({
  3703. selector: unescape('fetch%3Aprefix%3A'),
  3704. category: 'loading-storing',
  3705. fn: function (aPackageName, aPrefix) {
  3706. var self = this;
  3707. smalltalk.send(typeof jQuery == "undefined" ? nil : jQuery, "_getScript_onSuccess_", [smalltalk.send(smalltalk.send(aPrefix, "__comma", [aPackageName]), "__comma", [".js"]), function () {return smalltalk.send(smalltalk.Package || Package, "_init_", [aPackageName]);}]);
  3708. return self;
  3709. },
  3710. args: ["aPackageName", "aPrefix"],
  3711. source: unescape('fetch%3A%20aPackageName%20prefix%3A%20aPrefix%0A%09jQuery%20getScript%3A%20%28aPrefix%20%2C%20aPackageName%20%2C%20%27.js%27%29%20onSuccess%3A%20%5B%20Package%20init%3A%20aPackageName%20%5D'),
  3712. messageSends: ["getScript:onSuccess:", unescape("%2C"), "init:"],
  3713. referencedClasses: ["Package"]
  3714. }),
  3715. smalltalk.Package.klass);
  3716. smalltalk.addMethod(
  3717. unescape('_init_'),
  3718. smalltalk.method({
  3719. selector: unescape('init%3A'),
  3720. category: 'loading-storing',
  3721. fn: function (aPackageName) {
  3722. var self = this;
  3723. (function ($rec) {smalltalk.send($rec, "_do_", [function (each) {return smalltalk.init(each);}]);return smalltalk.send($rec, "_do_", [function (each) {return smalltalk.send(each, "_initialize", []);}]);}(smalltalk.send(smalltalk.send(typeof smalltalk == "undefined" ? nil : smalltalk, "_classes", []), "_select_", [function (each) {return each.pkg.pkgName == aPackageName;}])));
  3724. return self;
  3725. },
  3726. args: ["aPackageName"],
  3727. source: unescape('init%3A%20aPackageName%0A%09%28smalltalk%20classes%20select%3A%20%5B%20%3Aeach%20%7C%20%3Ceach.pkg.pkgName%20%3D%3D%20aPackageName%3E%20%5D%29%0A%09%09do%3A%20%5B%20%3Aeach%20%7C%20%3Csmalltalk.init%28each%29%3E%20%5D%3B%0A%09%09do%3A%20%5B%20%3Aeach%20%7C%20each%20initialize%20%5D'),
  3728. messageSends: ["do:", "initialize", "select:", "classes"],
  3729. referencedClasses: []
  3730. }),
  3731. smalltalk.Package.klass);
  3732. smalltalk.addMethod(
  3733. unescape('_named_'),
  3734. smalltalk.method({
  3735. selector: unescape('named%3A'),
  3736. category: 'not yet classified',
  3737. fn: function (aPackageName) {
  3738. var self = this;
  3739. return smalltalk.send(smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []), "_packageAt_", [aPackageName]);
  3740. return self;
  3741. },
  3742. args: ["aPackageName"],
  3743. source: unescape('named%3A%20aPackageName%0A%0A%09%5ESmalltalk%20current%20packageAt%3A%20aPackageName'),
  3744. messageSends: ["packageAt:", "current"],
  3745. referencedClasses: ["Smalltalk"]
  3746. }),
  3747. smalltalk.Package.klass);
  3748. smalltalk.addMethod(
  3749. unescape('_named_ifAbsent_'),
  3750. smalltalk.method({
  3751. selector: unescape('named%3AifAbsent%3A'),
  3752. category: 'not yet classified',
  3753. fn: function (aPackageName, aBlock) {
  3754. var self = this;
  3755. return smalltalk.send(smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []), "_packageAt_ifAbsent_", [aPackageName, aBlock]);
  3756. return self;
  3757. },
  3758. args: ["aPackageName", "aBlock"],
  3759. source: unescape('named%3A%20aPackageName%20ifAbsent%3A%20aBlock%0A%0A%09%5ESmalltalk%20current%20packageAt%3A%20aPackageName%20ifAbsent%3A%20aBlock'),
  3760. messageSends: ["packageAt:ifAbsent:", "current"],
  3761. referencedClasses: ["Smalltalk"]
  3762. }),
  3763. smalltalk.Package.klass);
  3764. smalltalk.addMethod(
  3765. unescape('_resetCommitPaths'),
  3766. smalltalk.method({
  3767. selector: unescape('resetCommitPaths'),
  3768. category: 'commit paths',
  3769. fn: function () {
  3770. var self = this;
  3771. self['@defaultCommitPathJs'] = nil;
  3772. self['@defaultCommitPathSt'] = nil;
  3773. return self;
  3774. },
  3775. args: [],
  3776. source: unescape('resetCommitPaths%0A%20%20%20%20%20%20%20%20defaultCommitPathJs%20%3A%3D%20nil.%0A%20%20%20%20%20%20%20%20defaultCommitPathSt%20%3A%3D%20nil.'),
  3777. messageSends: [],
  3778. referencedClasses: []
  3779. }),
  3780. smalltalk.Package.klass);
  3781. smalltalk.addMethod(
  3782. unescape('_sortedClasses_'),
  3783. smalltalk.method({
  3784. selector: unescape('sortedClasses%3A'),
  3785. category: 'sorting',
  3786. fn: function (classes){
  3787. var self=this;
  3788. var children=nil;
  3789. var others=nil;
  3790. var nodes=nil;
  3791. var expandedClasses=nil;
  3792. (children=[]);
  3793. (others=[]);
  3794. smalltalk.send(classes, "_do_", [(function(each){return ((($receiver = smalltalk.send(classes, "_includes_", [smalltalk.send(each, "_superclass", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(children, "_add_", [each]);})() : (function(){return smalltalk.send(others, "_add_", [each]);})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return smalltalk.send(children, "_add_", [each]);}), (function(){return smalltalk.send(others, "_add_", [each]);})]));})]);
  3795. (nodes=smalltalk.send(children, "_collect_", [(function(each){return smalltalk.send((smalltalk.ClassSorterNode || ClassSorterNode), "_on_classes_level_", [each, others, (0)]);})]));
  3796. (nodes=smalltalk.send(nodes, "_sorted_", [(function(a, b){return ((($receiver = smalltalk.send(smalltalk.send(a, "_theClass", []), "_name", [])).klass === smalltalk.Number) ? $receiver <=smalltalk.send(smalltalk.send(b, "_theClass", []), "_name", []) : smalltalk.send($receiver, "__lt_eq", [smalltalk.send(smalltalk.send(b, "_theClass", []), "_name", [])]));})]));
  3797. (expandedClasses=smalltalk.send((smalltalk.Array || Array), "_new", []));
  3798. smalltalk.send(nodes, "_do_", [(function(aNode){return smalltalk.send(aNode, "_traverseClassesWith_", [expandedClasses]);})]);
  3799. return expandedClasses;
  3800. return self;},
  3801. args: ["classes"],
  3802. source: unescape('sortedClasses%3A%20classes%0A%09%22Answer%20classes%2C%20sorted%20by%20superclass/subclasses%20and%20by%20class%20name%20for%20common%20subclasses%20%28Issue%20%23143%29%22%0A%0A%09%7C%20children%20others%20nodes%20expandedClasses%20%7C%0A%09children%20%3A%3D%20%23%28%29.%0A%09others%20%3A%3D%20%23%28%29.%0A%09classes%20do%3A%20%5B%3Aeach%20%7C%0A%09%09%28classes%20includes%3A%20each%20superclass%29%0A%09%09%09ifFalse%3A%20%5Bchildren%20add%3A%20each%5D%0A%09%09%09ifTrue%3A%20%5Bothers%20add%3A%20each%5D%5D.%0A%09nodes%20%3A%3D%20children%20collect%3A%20%5B%3Aeach%20%7C%0A%09%09ClassSorterNode%20on%3A%20each%20classes%3A%20others%20level%3A%200%5D.%0A%09nodes%20%3A%3D%20nodes%20sorted%3A%20%5B%3Aa%20%3Ab%20%7C%20a%20theClass%20name%20%3C%3D%20b%20theClass%20name%20%5D.%0A%09expandedClasses%20%3A%3D%20Array%20new.%0A%09nodes%20do%3A%20%5B%3AaNode%20%7C%0A%09%09aNode%20traverseClassesWith%3A%20expandedClasses%5D.%0A%09%5EexpandedClasses'),
  3803. messageSends: ["do:", "ifFalse:ifTrue:", "includes:", "superclass", "add:", "collect:", "on:classes:level:", "sorted:", unescape("%3C%3D"), "name", "theClass", "new", "traverseClassesWith:"],
  3804. referencedClasses: ["ClassSorterNode", "Array"]
  3805. }),
  3806. smalltalk.Package.klass);
  3807. smalltalk.addClass('Point', smalltalk.Object, ['x', 'y'], 'Kernel-Objects');
  3808. smalltalk.Point.comment=unescape('A%20%60Point%60%20represents%20an%20x-y%20pair%20of%20numbers%20usually%20designating%20a%20geometric%20coordinate.%0APoints%20are%20traditionally%20created%20using%20the%20binary%20%60%23@%60%20message%20to%20a%20number%3A%0A%0A%09100@120%0A%0APoints%20can%20then%20be%20arithmetically%20manipulated%3A%0A%0A%09100@100%20+%20%2810@10%29%0A%0A...or%20for%20example%3A%0A%0A%09%28100@100%29%20*%202%0A%0A**NOTE%3A**%20Creating%20a%20Point%20with%20a%20negative%20y-value%20will%20need%20a%20space%20after%20%60@%60%20in%20order%20to%20avoid%20a%20parsing%20error%3A%0A%0A%09100@%20-100%20%22but%20100@-100%20would%20not%20parse%22%0A%0AAmber%20does%20not%20have%20much%20behavior%20in%20this%20class%20out-of-the-box.')
  3809. smalltalk.addMethod(
  3810. unescape('__star'),
  3811. smalltalk.method({
  3812. selector: unescape('*'),
  3813. category: 'arithmetic',
  3814. fn: function (aPoint) {
  3815. var self = this;
  3816. return smalltalk.send(smalltalk.Point || Point, "_x_y_", [($receiver = smalltalk.send(self, "_x", [])).klass === smalltalk.Number ? $receiver * smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), ($receiver = smalltalk.send(self, "_y", [])).klass === smalltalk.Number ? $receiver * smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  3817. return self;
  3818. },
  3819. args: ["aPoint"],
  3820. source: unescape('*%20aPoint%0A%09%5EPoint%20x%3A%20self%20x%20*%20aPoint%20asPoint%20x%20y%3A%20self%20y%20*%20aPoint%20asPoint%20y'),
  3821. messageSends: ["x:y:", unescape("*"), "x", "asPoint", "y"],
  3822. referencedClasses: ["Point"]
  3823. }),
  3824. smalltalk.Point);
  3825. smalltalk.addMethod(
  3826. unescape('__plus'),
  3827. smalltalk.method({
  3828. selector: unescape('+'),
  3829. category: 'arithmetic',
  3830. fn: function (aPoint) {
  3831. var self = this;
  3832. return smalltalk.send(smalltalk.Point || Point, "_x_y_", [($receiver = smalltalk.send(self, "_x", [])).klass === smalltalk.Number ? $receiver + smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), ($receiver = smalltalk.send(self, "_y", [])).klass === smalltalk.Number ? $receiver + smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  3833. return self;
  3834. },
  3835. args: ["aPoint"],
  3836. source: unescape('+%20aPoint%0A%09%5EPoint%20x%3A%20self%20x%20+%20aPoint%20asPoint%20x%20y%3A%20self%20y%20+%20aPoint%20asPoint%20y'),
  3837. messageSends: ["x:y:", unescape("+"), "x", "asPoint", "y"],
  3838. referencedClasses: ["Point"]
  3839. }),
  3840. smalltalk.Point);
  3841. smalltalk.addMethod(
  3842. unescape('__minus'),
  3843. smalltalk.method({
  3844. selector: unescape('-'),
  3845. category: 'arithmetic',
  3846. fn: function (aPoint) {
  3847. var self = this;
  3848. return smalltalk.send(smalltalk.Point || Point, "_x_y_", [($receiver = smalltalk.send(self, "_x", [])).klass === smalltalk.Number ? $receiver - smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), ($receiver = smalltalk.send(self, "_y", [])).klass === smalltalk.Number ? $receiver - smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  3849. return self;
  3850. },
  3851. args: ["aPoint"],
  3852. source: unescape('-%20aPoint%0A%09%5EPoint%20x%3A%20self%20x%20-%20aPoint%20asPoint%20x%20y%3A%20self%20y%20-%20aPoint%20asPoint%20y'),
  3853. messageSends: ["x:y:", unescape("-"), "x", "asPoint", "y"],
  3854. referencedClasses: ["Point"]
  3855. }),
  3856. smalltalk.Point);
  3857. smalltalk.addMethod(
  3858. unescape('__slash'),
  3859. smalltalk.method({
  3860. selector: unescape('/'),
  3861. category: 'arithmetic',
  3862. fn: function (aPoint) {
  3863. var self = this;
  3864. return smalltalk.send(smalltalk.Point || Point, "_x_y_", [($receiver = smalltalk.send(self, "_x", [])).klass === smalltalk.Number ? $receiver / smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", []) : smalltalk.send($receiver, "__slash", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), ($receiver = smalltalk.send(self, "_y", [])).klass === smalltalk.Number ? $receiver / smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", []) : smalltalk.send($receiver, "__slash", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  3865. return self;
  3866. },
  3867. args: ["aPoint"],
  3868. source: unescape('/%20aPoint%0A%09%5EPoint%20x%3A%20self%20x%20/%20aPoint%20asPoint%20x%20y%3A%20self%20y%20/%20aPoint%20asPoint%20y'),
  3869. messageSends: ["x:y:", unescape("/"), "x", "asPoint", "y"],
  3870. referencedClasses: ["Point"]
  3871. }),
  3872. smalltalk.Point);
  3873. smalltalk.addMethod(
  3874. unescape('__eq'),
  3875. smalltalk.method({
  3876. selector: unescape('%3D'),
  3877. category: 'arithmetic',
  3878. fn: function (aPoint) {
  3879. var self = this;
  3880. return smalltalk.send(smalltalk.send(smalltalk.send(aPoint, "_class", []), "__eq", [smalltalk.send(self, "_class", [])]), "_and_", [function () {return smalltalk.send(smalltalk.send(smalltalk.send(aPoint, "_x", []), "__eq", [smalltalk.send(self, "_x", [])]), "_&", [smalltalk.send(smalltalk.send(aPoint, "_y", []), "__eq", [smalltalk.send(self, "_y", [])])]);}]);
  3881. return self;
  3882. },
  3883. args: ["aPoint"],
  3884. source: unescape('%3D%20aPoint%0A%09%5EaPoint%20class%20%3D%20self%20class%20and%3A%20%5B%0A%09%09%28aPoint%20x%20%3D%20self%20x%29%20%26%20%28aPoint%20y%20%3D%20self%20y%29%5D'),
  3885. messageSends: ["and:", unescape("%3D"), "class", unescape("%26"), "x", "y"],
  3886. referencedClasses: []
  3887. }),
  3888. smalltalk.Point);
  3889. smalltalk.addMethod(
  3890. unescape('_asPoint'),
  3891. smalltalk.method({
  3892. selector: unescape('asPoint'),
  3893. category: 'converting',
  3894. fn: function () {
  3895. var self = this;
  3896. return self;
  3897. return self;
  3898. },
  3899. args: [],
  3900. source: unescape('asPoint%0A%09%5Eself'),
  3901. messageSends: [],
  3902. referencedClasses: []
  3903. }),
  3904. smalltalk.Point);
  3905. smalltalk.addMethod(
  3906. unescape('_printString'),
  3907. smalltalk.method({
  3908. selector: unescape('printString'),
  3909. category: 'printing',
  3910. fn: function () {
  3911. var self = this;
  3912. return smalltalk.send(smalltalk.String || String, "_streamContents_", [function (stream) {smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(smalltalk.send(self['@x'], "_printString", []), "__comma", [unescape("@")])]);($receiver = smalltalk.send(smalltalk.send(self['@y'], "_notNil", []), "_and_", [function () {return smalltalk.send(self['@y'], "_negative", []);}])).klass === smalltalk.Boolean ? $receiver ? function () {return smalltalk.send(stream, "_space", []);}() : nil : smalltalk.send($receiver, "_ifTrue_", [function () {return smalltalk.send(stream, "_space", []);}]);return smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(self['@y'], "_printString", [])]);}]);
  3913. return self;
  3914. },
  3915. args: [],
  3916. source: unescape('printString%0A%09%22Print%20receiver%20in%20classic%20x@y%20notation.%22%0A%0A%09%5EString%20streamContents%3A%20%5B%3Astream%20%7C%0A%09%09stream%20nextPutAll%3A%20x%20printString%2C%20%27@%27.%0A%09%09%28y%20notNil%20and%3A%20%5By%20negative%5D%29%0A%09%09%09ifTrue%3A%20%5B%0A%09%09%09%09%22Avoid%20ambiguous%20@-%20construct%22%0A%09%09%09%09stream%20space%5D.%0A%09%09stream%20nextPutAll%3A%20y%20printString%5D'),
  3917. messageSends: ["streamContents:", "nextPutAll:", unescape("%2C"), "printString", "ifTrue:", "and:", "notNil", "negative", "space"],
  3918. referencedClasses: ["String"]
  3919. }),
  3920. smalltalk.Point);
  3921. smalltalk.addMethod(
  3922. unescape('_translateBy_'),
  3923. smalltalk.method({
  3924. selector: unescape('translateBy%3A'),
  3925. category: 'transforming',
  3926. fn: function (delta){
  3927. var self=this;
  3928. return smalltalk.send(((($receiver = smalltalk.send(delta, "_x", [])).klass === smalltalk.Number) ? $receiver +self['@x'] : smalltalk.send($receiver, "__plus", [self['@x']])), "__at", [((($receiver = smalltalk.send(delta, "_y", [])).klass === smalltalk.Number) ? $receiver +self['@y'] : smalltalk.send($receiver, "__plus", [self['@y']]))]);
  3929. return self;},
  3930. args: ["delta"],
  3931. source: unescape('translateBy%3A%20delta%20%0A%09%22Answer%20a%20Point%20translated%20by%20delta%20%28an%20instance%20of%20Point%29.%22%0A%09%5E%28delta%20x%20+%20x%29%20@%20%28delta%20y%20+%20y%29'),
  3932. messageSends: [unescape("@"), unescape("+"), "x", "y"],
  3933. referencedClasses: []
  3934. }),
  3935. smalltalk.Point);
  3936. smalltalk.addMethod(
  3937. unescape('_x'),
  3938. smalltalk.method({
  3939. selector: unescape('x'),
  3940. category: 'accessing',
  3941. fn: function () {
  3942. var self = this;
  3943. return self['@x'];
  3944. return self;
  3945. },
  3946. args: [],
  3947. source: unescape('x%0A%09%5Ex'),
  3948. messageSends: [],
  3949. referencedClasses: []
  3950. }),
  3951. smalltalk.Point);
  3952. smalltalk.addMethod(
  3953. unescape('_x_'),
  3954. smalltalk.method({
  3955. selector: unescape('x%3A'),
  3956. category: 'accessing',
  3957. fn: function (aNumber) {
  3958. var self = this;
  3959. self['@x'] = aNumber;
  3960. return self;
  3961. },
  3962. args: ["aNumber"],
  3963. source: unescape('x%3A%20aNumber%0A%09x%20%3A%3D%20aNumber'),
  3964. messageSends: [],
  3965. referencedClasses: []
  3966. }),
  3967. smalltalk.Point);
  3968. smalltalk.addMethod(
  3969. unescape('_y'),
  3970. smalltalk.method({
  3971. selector: unescape('y'),
  3972. category: 'accessing',
  3973. fn: function () {
  3974. var self = this;
  3975. return self['@y'];
  3976. return self;
  3977. },
  3978. args: [],
  3979. source: unescape('y%0A%09%5Ey'),
  3980. messageSends: [],
  3981. referencedClasses: []
  3982. }),
  3983. smalltalk.Point);
  3984. smalltalk.addMethod(
  3985. unescape('_y_'),
  3986. smalltalk.method({
  3987. selector: unescape('y%3A'),
  3988. category: 'accessing',
  3989. fn: function (aNumber) {
  3990. var self = this;
  3991. self['@y'] = aNumber;
  3992. return self;
  3993. },
  3994. args: ["aNumber"],
  3995. source: unescape('y%3A%20aNumber%0A%09y%20%3A%3D%20aNumber'),
  3996. messageSends: [],
  3997. referencedClasses: []
  3998. }),
  3999. smalltalk.Point);
  4000. smalltalk.addMethod(
  4001. unescape('_x_y_'),
  4002. smalltalk.method({
  4003. selector: unescape('x%3Ay%3A'),
  4004. category: 'instance creation',
  4005. fn: function (aNumber, anotherNumber) {
  4006. var self = this;
  4007. return function ($rec) {smalltalk.send($rec, "_x_", [aNumber]);smalltalk.send($rec, "_y_", [anotherNumber]);return smalltalk.send($rec, "_yourself", []);}(smalltalk.send(self, "_new", []));
  4008. return self;
  4009. },
  4010. args: ["aNumber", "anotherNumber"],
  4011. source: unescape('x%3A%20aNumber%20y%3A%20anotherNumber%0A%09%5Eself%20new%0A%09%09x%3A%20aNumber%3B%0A%09%09y%3A%20anotherNumber%3B%0A%09%09yourself'),
  4012. messageSends: ["x:", "y:", "yourself", "new"],
  4013. referencedClasses: []
  4014. }),
  4015. smalltalk.Point.klass);
  4016. smalltalk.addClass('Random', smalltalk.Object, [], 'Kernel-Objects');
  4017. smalltalk.Random.comment=unescape('%60Random%60%20is%20a%20random%20number%20generator%20and%20is%20implemented%20as%20a%20trivial%20wrapper%20around%20javascript%20%60Math.random%28%29%60%20and%20is%20used%20like%20this%3A%0A%0A%09Random%20new%20next%0A%0AThis%20will%20return%20a%20float%20x%20where%20x%20%3C%201%20and%20x%20%3E%200.%20If%20you%20want%20a%20random%20integer%20from%201%20to%2010%20you%20can%20use%20%60%23atRandom%60%0A%0A%0910%20atRandom%0A%0A...and%20if%20you%20want%20a%20random%20number%20in%20a%20specific%20interval%20this%20also%20works%3A%0A%0A%09%283%20to%3A%207%29%20atRandom%0A%0A...but%20be%20aware%20that%20%60%23to%3A%60%20does%20not%20create%20an%20Interval%20as%20in%20other%20Smalltalk%20implementations%20but%20in%20fact%20an%20%60Array%60%20of%20numbers%2C%20so%20it%27s%20better%20to%20use%3A%0A%0A%095%20atRandom%20+%202%0A%0ASince%20%60%23atRandom%60%20is%20implemented%20in%20%60SequencableCollection%60%20you%20can%20easy%20pick%20an%20element%20at%20random%3A%0A%0A%09%23%28%27a%27%20%27b%27%20%27c%27%29%20atRandom%0A%0A...or%20perhaps%20a%20letter%20from%20a%20%60String%60%3A%0A%0A%09%27abc%27%20atRandom%0A%0ASince%20Amber%20does%20not%20have%20Characters%20this%20will%20return%20a%20%60String%60%20of%20length%201%20like%20for%20example%20%60%27b%27%60.')
  4018. smalltalk.addMethod(
  4019. unescape('_next'),
  4020. smalltalk.method({
  4021. selector: unescape('next'),
  4022. category: 'accessing',
  4023. fn: function () {
  4024. var self = this;
  4025. return Math.random();
  4026. return self;
  4027. },
  4028. args: [],
  4029. source: unescape('next%0A%09%3Creturn%20Math.random%28%29%3E'),
  4030. messageSends: [],
  4031. referencedClasses: []
  4032. }),
  4033. smalltalk.Random);
  4034. smalltalk.addMethod(
  4035. unescape('_next_'),
  4036. smalltalk.method({
  4037. selector: unescape('next%3A'),
  4038. category: 'accessing',
  4039. fn: function (anInteger) {
  4040. var self = this;
  4041. return smalltalk.send(smalltalk.send(1, "_to_", [anInteger]), "_collect_", [function (each) {return smalltalk.send(self, "_next", []);}]);
  4042. return self;
  4043. },
  4044. args: ["anInteger"],
  4045. source: unescape('next%3A%20anInteger%0A%20%20%20%20%5E%281%20to%3A%20anInteger%29%20collect%3A%20%5B%3Aeach%20%7C%20self%20next%5D'),
  4046. messageSends: ["collect:", "to:", "next"],
  4047. referencedClasses: []
  4048. }),
  4049. smalltalk.Random);
  4050. smalltalk.addClass('Smalltalk', smalltalk.Object, [], 'Kernel-Objects');
  4051. smalltalk.Smalltalk.comment=unescape('Smalltalk%20has%20only%20one%20instance%2C%20accessed%20with%20%60Smalltalk%20current%60.%20%0AIt%20represents%20the%20global%20JavaScript%20variable%20%60smalltalk%60%20declared%20in%20%60js/boot.js%60.%0A%0AThe%20%60smalltalk%60%20object%20holds%20all%20class%20and%20packages%20defined%20in%20the%20system.%0A%0A%23%23%20Classes%0A%0AClasses%20can%20be%20accessed%20using%20the%20following%20methods%3A%0A%0A-%20%60%23classes%60%20answers%20the%20full%20list%20of%20Smalltalk%20classes%20in%20the%20system%0A-%20%60%23at%3A%60%20answers%20a%20specific%20class%20of%20%60nil%60%0A%0A%23%23%20Packages%0A%0APackages%20can%20be%20accessed%20using%20the%20following%20methods%3A%0A%0A-%20%60%23packages%60%20answers%20the%20full%20list%20of%20packages%0A-%20%60%23packageAt%3A%60%20answers%20a%20specific%20class%20of%20%60nil%60%0A%0A__note%3A__%20classes%20and%20packages%20are%20accessed%20using%20strings%2C%20not%20symbols%0A%0A%23%23%20Parsing%0A%0AThe%20%60%23parse%3A%60%20method%20is%20used%20to%20parse%20Smalltalk%20source%20code.%20%0AIt%20requires%20the%20%60Compiler%60%20package%20and%20the%20%60js/parser.js%60%20parser%20file%20in%20order%20to%20work')
  4052. smalltalk.addMethod(
  4053. unescape('_at_'),
  4054. smalltalk.method({
  4055. selector: unescape('at%3A'),
  4056. category: 'accessing',
  4057. fn: function (aString) {
  4058. var self = this;
  4059. return self[aString];
  4060. return self;
  4061. },
  4062. args: ["aString"],
  4063. source: unescape('at%3A%20aString%0A%09%3Creturn%20self%5BaString%5D%3E'),
  4064. messageSends: [],
  4065. referencedClasses: []
  4066. }),
  4067. smalltalk.Smalltalk);
  4068. smalltalk.addMethod(
  4069. unescape('_basicParse_'),
  4070. smalltalk.method({
  4071. selector: unescape('basicParse%3A'),
  4072. category: 'accessing',
  4073. fn: function (aString) {
  4074. var self = this;
  4075. return smalltalk.parser.parse(aString);
  4076. return self;
  4077. },
  4078. args: ["aString"],
  4079. source: unescape('basicParse%3A%20aString%0A%09%3Creturn%20smalltalk.parser.parse%28aString%29%3E'),
  4080. messageSends: [],
  4081. referencedClasses: []
  4082. }),
  4083. smalltalk.Smalltalk);
  4084. smalltalk.addMethod(
  4085. unescape('_classes'),
  4086. smalltalk.method({
  4087. selector: unescape('classes'),
  4088. category: 'accessing',
  4089. fn: function () {
  4090. var self = this;
  4091. return self.classes();
  4092. return self;
  4093. },
  4094. args: [],
  4095. source: unescape('classes%0A%09%3Creturn%20self.classes%28%29%3E'),
  4096. messageSends: [],
  4097. referencedClasses: []
  4098. }),
  4099. smalltalk.Smalltalk);
  4100. smalltalk.addMethod(
  4101. unescape('_createPackage_'),
  4102. smalltalk.method({
  4103. selector: unescape('createPackage%3A'),
  4104. category: 'private',
  4105. fn: function (packageName) {
  4106. var self = this;
  4107. return smalltalk.addPackage(packageName, nil);
  4108. return self;
  4109. },
  4110. args: ["packageName"],
  4111. source: unescape('createPackage%3A%20packageName%0A%09%22Create%20and%20bind%20a%20new%20package%20with%20given%20name%20and%20return%20it.%22%0A%0A%20%20%20%20%20%20%3Creturn%20smalltalk.addPackage%28packageName%2C%20nil%29%3E'),
  4112. messageSends: [],
  4113. referencedClasses: []
  4114. }),
  4115. smalltalk.Smalltalk);
  4116. smalltalk.addMethod(
  4117. unescape('_createPackage_properties_'),
  4118. smalltalk.method({
  4119. selector: unescape('createPackage%3Aproperties%3A'),
  4120. category: 'private',
  4121. fn: function (packageName, aDict) {
  4122. var self = this;
  4123. var object = nil;
  4124. object = {};
  4125. smalltalk.send(aDict, "_keysAndValuesDo_", [function (key, value) {return object[key] = value;}]);
  4126. return smalltalk.addPackage(packageName, object);
  4127. return self;
  4128. },
  4129. args: ["packageName", "aDict"],
  4130. source: unescape('createPackage%3A%20packageName%20properties%3A%20aDict%0A%09%22Create%20and%20bind%20a%20new%20package%20with%20given%20name%20and%20return%20it.%22%0A%0A%09%7C%20object%20%7C%0A%09%3Cobject%20%3D%20%7B%7D%3B%3E.%0A%09aDict%20keysAndValuesDo%3A%20%5B%3Akey%20%3Avalue%20%7C%0A%09%09%3Cobject%5Bkey%5D%20%3D%20value%3E.%0A%09%5D.%0A%20%20%20%20%20%20%20%3Creturn%20smalltalk.addPackage%28packageName%2C%20object%29%3E'),
  4131. messageSends: ["keysAndValuesDo:"],
  4132. referencedClasses: []
  4133. }),
  4134. smalltalk.Smalltalk);
  4135. smalltalk.addMethod(
  4136. unescape('_deletePackage_'),
  4137. smalltalk.method({
  4138. selector: unescape('deletePackage%3A'),
  4139. category: 'private',
  4140. fn: function (packageName) {
  4141. var self = this;
  4142. delete smalltalk.packages[packageName];
  4143. return self;
  4144. },
  4145. args: ["packageName"],
  4146. source: unescape('deletePackage%3A%20packageName%0A%09%22Deletes%20a%20package%20by%20deleting%20its%20binding%2C%20but%20does%20not%20check%20if%20it%20contains%20classes%20etc.%0A%09To%20remove%20a%20package%2C%20use%20%23removePackage%20instead.%22%0A%0A%20%20%20%20%20%20%20%3Cdelete%20smalltalk.packages%5BpackageName%5D%3E'),
  4147. messageSends: [],
  4148. referencedClasses: []
  4149. }),
  4150. smalltalk.Smalltalk);
  4151. smalltalk.addMethod(
  4152. unescape('_packageAt_'),
  4153. smalltalk.method({
  4154. selector: unescape('packageAt%3A'),
  4155. category: 'packages',
  4156. fn: function (packageName) {
  4157. var self = this;
  4158. return self.packages[packageName];
  4159. return self;
  4160. },
  4161. args: ["packageName"],
  4162. source: unescape('packageAt%3A%20packageName%0A%20%20%20%20%20%20%20%3Creturn%20self.packages%5BpackageName%5D%3E'),
  4163. messageSends: [],
  4164. referencedClasses: []
  4165. }),
  4166. smalltalk.Smalltalk);
  4167. smalltalk.addMethod(
  4168. unescape('_packageAt_ifAbsent_'),
  4169. smalltalk.method({
  4170. selector: unescape('packageAt%3AifAbsent%3A'),
  4171. category: 'packages',
  4172. fn: function (packageName, aBlock) {
  4173. var self = this;
  4174. return smalltalk.send(smalltalk.send(self, "_packageAt_", [packageName]), "_ifNil_", [aBlock]);
  4175. return self;
  4176. },
  4177. args: ["packageName", "aBlock"],
  4178. source: unescape('packageAt%3A%20packageName%20ifAbsent%3A%20aBlock%0A%20%20%20%20%20%20%20%5E%28self%20packageAt%3A%20packageName%29%20ifNil%3A%20aBlock'),
  4179. messageSends: ["ifNil:", "packageAt:"],
  4180. referencedClasses: []
  4181. }),
  4182. smalltalk.Smalltalk);
  4183. smalltalk.addMethod(
  4184. unescape('_packages'),
  4185. smalltalk.method({
  4186. selector: unescape('packages'),
  4187. category: 'packages',
  4188. fn: function () {
  4189. var self = this;
  4190. return self.packages.all();
  4191. return self;
  4192. },
  4193. args: [],
  4194. source: unescape('packages%0A%09%22Return%20all%20Package%20instances%20in%20the%20system.%22%0A%0A%09%3Creturn%20self.packages.all%28%29%3E'),
  4195. messageSends: [],
  4196. referencedClasses: []
  4197. }),
  4198. smalltalk.Smalltalk);
  4199. smalltalk.addMethod(
  4200. unescape('_parse_'),
  4201. smalltalk.method({
  4202. selector: unescape('parse%3A'),
  4203. category: 'accessing',
  4204. fn: function (aString) {
  4205. var self = this;
  4206. var result = nil;
  4207. smalltalk.send(self, "_try_catch_", [function () {return result = smalltalk.send(self, "_basicParse_", [aString]);}, function (ex) {return smalltalk.send(smalltalk.send(self, "_parseError_parsing_", [ex, aString]), "_signal", []);}]);
  4208. return result;
  4209. return self;
  4210. },
  4211. args: ["aString"],
  4212. source: unescape('parse%3A%20aString%0A%09%7C%20result%20%7C%20%0A%09self%20try%3A%20%5Bresult%20%3A%3D%20self%20basicParse%3A%20aString%5D%20catch%3A%20%5B%3Aex%20%7C%20%28self%20parseError%3A%20ex%20parsing%3A%20aString%29%20signal%5D.%0A%09%5Eresult'),
  4213. messageSends: ["try:catch:", "basicParse:", "signal", "parseError:parsing:"],
  4214. referencedClasses: []
  4215. }),
  4216. smalltalk.Smalltalk);
  4217. smalltalk.addMethod(
  4218. unescape('_parseError_parsing_'),
  4219. smalltalk.method({
  4220. selector: unescape('parseError%3Aparsing%3A'),
  4221. category: 'accessing',
  4222. fn: function (anException, aString) {
  4223. var self = this;
  4224. var row = nil;
  4225. var col = nil;
  4226. var message = nil;
  4227. var lines = nil;
  4228. var badLine = nil;
  4229. var code = nil;
  4230. row = anException.line;
  4231. col = anException.column;
  4232. message = anException.message;
  4233. lines = smalltalk.send(aString, "_lines", []);
  4234. badLine = smalltalk.send(lines, "_at_", [row]);
  4235. badLine = smalltalk.send(smalltalk.send(smalltalk.send(badLine, "_copyFrom_to_", [1, ($receiver = col).klass === smalltalk.Number ? $receiver - 1 : smalltalk.send($receiver, "__minus", [1])]), "__comma", [unescape("%20%3D%3D%3D%3E")]), "__comma", [smalltalk.send(badLine, "_copyFrom_to_", [col, smalltalk.send(badLine, "_size", [])])]);
  4236. smalltalk.send(lines, "_at_put_", [row, badLine]);
  4237. code = smalltalk.send(smalltalk.String || String, "_streamContents_", [function (s) {return smalltalk.send(lines, "_withIndexDo_", [function (l, i) {return smalltalk.send(s, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(i, "_asString", []), "__comma", [": "]), "__comma", [l]), "__comma", [smalltalk.send(smalltalk.String || String, "_lf", [])])]);}]);}]);
  4238. return smalltalk.send(smalltalk.send(smalltalk.Error || Error, "_new", []), "_messageText_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("Parse error on line ", "__comma", [row]), "__comma", [" column "]), "__comma", [col]), "__comma", [" : "]), "__comma", [message]), "__comma", [unescape("%20Below%20is%20code%20with%20line%20numbers%20and%20%3D%3D%3D%3E%20marker%20inserted%3A")]), "__comma", [smalltalk.send(smalltalk.String || String, "_lf", [])]), "__comma", [code])]);
  4239. return self;
  4240. },
  4241. args: ["anException", "aString"],
  4242. source: unescape('parseError%3A%20anException%20parsing%3A%20aString%0A%09%7C%20row%20col%20message%20lines%20badLine%20code%20%7C%0A%09%3Crow%20%3D%20anException.line%3B%0A%09col%20%3D%20anException.column%3B%0A%09message%20%3D%20anException.message%3B%3E.%0A%09lines%20%3A%3D%20aString%20lines.%0A%09badLine%20%3A%3D%20lines%20at%3A%20row.%0A%09badLine%20%3A%3D%20%28badLine%20copyFrom%3A%201%20to%3A%20col%20-%201%29%2C%20%27%20%3D%3D%3D%3E%27%2C%20%28badLine%20copyFrom%3A%20%20col%20to%3A%20badLine%20size%29.%0A%09lines%20at%3A%20row%20put%3A%20badLine.%0A%09code%20%3A%3D%20String%20streamContents%3A%20%5B%3As%20%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20lines%20withIndexDo%3A%20%5B%3Al%20%3Ai%20%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20s%20nextPutAll%3A%20i%20asString%2C%20%27%3A%20%27%2C%20l%2C%20String%20lf%5D%5D.%0A%09%5E%20Error%20new%20messageText%3A%20%28%27Parse%20error%20on%20line%20%27%20%2C%20row%20%2C%20%27%20column%20%27%20%2C%20col%20%2C%20%27%20%3A%20%27%20%2C%20message%20%2C%20%27%20Below%20is%20code%20with%20line%20numbers%20and%20%3D%3D%3D%3E%20marker%20inserted%3A%27%20%2C%20String%20lf%2C%20code%29'),
  4243. messageSends: ["lines", "at:", unescape("%2C"), "copyFrom:to:", unescape("-"), "size", "at:put:", "streamContents:", "withIndexDo:", "nextPutAll:", "asString", "lf", "messageText:", "new"],
  4244. referencedClasses: ["String", "Error"]
  4245. }),
  4246. smalltalk.Smalltalk);
  4247. smalltalk.addMethod(
  4248. unescape('_readJSObject_'),
  4249. smalltalk.method({
  4250. selector: unescape('readJSObject%3A'),
  4251. category: 'accessing',
  4252. fn: function (anObject) {
  4253. var self = this;
  4254. return self.readJSObject(anObject);
  4255. return self;
  4256. },
  4257. args: ["anObject"],
  4258. source: unescape('readJSObject%3A%20anObject%0A%09%3Creturn%20self.readJSObject%28anObject%29%3E'),
  4259. messageSends: [],
  4260. referencedClasses: []
  4261. }),
  4262. smalltalk.Smalltalk);
  4263. smalltalk.addMethod(
  4264. unescape('_removeClass_'),
  4265. smalltalk.method({
  4266. selector: unescape('removeClass%3A'),
  4267. category: 'classes',
  4268. fn: function (aClass) {
  4269. var self = this;
  4270. ($receiver = smalltalk.send(aClass, "_isMetaclass", [])).klass === smalltalk.Boolean ? $receiver ? function () {return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_asString", []), "__comma", [unescape("%20is%20a%20Metaclass%20and%20cannot%20be%20removed%21")])]);}() : nil : smalltalk.send($receiver, "_ifTrue_", [function () {return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_asString", []), "__comma", [unescape("%20is%20a%20Metaclass%20and%20cannot%20be%20removed%21")])]);}]);
  4271. smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_values", []), "_do_", [function (each) {return smalltalk.send(aClass, "_removeCompiledMethod_", [each]);}]);
  4272. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_methodDictionary", []), "_values", []), "_do_", [function (each) {return smalltalk.send(smalltalk.send(aClass, "_class", []), "_removeCompiledMethod_", [each]);}]);
  4273. smalltalk.send(self, "_basicDelete_", [smalltalk.send(aClass, "_name", [])]);
  4274. return self;
  4275. },
  4276. args: ["aClass"],
  4277. source: unescape('removeClass%3A%20aClass%0A%09aClass%20isMetaclass%20ifTrue%3A%20%5Bself%20error%3A%20aClass%20asString%2C%20%27%20is%20a%20Metaclass%20and%20cannot%20be%20removed%21%27%5D.%0A%09aClass%20methodDictionary%20values%20do%3A%20%5B%3Aeach%20%7C%0A%09%09aClass%20removeCompiledMethod%3A%20each%5D.%0A%09aClass%20class%20methodDictionary%20values%20do%3A%20%5B%3Aeach%20%7C%0A%09%09aClass%20class%20removeCompiledMethod%3A%20each%5D.%0A%09self%20basicDelete%3A%20aClass%20name'),
  4278. messageSends: ["ifTrue:", "isMetaclass", "error:", unescape("%2C"), "asString", "do:", "values", "methodDictionary", "removeCompiledMethod:", "class", "basicDelete:", "name"],
  4279. referencedClasses: []
  4280. }),
  4281. smalltalk.Smalltalk);
  4282. smalltalk.addMethod(
  4283. unescape('_removePackage_'),
  4284. smalltalk.method({
  4285. selector: unescape('removePackage%3A'),
  4286. category: 'packages',
  4287. fn: function (packageName) {
  4288. var self = this;
  4289. var pkg = nil;
  4290. pkg = smalltalk.send(self, "_packageAt_ifAbsent_", [packageName, function () {return smalltalk.send(self, "_error_", [smalltalk.send("Missing package: ", "__comma", [packageName])]);}]);
  4291. smalltalk.send(smalltalk.send(pkg, "_classes", []), "_do_", [function (each) {return smalltalk.send(self, "_removeClass_", [each]);}]);
  4292. smalltalk.send(self, "_deletePackage_", [packageName]);
  4293. return self;
  4294. },
  4295. args: ["packageName"],
  4296. source: unescape('removePackage%3A%20packageName%0A%09%22Removes%20a%20package%20and%20all%20its%20classes.%22%0A%0A%09%7C%20pkg%20%7C%0A%09pkg%20%3A%3D%20self%20packageAt%3A%20packageName%20ifAbsent%3A%20%5Bself%20error%3A%20%27Missing%20package%3A%20%27%2C%20packageName%5D.%0A%09pkg%20classes%20do%3A%20%5B%3Aeach%20%7C%0A%20%20%20%20%20%20%20%20%09self%20removeClass%3A%20each%5D.%0A%09self%20deletePackage%3A%20packageName'),
  4297. messageSends: ["packageAt:ifAbsent:", "error:", unescape("%2C"), "do:", "classes", "removeClass:", "deletePackage:"],
  4298. referencedClasses: []
  4299. }),
  4300. smalltalk.Smalltalk);
  4301. smalltalk.addMethod(
  4302. unescape('_renamePackage_to_'),
  4303. smalltalk.method({
  4304. selector: unescape('renamePackage%3Ato%3A'),
  4305. category: 'packages',
  4306. fn: function (packageName, newName) {
  4307. var self = this;
  4308. var pkg = nil;
  4309. pkg = smalltalk.send(self, "_packageAt_ifAbsent_", [packageName, function () {return smalltalk.send(self, "_error_", [smalltalk.send("Missing package: ", "__comma", [packageName])]);}]);
  4310. ($receiver = smalltalk.send(self, "_packageAt_", [newName])) != nil &&
  4311. $receiver != undefined ? function () {return smalltalk.send(self, "_error_", [smalltalk.send("Already exists a package called: ", "__comma", [newName])]);}() : nil;
  4312. smalltalk.packages[newName] = smalltalk.packages[packageName];
  4313. smalltalk.send(pkg, "_name_", [newName]);
  4314. smalltalk.send(self, "_deletePackage_", [packageName]);
  4315. return self;
  4316. },
  4317. args: ["packageName", "newName"],
  4318. source: unescape('renamePackage%3A%20packageName%20to%3A%20newName%0A%09%22Rename%20a%20package.%22%0A%0A%09%7C%20pkg%20%7C%0A%09pkg%20%3A%3D%20self%20packageAt%3A%20packageName%20ifAbsent%3A%20%5Bself%20error%3A%20%27Missing%20package%3A%20%27%2C%20packageName%5D.%0A%09%28self%20packageAt%3A%20newName%29%20ifNotNil%3A%20%5Bself%20error%3A%20%27Already%20exists%20a%20package%20called%3A%20%27%2C%20newName%5D.%0A%09%3Csmalltalk.packages%5BnewName%5D%20%3D%20smalltalk.packages%5BpackageName%5D%3E.%0A%09pkg%20name%3A%20newName.%0A%09self%20deletePackage%3A%20packageName.'),
  4319. messageSends: ["packageAt:ifAbsent:", "error:", unescape("%2C"), "ifNotNil:", "packageAt:", "name:", "deletePackage:"],
  4320. referencedClasses: []
  4321. }),
  4322. smalltalk.Smalltalk);
  4323. smalltalk.addMethod(
  4324. unescape('_reservedWords'),
  4325. smalltalk.method({
  4326. selector: unescape('reservedWords'),
  4327. category: 'accessing',
  4328. fn: function () {
  4329. var self = this;
  4330. return self.reservedWords;
  4331. return self;
  4332. },
  4333. args: [],
  4334. source: unescape('reservedWords%0A%09%22JavaScript%20reserved%20words%22%0A%09%3Creturn%20self.reservedWords%3E'),
  4335. messageSends: [],
  4336. referencedClasses: []
  4337. }),
  4338. smalltalk.Smalltalk);
  4339. smalltalk.addMethod(
  4340. unescape('_send_to_arguments_'),
  4341. smalltalk.method({
  4342. selector: unescape('send%3Ato%3Aarguments%3A'),
  4343. category: 'accessing',
  4344. fn: function (aSelector, anObject, aCollection) {
  4345. var self = this;
  4346. var selector = nil;
  4347. selector = smalltalk.send(smalltalk.send(aSelector, "_asString", []), "_asSelector", []);
  4348. self.send(anObject, selector, aCollection);
  4349. return self;
  4350. },
  4351. args: ["aSelector", "anObject", "aCollection"],
  4352. source: unescape('send%3A%20aSelector%20to%3A%20anObject%20arguments%3A%20aCollection%0A%09%7C%20selector%20%7C%0A%09selector%20%3A%3D%20aSelector%20asString%20asSelector.%0A%09%3Cself.send%28anObject%2C%20selector%2C%20aCollection%29%3E'),
  4353. messageSends: ["asSelector", "asString"],
  4354. referencedClasses: []
  4355. }),
  4356. smalltalk.Smalltalk);
  4357. smalltalk.Smalltalk.klass.iVarNames = ['current'];
  4358. smalltalk.addMethod(
  4359. unescape('_current'),
  4360. smalltalk.method({
  4361. selector: unescape('current'),
  4362. category: 'accessing',
  4363. fn: function () {
  4364. var self = this;
  4365. return smalltalk;
  4366. return self;
  4367. },
  4368. args: [],
  4369. source: unescape('current%0A%09%3Creturn%20smalltalk%3E'),
  4370. messageSends: [],
  4371. referencedClasses: []
  4372. }),
  4373. smalltalk.Smalltalk.klass);
  4374. smalltalk.addClass('UndefinedObject', smalltalk.Object, [], 'Kernel-Objects');
  4375. smalltalk.UndefinedObject.comment=unescape('UndefinedObject%20describes%20the%20behavior%20of%20its%20sole%20instance%2C%20%60nil%60.%20%60nil%60%20represents%20a%20prior%20value%20for%20variables%20that%20have%20not%20been%20initialized%2C%20or%20for%20results%20which%20are%20meaningless.%0A%0A%60nil%60%20is%20the%20Smalltalk%20representation%20of%20the%20%60undefined%60%20JavaScript%20object.')
  4376. smalltalk.addMethod(
  4377. unescape('_asJSON'),
  4378. smalltalk.method({
  4379. selector: unescape('asJSON'),
  4380. category: 'converting',
  4381. fn: function (){
  4382. var self=this;
  4383. return (typeof null == 'undefined' ? nil : null);
  4384. return self;},
  4385. args: [],
  4386. source: unescape('asJSON%0A%09%5Enull'),
  4387. messageSends: [],
  4388. referencedClasses: []
  4389. }),
  4390. smalltalk.UndefinedObject);
  4391. smalltalk.addMethod(
  4392. unescape('_deepCopy'),
  4393. smalltalk.method({
  4394. selector: unescape('deepCopy'),
  4395. category: 'copying',
  4396. fn: function () {
  4397. var self = this;
  4398. return self;
  4399. return self;
  4400. },
  4401. args: [],
  4402. source: unescape('deepCopy%0A%09%5Eself'),
  4403. messageSends: [],
  4404. referencedClasses: []
  4405. }),
  4406. smalltalk.UndefinedObject);
  4407. smalltalk.addMethod(
  4408. unescape('_ifNil_'),
  4409. smalltalk.method({
  4410. selector: unescape('ifNil%3A'),
  4411. category: 'testing',
  4412. fn: function (aBlock) {
  4413. var self = this;
  4414. return smalltalk.send(self, "_ifNil_ifNotNil_", [aBlock, function () {return nil;}]);
  4415. return self;
  4416. },
  4417. args: ["aBlock"],
  4418. source: unescape('ifNil%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5Eself%20ifNil%3A%20aBlock%20ifNotNil%3A%20%5B%5D'),
  4419. messageSends: ["ifNil:ifNotNil:"],
  4420. referencedClasses: []
  4421. }),
  4422. smalltalk.UndefinedObject);
  4423. smalltalk.addMethod(
  4424. unescape('_ifNil_ifNotNil_'),
  4425. smalltalk.method({
  4426. selector: unescape('ifNil%3AifNotNil%3A'),
  4427. category: 'testing',
  4428. fn: function (aBlock, anotherBlock) {
  4429. var self = this;
  4430. return smalltalk.send(aBlock, "_value", []);
  4431. return self;
  4432. },
  4433. args: ["aBlock", "anotherBlock"],
  4434. source: unescape('ifNil%3A%20aBlock%20ifNotNil%3A%20anotherBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5EaBlock%20value'),
  4435. messageSends: ["value"],
  4436. referencedClasses: []
  4437. }),
  4438. smalltalk.UndefinedObject);
  4439. smalltalk.addMethod(
  4440. unescape('_ifNotNil_'),
  4441. smalltalk.method({
  4442. selector: unescape('ifNotNil%3A'),
  4443. category: 'testing',
  4444. fn: function (aBlock) {
  4445. var self = this;
  4446. return self;
  4447. return self;
  4448. },
  4449. args: ["aBlock"],
  4450. source: unescape('ifNotNil%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5Eself'),
  4451. messageSends: [],
  4452. referencedClasses: []
  4453. }),
  4454. smalltalk.UndefinedObject);
  4455. smalltalk.addMethod(
  4456. unescape('_ifNotNil_ifNil_'),
  4457. smalltalk.method({
  4458. selector: unescape('ifNotNil%3AifNil%3A'),
  4459. category: 'testing',
  4460. fn: function (aBlock, anotherBlock) {
  4461. var self = this;
  4462. return smalltalk.send(anotherBlock, "_value", []);
  4463. return self;
  4464. },
  4465. args: ["aBlock", "anotherBlock"],
  4466. source: unescape('ifNotNil%3A%20aBlock%20ifNil%3A%20anotherBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5EanotherBlock%20value'),
  4467. messageSends: ["value"],
  4468. referencedClasses: []
  4469. }),
  4470. smalltalk.UndefinedObject);
  4471. smalltalk.addMethod(
  4472. unescape('_isNil'),
  4473. smalltalk.method({
  4474. selector: unescape('isNil'),
  4475. category: 'testing',
  4476. fn: function () {
  4477. var self = this;
  4478. return true;
  4479. return self;
  4480. },
  4481. args: [],
  4482. source: unescape('isNil%0A%09%5Etrue'),
  4483. messageSends: [],
  4484. referencedClasses: []
  4485. }),
  4486. smalltalk.UndefinedObject);
  4487. smalltalk.addMethod(
  4488. unescape('_notNil'),
  4489. smalltalk.method({
  4490. selector: unescape('notNil'),
  4491. category: 'testing',
  4492. fn: function () {
  4493. var self = this;
  4494. return false;
  4495. return self;
  4496. },
  4497. args: [],
  4498. source: unescape('notNil%0A%09%5Efalse'),
  4499. messageSends: [],
  4500. referencedClasses: []
  4501. }),
  4502. smalltalk.UndefinedObject);
  4503. smalltalk.addMethod(
  4504. unescape('_printString'),
  4505. smalltalk.method({
  4506. selector: unescape('printString'),
  4507. category: 'printing',
  4508. fn: function () {
  4509. var self = this;
  4510. return "nil";
  4511. return self;
  4512. },
  4513. args: [],
  4514. source: unescape('printString%0A%20%20%20%20%5E%27nil%27'),
  4515. messageSends: [],
  4516. referencedClasses: []
  4517. }),
  4518. smalltalk.UndefinedObject);
  4519. smalltalk.addMethod(
  4520. unescape('_shallowCopy'),
  4521. smalltalk.method({
  4522. selector: unescape('shallowCopy'),
  4523. category: 'copying',
  4524. fn: function () {
  4525. var self = this;
  4526. return self;
  4527. return self;
  4528. },
  4529. args: [],
  4530. source: unescape('shallowCopy%0A%09%5Eself'),
  4531. messageSends: [],
  4532. referencedClasses: []
  4533. }),
  4534. smalltalk.UndefinedObject);
  4535. smalltalk.addMethod(
  4536. unescape('_subclass_instanceVariableNames_'),
  4537. smalltalk.method({
  4538. selector: unescape('subclass%3AinstanceVariableNames%3A'),
  4539. category: 'class creation',
  4540. fn: function (aString, anotherString) {
  4541. var self = this;
  4542. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, anotherString, nil]);
  4543. return self;
  4544. },
  4545. args: ["aString", "anotherString"],
  4546. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%0A%09%5Eself%20subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%20package%3A%20nil'),
  4547. messageSends: ["subclass:instanceVariableNames:package:"],
  4548. referencedClasses: []
  4549. }),
  4550. smalltalk.UndefinedObject);
  4551. smalltalk.addMethod(
  4552. unescape('_subclass_instanceVariableNames_category_'),
  4553. smalltalk.method({
  4554. selector: unescape('subclass%3AinstanceVariableNames%3Acategory%3A'),
  4555. category: 'class creation',
  4556. fn: function (aString, aString2, aString3) {
  4557. var self = this;
  4558. smalltalk.send(self, "_deprecatedAPI", []);
  4559. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
  4560. return self;
  4561. },
  4562. args: ["aString", "aString2", "aString3"],
  4563. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20category%3A%20aString3%0A%09%22Kept%20for%20compatibility.%22%0A%09self%20deprecatedAPI.%0A%09%5Eself%20subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20package%3A%20aString3'),
  4564. messageSends: ["deprecatedAPI", "subclass:instanceVariableNames:package:"],
  4565. referencedClasses: []
  4566. }),
  4567. smalltalk.UndefinedObject);
  4568. smalltalk.addMethod(
  4569. unescape('_subclass_instanceVariableNames_package_'),
  4570. smalltalk.method({
  4571. selector: unescape('subclass%3AinstanceVariableNames%3Apackage%3A'),
  4572. category: 'class creation',
  4573. fn: function (aString, aString2, aString3) {
  4574. var self = this;
  4575. return smalltalk.send(smalltalk.send(smalltalk.ClassBuilder || ClassBuilder, "_new", []), "_superclass_subclass_instanceVariableNames_package_", [self, aString, aString2, aString3]);
  4576. return self;
  4577. },
  4578. args: ["aString", "aString2", "aString3"],
  4579. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20package%3A%20aString3%0A%09%5EClassBuilder%20new%0A%09%20%20%20%20superclass%3A%20self%20subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20package%3A%20aString3'),
  4580. messageSends: ["superclass:subclass:instanceVariableNames:package:", "new"],
  4581. referencedClasses: ["ClassBuilder"]
  4582. }),
  4583. smalltalk.UndefinedObject);
  4584. smalltalk.addMethod(
  4585. unescape('_new'),
  4586. smalltalk.method({
  4587. selector: unescape('new'),
  4588. category: 'instance creation',
  4589. fn: function () {
  4590. var self = this;
  4591. smalltalk.send(self, "_error_", ["You cannot create new instances of UndefinedObject. Use nil"]);
  4592. return self;
  4593. },
  4594. args: [],
  4595. source: unescape('new%0A%09%20%20%20%20self%20error%3A%20%27You%20cannot%20create%20new%20instances%20of%20UndefinedObject.%20Use%20nil%27'),
  4596. messageSends: ["error:"],
  4597. referencedClasses: []
  4598. }),
  4599. smalltalk.UndefinedObject.klass);