1
0

Kernel-Objects.js 178 KB

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