Kernel-Infrastructure.js 180 KB

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