Kernel-Infrastructure.js 186 KB

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