Kernel-Infrastructure.js 148 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159
  1. define(["amber/boot", "amber_core/Kernel-Collections", "amber_core/Kernel-Exceptions", "amber_core/Kernel-Objects", "amber_core/Kernel-Promises"], function($boot){"use strict";
  2. if(!("nilAsValue" in $boot))$boot.nilAsValue=$boot.nilAsReceiver;
  3. var $core=$boot.api,nil=$boot.nilAsValue,$nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;
  4. $core.addPackage("Kernel-Infrastructure");
  5. ($core.packageDescriptors||$core.packages)["Kernel-Infrastructure"].innerEval = function (expr) { return eval(expr); };
  6. ($core.packageDescriptors||$core.packages)["Kernel-Infrastructure"].transport = {"type":"amd","amdNamespace":"amber_core"};
  7. $core.addClass("AmberBootstrapInitialization", $globals.Object, [], "Kernel-Infrastructure");
  8. $core.addMethod(
  9. $core.method({
  10. selector: "initializeClasses",
  11. protocol: "initialization",
  12. fn: function (){
  13. var self=this,$self=this;
  14. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  15. return $core.withContext(function($ctx1) {
  16. //>>excludeEnd("ctx");
  17. var $1;
  18. $recv($recv($globals.Smalltalk)._classes())._do_((function(each){
  19. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  20. return $core.withContext(function($ctx2) {
  21. //>>excludeEnd("ctx");
  22. $1=$recv(each).__eq($globals.SmalltalkImage);
  23. if(!$core.assert($1)){
  24. return $recv(each)._initialize();
  25. }
  26. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  27. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  28. //>>excludeEnd("ctx");
  29. }));
  30. return self;
  31. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  32. }, function($ctx1) {$ctx1.fill(self,"initializeClasses",{},$globals.AmberBootstrapInitialization.a$cls)});
  33. //>>excludeEnd("ctx");
  34. },
  35. //>>excludeStart("ide", pragmas.excludeIdeData);
  36. args: [],
  37. source: "initializeClasses\x0a\x09Smalltalk classes do: [ :each |\x0a\x09\x09each = SmalltalkImage ifFalse: [ each initialize ] ]",
  38. referencedClasses: ["Smalltalk", "SmalltalkImage"],
  39. //>>excludeEnd("ide");
  40. messageSends: ["do:", "classes", "ifFalse:", "=", "initialize"]
  41. }),
  42. $globals.AmberBootstrapInitialization.a$cls);
  43. $core.addMethod(
  44. $core.method({
  45. selector: "organizeClasses",
  46. protocol: "organization",
  47. fn: function (){
  48. var self=this,$self=this;
  49. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  50. return $core.withContext(function($ctx1) {
  51. //>>excludeEnd("ctx");
  52. $recv($recv($globals.Smalltalk)._classes())._do_((function(each){
  53. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  54. return $core.withContext(function($ctx2) {
  55. //>>excludeEnd("ctx");
  56. return $recv(each)._enterOrganization();
  57. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  58. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  59. //>>excludeEnd("ctx");
  60. }));
  61. return self;
  62. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  63. }, function($ctx1) {$ctx1.fill(self,"organizeClasses",{},$globals.AmberBootstrapInitialization.a$cls)});
  64. //>>excludeEnd("ctx");
  65. },
  66. //>>excludeStart("ide", pragmas.excludeIdeData);
  67. args: [],
  68. source: "organizeClasses\x0a\x09Smalltalk classes do: [ :each | each enterOrganization ]",
  69. referencedClasses: ["Smalltalk"],
  70. //>>excludeEnd("ide");
  71. messageSends: ["do:", "classes", "enterOrganization"]
  72. }),
  73. $globals.AmberBootstrapInitialization.a$cls);
  74. $core.addMethod(
  75. $core.method({
  76. selector: "organizeMethods",
  77. protocol: "organization",
  78. fn: function (){
  79. var self=this,$self=this;
  80. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  81. return $core.withContext(function($ctx1) {
  82. //>>excludeEnd("ctx");
  83. $recv($recv($globals.Smalltalk)._classes())._do_((function(eachClass){
  84. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  85. return $core.withContext(function($ctx2) {
  86. //>>excludeEnd("ctx");
  87. return $recv($recv(eachClass)._definedMethods())._do_((function(eachMethod){
  88. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  89. return $core.withContext(function($ctx3) {
  90. //>>excludeEnd("ctx");
  91. return $recv($recv(eachMethod)._methodClass())._methodOrganizationEnter_andLeave_(eachMethod,nil);
  92. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  93. }, function($ctx3) {$ctx3.fillBlock({eachMethod:eachMethod},$ctx2,2)});
  94. //>>excludeEnd("ctx");
  95. }));
  96. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  97. }, function($ctx2) {$ctx2.fillBlock({eachClass:eachClass},$ctx1,1)});
  98. //>>excludeEnd("ctx");
  99. }));
  100. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  101. $ctx1.sendIdx["do:"]=1;
  102. //>>excludeEnd("ctx");
  103. return self;
  104. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  105. }, function($ctx1) {$ctx1.fill(self,"organizeMethods",{},$globals.AmberBootstrapInitialization.a$cls)});
  106. //>>excludeEnd("ctx");
  107. },
  108. //>>excludeStart("ide", pragmas.excludeIdeData);
  109. args: [],
  110. source: "organizeMethods\x0a\x09Smalltalk classes do: [ :eachClass |\x0a\x09\x09eachClass definedMethods do: [ :eachMethod |\x0a\x09\x09\x09eachMethod methodClass methodOrganizationEnter: eachMethod andLeave: nil ] ]",
  111. referencedClasses: ["Smalltalk"],
  112. //>>excludeEnd("ide");
  113. messageSends: ["do:", "classes", "definedMethods", "methodOrganizationEnter:andLeave:", "methodClass"]
  114. }),
  115. $globals.AmberBootstrapInitialization.a$cls);
  116. $core.addMethod(
  117. $core.method({
  118. selector: "run",
  119. protocol: "public api",
  120. fn: function (){
  121. var self=this,$self=this;
  122. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  123. return $core.withContext(function($ctx1) {
  124. //>>excludeEnd("ctx");
  125. $recv($globals.SmalltalkImage)._initialize();
  126. $recv($globals.Smalltalk)._adoptPackageDictionary();
  127. $self._organizeClasses();
  128. $self._organizeMethods();
  129. $self._initializeClasses();
  130. return self;
  131. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  132. }, function($ctx1) {$ctx1.fill(self,"run",{},$globals.AmberBootstrapInitialization.a$cls)});
  133. //>>excludeEnd("ctx");
  134. },
  135. //>>excludeStart("ide", pragmas.excludeIdeData);
  136. args: [],
  137. source: "run\x0a\x09SmalltalkImage initialize.\x0a\x09Smalltalk adoptPackageDictionary.\x0a\x09self\x0a\x09\x09organizeClasses;\x0a\x09\x09organizeMethods;\x0a\x09\x09initializeClasses",
  138. referencedClasses: ["SmalltalkImage", "Smalltalk"],
  139. //>>excludeEnd("ide");
  140. messageSends: ["initialize", "adoptPackageDictionary", "organizeClasses", "organizeMethods", "initializeClasses"]
  141. }),
  142. $globals.AmberBootstrapInitialization.a$cls);
  143. $core.addClass("JSObjectProxy", $globals.ProtoObject, ["jsObject"], "Kernel-Infrastructure");
  144. //>>excludeStart("ide", pragmas.excludeIdeData);
  145. $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`.";
  146. //>>excludeEnd("ide");
  147. $core.addMethod(
  148. $core.method({
  149. selector: "=",
  150. protocol: "comparing",
  151. fn: function (anObject){
  152. var self=this,$self=this;
  153. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  154. return $core.withContext(function($ctx1) {
  155. //>>excludeEnd("ctx");
  156. var $2,$1;
  157. $2=$recv(anObject)._class();
  158. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  159. $ctx1.sendIdx["class"]=1;
  160. //>>excludeEnd("ctx");
  161. $1=$recv($2).__eq_eq($self._class());
  162. if(!$core.assert($1)){
  163. return false;
  164. }
  165. return $recv($globals.JSObjectProxy)._compareJSObjectOfProxy_withProxy_(self,anObject);
  166. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  167. }, function($ctx1) {$ctx1.fill(self,"=",{anObject:anObject},$globals.JSObjectProxy)});
  168. //>>excludeEnd("ctx");
  169. },
  170. //>>excludeStart("ide", pragmas.excludeIdeData);
  171. args: ["anObject"],
  172. source: "= anObject\x0a\x09anObject class == self class ifFalse: [ ^ false ].\x0a\x09^ JSObjectProxy compareJSObjectOfProxy: self withProxy: anObject",
  173. referencedClasses: ["JSObjectProxy"],
  174. //>>excludeEnd("ide");
  175. messageSends: ["ifFalse:", "==", "class", "compareJSObjectOfProxy:withProxy:"]
  176. }),
  177. $globals.JSObjectProxy);
  178. $core.addMethod(
  179. $core.method({
  180. selector: "asJavaScriptObject",
  181. protocol: "converting",
  182. fn: function (){
  183. var self=this,$self=this;
  184. return $self["@jsObject"];
  185. },
  186. //>>excludeStart("ide", pragmas.excludeIdeData);
  187. args: [],
  188. source: "asJavaScriptObject\x0a\x09\x22Answers the receiver in a stringify-friendly fashion\x22\x0a\x0a\x09^ jsObject",
  189. referencedClasses: [],
  190. //>>excludeEnd("ide");
  191. messageSends: []
  192. }),
  193. $globals.JSObjectProxy);
  194. $core.addMethod(
  195. $core.method({
  196. selector: "at:",
  197. protocol: "accessing",
  198. fn: function (aString){
  199. var self=this,$self=this;
  200. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  201. return $core.withContext(function($ctx1) {
  202. //>>excludeEnd("ctx");
  203. return $self['@jsObject'][aString];
  204. return self;
  205. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  206. }, function($ctx1) {$ctx1.fill(self,"at:",{aString:aString},$globals.JSObjectProxy)});
  207. //>>excludeEnd("ctx");
  208. },
  209. //>>excludeStart("ide", pragmas.excludeIdeData);
  210. args: ["aString"],
  211. source: "at: aString\x0a\x09<inlineJS: 'return $self[''@jsObject''][aString]'>",
  212. referencedClasses: [],
  213. //>>excludeEnd("ide");
  214. messageSends: []
  215. }),
  216. $globals.JSObjectProxy);
  217. $core.addMethod(
  218. $core.method({
  219. selector: "at:ifAbsent:",
  220. protocol: "accessing",
  221. fn: function (aString,aBlock){
  222. var self=this,$self=this;
  223. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  224. return $core.withContext(function($ctx1) {
  225. //>>excludeEnd("ctx");
  226. var obj = $self['@jsObject'];
  227. return aString in obj ? obj[aString] : aBlock._value();
  228. ;
  229. return self;
  230. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  231. }, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{aString:aString,aBlock:aBlock},$globals.JSObjectProxy)});
  232. //>>excludeEnd("ctx");
  233. },
  234. //>>excludeStart("ide", pragmas.excludeIdeData);
  235. args: ["aString", "aBlock"],
  236. 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<inlineJS: '\x0a\x09\x09var obj = $self[''@jsObject''];\x0a\x09\x09return aString in obj ? obj[aString] : aBlock._value();\x0a\x09'>",
  237. referencedClasses: [],
  238. //>>excludeEnd("ide");
  239. messageSends: []
  240. }),
  241. $globals.JSObjectProxy);
  242. $core.addMethod(
  243. $core.method({
  244. selector: "at:ifPresent:",
  245. protocol: "accessing",
  246. fn: function (aString,aBlock){
  247. var self=this,$self=this;
  248. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  249. return $core.withContext(function($ctx1) {
  250. //>>excludeEnd("ctx");
  251. var obj = $self['@jsObject'];
  252. return aString in obj ? aBlock._value_(obj[aString]) : nil;
  253. ;
  254. return self;
  255. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  256. }, function($ctx1) {$ctx1.fill(self,"at:ifPresent:",{aString:aString,aBlock:aBlock},$globals.JSObjectProxy)});
  257. //>>excludeEnd("ctx");
  258. },
  259. //>>excludeStart("ide", pragmas.excludeIdeData);
  260. args: ["aString", "aBlock"],
  261. 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<inlineJS: '\x0a\x09\x09var obj = $self[''@jsObject''];\x0a\x09\x09return aString in obj ? aBlock._value_(obj[aString]) : nil;\x0a\x09'>",
  262. referencedClasses: [],
  263. //>>excludeEnd("ide");
  264. messageSends: []
  265. }),
  266. $globals.JSObjectProxy);
  267. $core.addMethod(
  268. $core.method({
  269. selector: "at:ifPresent:ifAbsent:",
  270. protocol: "accessing",
  271. fn: function (aString,aBlock,anotherBlock){
  272. var self=this,$self=this;
  273. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  274. return $core.withContext(function($ctx1) {
  275. //>>excludeEnd("ctx");
  276. var obj = $self['@jsObject'];
  277. return aString in obj ? aBlock._value_(obj[aString]) : anotherBlock._value();
  278. ;
  279. return self;
  280. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  281. }, function($ctx1) {$ctx1.fill(self,"at:ifPresent:ifAbsent:",{aString:aString,aBlock:aBlock,anotherBlock:anotherBlock},$globals.JSObjectProxy)});
  282. //>>excludeEnd("ctx");
  283. },
  284. //>>excludeStart("ide", pragmas.excludeIdeData);
  285. args: ["aString", "aBlock", "anotherBlock"],
  286. 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<inlineJS: '\x0a\x09\x09var obj = $self[''@jsObject''];\x0a\x09\x09return aString in obj ? aBlock._value_(obj[aString]) : anotherBlock._value();\x0a\x09'>",
  287. referencedClasses: [],
  288. //>>excludeEnd("ide");
  289. messageSends: []
  290. }),
  291. $globals.JSObjectProxy);
  292. $core.addMethod(
  293. $core.method({
  294. selector: "at:put:",
  295. protocol: "accessing",
  296. fn: function (aString,anObject){
  297. var self=this,$self=this;
  298. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  299. return $core.withContext(function($ctx1) {
  300. //>>excludeEnd("ctx");
  301. return $self['@jsObject'][aString] = anObject;
  302. return self;
  303. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  304. }, function($ctx1) {$ctx1.fill(self,"at:put:",{aString:aString,anObject:anObject},$globals.JSObjectProxy)});
  305. //>>excludeEnd("ctx");
  306. },
  307. //>>excludeStart("ide", pragmas.excludeIdeData);
  308. args: ["aString", "anObject"],
  309. source: "at: aString put: anObject\x0a\x09<inlineJS: 'return $self[''@jsObject''][aString] = anObject'>",
  310. referencedClasses: [],
  311. //>>excludeEnd("ide");
  312. messageSends: []
  313. }),
  314. $globals.JSObjectProxy);
  315. $core.addMethod(
  316. $core.method({
  317. selector: "catch:",
  318. protocol: "promises",
  319. fn: function (aBlock){
  320. var self=this,$self=this;
  321. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  322. return $core.withContext(function($ctx1) {
  323. //>>excludeEnd("ctx");
  324. var $1,$2;
  325. $1=$recv($globals.NativeFunction)._isNativeFunction_($self._at_("then"));
  326. if($core.assert($1)){
  327. return $recv($recv($globals.TThenable).__gt_gt("catch:"))._sendTo_arguments_($self["@jsObject"],[aBlock]);
  328. } else {
  329. $2=(
  330. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  331. $ctx1.supercall = true,
  332. //>>excludeEnd("ctx");
  333. ($globals.JSObjectProxy.superclass||$boot.nilAsClass).fn.prototype._catch_.apply($self, [aBlock]));
  334. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  335. $ctx1.supercall = false;
  336. //>>excludeEnd("ctx");;
  337. return $2;
  338. }
  339. return self;
  340. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  341. }, function($ctx1) {$ctx1.fill(self,"catch:",{aBlock:aBlock},$globals.JSObjectProxy)});
  342. //>>excludeEnd("ctx");
  343. },
  344. //>>excludeStart("ide", pragmas.excludeIdeData);
  345. args: ["aBlock"],
  346. source: "catch: aBlock\x0a(NativeFunction isNativeFunction: (self at: #then))\x0a\x09ifTrue: [ ^ (TThenable >> #catch:) sendTo: jsObject arguments: {aBlock} ]\x0a\x09ifFalse: [ ^ super catch: aBlock ]",
  347. referencedClasses: ["NativeFunction", "TThenable"],
  348. //>>excludeEnd("ide");
  349. messageSends: ["ifTrue:ifFalse:", "isNativeFunction:", "at:", "sendTo:arguments:", ">>", "catch:"]
  350. }),
  351. $globals.JSObjectProxy);
  352. $core.addMethod(
  353. $core.method({
  354. selector: "doesNotUnderstand:",
  355. protocol: "proxy",
  356. fn: function (aMessage){
  357. var self=this,$self=this;
  358. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  359. return $core.withContext(function($ctx1) {
  360. //>>excludeEnd("ctx");
  361. var $1,$receiver;
  362. $1=$recv($globals.JSObjectProxy)._lookupProperty_ofProxy_($recv($recv(aMessage)._selector())._asJavaScriptPropertyName(),self);
  363. if(($receiver = $1) == null || $receiver.a$nil){
  364. return (
  365. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  366. $ctx1.supercall = true,
  367. //>>excludeEnd("ctx");
  368. ($globals.JSObjectProxy.superclass||$boot.nilAsClass).fn.prototype._doesNotUnderstand_.apply($self, [aMessage]));
  369. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  370. $ctx1.supercall = false;
  371. //>>excludeEnd("ctx");;
  372. } else {
  373. var jsSelector;
  374. jsSelector=$receiver;
  375. return $recv($globals.JSObjectProxy)._forwardMessage_withArguments_ofProxy_(jsSelector,$recv(aMessage)._arguments(),self);
  376. }
  377. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  378. }, function($ctx1) {$ctx1.fill(self,"doesNotUnderstand:",{aMessage:aMessage},$globals.JSObjectProxy)});
  379. //>>excludeEnd("ctx");
  380. },
  381. //>>excludeStart("ide", pragmas.excludeIdeData);
  382. args: ["aMessage"],
  383. source: "doesNotUnderstand: aMessage\x0a\x09^ (JSObjectProxy lookupProperty: aMessage selector asJavaScriptPropertyName ofProxy: self)\x0a\x09\x09ifNil: [ super doesNotUnderstand: aMessage ]\x0a\x09\x09ifNotNil: [ :jsSelector | \x0a\x09\x09\x09JSObjectProxy \x0a\x09\x09\x09\x09forwardMessage: jsSelector \x0a\x09\x09\x09\x09withArguments: aMessage arguments\x0a\x09\x09\x09\x09ofProxy: self ]",
  384. referencedClasses: ["JSObjectProxy"],
  385. //>>excludeEnd("ide");
  386. messageSends: ["ifNil:ifNotNil:", "lookupProperty:ofProxy:", "asJavaScriptPropertyName", "selector", "doesNotUnderstand:", "forwardMessage:withArguments:ofProxy:", "arguments"]
  387. }),
  388. $globals.JSObjectProxy);
  389. $core.addMethod(
  390. $core.method({
  391. selector: "in:",
  392. protocol: "accessing",
  393. fn: function (aValuable){
  394. var self=this,$self=this;
  395. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  396. return $core.withContext(function($ctx1) {
  397. //>>excludeEnd("ctx");
  398. return $recv(aValuable)._value_($self["@jsObject"]);
  399. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  400. }, function($ctx1) {$ctx1.fill(self,"in:",{aValuable:aValuable},$globals.JSObjectProxy)});
  401. //>>excludeEnd("ctx");
  402. },
  403. //>>excludeStart("ide", pragmas.excludeIdeData);
  404. args: ["aValuable"],
  405. source: "in: aValuable\x0a\x09^ aValuable value: jsObject",
  406. referencedClasses: [],
  407. //>>excludeEnd("ide");
  408. messageSends: ["value:"]
  409. }),
  410. $globals.JSObjectProxy);
  411. $core.addMethod(
  412. $core.method({
  413. selector: "jsObject",
  414. protocol: "accessing",
  415. fn: function (){
  416. var self=this,$self=this;
  417. return $self["@jsObject"];
  418. },
  419. //>>excludeStart("ide", pragmas.excludeIdeData);
  420. args: [],
  421. source: "jsObject\x0a\x09^ jsObject",
  422. referencedClasses: [],
  423. //>>excludeEnd("ide");
  424. messageSends: []
  425. }),
  426. $globals.JSObjectProxy);
  427. $core.addMethod(
  428. $core.method({
  429. selector: "keysAndValuesDo:",
  430. protocol: "enumerating",
  431. fn: function (aBlock){
  432. var self=this,$self=this;
  433. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  434. return $core.withContext(function($ctx1) {
  435. //>>excludeEnd("ctx");
  436. var o = $self['@jsObject'];
  437. for(var i in o) {
  438. aBlock._value_value_(i, o[i]);
  439. }
  440. ;
  441. return self;
  442. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  443. }, function($ctx1) {$ctx1.fill(self,"keysAndValuesDo:",{aBlock:aBlock},$globals.JSObjectProxy)});
  444. //>>excludeEnd("ctx");
  445. },
  446. //>>excludeStart("ide", pragmas.excludeIdeData);
  447. args: ["aBlock"],
  448. source: "keysAndValuesDo: aBlock\x0a\x09<inlineJS: '\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'>",
  449. referencedClasses: [],
  450. //>>excludeEnd("ide");
  451. messageSends: []
  452. }),
  453. $globals.JSObjectProxy);
  454. $core.addMethod(
  455. $core.method({
  456. selector: "on:do:",
  457. protocol: "promises",
  458. fn: function (aClass,aBlock){
  459. var self=this,$self=this;
  460. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  461. return $core.withContext(function($ctx1) {
  462. //>>excludeEnd("ctx");
  463. var $1,$2;
  464. $1=$recv($globals.NativeFunction)._isNativeFunction_($self._at_("then"));
  465. if($core.assert($1)){
  466. return $recv($recv($globals.TThenable).__gt_gt("on:do:"))._sendTo_arguments_($self["@jsObject"],[aClass,aBlock]);
  467. } else {
  468. $2=(
  469. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  470. $ctx1.supercall = true,
  471. //>>excludeEnd("ctx");
  472. ($globals.JSObjectProxy.superclass||$boot.nilAsClass).fn.prototype._on_do_.apply($self, [aClass,aBlock]));
  473. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  474. $ctx1.supercall = false;
  475. //>>excludeEnd("ctx");;
  476. return $2;
  477. }
  478. return self;
  479. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  480. }, function($ctx1) {$ctx1.fill(self,"on:do:",{aClass:aClass,aBlock:aBlock},$globals.JSObjectProxy)});
  481. //>>excludeEnd("ctx");
  482. },
  483. //>>excludeStart("ide", pragmas.excludeIdeData);
  484. args: ["aClass", "aBlock"],
  485. source: "on: aClass do: aBlock\x0a(NativeFunction isNativeFunction: (self at: #then))\x0a\x09ifTrue: [ ^ (TThenable >> #on:do:) sendTo: jsObject arguments: {aClass. aBlock} ]\x0a\x09ifFalse: [ ^ super on: aClass do: aBlock ]",
  486. referencedClasses: ["NativeFunction", "TThenable"],
  487. //>>excludeEnd("ide");
  488. messageSends: ["ifTrue:ifFalse:", "isNativeFunction:", "at:", "sendTo:arguments:", ">>", "on:do:"]
  489. }),
  490. $globals.JSObjectProxy);
  491. $core.addMethod(
  492. $core.method({
  493. selector: "printOn:",
  494. protocol: "printing",
  495. fn: function (aStream){
  496. var self=this,$self=this;
  497. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  498. return $core.withContext(function($ctx1) {
  499. //>>excludeEnd("ctx");
  500. $recv(aStream)._nextPutAll_($self._printString());
  501. return self;
  502. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  503. }, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},$globals.JSObjectProxy)});
  504. //>>excludeEnd("ctx");
  505. },
  506. //>>excludeStart("ide", pragmas.excludeIdeData);
  507. args: ["aStream"],
  508. source: "printOn: aStream\x0a\x09aStream nextPutAll: self printString",
  509. referencedClasses: [],
  510. //>>excludeEnd("ide");
  511. messageSends: ["nextPutAll:", "printString"]
  512. }),
  513. $globals.JSObjectProxy);
  514. $core.addMethod(
  515. $core.method({
  516. selector: "printString",
  517. protocol: "printing",
  518. fn: function (){
  519. var self=this,$self=this;
  520. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  521. return $core.withContext(function($ctx1) {
  522. //>>excludeEnd("ctx");
  523. var js = $self['@jsObject'];
  524. return js.toString
  525. ? js.toString()
  526. : Object.prototype.toString.call(js)
  527. ;
  528. return self;
  529. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  530. }, function($ctx1) {$ctx1.fill(self,"printString",{},$globals.JSObjectProxy)});
  531. //>>excludeEnd("ctx");
  532. },
  533. //>>excludeStart("ide", pragmas.excludeIdeData);
  534. args: [],
  535. source: "printString\x0a\x09<inlineJS: '\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'>",
  536. referencedClasses: [],
  537. //>>excludeEnd("ide");
  538. messageSends: []
  539. }),
  540. $globals.JSObjectProxy);
  541. $core.addMethod(
  542. $core.method({
  543. selector: "putOn:",
  544. protocol: "streaming",
  545. fn: function (aStream){
  546. var self=this,$self=this;
  547. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  548. return $core.withContext(function($ctx1) {
  549. //>>excludeEnd("ctx");
  550. $recv(aStream)._nextPutJSObject_($self["@jsObject"]);
  551. return self;
  552. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  553. }, function($ctx1) {$ctx1.fill(self,"putOn:",{aStream:aStream},$globals.JSObjectProxy)});
  554. //>>excludeEnd("ctx");
  555. },
  556. //>>excludeStart("ide", pragmas.excludeIdeData);
  557. args: ["aStream"],
  558. source: "putOn: aStream\x0a\x09aStream nextPutJSObject: jsObject",
  559. referencedClasses: [],
  560. //>>excludeEnd("ide");
  561. messageSends: ["nextPutJSObject:"]
  562. }),
  563. $globals.JSObjectProxy);
  564. $core.addMethod(
  565. $core.method({
  566. selector: "then:",
  567. protocol: "promises",
  568. fn: function (aBlockOrArray){
  569. var self=this,$self=this;
  570. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  571. return $core.withContext(function($ctx1) {
  572. //>>excludeEnd("ctx");
  573. var $1,$2;
  574. $1=$recv($globals.NativeFunction)._isNativeFunction_($self._at_("then"));
  575. if($core.assert($1)){
  576. return $recv($recv($globals.TThenable).__gt_gt("then:"))._sendTo_arguments_($self["@jsObject"],[aBlockOrArray]);
  577. } else {
  578. $2=(
  579. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  580. $ctx1.supercall = true,
  581. //>>excludeEnd("ctx");
  582. ($globals.JSObjectProxy.superclass||$boot.nilAsClass).fn.prototype._then_.apply($self, [aBlockOrArray]));
  583. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  584. $ctx1.supercall = false;
  585. //>>excludeEnd("ctx");;
  586. return $2;
  587. }
  588. return self;
  589. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  590. }, function($ctx1) {$ctx1.fill(self,"then:",{aBlockOrArray:aBlockOrArray},$globals.JSObjectProxy)});
  591. //>>excludeEnd("ctx");
  592. },
  593. //>>excludeStart("ide", pragmas.excludeIdeData);
  594. args: ["aBlockOrArray"],
  595. source: "then: aBlockOrArray\x0a(NativeFunction isNativeFunction: (self at: #then))\x0a\x09ifTrue: [ ^ (TThenable >> #then:) sendTo: jsObject arguments: {aBlockOrArray} ]\x0a\x09ifFalse: [ ^ super then: aBlockOrArray ]",
  596. referencedClasses: ["NativeFunction", "TThenable"],
  597. //>>excludeEnd("ide");
  598. messageSends: ["ifTrue:ifFalse:", "isNativeFunction:", "at:", "sendTo:arguments:", ">>", "then:"]
  599. }),
  600. $globals.JSObjectProxy);
  601. $core.addMethod(
  602. $core.method({
  603. selector: "addObjectVariablesTo:ofProxy:",
  604. protocol: "proxy",
  605. fn: function (aDictionary,aProxy){
  606. var self=this,$self=this;
  607. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  608. return $core.withContext(function($ctx1) {
  609. //>>excludeEnd("ctx");
  610. var jsObject = aProxy['@jsObject'];
  611. for(var i in jsObject) {
  612. aDictionary._at_put_(i, jsObject[i]);
  613. }
  614. ;
  615. return self;
  616. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  617. }, function($ctx1) {$ctx1.fill(self,"addObjectVariablesTo:ofProxy:",{aDictionary:aDictionary,aProxy:aProxy},$globals.JSObjectProxy.a$cls)});
  618. //>>excludeEnd("ctx");
  619. },
  620. //>>excludeStart("ide", pragmas.excludeIdeData);
  621. args: ["aDictionary", "aProxy"],
  622. source: "addObjectVariablesTo: aDictionary ofProxy: aProxy\x0a\x09<inlineJS: '\x0a\x09\x09var jsObject = aProxy[''@jsObject''];\x0a\x09\x09for(var i in jsObject) {\x0a\x09\x09\x09aDictionary._at_put_(i, jsObject[i]);\x0a\x09\x09}\x0a\x09'>",
  623. referencedClasses: [],
  624. //>>excludeEnd("ide");
  625. messageSends: []
  626. }),
  627. $globals.JSObjectProxy.a$cls);
  628. $core.addMethod(
  629. $core.method({
  630. selector: "compareJSObjectOfProxy:withProxy:",
  631. protocol: "proxy",
  632. fn: function (aProxy,anotherProxy){
  633. var self=this,$self=this;
  634. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  635. return $core.withContext(function($ctx1) {
  636. //>>excludeEnd("ctx");
  637. var anotherJSObject = anotherProxy.a$cls ? anotherProxy["@jsObject"] : anotherProxy;
  638. return aProxy["@jsObject"] === anotherJSObject;
  639. return self;
  640. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  641. }, function($ctx1) {$ctx1.fill(self,"compareJSObjectOfProxy:withProxy:",{aProxy:aProxy,anotherProxy:anotherProxy},$globals.JSObjectProxy.a$cls)});
  642. //>>excludeEnd("ctx");
  643. },
  644. //>>excludeStart("ide", pragmas.excludeIdeData);
  645. args: ["aProxy", "anotherProxy"],
  646. source: "compareJSObjectOfProxy: aProxy withProxy: anotherProxy\x0a<inlineJS: '\x0a\x09var anotherJSObject = anotherProxy.a$cls ? anotherProxy[\x22@jsObject\x22] : anotherProxy;\x0a\x09return aProxy[\x22@jsObject\x22] === anotherJSObject\x0a'>",
  647. referencedClasses: [],
  648. //>>excludeEnd("ide");
  649. messageSends: []
  650. }),
  651. $globals.JSObjectProxy.a$cls);
  652. $core.addMethod(
  653. $core.method({
  654. selector: "forwardMessage:withArguments:ofProxy:",
  655. protocol: "proxy",
  656. fn: function (aString,anArray,aProxy){
  657. var self=this,$self=this;
  658. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  659. return $core.withContext(function($ctx1) {
  660. //>>excludeEnd("ctx");
  661. return $core.accessJavaScript(aProxy._jsObject(), aString, anArray);
  662. ;
  663. return self;
  664. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  665. }, function($ctx1) {$ctx1.fill(self,"forwardMessage:withArguments:ofProxy:",{aString:aString,anArray:anArray,aProxy:aProxy},$globals.JSObjectProxy.a$cls)});
  666. //>>excludeEnd("ctx");
  667. },
  668. //>>excludeStart("ide", pragmas.excludeIdeData);
  669. args: ["aString", "anArray", "aProxy"],
  670. source: "forwardMessage: aString withArguments: anArray ofProxy: aProxy\x0a\x09<inlineJS: '\x0a\x09\x09return $core.accessJavaScript(aProxy._jsObject(), aString, anArray);\x0a\x09'>",
  671. referencedClasses: [],
  672. //>>excludeEnd("ide");
  673. messageSends: []
  674. }),
  675. $globals.JSObjectProxy.a$cls);
  676. $core.addMethod(
  677. $core.method({
  678. selector: "jsObject:ofProxy:",
  679. protocol: "proxy",
  680. fn: function (aJSObject,aProxy){
  681. var self=this,$self=this;
  682. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  683. return $core.withContext(function($ctx1) {
  684. //>>excludeEnd("ctx");
  685. aProxy['@jsObject'] = aJSObject;
  686. return self;
  687. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  688. }, function($ctx1) {$ctx1.fill(self,"jsObject:ofProxy:",{aJSObject:aJSObject,aProxy:aProxy},$globals.JSObjectProxy.a$cls)});
  689. //>>excludeEnd("ctx");
  690. },
  691. //>>excludeStart("ide", pragmas.excludeIdeData);
  692. args: ["aJSObject", "aProxy"],
  693. source: "jsObject: aJSObject ofProxy: aProxy\x0a\x09<inlineJS: 'aProxy[''@jsObject''] = aJSObject'>",
  694. referencedClasses: [],
  695. //>>excludeEnd("ide");
  696. messageSends: []
  697. }),
  698. $globals.JSObjectProxy.a$cls);
  699. $core.addMethod(
  700. $core.method({
  701. selector: "lookupProperty:ofProxy:",
  702. protocol: "proxy",
  703. fn: function (aString,aProxy){
  704. var self=this,$self=this;
  705. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  706. return $core.withContext(function($ctx1) {
  707. //>>excludeEnd("ctx");
  708. return aString in aProxy._jsObject() ? aString : nil;
  709. return self;
  710. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  711. }, function($ctx1) {$ctx1.fill(self,"lookupProperty:ofProxy:",{aString:aString,aProxy:aProxy},$globals.JSObjectProxy.a$cls)});
  712. //>>excludeEnd("ctx");
  713. },
  714. //>>excludeStart("ide", pragmas.excludeIdeData);
  715. args: ["aString", "aProxy"],
  716. source: "lookupProperty: aString ofProxy: aProxy\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<inlineJS: 'return aString in aProxy._jsObject() ? aString : nil'>",
  717. referencedClasses: [],
  718. //>>excludeEnd("ide");
  719. messageSends: []
  720. }),
  721. $globals.JSObjectProxy.a$cls);
  722. $core.addMethod(
  723. $core.method({
  724. selector: "on:",
  725. protocol: "instance creation",
  726. fn: function (aJSObject){
  727. var self=this,$self=this;
  728. var instance;
  729. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  730. return $core.withContext(function($ctx1) {
  731. //>>excludeEnd("ctx");
  732. instance=$self._new();
  733. $self._jsObject_ofProxy_(aJSObject,instance);
  734. return instance;
  735. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  736. }, function($ctx1) {$ctx1.fill(self,"on:",{aJSObject:aJSObject,instance:instance},$globals.JSObjectProxy.a$cls)});
  737. //>>excludeEnd("ctx");
  738. },
  739. //>>excludeStart("ide", pragmas.excludeIdeData);
  740. args: ["aJSObject"],
  741. source: "on: aJSObject\x0a\x09| instance |\x0a\x09instance := self new.\x0a\x09self jsObject: aJSObject ofProxy: instance.\x0a\x09^ instance",
  742. referencedClasses: [],
  743. //>>excludeEnd("ide");
  744. messageSends: ["new", "jsObject:ofProxy:"]
  745. }),
  746. $globals.JSObjectProxy.a$cls);
  747. $core.addClass("Organizer", $globals.Object, ["elements"], "Kernel-Infrastructure");
  748. //>>excludeStart("ide", pragmas.excludeIdeData);
  749. $globals.Organizer.comment="I represent categorization information. \x0a\x0a## API\x0a\x0aUse `#addElement:` and `#removeElement:` to manipulate instances.";
  750. //>>excludeEnd("ide");
  751. $core.addMethod(
  752. $core.method({
  753. selector: "addElement:",
  754. protocol: "accessing",
  755. fn: function (anObject){
  756. var self=this,$self=this;
  757. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  758. return $core.withContext(function($ctx1) {
  759. //>>excludeEnd("ctx");
  760. $recv($self._elements())._add_(anObject);
  761. return self;
  762. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  763. }, function($ctx1) {$ctx1.fill(self,"addElement:",{anObject:anObject},$globals.Organizer)});
  764. //>>excludeEnd("ctx");
  765. },
  766. //>>excludeStart("ide", pragmas.excludeIdeData);
  767. args: ["anObject"],
  768. source: "addElement: anObject\x0a\x09self elements add: anObject",
  769. referencedClasses: [],
  770. //>>excludeEnd("ide");
  771. messageSends: ["add:", "elements"]
  772. }),
  773. $globals.Organizer);
  774. $core.addMethod(
  775. $core.method({
  776. selector: "elements",
  777. protocol: "accessing",
  778. fn: function (){
  779. var self=this,$self=this;
  780. return $self["@elements"];
  781. },
  782. //>>excludeStart("ide", pragmas.excludeIdeData);
  783. args: [],
  784. source: "elements\x0a\x09^ elements",
  785. referencedClasses: [],
  786. //>>excludeEnd("ide");
  787. messageSends: []
  788. }),
  789. $globals.Organizer);
  790. $core.addMethod(
  791. $core.method({
  792. selector: "initialize",
  793. protocol: "initialization",
  794. fn: function (){
  795. var self=this,$self=this;
  796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  797. return $core.withContext(function($ctx1) {
  798. //>>excludeEnd("ctx");
  799. (
  800. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  801. $ctx1.supercall = true,
  802. //>>excludeEnd("ctx");
  803. ($globals.Organizer.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($self, []));
  804. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  805. $ctx1.supercall = false;
  806. //>>excludeEnd("ctx");;
  807. $self["@elements"]=$recv($globals.Set)._new();
  808. return self;
  809. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  810. }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.Organizer)});
  811. //>>excludeEnd("ctx");
  812. },
  813. //>>excludeStart("ide", pragmas.excludeIdeData);
  814. args: [],
  815. source: "initialize\x0a\x09super initialize.\x0a\x09elements := Set new",
  816. referencedClasses: ["Set"],
  817. //>>excludeEnd("ide");
  818. messageSends: ["initialize", "new"]
  819. }),
  820. $globals.Organizer);
  821. $core.addMethod(
  822. $core.method({
  823. selector: "removeElement:",
  824. protocol: "accessing",
  825. fn: function (anObject){
  826. var self=this,$self=this;
  827. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  828. return $core.withContext(function($ctx1) {
  829. //>>excludeEnd("ctx");
  830. $recv($self._elements())._remove_ifAbsent_(anObject,(function(){
  831. }));
  832. return self;
  833. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  834. }, function($ctx1) {$ctx1.fill(self,"removeElement:",{anObject:anObject},$globals.Organizer)});
  835. //>>excludeEnd("ctx");
  836. },
  837. //>>excludeStart("ide", pragmas.excludeIdeData);
  838. args: ["anObject"],
  839. source: "removeElement: anObject\x0a\x09self elements remove: anObject ifAbsent: []",
  840. referencedClasses: [],
  841. //>>excludeEnd("ide");
  842. messageSends: ["remove:ifAbsent:", "elements"]
  843. }),
  844. $globals.Organizer);
  845. $core.addClass("ClassOrganizer", $globals.Organizer, ["traitOrBehavior"], "Kernel-Infrastructure");
  846. //>>excludeStart("ide", pragmas.excludeIdeData);
  847. $globals.ClassOrganizer.comment="I am an organizer specific to classes. I hold method categorization information for classes.";
  848. //>>excludeEnd("ide");
  849. $core.addMethod(
  850. $core.method({
  851. selector: "addElement:",
  852. protocol: "accessing",
  853. fn: function (aString){
  854. var self=this,$self=this;
  855. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  856. return $core.withContext(function($ctx1) {
  857. //>>excludeEnd("ctx");
  858. var $1,$3,$2;
  859. (
  860. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  861. $ctx1.supercall = true,
  862. //>>excludeEnd("ctx");
  863. ($globals.ClassOrganizer.superclass||$boot.nilAsClass).fn.prototype._addElement_.apply($self, [aString]));
  864. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  865. $ctx1.supercall = false;
  866. //>>excludeEnd("ctx");;
  867. $1=$recv($globals.SystemAnnouncer)._current();
  868. $3=$recv($globals.ProtocolAdded)._new();
  869. $recv($3)._protocol_(aString);
  870. $recv($3)._theClass_($self._theClass());
  871. $2=$recv($3)._yourself();
  872. $recv($1)._announce_($2);
  873. return self;
  874. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  875. }, function($ctx1) {$ctx1.fill(self,"addElement:",{aString:aString},$globals.ClassOrganizer)});
  876. //>>excludeEnd("ctx");
  877. },
  878. //>>excludeStart("ide", pragmas.excludeIdeData);
  879. args: ["aString"],
  880. 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)",
  881. referencedClasses: ["SystemAnnouncer", "ProtocolAdded"],
  882. //>>excludeEnd("ide");
  883. messageSends: ["addElement:", "announce:", "current", "protocol:", "new", "theClass:", "theClass", "yourself"]
  884. }),
  885. $globals.ClassOrganizer);
  886. $core.addMethod(
  887. $core.method({
  888. selector: "removeElement:",
  889. protocol: "accessing",
  890. fn: function (aString){
  891. var self=this,$self=this;
  892. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  893. return $core.withContext(function($ctx1) {
  894. //>>excludeEnd("ctx");
  895. var $1,$3,$2;
  896. (
  897. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  898. $ctx1.supercall = true,
  899. //>>excludeEnd("ctx");
  900. ($globals.ClassOrganizer.superclass||$boot.nilAsClass).fn.prototype._removeElement_.apply($self, [aString]));
  901. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  902. $ctx1.supercall = false;
  903. //>>excludeEnd("ctx");;
  904. $1=$recv($globals.SystemAnnouncer)._current();
  905. $3=$recv($globals.ProtocolRemoved)._new();
  906. $recv($3)._protocol_(aString);
  907. $recv($3)._theClass_($self._theClass());
  908. $2=$recv($3)._yourself();
  909. $recv($1)._announce_($2);
  910. return self;
  911. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  912. }, function($ctx1) {$ctx1.fill(self,"removeElement:",{aString:aString},$globals.ClassOrganizer)});
  913. //>>excludeEnd("ctx");
  914. },
  915. //>>excludeStart("ide", pragmas.excludeIdeData);
  916. args: ["aString"],
  917. 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)",
  918. referencedClasses: ["SystemAnnouncer", "ProtocolRemoved"],
  919. //>>excludeEnd("ide");
  920. messageSends: ["removeElement:", "announce:", "current", "protocol:", "new", "theClass:", "theClass", "yourself"]
  921. }),
  922. $globals.ClassOrganizer);
  923. $core.addMethod(
  924. $core.method({
  925. selector: "theClass",
  926. protocol: "accessing",
  927. fn: function (){
  928. var self=this,$self=this;
  929. return $self["@traitOrBehavior"];
  930. },
  931. //>>excludeStart("ide", pragmas.excludeIdeData);
  932. args: [],
  933. source: "theClass\x0a\x09^ traitOrBehavior",
  934. referencedClasses: [],
  935. //>>excludeEnd("ide");
  936. messageSends: []
  937. }),
  938. $globals.ClassOrganizer);
  939. $core.addMethod(
  940. $core.method({
  941. selector: "theClass:",
  942. protocol: "accessing",
  943. fn: function (aClass){
  944. var self=this,$self=this;
  945. $self["@traitOrBehavior"]=aClass;
  946. return self;
  947. },
  948. //>>excludeStart("ide", pragmas.excludeIdeData);
  949. args: ["aClass"],
  950. source: "theClass: aClass\x0a\x09traitOrBehavior := aClass",
  951. referencedClasses: [],
  952. //>>excludeEnd("ide");
  953. messageSends: []
  954. }),
  955. $globals.ClassOrganizer);
  956. $core.addMethod(
  957. $core.method({
  958. selector: "on:",
  959. protocol: "instance creation",
  960. fn: function (aClass){
  961. var self=this,$self=this;
  962. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  963. return $core.withContext(function($ctx1) {
  964. //>>excludeEnd("ctx");
  965. var $1;
  966. $1=$self._new();
  967. $recv($1)._theClass_(aClass);
  968. return $recv($1)._yourself();
  969. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  970. }, function($ctx1) {$ctx1.fill(self,"on:",{aClass:aClass},$globals.ClassOrganizer.a$cls)});
  971. //>>excludeEnd("ctx");
  972. },
  973. //>>excludeStart("ide", pragmas.excludeIdeData);
  974. args: ["aClass"],
  975. source: "on: aClass\x0a\x09^ self new\x0a\x09\x09theClass: aClass;\x0a\x09\x09yourself",
  976. referencedClasses: [],
  977. //>>excludeEnd("ide");
  978. messageSends: ["theClass:", "new", "yourself"]
  979. }),
  980. $globals.ClassOrganizer.a$cls);
  981. $core.addClass("PackageOrganizer", $globals.Organizer, [], "Kernel-Infrastructure");
  982. //>>excludeStart("ide", pragmas.excludeIdeData);
  983. $globals.PackageOrganizer.comment="I am an organizer specific to packages. I hold classes categorization information.";
  984. //>>excludeEnd("ide");
  985. $core.addClass("Package", $globals.Object, ["evalBlock", "basicTransport", "name", "transport", "imports", "dirty", "organization"], "Kernel-Infrastructure");
  986. //>>excludeStart("ide", pragmas.excludeIdeData);
  987. $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'";
  988. //>>excludeEnd("ide");
  989. $core.addMethod(
  990. $core.method({
  991. selector: "basicTransport",
  992. protocol: "private",
  993. fn: function (){
  994. var self=this,$self=this;
  995. return $self["@basicTransport"];
  996. },
  997. //>>excludeStart("ide", pragmas.excludeIdeData);
  998. args: [],
  999. source: "basicTransport\x0a\x09\x22Answer the transport literal JavaScript object as setup in the JavaScript file, if any\x22\x0a\x09\x0a\x09^ basicTransport",
  1000. referencedClasses: [],
  1001. //>>excludeEnd("ide");
  1002. messageSends: []
  1003. }),
  1004. $globals.Package);
  1005. $core.addMethod(
  1006. $core.method({
  1007. selector: "beClean",
  1008. protocol: "accessing",
  1009. fn: function (){
  1010. var self=this,$self=this;
  1011. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1012. return $core.withContext(function($ctx1) {
  1013. //>>excludeEnd("ctx");
  1014. var $1,$3,$2;
  1015. $self["@dirty"]=false;
  1016. $1=$recv($globals.SystemAnnouncer)._current();
  1017. $3=$recv($globals.PackageClean)._new();
  1018. $recv($3)._package_(self);
  1019. $2=$recv($3)._yourself();
  1020. $recv($1)._announce_($2);
  1021. return self;
  1022. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1023. }, function($ctx1) {$ctx1.fill(self,"beClean",{},$globals.Package)});
  1024. //>>excludeEnd("ctx");
  1025. },
  1026. //>>excludeStart("ide", pragmas.excludeIdeData);
  1027. args: [],
  1028. source: "beClean\x0a\x09dirty := false.\x0a\x09\x0a\x09SystemAnnouncer current announce: (PackageClean new\x0a\x09\x09package: self;\x0a\x09\x09yourself)",
  1029. referencedClasses: ["SystemAnnouncer", "PackageClean"],
  1030. //>>excludeEnd("ide");
  1031. messageSends: ["announce:", "current", "package:", "new", "yourself"]
  1032. }),
  1033. $globals.Package);
  1034. $core.addMethod(
  1035. $core.method({
  1036. selector: "beDirty",
  1037. protocol: "accessing",
  1038. fn: function (){
  1039. var self=this,$self=this;
  1040. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1041. return $core.withContext(function($ctx1) {
  1042. //>>excludeEnd("ctx");
  1043. var $1,$3,$2;
  1044. $self["@dirty"]=true;
  1045. $1=$recv($globals.SystemAnnouncer)._current();
  1046. $3=$recv($globals.PackageDirty)._new();
  1047. $recv($3)._package_(self);
  1048. $2=$recv($3)._yourself();
  1049. $recv($1)._announce_($2);
  1050. return self;
  1051. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1052. }, function($ctx1) {$ctx1.fill(self,"beDirty",{},$globals.Package)});
  1053. //>>excludeEnd("ctx");
  1054. },
  1055. //>>excludeStart("ide", pragmas.excludeIdeData);
  1056. args: [],
  1057. source: "beDirty\x0a\x09dirty := true.\x0a\x09\x0a\x09SystemAnnouncer current announce: (PackageDirty new\x0a\x09\x09package: self;\x0a\x09\x09yourself)",
  1058. referencedClasses: ["SystemAnnouncer", "PackageDirty"],
  1059. //>>excludeEnd("ide");
  1060. messageSends: ["announce:", "current", "package:", "new", "yourself"]
  1061. }),
  1062. $globals.Package);
  1063. $core.addMethod(
  1064. $core.method({
  1065. selector: "classTemplate",
  1066. protocol: "accessing",
  1067. fn: function (){
  1068. var self=this,$self=this;
  1069. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1070. return $core.withContext(function($ctx1) {
  1071. //>>excludeEnd("ctx");
  1072. return $recv($globals.String)._streamContents_((function(stream){
  1073. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1074. return $core.withContext(function($ctx2) {
  1075. //>>excludeEnd("ctx");
  1076. $recv(stream)._write_("Object subclass: #NameOfSubclass");
  1077. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1078. $ctx2.sendIdx["write:"]=1;
  1079. //>>excludeEnd("ctx");
  1080. $recv(stream)._lf();
  1081. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1082. $ctx2.sendIdx["lf"]=1;
  1083. //>>excludeEnd("ctx");
  1084. $recv(stream)._tab();
  1085. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1086. $ctx2.sendIdx["tab"]=1;
  1087. //>>excludeEnd("ctx");
  1088. $recv(stream)._write_("instanceVariableNames: ''");
  1089. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1090. $ctx2.sendIdx["write:"]=2;
  1091. //>>excludeEnd("ctx");
  1092. $recv(stream)._lf();
  1093. $recv(stream)._tab();
  1094. $recv(stream)._write_("package: ");
  1095. return $recv(stream)._print_($self._name());
  1096. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1097. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)});
  1098. //>>excludeEnd("ctx");
  1099. }));
  1100. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1101. }, function($ctx1) {$ctx1.fill(self,"classTemplate",{},$globals.Package)});
  1102. //>>excludeEnd("ctx");
  1103. },
  1104. //>>excludeStart("ide", pragmas.excludeIdeData);
  1105. args: [],
  1106. source: "classTemplate\x0a\x09^ String streamContents: [ :stream | stream\x0a\x09\x09write: 'Object subclass: #NameOfSubclass'; lf;\x0a\x09\x09tab; write: 'instanceVariableNames: '''''; lf;\x0a\x09\x09tab; write: 'package: '; print: self name ]",
  1107. referencedClasses: ["String"],
  1108. //>>excludeEnd("ide");
  1109. messageSends: ["streamContents:", "write:", "lf", "tab", "print:", "name"]
  1110. }),
  1111. $globals.Package);
  1112. $core.addMethod(
  1113. $core.method({
  1114. selector: "classes",
  1115. protocol: "classes",
  1116. fn: function (){
  1117. var self=this,$self=this;
  1118. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1119. return $core.withContext(function($ctx1) {
  1120. //>>excludeEnd("ctx");
  1121. return $recv($recv($self._organization())._elements())._copy();
  1122. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1123. }, function($ctx1) {$ctx1.fill(self,"classes",{},$globals.Package)});
  1124. //>>excludeEnd("ctx");
  1125. },
  1126. //>>excludeStart("ide", pragmas.excludeIdeData);
  1127. args: [],
  1128. source: "classes\x0a\x09^ self organization elements copy",
  1129. referencedClasses: [],
  1130. //>>excludeEnd("ide");
  1131. messageSends: ["copy", "elements", "organization"]
  1132. }),
  1133. $globals.Package);
  1134. $core.addMethod(
  1135. $core.method({
  1136. selector: "definition",
  1137. protocol: "accessing",
  1138. fn: function (){
  1139. var self=this,$self=this;
  1140. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1141. return $core.withContext(function($ctx1) {
  1142. //>>excludeEnd("ctx");
  1143. var $1;
  1144. return $recv($globals.String)._streamContents_((function(stream){
  1145. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1146. return $core.withContext(function($ctx2) {
  1147. //>>excludeEnd("ctx");
  1148. $1=$recv($self._class())._name();
  1149. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1150. $ctx2.sendIdx["name"]=1;
  1151. //>>excludeEnd("ctx");
  1152. $recv(stream)._write_($1);
  1153. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1154. $ctx2.sendIdx["write:"]=1;
  1155. //>>excludeEnd("ctx");
  1156. $recv(stream)._lf();
  1157. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1158. $ctx2.sendIdx["lf"]=1;
  1159. //>>excludeEnd("ctx");
  1160. $recv(stream)._tab();
  1161. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1162. $ctx2.sendIdx["tab"]=1;
  1163. //>>excludeEnd("ctx");
  1164. $recv(stream)._write_("named: ");
  1165. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1166. $ctx2.sendIdx["write:"]=2;
  1167. //>>excludeEnd("ctx");
  1168. $recv(stream)._print_($self._name());
  1169. $recv(stream)._lf();
  1170. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1171. $ctx2.sendIdx["lf"]=2;
  1172. //>>excludeEnd("ctx");
  1173. $recv(stream)._tab();
  1174. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1175. $ctx2.sendIdx["tab"]=2;
  1176. //>>excludeEnd("ctx");
  1177. $recv(stream)._write_(["imports: ",$self._importsDefinition()]);
  1178. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1179. $ctx2.sendIdx["write:"]=3;
  1180. //>>excludeEnd("ctx");
  1181. $recv(stream)._lf();
  1182. $recv(stream)._tab();
  1183. return $recv(stream)._write_(["transport: (",$recv($self._transport())._definition(),")"]);
  1184. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1185. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)});
  1186. //>>excludeEnd("ctx");
  1187. }));
  1188. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1189. }, function($ctx1) {$ctx1.fill(self,"definition",{},$globals.Package)});
  1190. //>>excludeEnd("ctx");
  1191. },
  1192. //>>excludeStart("ide", pragmas.excludeIdeData);
  1193. args: [],
  1194. source: "definition\x0a\x09^ String streamContents: [ :stream | stream\x0a\x09\x09write: self class name; lf;\x0a\x09\x09tab; write: 'named: '; print: self name; lf;\x0a\x09\x09tab; write: { 'imports: '. self importsDefinition }; lf;\x0a\x09\x09tab; write: { 'transport: ('. self transport definition. ')' } ]",
  1195. referencedClasses: ["String"],
  1196. //>>excludeEnd("ide");
  1197. messageSends: ["streamContents:", "write:", "name", "class", "lf", "tab", "print:", "importsDefinition", "definition", "transport"]
  1198. }),
  1199. $globals.Package);
  1200. $core.addMethod(
  1201. $core.method({
  1202. selector: "eval:",
  1203. protocol: "evaluating",
  1204. fn: function (aString){
  1205. var self=this,$self=this;
  1206. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1207. return $core.withContext(function($ctx1) {
  1208. //>>excludeEnd("ctx");
  1209. var $1,$receiver;
  1210. $1=$self["@evalBlock"];
  1211. if(($receiver = $1) == null || $receiver.a$nil){
  1212. return $recv($globals.Compiler)._eval_(aString);
  1213. } else {
  1214. return $recv($self["@evalBlock"])._value_(aString);
  1215. }
  1216. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1217. }, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString},$globals.Package)});
  1218. //>>excludeEnd("ctx");
  1219. },
  1220. //>>excludeStart("ide", pragmas.excludeIdeData);
  1221. args: ["aString"],
  1222. source: "eval: aString\x0a\x09^ evalBlock\x0a\x09\x09ifNotNil: [ evalBlock value: aString ]\x0a\x09\x09ifNil: [ Compiler eval: aString ]",
  1223. referencedClasses: ["Compiler"],
  1224. //>>excludeEnd("ide");
  1225. messageSends: ["ifNotNil:ifNil:", "value:", "eval:"]
  1226. }),
  1227. $globals.Package);
  1228. $core.addMethod(
  1229. $core.method({
  1230. selector: "evalBlock",
  1231. protocol: "accessing",
  1232. fn: function (){
  1233. var self=this,$self=this;
  1234. return $self["@evalBlock"];
  1235. },
  1236. //>>excludeStart("ide", pragmas.excludeIdeData);
  1237. args: [],
  1238. source: "evalBlock\x0a\x09^ evalBlock",
  1239. referencedClasses: [],
  1240. //>>excludeEnd("ide");
  1241. messageSends: []
  1242. }),
  1243. $globals.Package);
  1244. $core.addMethod(
  1245. $core.method({
  1246. selector: "evalBlock:",
  1247. protocol: "accessing",
  1248. fn: function (aBlock){
  1249. var self=this,$self=this;
  1250. $self["@evalBlock"]=aBlock;
  1251. return self;
  1252. },
  1253. //>>excludeStart("ide", pragmas.excludeIdeData);
  1254. args: ["aBlock"],
  1255. source: "evalBlock: aBlock\x0a\x09evalBlock := aBlock",
  1256. referencedClasses: [],
  1257. //>>excludeEnd("ide");
  1258. messageSends: []
  1259. }),
  1260. $globals.Package);
  1261. $core.addMethod(
  1262. $core.method({
  1263. selector: "imports",
  1264. protocol: "accessing",
  1265. fn: function (){
  1266. var self=this,$self=this;
  1267. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1268. return $core.withContext(function($ctx1) {
  1269. //>>excludeEnd("ctx");
  1270. var $1,$receiver;
  1271. $1=$self["@imports"];
  1272. if(($receiver = $1) == null || $receiver.a$nil){
  1273. $self._imports_([]);
  1274. return $self["@imports"];
  1275. } else {
  1276. return $1;
  1277. }
  1278. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1279. }, function($ctx1) {$ctx1.fill(self,"imports",{},$globals.Package)});
  1280. //>>excludeEnd("ctx");
  1281. },
  1282. //>>excludeStart("ide", pragmas.excludeIdeData);
  1283. args: [],
  1284. source: "imports\x0a\x09^ imports ifNil: [\x0a\x09\x09self imports: #().\x0a\x09\x09imports ]",
  1285. referencedClasses: [],
  1286. //>>excludeEnd("ide");
  1287. messageSends: ["ifNil:", "imports:"]
  1288. }),
  1289. $globals.Package);
  1290. $core.addMethod(
  1291. $core.method({
  1292. selector: "imports:",
  1293. protocol: "accessing",
  1294. fn: function (anArray){
  1295. var self=this,$self=this;
  1296. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1297. return $core.withContext(function($ctx1) {
  1298. //>>excludeEnd("ctx");
  1299. $self._validateImports_(anArray);
  1300. $self["@imports"]=$recv(anArray)._asSet();
  1301. return self;
  1302. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1303. }, function($ctx1) {$ctx1.fill(self,"imports:",{anArray:anArray},$globals.Package)});
  1304. //>>excludeEnd("ctx");
  1305. },
  1306. //>>excludeStart("ide", pragmas.excludeIdeData);
  1307. args: ["anArray"],
  1308. source: "imports: anArray\x0a\x09self validateImports: anArray.\x0a\x09imports := anArray asSet",
  1309. referencedClasses: [],
  1310. //>>excludeEnd("ide");
  1311. messageSends: ["validateImports:", "asSet"]
  1312. }),
  1313. $globals.Package);
  1314. $core.addMethod(
  1315. $core.method({
  1316. selector: "importsAsJson",
  1317. protocol: "converting",
  1318. fn: function (){
  1319. var self=this,$self=this;
  1320. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1321. return $core.withContext(function($ctx1) {
  1322. //>>excludeEnd("ctx");
  1323. var $1;
  1324. return $recv($self._sortedImportsAsArray())._collect_((function(each){
  1325. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1326. return $core.withContext(function($ctx2) {
  1327. //>>excludeEnd("ctx");
  1328. $1=$recv(each)._isString();
  1329. if($core.assert($1)){
  1330. return each;
  1331. } else {
  1332. return $recv($recv($recv(each)._key()).__comma("=")).__comma($recv(each)._value());
  1333. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1334. $ctx2.sendIdx[","]=1;
  1335. //>>excludeEnd("ctx");
  1336. }
  1337. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1338. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  1339. //>>excludeEnd("ctx");
  1340. }));
  1341. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1342. }, function($ctx1) {$ctx1.fill(self,"importsAsJson",{},$globals.Package)});
  1343. //>>excludeEnd("ctx");
  1344. },
  1345. //>>excludeStart("ide", pragmas.excludeIdeData);
  1346. args: [],
  1347. source: "importsAsJson\x0a\x0a\x09^ self sortedImportsAsArray collect: [ :each |\x0a\x09\x09each isString\x0a\x09\x09\x09ifTrue: [ each ]\x0a\x09\x09\x09ifFalse: [ each key, '=', each value ]]",
  1348. referencedClasses: [],
  1349. //>>excludeEnd("ide");
  1350. messageSends: ["collect:", "sortedImportsAsArray", "ifTrue:ifFalse:", "isString", ",", "key", "value"]
  1351. }),
  1352. $globals.Package);
  1353. $core.addMethod(
  1354. $core.method({
  1355. selector: "importsDefinition",
  1356. protocol: "accessing",
  1357. fn: function (){
  1358. var self=this,$self=this;
  1359. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1360. return $core.withContext(function($ctx1) {
  1361. //>>excludeEnd("ctx");
  1362. return $recv($globals.String)._streamContents_((function(stream){
  1363. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1364. return $core.withContext(function($ctx2) {
  1365. //>>excludeEnd("ctx");
  1366. $recv(stream)._write_("{");
  1367. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1368. $ctx2.sendIdx["write:"]=1;
  1369. //>>excludeEnd("ctx");
  1370. $recv($self._sortedImportsAsArray())._do_separatedBy_((function(each){
  1371. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1372. return $core.withContext(function($ctx3) {
  1373. //>>excludeEnd("ctx");
  1374. return $recv(stream)._print_(each);
  1375. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1376. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)});
  1377. //>>excludeEnd("ctx");
  1378. }),(function(){
  1379. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1380. return $core.withContext(function($ctx3) {
  1381. //>>excludeEnd("ctx");
  1382. return $recv(stream)._write_(". ");
  1383. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1384. $ctx3.sendIdx["write:"]=2;
  1385. //>>excludeEnd("ctx");
  1386. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1387. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)});
  1388. //>>excludeEnd("ctx");
  1389. }));
  1390. return $recv(stream)._write_("}");
  1391. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1392. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)});
  1393. //>>excludeEnd("ctx");
  1394. }));
  1395. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1396. }, function($ctx1) {$ctx1.fill(self,"importsDefinition",{},$globals.Package)});
  1397. //>>excludeEnd("ctx");
  1398. },
  1399. //>>excludeStart("ide", pragmas.excludeIdeData);
  1400. args: [],
  1401. source: "importsDefinition\x0a\x09^ String streamContents: [ :stream |\x0a\x09\x09stream write: '{'.\x0a\x09\x09self sortedImportsAsArray\x0a\x09\x09\x09do: [ :each | stream print: each ]\x0a\x09\x09\x09separatedBy: [ stream write: '. ' ].\x0a\x09\x09stream write: '}' ]",
  1402. referencedClasses: ["String"],
  1403. //>>excludeEnd("ide");
  1404. messageSends: ["streamContents:", "write:", "do:separatedBy:", "sortedImportsAsArray", "print:"]
  1405. }),
  1406. $globals.Package);
  1407. $core.addMethod(
  1408. $core.method({
  1409. selector: "importsFromJson:",
  1410. protocol: "converting",
  1411. fn: function (anArray){
  1412. var self=this,$self=this;
  1413. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1414. return $core.withContext(function($ctx1) {
  1415. //>>excludeEnd("ctx");
  1416. var $1;
  1417. return $recv(anArray)._collect_((function(each){
  1418. var split;
  1419. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1420. return $core.withContext(function($ctx2) {
  1421. //>>excludeEnd("ctx");
  1422. split=$recv(each)._tokenize_("=");
  1423. split;
  1424. $1=$recv($recv(split)._size()).__eq((1));
  1425. if($core.assert($1)){
  1426. return $recv(split)._first();
  1427. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1428. $ctx2.sendIdx["first"]=1;
  1429. //>>excludeEnd("ctx");
  1430. } else {
  1431. return $recv($recv(split)._first()).__minus_gt($recv(split)._second());
  1432. }
  1433. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1434. }, function($ctx2) {$ctx2.fillBlock({each:each,split:split},$ctx1,1)});
  1435. //>>excludeEnd("ctx");
  1436. }));
  1437. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1438. }, function($ctx1) {$ctx1.fill(self,"importsFromJson:",{anArray:anArray},$globals.Package)});
  1439. //>>excludeEnd("ctx");
  1440. },
  1441. //>>excludeStart("ide", pragmas.excludeIdeData);
  1442. args: ["anArray"],
  1443. source: "importsFromJson: anArray\x0a\x09\x22Parses array of string, eg. #('asdf' 'qwer=tyuo')\x0a\x09into array of Strings and Associations,\x0a\x09eg. {'asdf'. 'qwer'->'tyuo'}\x22\x0a\x0a\x09^ anArray collect: [ :each |\x0a\x09\x09| split |\x0a\x09\x09split := each tokenize: '='.\x0a\x09\x09split size = 1\x0a\x09\x09\x09ifTrue: [ split first ]\x0a\x09\x09\x09ifFalse: [ split first -> split second ]]",
  1444. referencedClasses: [],
  1445. //>>excludeEnd("ide");
  1446. messageSends: ["collect:", "tokenize:", "ifTrue:ifFalse:", "=", "size", "first", "->", "second"]
  1447. }),
  1448. $globals.Package);
  1449. $core.addMethod(
  1450. $core.method({
  1451. selector: "initialize",
  1452. protocol: "initialization",
  1453. fn: function (){
  1454. var self=this,$self=this;
  1455. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1456. return $core.withContext(function($ctx1) {
  1457. //>>excludeEnd("ctx");
  1458. (
  1459. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1460. $ctx1.supercall = true,
  1461. //>>excludeEnd("ctx");
  1462. ($globals.Package.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($self, []));
  1463. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1464. $ctx1.supercall = false;
  1465. //>>excludeEnd("ctx");;
  1466. $self["@organization"]=$recv($globals.PackageOrganizer)._new();
  1467. $self["@evalBlock"]=nil;
  1468. $self["@dirty"]=nil;
  1469. $self["@imports"]=nil;
  1470. $self["@transport"]=nil;
  1471. return self;
  1472. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1473. }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.Package)});
  1474. //>>excludeEnd("ctx");
  1475. },
  1476. //>>excludeStart("ide", pragmas.excludeIdeData);
  1477. args: [],
  1478. source: "initialize\x0a\x09super initialize.\x0a\x0a\x09organization := PackageOrganizer new.\x0a\x09evalBlock := nil.\x0a\x09dirty := nil.\x0a\x09imports := nil.\x0a\x09transport := nil",
  1479. referencedClasses: ["PackageOrganizer"],
  1480. //>>excludeEnd("ide");
  1481. messageSends: ["initialize", "new"]
  1482. }),
  1483. $globals.Package);
  1484. $core.addMethod(
  1485. $core.method({
  1486. selector: "isDirty",
  1487. protocol: "testing",
  1488. fn: function (){
  1489. var self=this,$self=this;
  1490. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1491. return $core.withContext(function($ctx1) {
  1492. //>>excludeEnd("ctx");
  1493. var $1,$receiver;
  1494. $1=$self["@dirty"];
  1495. if(($receiver = $1) == null || $receiver.a$nil){
  1496. return false;
  1497. } else {
  1498. return $1;
  1499. }
  1500. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1501. }, function($ctx1) {$ctx1.fill(self,"isDirty",{},$globals.Package)});
  1502. //>>excludeEnd("ctx");
  1503. },
  1504. //>>excludeStart("ide", pragmas.excludeIdeData);
  1505. args: [],
  1506. source: "isDirty\x0a\x09^ dirty ifNil: [ false ]",
  1507. referencedClasses: [],
  1508. //>>excludeEnd("ide");
  1509. messageSends: ["ifNil:"]
  1510. }),
  1511. $globals.Package);
  1512. $core.addMethod(
  1513. $core.method({
  1514. selector: "isPackage",
  1515. protocol: "testing",
  1516. fn: function (){
  1517. var self=this,$self=this;
  1518. return true;
  1519. },
  1520. //>>excludeStart("ide", pragmas.excludeIdeData);
  1521. args: [],
  1522. source: "isPackage\x0a\x09^ true",
  1523. referencedClasses: [],
  1524. //>>excludeEnd("ide");
  1525. messageSends: []
  1526. }),
  1527. $globals.Package);
  1528. $core.addMethod(
  1529. $core.method({
  1530. selector: "javaScriptDescriptor:",
  1531. protocol: "accessing",
  1532. fn: function (anObject){
  1533. var self=this,$self=this;
  1534. var basicEval,basicImports;
  1535. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1536. return $core.withContext(function($ctx1) {
  1537. //>>excludeEnd("ctx");
  1538. basicEval=$recv(anObject)._at_ifAbsent_("innerEval",(function(){
  1539. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1540. return $core.withContext(function($ctx2) {
  1541. //>>excludeEnd("ctx");
  1542. return nil._asJavaScriptObject();
  1543. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1544. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  1545. //>>excludeEnd("ctx");
  1546. }));
  1547. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1548. $ctx1.sendIdx["at:ifAbsent:"]=1;
  1549. //>>excludeEnd("ctx");
  1550. basicImports=$recv(anObject)._at_ifAbsent_("imports",(function(){
  1551. return [];
  1552. }));
  1553. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1554. $ctx1.sendIdx["at:ifAbsent:"]=2;
  1555. //>>excludeEnd("ctx");
  1556. $self["@basicTransport"]=$recv(anObject)._at_ifAbsent_("transport",(function(){
  1557. }));
  1558. $self._evalBlock_(basicEval);
  1559. $self._imports_($self._importsFromJson_(basicImports));
  1560. return self;
  1561. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1562. }, function($ctx1) {$ctx1.fill(self,"javaScriptDescriptor:",{anObject:anObject,basicEval:basicEval,basicImports:basicImports},$globals.Package)});
  1563. //>>excludeEnd("ctx");
  1564. },
  1565. //>>excludeStart("ide", pragmas.excludeIdeData);
  1566. args: ["anObject"],
  1567. source: "javaScriptDescriptor: anObject\x0a\x09| basicEval basicImports |\x0a\x0a\x09basicEval := (anObject at: 'innerEval' ifAbsent: [ nil asJavaScriptObject ]).\x0a\x09basicImports := (anObject at: 'imports' ifAbsent: [ #() ]).\x0a\x09basicTransport := (anObject at: 'transport' ifAbsent: []).\x0a\x09\x09\x09\x0a\x09self\x0a\x09\x09evalBlock: basicEval;\x0a\x09\x09imports: (self importsFromJson: basicImports)",
  1568. referencedClasses: [],
  1569. //>>excludeEnd("ide");
  1570. messageSends: ["at:ifAbsent:", "asJavaScriptObject", "evalBlock:", "imports:", "importsFromJson:"]
  1571. }),
  1572. $globals.Package);
  1573. $core.addMethod(
  1574. $core.method({
  1575. selector: "loadDependencies",
  1576. protocol: "dependencies",
  1577. fn: function (){
  1578. var self=this,$self=this;
  1579. var classes,packages;
  1580. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1581. return $core.withContext(function($ctx1) {
  1582. //>>excludeEnd("ctx");
  1583. var $1;
  1584. classes=$self._loadDependencyClasses();
  1585. $1=$recv($recv(classes)._collect_((function(each){
  1586. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1587. return $core.withContext(function($ctx2) {
  1588. //>>excludeEnd("ctx");
  1589. return $recv(each)._package();
  1590. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1591. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  1592. //>>excludeEnd("ctx");
  1593. })))._asSet();
  1594. $recv($1)._remove_ifAbsent_(self,(function(){
  1595. }));
  1596. return $recv($1)._yourself();
  1597. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1598. }, function($ctx1) {$ctx1.fill(self,"loadDependencies",{classes:classes,packages:packages},$globals.Package)});
  1599. //>>excludeEnd("ctx");
  1600. },
  1601. //>>excludeStart("ide", pragmas.excludeIdeData);
  1602. args: [],
  1603. 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",
  1604. referencedClasses: [],
  1605. //>>excludeEnd("ide");
  1606. messageSends: ["loadDependencyClasses", "remove:ifAbsent:", "asSet", "collect:", "package", "yourself"]
  1607. }),
  1608. $globals.Package);
  1609. $core.addMethod(
  1610. $core.method({
  1611. selector: "loadDependencyClasses",
  1612. protocol: "dependencies",
  1613. fn: function (){
  1614. var self=this,$self=this;
  1615. var starCategoryName;
  1616. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1617. return $core.withContext(function($ctx1) {
  1618. //>>excludeEnd("ctx");
  1619. var $3,$2,$1,$5,$7,$6,$4,$receiver;
  1620. starCategoryName="*".__comma($self._name());
  1621. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1622. $ctx1.sendIdx[","]=1;
  1623. //>>excludeEnd("ctx");
  1624. $3=$self._classes();
  1625. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1626. $ctx1.sendIdx["classes"]=1;
  1627. //>>excludeEnd("ctx");
  1628. $2=$recv($3)._collect_((function(each){
  1629. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1630. return $core.withContext(function($ctx2) {
  1631. //>>excludeEnd("ctx");
  1632. return $recv(each)._superclass();
  1633. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1634. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  1635. //>>excludeEnd("ctx");
  1636. }));
  1637. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1638. $ctx1.sendIdx["collect:"]=1;
  1639. //>>excludeEnd("ctx");
  1640. $1=$recv($2)._asSet();
  1641. $recv($1)._addAll_($recv($recv($globals.Smalltalk)._classes())._select_((function(each){
  1642. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1643. return $core.withContext(function($ctx2) {
  1644. //>>excludeEnd("ctx");
  1645. $5=$recv(each)._protocols();
  1646. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1647. $ctx2.sendIdx["protocols"]=1;
  1648. //>>excludeEnd("ctx");
  1649. $7=$recv(each)._theMetaClass();
  1650. if(($receiver = $7) == null || $receiver.a$nil){
  1651. $6=[];
  1652. } else {
  1653. var meta;
  1654. meta=$receiver;
  1655. $6=$recv(meta)._protocols();
  1656. }
  1657. $4=$recv($5).__comma($6);
  1658. return $recv($4)._includes_(starCategoryName);
  1659. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1660. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  1661. //>>excludeEnd("ctx");
  1662. })));
  1663. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1664. $ctx1.sendIdx["addAll:"]=1;
  1665. //>>excludeEnd("ctx");
  1666. $recv($1)._addAll_($recv($globals.Array)._streamContents_((function(as){
  1667. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1668. return $core.withContext(function($ctx2) {
  1669. //>>excludeEnd("ctx");
  1670. return $recv($self._traitCompositions())._valuesDo_((function(each){
  1671. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1672. return $core.withContext(function($ctx3) {
  1673. //>>excludeEnd("ctx");
  1674. return $recv(as)._write_($recv(each)._collect_((function(eachTT){
  1675. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1676. return $core.withContext(function($ctx4) {
  1677. //>>excludeEnd("ctx");
  1678. return $recv(eachTT)._trait();
  1679. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1680. }, function($ctx4) {$ctx4.fillBlock({eachTT:eachTT},$ctx3,7)});
  1681. //>>excludeEnd("ctx");
  1682. })));
  1683. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1684. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,6)});
  1685. //>>excludeEnd("ctx");
  1686. }));
  1687. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1688. }, function($ctx2) {$ctx2.fillBlock({as:as},$ctx1,5)});
  1689. //>>excludeEnd("ctx");
  1690. })));
  1691. $recv($1)._remove_ifAbsent_(nil,(function(){
  1692. }));
  1693. return $recv($1)._yourself();
  1694. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1695. }, function($ctx1) {$ctx1.fill(self,"loadDependencyClasses",{starCategoryName:starCategoryName},$globals.Package)});
  1696. //>>excludeEnd("ctx");
  1697. },
  1698. //>>excludeStart("ide", pragmas.excludeIdeData);
  1699. args: [],
  1700. 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\x0a\x09as well as all traits used\x22\x0a\x09\x0a\x09| starCategoryName |\x0a\x09starCategoryName := '*', self name.\x0a\x09^ (self classes collect: [ :each | each superclass ]) asSet\x0a\x09\x09addAll: (Smalltalk classes select: [ :each |\x0a\x09\x09\x09each protocols, (each theMetaClass ifNil: [ #() ] ifNotNil: [ :meta | meta protocols])\x0a\x09\x09\x09\x09includes: starCategoryName ]);\x0a\x09\x09addAll: (Array streamContents: [ :as | self traitCompositions valuesDo: [ :each | as write: (each collect: [ :eachTT | eachTT trait ])]]);\x0a\x09\x09remove: nil ifAbsent: [];\x0a\x09\x09yourself",
  1701. referencedClasses: ["Smalltalk", "Array"],
  1702. //>>excludeEnd("ide");
  1703. messageSends: [",", "name", "addAll:", "asSet", "collect:", "classes", "superclass", "select:", "includes:", "protocols", "ifNil:ifNotNil:", "theMetaClass", "streamContents:", "valuesDo:", "traitCompositions", "write:", "trait", "remove:ifAbsent:", "yourself"]
  1704. }),
  1705. $globals.Package);
  1706. $core.addMethod(
  1707. $core.method({
  1708. selector: "name",
  1709. protocol: "accessing",
  1710. fn: function (){
  1711. var self=this,$self=this;
  1712. return $self["@name"];
  1713. },
  1714. //>>excludeStart("ide", pragmas.excludeIdeData);
  1715. args: [],
  1716. source: "name\x0a\x09^ name",
  1717. referencedClasses: [],
  1718. //>>excludeEnd("ide");
  1719. messageSends: []
  1720. }),
  1721. $globals.Package);
  1722. $core.addMethod(
  1723. $core.method({
  1724. selector: "name:",
  1725. protocol: "accessing",
  1726. fn: function (aString){
  1727. var self=this,$self=this;
  1728. $self["@name"]=aString;
  1729. return self;
  1730. },
  1731. //>>excludeStart("ide", pragmas.excludeIdeData);
  1732. args: ["aString"],
  1733. source: "name: aString\x0a\x09name := aString",
  1734. referencedClasses: [],
  1735. //>>excludeEnd("ide");
  1736. messageSends: []
  1737. }),
  1738. $globals.Package);
  1739. $core.addMethod(
  1740. $core.method({
  1741. selector: "organization",
  1742. protocol: "accessing",
  1743. fn: function (){
  1744. var self=this,$self=this;
  1745. return $self["@organization"];
  1746. },
  1747. //>>excludeStart("ide", pragmas.excludeIdeData);
  1748. args: [],
  1749. source: "organization\x0a\x09^ organization",
  1750. referencedClasses: [],
  1751. //>>excludeEnd("ide");
  1752. messageSends: []
  1753. }),
  1754. $globals.Package);
  1755. $core.addMethod(
  1756. $core.method({
  1757. selector: "printOn:",
  1758. protocol: "printing",
  1759. fn: function (aStream){
  1760. var self=this,$self=this;
  1761. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1762. return $core.withContext(function($ctx1) {
  1763. //>>excludeEnd("ctx");
  1764. (
  1765. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1766. $ctx1.supercall = true,
  1767. //>>excludeEnd("ctx");
  1768. ($globals.Package.superclass||$boot.nilAsClass).fn.prototype._printOn_.apply($self, [aStream]));
  1769. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1770. $ctx1.supercall = false;
  1771. //>>excludeEnd("ctx");;
  1772. $recv(aStream)._nextPutAll_(" (");
  1773. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1774. $ctx1.sendIdx["nextPutAll:"]=1;
  1775. //>>excludeEnd("ctx");
  1776. $recv(aStream)._nextPutAll_($self._name());
  1777. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1778. $ctx1.sendIdx["nextPutAll:"]=2;
  1779. //>>excludeEnd("ctx");
  1780. $recv(aStream)._nextPutAll_(")");
  1781. return self;
  1782. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1783. }, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},$globals.Package)});
  1784. //>>excludeEnd("ctx");
  1785. },
  1786. //>>excludeStart("ide", pragmas.excludeIdeData);
  1787. args: ["aStream"],
  1788. source: "printOn: aStream\x0a\x09super printOn: aStream.\x0a\x09aStream \x0a\x09\x09nextPutAll: ' (';\x0a\x09\x09nextPutAll: self name;\x0a\x09\x09nextPutAll: ')'",
  1789. referencedClasses: [],
  1790. //>>excludeEnd("ide");
  1791. messageSends: ["printOn:", "nextPutAll:", "name"]
  1792. }),
  1793. $globals.Package);
  1794. $core.addMethod(
  1795. $core.method({
  1796. selector: "setupClasses",
  1797. protocol: "classes",
  1798. fn: function (){
  1799. var self=this,$self=this;
  1800. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1801. return $core.withContext(function($ctx1) {
  1802. //>>excludeEnd("ctx");
  1803. $recv($self._classes())._do_((function(each){
  1804. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1805. return $core.withContext(function($ctx2) {
  1806. //>>excludeEnd("ctx");
  1807. return $recv(each)._initialize();
  1808. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1809. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  1810. //>>excludeEnd("ctx");
  1811. }));
  1812. return self;
  1813. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1814. }, function($ctx1) {$ctx1.fill(self,"setupClasses",{},$globals.Package)});
  1815. //>>excludeEnd("ctx");
  1816. },
  1817. //>>excludeStart("ide", pragmas.excludeIdeData);
  1818. args: [],
  1819. source: "setupClasses\x0a\x09self classes do: [ :each | each initialize ]",
  1820. referencedClasses: [],
  1821. //>>excludeEnd("ide");
  1822. messageSends: ["do:", "classes", "initialize"]
  1823. }),
  1824. $globals.Package);
  1825. $core.addMethod(
  1826. $core.method({
  1827. selector: "sortedClasses",
  1828. protocol: "classes",
  1829. fn: function (){
  1830. var self=this,$self=this;
  1831. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1832. return $core.withContext(function($ctx1) {
  1833. //>>excludeEnd("ctx");
  1834. return $recv($self._class())._sortedClasses_($self._classes());
  1835. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1836. }, function($ctx1) {$ctx1.fill(self,"sortedClasses",{},$globals.Package)});
  1837. //>>excludeEnd("ctx");
  1838. },
  1839. //>>excludeStart("ide", pragmas.excludeIdeData);
  1840. args: [],
  1841. 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",
  1842. referencedClasses: [],
  1843. //>>excludeEnd("ide");
  1844. messageSends: ["sortedClasses:", "class", "classes"]
  1845. }),
  1846. $globals.Package);
  1847. $core.addMethod(
  1848. $core.method({
  1849. selector: "sortedImportsAsArray",
  1850. protocol: "private",
  1851. fn: function (){
  1852. var self=this,$self=this;
  1853. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1854. return $core.withContext(function($ctx1) {
  1855. //>>excludeEnd("ctx");
  1856. var $3,$2,$4,$1,$6,$5,$7;
  1857. return $recv($recv($self._imports())._asArray())._sorted_((function(a,b){
  1858. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1859. return $core.withContext(function($ctx2) {
  1860. //>>excludeEnd("ctx");
  1861. $3=$recv(a)._isString();
  1862. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1863. $ctx2.sendIdx["isString"]=1;
  1864. //>>excludeEnd("ctx");
  1865. $2=$recv($3)._not();
  1866. $4=$recv(b)._isString();
  1867. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1868. $ctx2.sendIdx["isString"]=2;
  1869. //>>excludeEnd("ctx");
  1870. $1=$recv($2).__and($4);
  1871. return $recv($1)._or_((function(){
  1872. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1873. return $core.withContext(function($ctx3) {
  1874. //>>excludeEnd("ctx");
  1875. $6=$recv(a)._isString();
  1876. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1877. $ctx3.sendIdx["isString"]=3;
  1878. //>>excludeEnd("ctx");
  1879. $5=$recv($6).__eq($recv(b)._isString());
  1880. return $recv($5)._and_((function(){
  1881. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1882. return $core.withContext(function($ctx4) {
  1883. //>>excludeEnd("ctx");
  1884. $7=$recv(a)._value();
  1885. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1886. $ctx4.sendIdx["value"]=1;
  1887. //>>excludeEnd("ctx");
  1888. return $recv($7).__lt_eq($recv(b)._value());
  1889. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1890. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,3)});
  1891. //>>excludeEnd("ctx");
  1892. }));
  1893. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1894. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  1895. //>>excludeEnd("ctx");
  1896. }));
  1897. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1898. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,1)});
  1899. //>>excludeEnd("ctx");
  1900. }));
  1901. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1902. }, function($ctx1) {$ctx1.fill(self,"sortedImportsAsArray",{},$globals.Package)});
  1903. //>>excludeEnd("ctx");
  1904. },
  1905. //>>excludeStart("ide", pragmas.excludeIdeData);
  1906. args: [],
  1907. source: "sortedImportsAsArray\x0a\x09\x22Answer imports sorted first by type (associations first),\x0a\x09then by value\x22\x0a\x0a\x09^ self imports asArray\x0a\x09\x09sorted: [ :a :b |\x0a\x09\x09\x09a isString not & b isString or: [\x0a\x09\x09\x09\x09a isString = b isString and: [\x0a\x09\x09\x09\x09\x09a value <= b value ]]]",
  1908. referencedClasses: [],
  1909. //>>excludeEnd("ide");
  1910. messageSends: ["sorted:", "asArray", "imports", "or:", "&", "not", "isString", "and:", "=", "<=", "value"]
  1911. }),
  1912. $globals.Package);
  1913. $core.addMethod(
  1914. $core.method({
  1915. selector: "traitCompositions",
  1916. protocol: "dependencies",
  1917. fn: function (){
  1918. var self=this,$self=this;
  1919. var traitCompositions;
  1920. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1921. return $core.withContext(function($ctx1) {
  1922. //>>excludeEnd("ctx");
  1923. var $1,$2,$3,$receiver;
  1924. traitCompositions=$recv($globals.Dictionary)._new();
  1925. $recv($self._classes())._do_((function(each){
  1926. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1927. return $core.withContext(function($ctx2) {
  1928. //>>excludeEnd("ctx");
  1929. $1=traitCompositions;
  1930. $2=$recv(each)._traitComposition();
  1931. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1932. $ctx2.sendIdx["traitComposition"]=1;
  1933. //>>excludeEnd("ctx");
  1934. $recv($1)._at_put_(each,$2);
  1935. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1936. $ctx2.sendIdx["at:put:"]=1;
  1937. //>>excludeEnd("ctx");
  1938. $3=$recv(each)._theMetaClass();
  1939. if(($receiver = $3) == null || $receiver.a$nil){
  1940. return $3;
  1941. } else {
  1942. var meta;
  1943. meta=$receiver;
  1944. return $recv(traitCompositions)._at_put_(meta,$recv(meta)._traitComposition());
  1945. }
  1946. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1947. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  1948. //>>excludeEnd("ctx");
  1949. }));
  1950. return $recv(traitCompositions)._reject_((function(each){
  1951. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1952. return $core.withContext(function($ctx2) {
  1953. //>>excludeEnd("ctx");
  1954. return $recv(each)._isEmpty();
  1955. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1956. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
  1957. //>>excludeEnd("ctx");
  1958. }));
  1959. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1960. }, function($ctx1) {$ctx1.fill(self,"traitCompositions",{traitCompositions:traitCompositions},$globals.Package)});
  1961. //>>excludeEnd("ctx");
  1962. },
  1963. //>>excludeStart("ide", pragmas.excludeIdeData);
  1964. args: [],
  1965. source: "traitCompositions\x0a\x09| traitCompositions |\x0a\x09traitCompositions := Dictionary new.\x0a\x09self classes do: [ :each |\x0a\x09\x09traitCompositions at: each put: each traitComposition.\x0a\x09\x09each theMetaClass ifNotNil: [ :meta | traitCompositions at: meta put: meta traitComposition ] ].\x0a\x09^ traitCompositions reject: [ :each | each isEmpty ]",
  1966. referencedClasses: ["Dictionary"],
  1967. //>>excludeEnd("ide");
  1968. messageSends: ["new", "do:", "classes", "at:put:", "traitComposition", "ifNotNil:", "theMetaClass", "reject:", "isEmpty"]
  1969. }),
  1970. $globals.Package);
  1971. $core.addMethod(
  1972. $core.method({
  1973. selector: "transport",
  1974. protocol: "accessing",
  1975. fn: function (){
  1976. var self=this,$self=this;
  1977. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1978. return $core.withContext(function($ctx1) {
  1979. //>>excludeEnd("ctx");
  1980. var $1,$receiver;
  1981. $1=$self["@transport"];
  1982. if(($receiver = $1) == null || $receiver.a$nil){
  1983. $self._transport_($recv($globals.PackageTransport)._fromJson_($self._basicTransport()));
  1984. return $self["@transport"];
  1985. } else {
  1986. return $1;
  1987. }
  1988. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1989. }, function($ctx1) {$ctx1.fill(self,"transport",{},$globals.Package)});
  1990. //>>excludeEnd("ctx");
  1991. },
  1992. //>>excludeStart("ide", pragmas.excludeIdeData);
  1993. args: [],
  1994. source: "transport\x0a\x09^ transport ifNil: [ \x0a\x09\x09self transport: (PackageTransport fromJson: self basicTransport).\x0a\x09\x09transport ]",
  1995. referencedClasses: ["PackageTransport"],
  1996. //>>excludeEnd("ide");
  1997. messageSends: ["ifNil:", "transport:", "fromJson:", "basicTransport"]
  1998. }),
  1999. $globals.Package);
  2000. $core.addMethod(
  2001. $core.method({
  2002. selector: "transport:",
  2003. protocol: "accessing",
  2004. fn: function (aPackageTransport){
  2005. var self=this,$self=this;
  2006. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2007. return $core.withContext(function($ctx1) {
  2008. //>>excludeEnd("ctx");
  2009. $self["@transport"]=aPackageTransport;
  2010. $recv(aPackageTransport)._package_(self);
  2011. return self;
  2012. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2013. }, function($ctx1) {$ctx1.fill(self,"transport:",{aPackageTransport:aPackageTransport},$globals.Package)});
  2014. //>>excludeEnd("ctx");
  2015. },
  2016. //>>excludeStart("ide", pragmas.excludeIdeData);
  2017. args: ["aPackageTransport"],
  2018. source: "transport: aPackageTransport\x0a\x09transport := aPackageTransport.\x0a\x09aPackageTransport package: self",
  2019. referencedClasses: [],
  2020. //>>excludeEnd("ide");
  2021. messageSends: ["package:"]
  2022. }),
  2023. $globals.Package);
  2024. $core.addMethod(
  2025. $core.method({
  2026. selector: "validateImports:",
  2027. protocol: "validation",
  2028. fn: function (aCollection){
  2029. var self=this,$self=this;
  2030. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2031. return $core.withContext(function($ctx1) {
  2032. //>>excludeEnd("ctx");
  2033. var $1,$2,$5,$4,$3,$6;
  2034. $recv(aCollection)._do_((function(import_){
  2035. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2036. return $core.withContext(function($ctx2) {
  2037. //>>excludeEnd("ctx");
  2038. $1=$recv(import_)._isString();
  2039. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2040. $ctx2.sendIdx["isString"]=1;
  2041. //>>excludeEnd("ctx");
  2042. if(!$core.assert($1)){
  2043. $2=$recv(import_)._respondsTo_("key");
  2044. if(!$core.assert($2)){
  2045. $self._error_("Imports must be Strings or Associations");
  2046. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2047. $ctx2.sendIdx["error:"]=1;
  2048. //>>excludeEnd("ctx");
  2049. }
  2050. $5=$recv(import_)._key();
  2051. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2052. $ctx2.sendIdx["key"]=1;
  2053. //>>excludeEnd("ctx");
  2054. $4=$recv($5)._isString();
  2055. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2056. $ctx2.sendIdx["isString"]=2;
  2057. //>>excludeEnd("ctx");
  2058. $3=$recv($4).__and($recv($recv(import_)._value())._isString());
  2059. if(!$core.assert($3)){
  2060. $self._error_("Key and value must be Strings");
  2061. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2062. $ctx2.sendIdx["error:"]=2;
  2063. //>>excludeEnd("ctx");
  2064. }
  2065. $6=$recv($recv(import_)._key())._match_("^[a-zA-Z][a-zA-Z0-9]*$");
  2066. if(!$core.assert($6)){
  2067. return $self._error_("Keys must be identifiers");
  2068. }
  2069. }
  2070. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2071. }, function($ctx2) {$ctx2.fillBlock({import_:import_},$ctx1,1)});
  2072. //>>excludeEnd("ctx");
  2073. }));
  2074. return self;
  2075. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2076. }, function($ctx1) {$ctx1.fill(self,"validateImports:",{aCollection:aCollection},$globals.Package)});
  2077. //>>excludeEnd("ctx");
  2078. },
  2079. //>>excludeStart("ide", pragmas.excludeIdeData);
  2080. args: ["aCollection"],
  2081. source: "validateImports: aCollection\x0a\x0a\x09aCollection do: [ :import |\x0a\x09\x09import isString ifFalse: [\x0a\x09\x09\x09(import respondsTo: #key) ifFalse: [\x0a\x09\x09\x09\x09self error: 'Imports must be Strings or Associations' ].\x0a\x09\x09\x09import key isString & import value isString ifFalse: [\x0a\x09\x09\x09\x09self error: 'Key and value must be Strings' ].\x0a\x09\x09\x09(import key match: '^[a-zA-Z][a-zA-Z0-9]*$') ifFalse: [\x0a\x09\x09\x09\x09self error: 'Keys must be identifiers' ]]]",
  2082. referencedClasses: [],
  2083. //>>excludeEnd("ide");
  2084. messageSends: ["do:", "ifFalse:", "isString", "respondsTo:", "error:", "&", "key", "value", "match:"]
  2085. }),
  2086. $globals.Package);
  2087. $globals.Package.a$cls.iVarNames = ["defaultCommitPathJs", "defaultCommitPathSt"];
  2088. $core.addMethod(
  2089. $core.method({
  2090. selector: "named:",
  2091. protocol: "accessing",
  2092. fn: function (aPackageName){
  2093. var self=this,$self=this;
  2094. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2095. return $core.withContext(function($ctx1) {
  2096. //>>excludeEnd("ctx");
  2097. return $recv($globals.Smalltalk)._packageAt_ifAbsent_(aPackageName,(function(){
  2098. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2099. return $core.withContext(function($ctx2) {
  2100. //>>excludeEnd("ctx");
  2101. return $recv($globals.Smalltalk)._createPackage_(aPackageName);
  2102. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2103. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2104. //>>excludeEnd("ctx");
  2105. }));
  2106. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2107. }, function($ctx1) {$ctx1.fill(self,"named:",{aPackageName:aPackageName},$globals.Package.a$cls)});
  2108. //>>excludeEnd("ctx");
  2109. },
  2110. //>>excludeStart("ide", pragmas.excludeIdeData);
  2111. args: ["aPackageName"],
  2112. source: "named: aPackageName\x0a\x09^ Smalltalk \x0a\x09\x09packageAt: aPackageName\x0a\x09\x09ifAbsent: [ \x0a\x09\x09\x09Smalltalk createPackage: aPackageName ]",
  2113. referencedClasses: ["Smalltalk"],
  2114. //>>excludeEnd("ide");
  2115. messageSends: ["packageAt:ifAbsent:", "createPackage:"]
  2116. }),
  2117. $globals.Package.a$cls);
  2118. $core.addMethod(
  2119. $core.method({
  2120. selector: "named:ifAbsent:",
  2121. protocol: "accessing",
  2122. fn: function (aPackageName,aBlock){
  2123. var self=this,$self=this;
  2124. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2125. return $core.withContext(function($ctx1) {
  2126. //>>excludeEnd("ctx");
  2127. return $recv($globals.Smalltalk)._packageAt_ifAbsent_(aPackageName,aBlock);
  2128. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2129. }, function($ctx1) {$ctx1.fill(self,"named:ifAbsent:",{aPackageName:aPackageName,aBlock:aBlock},$globals.Package.a$cls)});
  2130. //>>excludeEnd("ctx");
  2131. },
  2132. //>>excludeStart("ide", pragmas.excludeIdeData);
  2133. args: ["aPackageName", "aBlock"],
  2134. source: "named: aPackageName ifAbsent: aBlock\x0a\x09^ Smalltalk packageAt: aPackageName ifAbsent: aBlock",
  2135. referencedClasses: ["Smalltalk"],
  2136. //>>excludeEnd("ide");
  2137. messageSends: ["packageAt:ifAbsent:"]
  2138. }),
  2139. $globals.Package.a$cls);
  2140. $core.addMethod(
  2141. $core.method({
  2142. selector: "named:imports:transport:",
  2143. protocol: "accessing",
  2144. fn: function (aPackageName,anArray,aTransport){
  2145. var self=this,$self=this;
  2146. var pkg;
  2147. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2148. return $core.withContext(function($ctx1) {
  2149. //>>excludeEnd("ctx");
  2150. pkg=$self._named_(aPackageName);
  2151. $recv(pkg)._imports_(anArray);
  2152. $recv(pkg)._transport_(aTransport);
  2153. return pkg;
  2154. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2155. }, function($ctx1) {$ctx1.fill(self,"named:imports:transport:",{aPackageName:aPackageName,anArray:anArray,aTransport:aTransport,pkg:pkg},$globals.Package.a$cls)});
  2156. //>>excludeEnd("ctx");
  2157. },
  2158. //>>excludeStart("ide", pragmas.excludeIdeData);
  2159. args: ["aPackageName", "anArray", "aTransport"],
  2160. source: "named: aPackageName imports: anArray transport: aTransport\x0a\x09| pkg |\x0a\x09\x0a\x09pkg := self named: aPackageName.\x0a\x09pkg imports: anArray.\x0a\x09pkg transport: aTransport.\x0a\x09\x0a\x09^ pkg",
  2161. referencedClasses: [],
  2162. //>>excludeEnd("ide");
  2163. messageSends: ["named:", "imports:", "transport:"]
  2164. }),
  2165. $globals.Package.a$cls);
  2166. $core.addMethod(
  2167. $core.method({
  2168. selector: "named:javaScriptDescriptor:",
  2169. protocol: "instance creation",
  2170. fn: function (aString,anObject){
  2171. var self=this,$self=this;
  2172. var pkg;
  2173. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2174. return $core.withContext(function($ctx1) {
  2175. //>>excludeEnd("ctx");
  2176. pkg=$recv($globals.Smalltalk)._createPackage_(aString);
  2177. $recv(pkg)._javaScriptDescriptor_(anObject);
  2178. return pkg;
  2179. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2180. }, function($ctx1) {$ctx1.fill(self,"named:javaScriptDescriptor:",{aString:aString,anObject:anObject,pkg:pkg},$globals.Package.a$cls)});
  2181. //>>excludeEnd("ctx");
  2182. },
  2183. //>>excludeStart("ide", pragmas.excludeIdeData);
  2184. args: ["aString", "anObject"],
  2185. source: "named: aString javaScriptDescriptor: anObject\x0a\x09| pkg |\x0a\x09\x0a\x09pkg := Smalltalk createPackage: aString.\x0a\x09pkg javaScriptDescriptor: anObject.\x0a\x09^ pkg",
  2186. referencedClasses: ["Smalltalk"],
  2187. //>>excludeEnd("ide");
  2188. messageSends: ["createPackage:", "javaScriptDescriptor:"]
  2189. }),
  2190. $globals.Package.a$cls);
  2191. $core.addMethod(
  2192. $core.method({
  2193. selector: "named:transport:",
  2194. protocol: "accessing",
  2195. fn: function (aPackageName,aTransport){
  2196. var self=this,$self=this;
  2197. var pkg;
  2198. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2199. return $core.withContext(function($ctx1) {
  2200. //>>excludeEnd("ctx");
  2201. pkg=$self._named_(aPackageName);
  2202. $recv(pkg)._transport_(aTransport);
  2203. return pkg;
  2204. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2205. }, function($ctx1) {$ctx1.fill(self,"named:transport:",{aPackageName:aPackageName,aTransport:aTransport,pkg:pkg},$globals.Package.a$cls)});
  2206. //>>excludeEnd("ctx");
  2207. },
  2208. //>>excludeStart("ide", pragmas.excludeIdeData);
  2209. args: ["aPackageName", "aTransport"],
  2210. source: "named: aPackageName transport: aTransport\x0a\x09| pkg |\x0a\x09\x0a\x09pkg := self named: aPackageName.\x0a\x09pkg transport: aTransport.\x0a\x09\x0a\x09^ pkg",
  2211. referencedClasses: [],
  2212. //>>excludeEnd("ide");
  2213. messageSends: ["named:", "transport:"]
  2214. }),
  2215. $globals.Package.a$cls);
  2216. $core.addMethod(
  2217. $core.method({
  2218. selector: "new:",
  2219. protocol: "instance creation",
  2220. fn: function (aString){
  2221. var self=this,$self=this;
  2222. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2223. return $core.withContext(function($ctx1) {
  2224. //>>excludeEnd("ctx");
  2225. var $1;
  2226. $1=$recv($globals.Package)._new();
  2227. $recv($1)._name_(aString);
  2228. return $recv($1)._yourself();
  2229. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2230. }, function($ctx1) {$ctx1.fill(self,"new:",{aString:aString},$globals.Package.a$cls)});
  2231. //>>excludeEnd("ctx");
  2232. },
  2233. //>>excludeStart("ide", pragmas.excludeIdeData);
  2234. args: ["aString"],
  2235. source: "new: aString\x0a\x09^ Package new\x0a\x09\x09name: aString;\x0a\x09\x09yourself",
  2236. referencedClasses: ["Package"],
  2237. //>>excludeEnd("ide");
  2238. messageSends: ["name:", "new", "yourself"]
  2239. }),
  2240. $globals.Package.a$cls);
  2241. $core.addMethod(
  2242. $core.method({
  2243. selector: "sortedClasses:",
  2244. protocol: "sorting",
  2245. fn: function (classes){
  2246. var self=this,$self=this;
  2247. var children,others,nodes,expandedClasses;
  2248. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2249. return $core.withContext(function($ctx1) {
  2250. //>>excludeEnd("ctx");
  2251. var $1,$3,$2;
  2252. children=[];
  2253. others=[];
  2254. $recv(classes)._do_((function(each){
  2255. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2256. return $core.withContext(function($ctx2) {
  2257. //>>excludeEnd("ctx");
  2258. $1=$recv(classes)._includes_($recv(each)._superclass());
  2259. if($core.assert($1)){
  2260. return $recv(others)._add_(each);
  2261. } else {
  2262. return $recv(children)._add_(each);
  2263. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2264. $ctx2.sendIdx["add:"]=1;
  2265. //>>excludeEnd("ctx");
  2266. }
  2267. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2268. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2269. //>>excludeEnd("ctx");
  2270. }));
  2271. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2272. $ctx1.sendIdx["do:"]=1;
  2273. //>>excludeEnd("ctx");
  2274. nodes=$recv(children)._collect_((function(each){
  2275. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2276. return $core.withContext(function($ctx2) {
  2277. //>>excludeEnd("ctx");
  2278. return $recv($globals.ClassSorterNode)._on_classes_level_(each,others,(0));
  2279. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2280. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)});
  2281. //>>excludeEnd("ctx");
  2282. }));
  2283. nodes=$recv(nodes)._sorted_((function(a,b){
  2284. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2285. return $core.withContext(function($ctx2) {
  2286. //>>excludeEnd("ctx");
  2287. $3=$recv(a)._theClass();
  2288. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2289. $ctx2.sendIdx["theClass"]=1;
  2290. //>>excludeEnd("ctx");
  2291. $2=$recv($3)._name();
  2292. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2293. $ctx2.sendIdx["name"]=1;
  2294. //>>excludeEnd("ctx");
  2295. return $recv($2).__lt_eq($recv($recv(b)._theClass())._name());
  2296. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2297. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,5)});
  2298. //>>excludeEnd("ctx");
  2299. }));
  2300. expandedClasses=$recv($globals.Array)._new();
  2301. $recv(nodes)._do_((function(aNode){
  2302. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2303. return $core.withContext(function($ctx2) {
  2304. //>>excludeEnd("ctx");
  2305. return $recv(aNode)._traverseClassesWith_(expandedClasses);
  2306. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2307. }, function($ctx2) {$ctx2.fillBlock({aNode:aNode},$ctx1,6)});
  2308. //>>excludeEnd("ctx");
  2309. }));
  2310. return expandedClasses;
  2311. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2312. }, function($ctx1) {$ctx1.fill(self,"sortedClasses:",{classes:classes,children:children,others:others,nodes:nodes,expandedClasses:expandedClasses},$globals.Package.a$cls)});
  2313. //>>excludeEnd("ctx");
  2314. },
  2315. //>>excludeStart("ide", pragmas.excludeIdeData);
  2316. args: ["classes"],
  2317. 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",
  2318. referencedClasses: ["ClassSorterNode", "Array"],
  2319. //>>excludeEnd("ide");
  2320. messageSends: ["do:", "ifFalse:ifTrue:", "includes:", "superclass", "add:", "collect:", "on:classes:level:", "sorted:", "<=", "name", "theClass", "new", "traverseClassesWith:"]
  2321. }),
  2322. $globals.Package.a$cls);
  2323. $core.addClass("PackageStateObserver", $globals.Object, [], "Kernel-Infrastructure");
  2324. //>>excludeStart("ide", pragmas.excludeIdeData);
  2325. $globals.PackageStateObserver.comment="My current instance listens for any changes in the system that might affect the state of a package (being dirty).";
  2326. //>>excludeEnd("ide");
  2327. $core.addMethod(
  2328. $core.method({
  2329. selector: "announcer",
  2330. protocol: "accessing",
  2331. fn: function (){
  2332. var self=this,$self=this;
  2333. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2334. return $core.withContext(function($ctx1) {
  2335. //>>excludeEnd("ctx");
  2336. return $recv($globals.SystemAnnouncer)._current();
  2337. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2338. }, function($ctx1) {$ctx1.fill(self,"announcer",{},$globals.PackageStateObserver)});
  2339. //>>excludeEnd("ctx");
  2340. },
  2341. //>>excludeStart("ide", pragmas.excludeIdeData);
  2342. args: [],
  2343. source: "announcer\x0a\x09^ SystemAnnouncer current",
  2344. referencedClasses: ["SystemAnnouncer"],
  2345. //>>excludeEnd("ide");
  2346. messageSends: ["current"]
  2347. }),
  2348. $globals.PackageStateObserver);
  2349. $core.addMethod(
  2350. $core.method({
  2351. selector: "observeSystem",
  2352. protocol: "actions",
  2353. fn: function (){
  2354. var self=this,$self=this;
  2355. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2356. return $core.withContext(function($ctx1) {
  2357. //>>excludeEnd("ctx");
  2358. var $1;
  2359. $1=$self._announcer();
  2360. $recv($1)._on_send_to_($globals.PackageAdded,"onPackageAdded:",self);
  2361. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2362. $ctx1.sendIdx["on:send:to:"]=1;
  2363. //>>excludeEnd("ctx");
  2364. $recv($1)._on_send_to_($globals.ClassAnnouncement,"onClassModification:",self);
  2365. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2366. $ctx1.sendIdx["on:send:to:"]=2;
  2367. //>>excludeEnd("ctx");
  2368. $recv($1)._on_send_to_($globals.MethodAnnouncement,"onMethodModification:",self);
  2369. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2370. $ctx1.sendIdx["on:send:to:"]=3;
  2371. //>>excludeEnd("ctx");
  2372. $recv($1)._on_send_to_($globals.ProtocolAnnouncement,"onProtocolModification:",self);
  2373. return self;
  2374. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2375. }, function($ctx1) {$ctx1.fill(self,"observeSystem",{},$globals.PackageStateObserver)});
  2376. //>>excludeEnd("ctx");
  2377. },
  2378. //>>excludeStart("ide", pragmas.excludeIdeData);
  2379. args: [],
  2380. 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",
  2381. referencedClasses: ["PackageAdded", "ClassAnnouncement", "MethodAnnouncement", "ProtocolAnnouncement"],
  2382. //>>excludeEnd("ide");
  2383. messageSends: ["on:send:to:", "announcer"]
  2384. }),
  2385. $globals.PackageStateObserver);
  2386. $core.addMethod(
  2387. $core.method({
  2388. selector: "onClassModification:",
  2389. protocol: "reactions",
  2390. fn: function (anAnnouncement){
  2391. var self=this,$self=this;
  2392. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2393. return $core.withContext(function($ctx1) {
  2394. //>>excludeEnd("ctx");
  2395. var $1,$receiver;
  2396. $1=$recv(anAnnouncement)._theClass();
  2397. if(($receiver = $1) == null || $receiver.a$nil){
  2398. $1;
  2399. } else {
  2400. var theClass;
  2401. theClass=$receiver;
  2402. $recv($recv(theClass)._package())._beDirty();
  2403. }
  2404. return self;
  2405. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2406. }, function($ctx1) {$ctx1.fill(self,"onClassModification:",{anAnnouncement:anAnnouncement},$globals.PackageStateObserver)});
  2407. //>>excludeEnd("ctx");
  2408. },
  2409. //>>excludeStart("ide", pragmas.excludeIdeData);
  2410. args: ["anAnnouncement"],
  2411. source: "onClassModification: anAnnouncement\x0a\x09anAnnouncement theClass ifNotNil: [ :theClass | theClass package beDirty ]",
  2412. referencedClasses: [],
  2413. //>>excludeEnd("ide");
  2414. messageSends: ["ifNotNil:", "theClass", "beDirty", "package"]
  2415. }),
  2416. $globals.PackageStateObserver);
  2417. $core.addMethod(
  2418. $core.method({
  2419. selector: "onMethodModification:",
  2420. protocol: "reactions",
  2421. fn: function (anAnnouncement){
  2422. var self=this,$self=this;
  2423. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2424. return $core.withContext(function($ctx1) {
  2425. //>>excludeEnd("ctx");
  2426. var $1,$receiver;
  2427. $1=$recv($recv(anAnnouncement)._method())._package();
  2428. if(($receiver = $1) == null || $receiver.a$nil){
  2429. $1;
  2430. } else {
  2431. var package_;
  2432. package_=$receiver;
  2433. $recv(package_)._beDirty();
  2434. }
  2435. return self;
  2436. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2437. }, function($ctx1) {$ctx1.fill(self,"onMethodModification:",{anAnnouncement:anAnnouncement},$globals.PackageStateObserver)});
  2438. //>>excludeEnd("ctx");
  2439. },
  2440. //>>excludeStart("ide", pragmas.excludeIdeData);
  2441. args: ["anAnnouncement"],
  2442. source: "onMethodModification: anAnnouncement\x0a\x09anAnnouncement method package ifNotNil: [ :package | package beDirty ]",
  2443. referencedClasses: [],
  2444. //>>excludeEnd("ide");
  2445. messageSends: ["ifNotNil:", "package", "method", "beDirty"]
  2446. }),
  2447. $globals.PackageStateObserver);
  2448. $core.addMethod(
  2449. $core.method({
  2450. selector: "onPackageAdded:",
  2451. protocol: "reactions",
  2452. fn: function (anAnnouncement){
  2453. var self=this,$self=this;
  2454. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2455. return $core.withContext(function($ctx1) {
  2456. //>>excludeEnd("ctx");
  2457. $recv($recv(anAnnouncement)._package())._beDirty();
  2458. return self;
  2459. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2460. }, function($ctx1) {$ctx1.fill(self,"onPackageAdded:",{anAnnouncement:anAnnouncement},$globals.PackageStateObserver)});
  2461. //>>excludeEnd("ctx");
  2462. },
  2463. //>>excludeStart("ide", pragmas.excludeIdeData);
  2464. args: ["anAnnouncement"],
  2465. source: "onPackageAdded: anAnnouncement\x0a\x09anAnnouncement package beDirty",
  2466. referencedClasses: [],
  2467. //>>excludeEnd("ide");
  2468. messageSends: ["beDirty", "package"]
  2469. }),
  2470. $globals.PackageStateObserver);
  2471. $core.addMethod(
  2472. $core.method({
  2473. selector: "onProtocolModification:",
  2474. protocol: "reactions",
  2475. fn: function (anAnnouncement){
  2476. var self=this,$self=this;
  2477. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2478. return $core.withContext(function($ctx1) {
  2479. //>>excludeEnd("ctx");
  2480. var $1,$receiver;
  2481. $1=$recv(anAnnouncement)._package();
  2482. if(($receiver = $1) == null || $receiver.a$nil){
  2483. $1;
  2484. } else {
  2485. var package_;
  2486. package_=$receiver;
  2487. $recv(package_)._beDirty();
  2488. }
  2489. return self;
  2490. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2491. }, function($ctx1) {$ctx1.fill(self,"onProtocolModification:",{anAnnouncement:anAnnouncement},$globals.PackageStateObserver)});
  2492. //>>excludeEnd("ctx");
  2493. },
  2494. //>>excludeStart("ide", pragmas.excludeIdeData);
  2495. args: ["anAnnouncement"],
  2496. source: "onProtocolModification: anAnnouncement\x0a\x09anAnnouncement package ifNotNil: [ :package | package beDirty ]",
  2497. referencedClasses: [],
  2498. //>>excludeEnd("ide");
  2499. messageSends: ["ifNotNil:", "package", "beDirty"]
  2500. }),
  2501. $globals.PackageStateObserver);
  2502. $globals.PackageStateObserver.a$cls.iVarNames = ["current"];
  2503. $core.addMethod(
  2504. $core.method({
  2505. selector: "current",
  2506. protocol: "accessing",
  2507. fn: function (){
  2508. var self=this,$self=this;
  2509. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2510. return $core.withContext(function($ctx1) {
  2511. //>>excludeEnd("ctx");
  2512. var $1,$receiver;
  2513. $1=$self["@current"];
  2514. if(($receiver = $1) == null || $receiver.a$nil){
  2515. $self["@current"]=$self._new();
  2516. return $self["@current"];
  2517. } else {
  2518. return $1;
  2519. }
  2520. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2521. }, function($ctx1) {$ctx1.fill(self,"current",{},$globals.PackageStateObserver.a$cls)});
  2522. //>>excludeEnd("ctx");
  2523. },
  2524. //>>excludeStart("ide", pragmas.excludeIdeData);
  2525. args: [],
  2526. source: "current\x0a\x09^ current ifNil: [ current := self new ]",
  2527. referencedClasses: [],
  2528. //>>excludeEnd("ide");
  2529. messageSends: ["ifNil:", "new"]
  2530. }),
  2531. $globals.PackageStateObserver.a$cls);
  2532. $core.addMethod(
  2533. $core.method({
  2534. selector: "initialize",
  2535. protocol: "initialization",
  2536. fn: function (){
  2537. var self=this,$self=this;
  2538. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2539. return $core.withContext(function($ctx1) {
  2540. //>>excludeEnd("ctx");
  2541. $recv($self._current())._observeSystem();
  2542. return self;
  2543. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2544. }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.PackageStateObserver.a$cls)});
  2545. //>>excludeEnd("ctx");
  2546. },
  2547. //>>excludeStart("ide", pragmas.excludeIdeData);
  2548. args: [],
  2549. source: "initialize\x0a\x09self current observeSystem",
  2550. referencedClasses: [],
  2551. //>>excludeEnd("ide");
  2552. messageSends: ["observeSystem", "current"]
  2553. }),
  2554. $globals.PackageStateObserver.a$cls);
  2555. $core.addClass("ParseError", $globals.Error, [], "Kernel-Infrastructure");
  2556. //>>excludeStart("ide", pragmas.excludeIdeData);
  2557. $globals.ParseError.comment="Instance of ParseError are signaled on any parsing error.\x0aSee `Smalltalk >> #parse:`";
  2558. //>>excludeEnd("ide");
  2559. $core.addClass("Setting", $globals.Object, ["key", "value", "defaultValue"], "Kernel-Infrastructure");
  2560. //>>excludeStart("ide", pragmas.excludeIdeData);
  2561. $globals.Setting.comment="I represent a setting **stored** at `Smalltalk settings`. \x0aIn the current implementation, `Smalltalk settings` is an object persisted in the localStorage.\x0a\x0a## API\x0a\x0aA `Setting` value can be read using `value` and set using `value:`.\x0a\x0aSettings are accessed with `'key' asSetting` or `'key' asSettingIfAbsent: aDefaultValue`.\x0a\x0aTo read the value of a setting you can also use the convenience:\x0a\x0a`theValueSet := 'any.characteristic' settingValue` \x0a\x0aor with a default using:\x0a\x0a `theEnsuredValueSet := 'any.characteristic' settingValueIfAbsent: true`";
  2562. //>>excludeEnd("ide");
  2563. $core.addMethod(
  2564. $core.method({
  2565. selector: "defaultValue",
  2566. protocol: "accessing",
  2567. fn: function (){
  2568. var self=this,$self=this;
  2569. return $self["@defaultValue"];
  2570. },
  2571. //>>excludeStart("ide", pragmas.excludeIdeData);
  2572. args: [],
  2573. source: "defaultValue\x0a\x09^ defaultValue",
  2574. referencedClasses: [],
  2575. //>>excludeEnd("ide");
  2576. messageSends: []
  2577. }),
  2578. $globals.Setting);
  2579. $core.addMethod(
  2580. $core.method({
  2581. selector: "defaultValue:",
  2582. protocol: "accessing",
  2583. fn: function (aStringifiableObject){
  2584. var self=this,$self=this;
  2585. $self["@defaultValue"]=aStringifiableObject;
  2586. return self;
  2587. },
  2588. //>>excludeStart("ide", pragmas.excludeIdeData);
  2589. args: ["aStringifiableObject"],
  2590. source: "defaultValue: aStringifiableObject\x0a\x09defaultValue := aStringifiableObject",
  2591. referencedClasses: [],
  2592. //>>excludeEnd("ide");
  2593. messageSends: []
  2594. }),
  2595. $globals.Setting);
  2596. $core.addMethod(
  2597. $core.method({
  2598. selector: "key",
  2599. protocol: "accessing",
  2600. fn: function (){
  2601. var self=this,$self=this;
  2602. return $self["@key"];
  2603. },
  2604. //>>excludeStart("ide", pragmas.excludeIdeData);
  2605. args: [],
  2606. source: "key\x0a\x09^ key",
  2607. referencedClasses: [],
  2608. //>>excludeEnd("ide");
  2609. messageSends: []
  2610. }),
  2611. $globals.Setting);
  2612. $core.addMethod(
  2613. $core.method({
  2614. selector: "key:",
  2615. protocol: "accessing",
  2616. fn: function (aString){
  2617. var self=this,$self=this;
  2618. $self["@key"]=aString;
  2619. return self;
  2620. },
  2621. //>>excludeStart("ide", pragmas.excludeIdeData);
  2622. args: ["aString"],
  2623. source: "key: aString\x0a\x09key := aString",
  2624. referencedClasses: [],
  2625. //>>excludeEnd("ide");
  2626. messageSends: []
  2627. }),
  2628. $globals.Setting);
  2629. $core.addMethod(
  2630. $core.method({
  2631. selector: "value",
  2632. protocol: "accessing",
  2633. fn: function (){
  2634. var self=this,$self=this;
  2635. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2636. return $core.withContext(function($ctx1) {
  2637. //>>excludeEnd("ctx");
  2638. return $recv($recv($globals.Smalltalk)._settings())._at_ifAbsent_($self._key(),(function(){
  2639. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2640. return $core.withContext(function($ctx2) {
  2641. //>>excludeEnd("ctx");
  2642. return $self._defaultValue();
  2643. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2644. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2645. //>>excludeEnd("ctx");
  2646. }));
  2647. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2648. }, function($ctx1) {$ctx1.fill(self,"value",{},$globals.Setting)});
  2649. //>>excludeEnd("ctx");
  2650. },
  2651. //>>excludeStart("ide", pragmas.excludeIdeData);
  2652. args: [],
  2653. source: "value\x0a\x09^ Smalltalk settings at: self key ifAbsent: [ self defaultValue ]",
  2654. referencedClasses: ["Smalltalk"],
  2655. //>>excludeEnd("ide");
  2656. messageSends: ["at:ifAbsent:", "settings", "key", "defaultValue"]
  2657. }),
  2658. $globals.Setting);
  2659. $core.addMethod(
  2660. $core.method({
  2661. selector: "value:",
  2662. protocol: "accessing",
  2663. fn: function (aStringifiableObject){
  2664. var self=this,$self=this;
  2665. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2666. return $core.withContext(function($ctx1) {
  2667. //>>excludeEnd("ctx");
  2668. return $recv($recv($globals.Smalltalk)._settings())._at_put_($self._key(),aStringifiableObject);
  2669. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2670. }, function($ctx1) {$ctx1.fill(self,"value:",{aStringifiableObject:aStringifiableObject},$globals.Setting)});
  2671. //>>excludeEnd("ctx");
  2672. },
  2673. //>>excludeStart("ide", pragmas.excludeIdeData);
  2674. args: ["aStringifiableObject"],
  2675. source: "value: aStringifiableObject\x0a\x09^ Smalltalk settings at: self key put: aStringifiableObject",
  2676. referencedClasses: ["Smalltalk"],
  2677. //>>excludeEnd("ide");
  2678. messageSends: ["at:put:", "settings", "key"]
  2679. }),
  2680. $globals.Setting);
  2681. $core.addMethod(
  2682. $core.method({
  2683. selector: "at:ifAbsent:",
  2684. protocol: "instance creation",
  2685. fn: function (aString,aDefaultValue){
  2686. var self=this,$self=this;
  2687. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2688. return $core.withContext(function($ctx1) {
  2689. //>>excludeEnd("ctx");
  2690. var $1;
  2691. $1=(
  2692. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2693. $ctx1.supercall = true,
  2694. //>>excludeEnd("ctx");
  2695. ($globals.Setting.a$cls.superclass||$boot.nilAsClass).fn.prototype._new.apply($self, []));
  2696. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2697. $ctx1.supercall = false;
  2698. //>>excludeEnd("ctx");;
  2699. $recv($1)._key_(aString);
  2700. $recv($1)._defaultValue_(aDefaultValue);
  2701. return $recv($1)._yourself();
  2702. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2703. }, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{aString:aString,aDefaultValue:aDefaultValue},$globals.Setting.a$cls)});
  2704. //>>excludeEnd("ctx");
  2705. },
  2706. //>>excludeStart("ide", pragmas.excludeIdeData);
  2707. args: ["aString", "aDefaultValue"],
  2708. source: "at: aString ifAbsent: aDefaultValue\x0a\x09\x0a\x09^ super new\x0a\x09\x09key: aString;\x0a\x09\x09defaultValue: aDefaultValue;\x0a\x09\x09yourself",
  2709. referencedClasses: [],
  2710. //>>excludeEnd("ide");
  2711. messageSends: ["key:", "new", "defaultValue:", "yourself"]
  2712. }),
  2713. $globals.Setting.a$cls);
  2714. $core.addMethod(
  2715. $core.method({
  2716. selector: "new",
  2717. protocol: "instance creation",
  2718. fn: function (){
  2719. var self=this,$self=this;
  2720. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2721. return $core.withContext(function($ctx1) {
  2722. //>>excludeEnd("ctx");
  2723. $self._shouldNotImplement();
  2724. return self;
  2725. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2726. }, function($ctx1) {$ctx1.fill(self,"new",{},$globals.Setting.a$cls)});
  2727. //>>excludeEnd("ctx");
  2728. },
  2729. //>>excludeStart("ide", pragmas.excludeIdeData);
  2730. args: [],
  2731. source: "new\x0a\x09self shouldNotImplement",
  2732. referencedClasses: [],
  2733. //>>excludeEnd("ide");
  2734. messageSends: ["shouldNotImplement"]
  2735. }),
  2736. $globals.Setting.a$cls);
  2737. $core.addClass("SmalltalkImage", $globals.Object, ["globalJsVariables", "packageDictionary"], "Kernel-Infrastructure");
  2738. //>>excludeStart("ide", pragmas.excludeIdeData);
  2739. $globals.SmalltalkImage.comment="I represent the Smalltalk system, wrapping\x0aoperations of variable `$core` declared in `support/boot.js`.\x0a\x0a## API\x0a\x0aI have only one instance, accessed with global variable `Smalltalk`.\x0a\x0a## Classes\x0a\x0aClasses can be accessed using the following methods:\x0a\x0a- `#classes` answers the full list of Smalltalk classes in the system\x0a- `#globals #at:` answers a specific global (usually, a class) or `nil`\x0a\x0a## Packages\x0a\x0aPackages can be accessed using the following methods:\x0a\x0a- `#packages` answers the full list of packages\x0a- `#packageAt:` answers a specific package or `nil`\x0a\x0a## Parsing\x0a\x0aThe `#parse:` method is used to parse Amber source code.\x0aIt requires the `Compiler` package and the `support/parser.js` parser file in order to work.";
  2740. //>>excludeEnd("ide");
  2741. $core.addMethod(
  2742. $core.method({
  2743. selector: "addGlobalJsVariable:",
  2744. protocol: "globals",
  2745. fn: function (aString){
  2746. var self=this,$self=this;
  2747. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2748. return $core.withContext(function($ctx1) {
  2749. //>>excludeEnd("ctx");
  2750. $recv($self._globalJsVariables())._add_(aString);
  2751. return self;
  2752. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2753. }, function($ctx1) {$ctx1.fill(self,"addGlobalJsVariable:",{aString:aString},$globals.SmalltalkImage)});
  2754. //>>excludeEnd("ctx");
  2755. },
  2756. //>>excludeStart("ide", pragmas.excludeIdeData);
  2757. args: ["aString"],
  2758. source: "addGlobalJsVariable: aString\x0a\x09self globalJsVariables add: aString",
  2759. referencedClasses: [],
  2760. //>>excludeEnd("ide");
  2761. messageSends: ["add:", "globalJsVariables"]
  2762. }),
  2763. $globals.SmalltalkImage);
  2764. $core.addMethod(
  2765. $core.method({
  2766. selector: "adoptPackageDictionary",
  2767. protocol: "private",
  2768. fn: function (){
  2769. var self=this,$self=this;
  2770. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2771. return $core.withContext(function($ctx1) {
  2772. //>>excludeEnd("ctx");
  2773. $recv($recv($self._core())._packageDescriptors())._keysAndValuesDo_((function(key,value){
  2774. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2775. return $core.withContext(function($ctx2) {
  2776. //>>excludeEnd("ctx");
  2777. return $recv($globals.Package)._named_javaScriptDescriptor_(key,value);
  2778. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2779. }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1,1)});
  2780. //>>excludeEnd("ctx");
  2781. }));
  2782. return self;
  2783. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2784. }, function($ctx1) {$ctx1.fill(self,"adoptPackageDictionary",{},$globals.SmalltalkImage)});
  2785. //>>excludeEnd("ctx");
  2786. },
  2787. //>>excludeStart("ide", pragmas.excludeIdeData);
  2788. args: [],
  2789. source: "adoptPackageDictionary\x0a\x09self core packageDescriptors keysAndValuesDo: [ :key :value | Package named: key javaScriptDescriptor: value ]",
  2790. referencedClasses: ["Package"],
  2791. //>>excludeEnd("ide");
  2792. messageSends: ["keysAndValuesDo:", "packageDescriptors", "core", "named:javaScriptDescriptor:"]
  2793. }),
  2794. $globals.SmalltalkImage);
  2795. $core.addMethod(
  2796. $core.method({
  2797. selector: "amdRequire",
  2798. protocol: "accessing amd",
  2799. fn: function (){
  2800. var self=this,$self=this;
  2801. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2802. return $core.withContext(function($ctx1) {
  2803. //>>excludeEnd("ctx");
  2804. return $recv($self._core())._at_("amdRequire");
  2805. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2806. }, function($ctx1) {$ctx1.fill(self,"amdRequire",{},$globals.SmalltalkImage)});
  2807. //>>excludeEnd("ctx");
  2808. },
  2809. //>>excludeStart("ide", pragmas.excludeIdeData);
  2810. args: [],
  2811. source: "amdRequire\x0a\x09^ self core at: 'amdRequire'",
  2812. referencedClasses: [],
  2813. //>>excludeEnd("ide");
  2814. messageSends: ["at:", "core"]
  2815. }),
  2816. $globals.SmalltalkImage);
  2817. $core.addMethod(
  2818. $core.method({
  2819. selector: "asSmalltalkException:",
  2820. protocol: "error handling",
  2821. fn: function (anObject){
  2822. var self=this,$self=this;
  2823. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2824. return $core.withContext(function($ctx1) {
  2825. //>>excludeEnd("ctx");
  2826. var $1;
  2827. $1=$recv($self._isSmalltalkObject_(anObject))._and_((function(){
  2828. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2829. return $core.withContext(function($ctx2) {
  2830. //>>excludeEnd("ctx");
  2831. return $recv(anObject)._isKindOf_($globals.Error);
  2832. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2833. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2834. //>>excludeEnd("ctx");
  2835. }));
  2836. if($core.assert($1)){
  2837. return anObject;
  2838. } else {
  2839. return $recv($globals.JavaScriptException)._on_(anObject);
  2840. }
  2841. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2842. }, function($ctx1) {$ctx1.fill(self,"asSmalltalkException:",{anObject:anObject},$globals.SmalltalkImage)});
  2843. //>>excludeEnd("ctx");
  2844. },
  2845. //>>excludeStart("ide", pragmas.excludeIdeData);
  2846. args: ["anObject"],
  2847. 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 ]",
  2848. referencedClasses: ["Error", "JavaScriptException"],
  2849. //>>excludeEnd("ide");
  2850. messageSends: ["ifTrue:ifFalse:", "and:", "isSmalltalkObject:", "isKindOf:", "on:"]
  2851. }),
  2852. $globals.SmalltalkImage);
  2853. $core.addMethod(
  2854. $core.method({
  2855. selector: "basicCreatePackage:",
  2856. protocol: "private",
  2857. fn: function (packageName){
  2858. var self=this,$self=this;
  2859. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2860. return $core.withContext(function($ctx1) {
  2861. //>>excludeEnd("ctx");
  2862. return $recv($self._packageDictionary())._at_ifAbsentPut_(packageName,(function(){
  2863. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2864. return $core.withContext(function($ctx2) {
  2865. //>>excludeEnd("ctx");
  2866. return $recv($globals.Package)._new_(packageName);
  2867. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2868. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2869. //>>excludeEnd("ctx");
  2870. }));
  2871. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2872. }, function($ctx1) {$ctx1.fill(self,"basicCreatePackage:",{packageName:packageName},$globals.SmalltalkImage)});
  2873. //>>excludeEnd("ctx");
  2874. },
  2875. //>>excludeStart("ide", pragmas.excludeIdeData);
  2876. args: ["packageName"],
  2877. source: "basicCreatePackage: packageName\x0a\x09\x22Create and bind a new bare package with given name and return it.\x22\x0a\x09^ self packageDictionary at: packageName ifAbsentPut: [ Package new: packageName ]",
  2878. referencedClasses: ["Package"],
  2879. //>>excludeEnd("ide");
  2880. messageSends: ["at:ifAbsentPut:", "packageDictionary", "new:"]
  2881. }),
  2882. $globals.SmalltalkImage);
  2883. $core.addMethod(
  2884. $core.method({
  2885. selector: "basicParse:",
  2886. protocol: "private",
  2887. fn: function (aString){
  2888. var self=this,$self=this;
  2889. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2890. return $core.withContext(function($ctx1) {
  2891. //>>excludeEnd("ctx");
  2892. return $recv($globals.SmalltalkParser)._parse_(aString);
  2893. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2894. }, function($ctx1) {$ctx1.fill(self,"basicParse:",{aString:aString},$globals.SmalltalkImage)});
  2895. //>>excludeEnd("ctx");
  2896. },
  2897. //>>excludeStart("ide", pragmas.excludeIdeData);
  2898. args: ["aString"],
  2899. source: "basicParse: aString\x0a\x09^ SmalltalkParser parse: aString",
  2900. referencedClasses: ["SmalltalkParser"],
  2901. //>>excludeEnd("ide");
  2902. messageSends: ["parse:"]
  2903. }),
  2904. $globals.SmalltalkImage);
  2905. $core.addMethod(
  2906. $core.method({
  2907. selector: "cancelOptOut:",
  2908. protocol: "accessing",
  2909. fn: function (anObject){
  2910. var self=this,$self=this;
  2911. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2912. return $core.withContext(function($ctx1) {
  2913. //>>excludeEnd("ctx");
  2914. delete anObject.klass; delete anObject.a$cls;;
  2915. return self;
  2916. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2917. }, function($ctx1) {$ctx1.fill(self,"cancelOptOut:",{anObject:anObject},$globals.SmalltalkImage)});
  2918. //>>excludeEnd("ctx");
  2919. },
  2920. //>>excludeStart("ide", pragmas.excludeIdeData);
  2921. args: ["anObject"],
  2922. source: "cancelOptOut: anObject\x0a\x09\x22A Smalltalk object has a 'a$cls' property.\x0a\x09If this property is shadowed for anObject by optOut:,\x0a\x09the object is treated as plain JS object.\x0a\x09This removes the shadow and anObject is Smalltalk object\x0a\x09again if it was before.\x22\x0a\x09\x0a\x09<inlineJS: 'delete anObject.klass; delete anObject.a$cls;'>",
  2923. referencedClasses: [],
  2924. //>>excludeEnd("ide");
  2925. messageSends: []
  2926. }),
  2927. $globals.SmalltalkImage);
  2928. $core.addMethod(
  2929. $core.method({
  2930. selector: "classes",
  2931. protocol: "classes",
  2932. fn: function (){
  2933. var self=this,$self=this;
  2934. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2935. return $core.withContext(function($ctx1) {
  2936. //>>excludeEnd("ctx");
  2937. return $recv($recv($self._core())._traitsOrClasses())._copy();
  2938. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2939. }, function($ctx1) {$ctx1.fill(self,"classes",{},$globals.SmalltalkImage)});
  2940. //>>excludeEnd("ctx");
  2941. },
  2942. //>>excludeStart("ide", pragmas.excludeIdeData);
  2943. args: [],
  2944. source: "classes\x0a\x09^ self core traitsOrClasses copy",
  2945. referencedClasses: [],
  2946. //>>excludeEnd("ide");
  2947. messageSends: ["copy", "traitsOrClasses", "core"]
  2948. }),
  2949. $globals.SmalltalkImage);
  2950. $core.addMethod(
  2951. $core.method({
  2952. selector: "core",
  2953. protocol: "accessing",
  2954. fn: function (){
  2955. var self=this,$self=this;
  2956. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2957. return $core.withContext(function($ctx1) {
  2958. //>>excludeEnd("ctx");
  2959. return $core;
  2960. return self;
  2961. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2962. }, function($ctx1) {$ctx1.fill(self,"core",{},$globals.SmalltalkImage)});
  2963. //>>excludeEnd("ctx");
  2964. },
  2965. //>>excludeStart("ide", pragmas.excludeIdeData);
  2966. args: [],
  2967. source: "core\x0a\x09<inlineJS: 'return $core'>",
  2968. referencedClasses: [],
  2969. //>>excludeEnd("ide");
  2970. messageSends: []
  2971. }),
  2972. $globals.SmalltalkImage);
  2973. $core.addMethod(
  2974. $core.method({
  2975. selector: "createPackage:",
  2976. protocol: "packages",
  2977. fn: function (packageName){
  2978. var self=this,$self=this;
  2979. var package_,announcement;
  2980. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2981. return $core.withContext(function($ctx1) {
  2982. //>>excludeEnd("ctx");
  2983. var $1;
  2984. package_=$self._basicCreatePackage_(packageName);
  2985. $1=$recv($globals.PackageAdded)._new();
  2986. $recv($1)._package_(package_);
  2987. announcement=$recv($1)._yourself();
  2988. $recv($recv($globals.SystemAnnouncer)._current())._announce_(announcement);
  2989. return package_;
  2990. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2991. }, function($ctx1) {$ctx1.fill(self,"createPackage:",{packageName:packageName,package_:package_,announcement:announcement},$globals.SmalltalkImage)});
  2992. //>>excludeEnd("ctx");
  2993. },
  2994. //>>excludeStart("ide", pragmas.excludeIdeData);
  2995. args: ["packageName"],
  2996. 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",
  2997. referencedClasses: ["PackageAdded", "SystemAnnouncer"],
  2998. //>>excludeEnd("ide");
  2999. messageSends: ["basicCreatePackage:", "package:", "new", "yourself", "announce:", "current"]
  3000. }),
  3001. $globals.SmalltalkImage);
  3002. $core.addMethod(
  3003. $core.method({
  3004. selector: "defaultAmdNamespace",
  3005. protocol: "accessing amd",
  3006. fn: function (){
  3007. var self=this,$self=this;
  3008. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3009. return $core.withContext(function($ctx1) {
  3010. //>>excludeEnd("ctx");
  3011. return "transport.defaultAmdNamespace"._settingValue();
  3012. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3013. }, function($ctx1) {$ctx1.fill(self,"defaultAmdNamespace",{},$globals.SmalltalkImage)});
  3014. //>>excludeEnd("ctx");
  3015. },
  3016. //>>excludeStart("ide", pragmas.excludeIdeData);
  3017. args: [],
  3018. source: "defaultAmdNamespace\x0a\x09^ 'transport.defaultAmdNamespace' settingValue",
  3019. referencedClasses: [],
  3020. //>>excludeEnd("ide");
  3021. messageSends: ["settingValue"]
  3022. }),
  3023. $globals.SmalltalkImage);
  3024. $core.addMethod(
  3025. $core.method({
  3026. selector: "defaultAmdNamespace:",
  3027. protocol: "accessing amd",
  3028. fn: function (aString){
  3029. var self=this,$self=this;
  3030. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3031. return $core.withContext(function($ctx1) {
  3032. //>>excludeEnd("ctx");
  3033. "transport.defaultAmdNamespace"._settingValue_(aString);
  3034. return self;
  3035. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3036. }, function($ctx1) {$ctx1.fill(self,"defaultAmdNamespace:",{aString:aString},$globals.SmalltalkImage)});
  3037. //>>excludeEnd("ctx");
  3038. },
  3039. //>>excludeStart("ide", pragmas.excludeIdeData);
  3040. args: ["aString"],
  3041. source: "defaultAmdNamespace: aString\x0a\x09'transport.defaultAmdNamespace' settingValue: aString",
  3042. referencedClasses: [],
  3043. //>>excludeEnd("ide");
  3044. messageSends: ["settingValue:"]
  3045. }),
  3046. $globals.SmalltalkImage);
  3047. $core.addMethod(
  3048. $core.method({
  3049. selector: "deleteClass:",
  3050. protocol: "private",
  3051. fn: function (aClass){
  3052. var self=this,$self=this;
  3053. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3054. return $core.withContext(function($ctx1) {
  3055. //>>excludeEnd("ctx");
  3056. $core.removeClass(aClass);
  3057. return self;
  3058. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3059. }, function($ctx1) {$ctx1.fill(self,"deleteClass:",{aClass:aClass},$globals.SmalltalkImage)});
  3060. //>>excludeEnd("ctx");
  3061. },
  3062. //>>excludeStart("ide", pragmas.excludeIdeData);
  3063. args: ["aClass"],
  3064. source: "deleteClass: aClass\x0a\x09\x22Deletes a class by deleting its binding only. Use #removeClass instead\x22\x0a\x09\x0a\x09<inlineJS: '$core.removeClass(aClass)'>",
  3065. referencedClasses: [],
  3066. //>>excludeEnd("ide");
  3067. messageSends: []
  3068. }),
  3069. $globals.SmalltalkImage);
  3070. $core.addMethod(
  3071. $core.method({
  3072. selector: "deleteGlobalJsVariable:",
  3073. protocol: "globals",
  3074. fn: function (aString){
  3075. var self=this,$self=this;
  3076. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3077. return $core.withContext(function($ctx1) {
  3078. //>>excludeEnd("ctx");
  3079. $recv($self._globalJsVariables())._remove_ifAbsent_(aString,(function(){
  3080. }));
  3081. return self;
  3082. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3083. }, function($ctx1) {$ctx1.fill(self,"deleteGlobalJsVariable:",{aString:aString},$globals.SmalltalkImage)});
  3084. //>>excludeEnd("ctx");
  3085. },
  3086. //>>excludeStart("ide", pragmas.excludeIdeData);
  3087. args: ["aString"],
  3088. source: "deleteGlobalJsVariable: aString\x0a\x09self globalJsVariables remove: aString ifAbsent:[]",
  3089. referencedClasses: [],
  3090. //>>excludeEnd("ide");
  3091. messageSends: ["remove:ifAbsent:", "globalJsVariables"]
  3092. }),
  3093. $globals.SmalltalkImage);
  3094. $core.addMethod(
  3095. $core.method({
  3096. selector: "existsJsGlobal:",
  3097. protocol: "testing",
  3098. fn: function (aString){
  3099. var self=this,$self=this;
  3100. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3101. return $core.withContext(function($ctx1) {
  3102. //>>excludeEnd("ctx");
  3103. return $recv($recv($globals.Platform)._globals())._at_ifPresent_ifAbsent_(aString,(function(){
  3104. return true;
  3105. }),(function(){
  3106. return false;
  3107. }));
  3108. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3109. }, function($ctx1) {$ctx1.fill(self,"existsJsGlobal:",{aString:aString},$globals.SmalltalkImage)});
  3110. //>>excludeEnd("ctx");
  3111. },
  3112. //>>excludeStart("ide", pragmas.excludeIdeData);
  3113. args: ["aString"],
  3114. source: "existsJsGlobal: aString\x0a\x09^ Platform globals \x0a\x09\x09at: aString \x0a\x09\x09ifPresent: [ true ] \x0a\x09\x09ifAbsent: [ false ]",
  3115. referencedClasses: ["Platform"],
  3116. //>>excludeEnd("ide");
  3117. messageSends: ["at:ifPresent:ifAbsent:", "globals"]
  3118. }),
  3119. $globals.SmalltalkImage);
  3120. $core.addMethod(
  3121. $core.method({
  3122. selector: "globalJsVariables",
  3123. protocol: "globals",
  3124. fn: function (){
  3125. var self=this,$self=this;
  3126. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3127. return $core.withContext(function($ctx1) {
  3128. //>>excludeEnd("ctx");
  3129. var $1,$receiver;
  3130. $1=$self["@globalJsVariables"];
  3131. if(($receiver = $1) == null || $receiver.a$nil){
  3132. $self["@globalJsVariables"]=["window", "document", "process", "global"];
  3133. return $self["@globalJsVariables"];
  3134. } else {
  3135. return $1;
  3136. }
  3137. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3138. }, function($ctx1) {$ctx1.fill(self,"globalJsVariables",{},$globals.SmalltalkImage)});
  3139. //>>excludeEnd("ctx");
  3140. },
  3141. //>>excludeStart("ide", pragmas.excludeIdeData);
  3142. args: [],
  3143. source: "globalJsVariables\x0a\x09^ globalJsVariables ifNil: [\x0a\x09\x09globalJsVariables := #(window document process global) ]",
  3144. referencedClasses: [],
  3145. //>>excludeEnd("ide");
  3146. messageSends: ["ifNil:"]
  3147. }),
  3148. $globals.SmalltalkImage);
  3149. $core.addMethod(
  3150. $core.method({
  3151. selector: "globals",
  3152. protocol: "accessing",
  3153. fn: function (){
  3154. var self=this,$self=this;
  3155. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3156. return $core.withContext(function($ctx1) {
  3157. //>>excludeEnd("ctx");
  3158. return $globals;
  3159. return self;
  3160. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3161. }, function($ctx1) {$ctx1.fill(self,"globals",{},$globals.SmalltalkImage)});
  3162. //>>excludeEnd("ctx");
  3163. },
  3164. //>>excludeStart("ide", pragmas.excludeIdeData);
  3165. args: [],
  3166. source: "globals\x0a\x09<inlineJS: 'return $globals'>",
  3167. referencedClasses: [],
  3168. //>>excludeEnd("ide");
  3169. messageSends: []
  3170. }),
  3171. $globals.SmalltalkImage);
  3172. $core.addMethod(
  3173. $core.method({
  3174. selector: "includesKey:",
  3175. protocol: "accessing",
  3176. fn: function (aKey){
  3177. var self=this,$self=this;
  3178. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3179. return $core.withContext(function($ctx1) {
  3180. //>>excludeEnd("ctx");
  3181. return $core.hasOwnProperty(aKey);
  3182. return self;
  3183. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3184. }, function($ctx1) {$ctx1.fill(self,"includesKey:",{aKey:aKey},$globals.SmalltalkImage)});
  3185. //>>excludeEnd("ctx");
  3186. },
  3187. //>>excludeStart("ide", pragmas.excludeIdeData);
  3188. args: ["aKey"],
  3189. source: "includesKey: aKey\x0a\x09<inlineJS: 'return $core.hasOwnProperty(aKey)'>",
  3190. referencedClasses: [],
  3191. //>>excludeEnd("ide");
  3192. messageSends: []
  3193. }),
  3194. $globals.SmalltalkImage);
  3195. $core.addMethod(
  3196. $core.method({
  3197. selector: "isSmalltalkObject:",
  3198. protocol: "testing",
  3199. fn: function (anObject){
  3200. var self=this,$self=this;
  3201. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3202. return $core.withContext(function($ctx1) {
  3203. //>>excludeEnd("ctx");
  3204. return anObject.a$cls != null;
  3205. return self;
  3206. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3207. }, function($ctx1) {$ctx1.fill(self,"isSmalltalkObject:",{anObject:anObject},$globals.SmalltalkImage)});
  3208. //>>excludeEnd("ctx");
  3209. },
  3210. //>>excludeStart("ide", pragmas.excludeIdeData);
  3211. args: ["anObject"],
  3212. source: "isSmalltalkObject: anObject\x0a\x09\x22Consider anObject a Smalltalk object if it has a 'a$cls' property.\x0a\x09Note that this may be unaccurate\x22\x0a\x09\x0a\x09<inlineJS: 'return anObject.a$cls != null'>",
  3213. referencedClasses: [],
  3214. //>>excludeEnd("ide");
  3215. messageSends: []
  3216. }),
  3217. $globals.SmalltalkImage);
  3218. $core.addMethod(
  3219. $core.method({
  3220. selector: "optOut:",
  3221. protocol: "accessing",
  3222. fn: function (anObject){
  3223. var self=this,$self=this;
  3224. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3225. return $core.withContext(function($ctx1) {
  3226. //>>excludeEnd("ctx");
  3227. anObject.klass = null; anObject.a$cls = null;
  3228. return self;
  3229. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3230. }, function($ctx1) {$ctx1.fill(self,"optOut:",{anObject:anObject},$globals.SmalltalkImage)});
  3231. //>>excludeEnd("ctx");
  3232. },
  3233. //>>excludeStart("ide", pragmas.excludeIdeData);
  3234. args: ["anObject"],
  3235. source: "optOut: anObject\x0a\x09\x22A Smalltalk object has a 'a$cls' property.\x0a\x09This shadows the property for anObject.\x0a\x09The object is treated as plain JS object following this.\x22\x0a\x09\x0a\x09<inlineJS: 'anObject.klass = null; anObject.a$cls = null'>",
  3236. referencedClasses: [],
  3237. //>>excludeEnd("ide");
  3238. messageSends: []
  3239. }),
  3240. $globals.SmalltalkImage);
  3241. $core.addMethod(
  3242. $core.method({
  3243. selector: "packageAt:",
  3244. protocol: "packages",
  3245. fn: function (packageName){
  3246. var self=this,$self=this;
  3247. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3248. return $core.withContext(function($ctx1) {
  3249. //>>excludeEnd("ctx");
  3250. $self._deprecatedAPI_("Use #packageAt:ifAbsent: directly.");
  3251. return $self._packageAt_ifAbsent_(packageName,(function(){
  3252. }));
  3253. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3254. }, function($ctx1) {$ctx1.fill(self,"packageAt:",{packageName:packageName},$globals.SmalltalkImage)});
  3255. //>>excludeEnd("ctx");
  3256. },
  3257. //>>excludeStart("ide", pragmas.excludeIdeData);
  3258. args: ["packageName"],
  3259. source: "packageAt: packageName\x0a\x09self deprecatedAPI: 'Use #packageAt:ifAbsent: directly.'.\x0a\x09^ self packageAt: packageName ifAbsent: []",
  3260. referencedClasses: [],
  3261. //>>excludeEnd("ide");
  3262. messageSends: ["deprecatedAPI:", "packageAt:ifAbsent:"]
  3263. }),
  3264. $globals.SmalltalkImage);
  3265. $core.addMethod(
  3266. $core.method({
  3267. selector: "packageAt:ifAbsent:",
  3268. protocol: "packages",
  3269. fn: function (packageName,aBlock){
  3270. var self=this,$self=this;
  3271. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3272. return $core.withContext(function($ctx1) {
  3273. //>>excludeEnd("ctx");
  3274. return $recv($self._packageDictionary())._at_ifAbsent_(packageName,aBlock);
  3275. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3276. }, function($ctx1) {$ctx1.fill(self,"packageAt:ifAbsent:",{packageName:packageName,aBlock:aBlock},$globals.SmalltalkImage)});
  3277. //>>excludeEnd("ctx");
  3278. },
  3279. //>>excludeStart("ide", pragmas.excludeIdeData);
  3280. args: ["packageName", "aBlock"],
  3281. source: "packageAt: packageName ifAbsent: aBlock\x0a\x09^ self packageDictionary at: packageName ifAbsent: aBlock",
  3282. referencedClasses: [],
  3283. //>>excludeEnd("ide");
  3284. messageSends: ["at:ifAbsent:", "packageDictionary"]
  3285. }),
  3286. $globals.SmalltalkImage);
  3287. $core.addMethod(
  3288. $core.method({
  3289. selector: "packageAt:ifPresent:",
  3290. protocol: "packages",
  3291. fn: function (packageName,aBlock){
  3292. var self=this,$self=this;
  3293. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3294. return $core.withContext(function($ctx1) {
  3295. //>>excludeEnd("ctx");
  3296. return $recv($self._packageDictionary())._at_ifPresent_(packageName,aBlock);
  3297. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3298. }, function($ctx1) {$ctx1.fill(self,"packageAt:ifPresent:",{packageName:packageName,aBlock:aBlock},$globals.SmalltalkImage)});
  3299. //>>excludeEnd("ctx");
  3300. },
  3301. //>>excludeStart("ide", pragmas.excludeIdeData);
  3302. args: ["packageName", "aBlock"],
  3303. source: "packageAt: packageName ifPresent: aBlock\x0a\x09^ self packageDictionary at: packageName ifPresent: aBlock",
  3304. referencedClasses: [],
  3305. //>>excludeEnd("ide");
  3306. messageSends: ["at:ifPresent:", "packageDictionary"]
  3307. }),
  3308. $globals.SmalltalkImage);
  3309. $core.addMethod(
  3310. $core.method({
  3311. selector: "packageDictionary",
  3312. protocol: "packages",
  3313. fn: function (){
  3314. var self=this,$self=this;
  3315. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3316. return $core.withContext(function($ctx1) {
  3317. //>>excludeEnd("ctx");
  3318. var $1,$receiver;
  3319. $1=$self["@packageDictionary"];
  3320. if(($receiver = $1) == null || $receiver.a$nil){
  3321. $self["@packageDictionary"]=$recv($globals.Dictionary)._new();
  3322. return $self["@packageDictionary"];
  3323. } else {
  3324. return $1;
  3325. }
  3326. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3327. }, function($ctx1) {$ctx1.fill(self,"packageDictionary",{},$globals.SmalltalkImage)});
  3328. //>>excludeEnd("ctx");
  3329. },
  3330. //>>excludeStart("ide", pragmas.excludeIdeData);
  3331. args: [],
  3332. source: "packageDictionary\x0a\x09^ packageDictionary ifNil: [ packageDictionary := Dictionary new ]",
  3333. referencedClasses: ["Dictionary"],
  3334. //>>excludeEnd("ide");
  3335. messageSends: ["ifNil:", "new"]
  3336. }),
  3337. $globals.SmalltalkImage);
  3338. $core.addMethod(
  3339. $core.method({
  3340. selector: "packages",
  3341. protocol: "packages",
  3342. fn: function (){
  3343. var self=this,$self=this;
  3344. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3345. return $core.withContext(function($ctx1) {
  3346. //>>excludeEnd("ctx");
  3347. return $recv($recv($self._packageDictionary())._values())._copy();
  3348. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3349. }, function($ctx1) {$ctx1.fill(self,"packages",{},$globals.SmalltalkImage)});
  3350. //>>excludeEnd("ctx");
  3351. },
  3352. //>>excludeStart("ide", pragmas.excludeIdeData);
  3353. args: [],
  3354. source: "packages\x0a\x09\x22Return all Package instances in the system.\x22\x0a\x0a\x09^ self packageDictionary values copy",
  3355. referencedClasses: [],
  3356. //>>excludeEnd("ide");
  3357. messageSends: ["copy", "values", "packageDictionary"]
  3358. }),
  3359. $globals.SmalltalkImage);
  3360. $core.addMethod(
  3361. $core.method({
  3362. selector: "parse:",
  3363. protocol: "accessing",
  3364. fn: function (aString){
  3365. var self=this,$self=this;
  3366. var result;
  3367. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3368. return $core.withContext(function($ctx1) {
  3369. //>>excludeEnd("ctx");
  3370. var $1;
  3371. $recv((function(){
  3372. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3373. return $core.withContext(function($ctx2) {
  3374. //>>excludeEnd("ctx");
  3375. result=$self._basicParse_(aString);
  3376. return result;
  3377. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3378. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  3379. //>>excludeEnd("ctx");
  3380. }))._tryCatch_((function(ex){
  3381. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3382. return $core.withContext(function($ctx2) {
  3383. //>>excludeEnd("ctx");
  3384. return $recv($self._parseError_parsing_(ex,aString))._signal();
  3385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3386. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1,2)});
  3387. //>>excludeEnd("ctx");
  3388. }));
  3389. $1=result;
  3390. $recv($1)._source_(aString);
  3391. return $recv($1)._yourself();
  3392. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3393. }, function($ctx1) {$ctx1.fill(self,"parse:",{aString:aString,result:result},$globals.SmalltalkImage)});
  3394. //>>excludeEnd("ctx");
  3395. },
  3396. //>>excludeStart("ide", pragmas.excludeIdeData);
  3397. args: ["aString"],
  3398. 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",
  3399. referencedClasses: [],
  3400. //>>excludeEnd("ide");
  3401. messageSends: ["tryCatch:", "basicParse:", "signal", "parseError:parsing:", "source:", "yourself"]
  3402. }),
  3403. $globals.SmalltalkImage);
  3404. $core.addMethod(
  3405. $core.method({
  3406. selector: "parseError:parsing:",
  3407. protocol: "error handling",
  3408. fn: function (anException,aString){
  3409. var self=this,$self=this;
  3410. var pos;
  3411. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3412. return $core.withContext(function($ctx1) {
  3413. //>>excludeEnd("ctx");
  3414. var $1,$2,$6,$5,$4,$3;
  3415. $1=$recv(anException)._basicAt_("location");
  3416. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3417. $ctx1.sendIdx["basicAt:"]=1;
  3418. //>>excludeEnd("ctx");
  3419. pos=$recv($1)._start();
  3420. $2=$recv($globals.ParseError)._new();
  3421. $6=$recv("Parse error on line ".__comma($recv(pos)._line())).__comma(" column ");
  3422. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3423. $ctx1.sendIdx[","]=4;
  3424. //>>excludeEnd("ctx");
  3425. $5=$recv($6).__comma($recv(pos)._column());
  3426. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3427. $ctx1.sendIdx[","]=3;
  3428. //>>excludeEnd("ctx");
  3429. $4=$recv($5).__comma(" : Unexpected character ");
  3430. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3431. $ctx1.sendIdx[","]=2;
  3432. //>>excludeEnd("ctx");
  3433. $3=$recv($4).__comma($recv(anException)._basicAt_("found"));
  3434. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3435. $ctx1.sendIdx[","]=1;
  3436. //>>excludeEnd("ctx");
  3437. return $recv($2)._messageText_($3);
  3438. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3439. }, function($ctx1) {$ctx1.fill(self,"parseError:parsing:",{anException:anException,aString:aString,pos:pos},$globals.SmalltalkImage)});
  3440. //>>excludeEnd("ctx");
  3441. },
  3442. //>>excludeStart("ide", pragmas.excludeIdeData);
  3443. args: ["anException", "aString"],
  3444. source: "parseError: anException parsing: aString\x0a\x09| pos |\x0a\x09pos := (anException basicAt: 'location') start.\x0a\x09^ ParseError new messageText: 'Parse error on line ', pos line ,' column ' , pos column ,' : Unexpected character ', (anException basicAt: 'found')",
  3445. referencedClasses: ["ParseError"],
  3446. //>>excludeEnd("ide");
  3447. messageSends: ["start", "basicAt:", "messageText:", "new", ",", "line", "column"]
  3448. }),
  3449. $globals.SmalltalkImage);
  3450. $core.addMethod(
  3451. $core.method({
  3452. selector: "pseudoVariableNames",
  3453. protocol: "accessing",
  3454. fn: function (){
  3455. var self=this,$self=this;
  3456. return ["self", "super", "nil", "true", "false", "thisContext"];
  3457. },
  3458. //>>excludeStart("ide", pragmas.excludeIdeData);
  3459. args: [],
  3460. source: "pseudoVariableNames\x0a\x09^ #('self' 'super' 'nil' 'true' 'false' 'thisContext')",
  3461. referencedClasses: [],
  3462. //>>excludeEnd("ide");
  3463. messageSends: []
  3464. }),
  3465. $globals.SmalltalkImage);
  3466. $core.addMethod(
  3467. $core.method({
  3468. selector: "readJSObject:",
  3469. protocol: "accessing",
  3470. fn: function (anObject){
  3471. var self=this,$self=this;
  3472. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3473. return $core.withContext(function($ctx1) {
  3474. //>>excludeEnd("ctx");
  3475. return $core.readJSObject(anObject);
  3476. return self;
  3477. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3478. }, function($ctx1) {$ctx1.fill(self,"readJSObject:",{anObject:anObject},$globals.SmalltalkImage)});
  3479. //>>excludeEnd("ctx");
  3480. },
  3481. //>>excludeStart("ide", pragmas.excludeIdeData);
  3482. args: ["anObject"],
  3483. source: "readJSObject: anObject\x0a\x09<inlineJS: 'return $core.readJSObject(anObject)'>",
  3484. referencedClasses: [],
  3485. //>>excludeEnd("ide");
  3486. messageSends: []
  3487. }),
  3488. $globals.SmalltalkImage);
  3489. $core.addMethod(
  3490. $core.method({
  3491. selector: "removeClass:",
  3492. protocol: "classes",
  3493. fn: function (aClass){
  3494. var self=this,$self=this;
  3495. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3496. return $core.withContext(function($ctx1) {
  3497. //>>excludeEnd("ctx");
  3498. var $1,$2,$5,$4,$6,$3,$7,$8,$10,$9,$receiver;
  3499. $1=$recv(aClass)._isMetaclass();
  3500. if($core.assert($1)){
  3501. $2=$recv($recv(aClass)._asString()).__comma(" is a Metaclass and cannot be removed!");
  3502. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3503. $ctx1.sendIdx[","]=1;
  3504. //>>excludeEnd("ctx");
  3505. $self._error_($2);
  3506. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3507. $ctx1.sendIdx["error:"]=1;
  3508. //>>excludeEnd("ctx");
  3509. }
  3510. $recv(aClass)._allSubclassesDo_((function(subclass){
  3511. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3512. return $core.withContext(function($ctx2) {
  3513. //>>excludeEnd("ctx");
  3514. $5=$recv(aClass)._name();
  3515. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3516. $ctx2.sendIdx["name"]=1;
  3517. //>>excludeEnd("ctx");
  3518. $4=$recv($5).__comma(" has a subclass: ");
  3519. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3520. $ctx2.sendIdx[","]=3;
  3521. //>>excludeEnd("ctx");
  3522. $6=$recv(subclass)._name();
  3523. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3524. $ctx2.sendIdx["name"]=2;
  3525. //>>excludeEnd("ctx");
  3526. $3=$recv($4).__comma($6);
  3527. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3528. $ctx2.sendIdx[","]=2;
  3529. //>>excludeEnd("ctx");
  3530. return $self._error_($3);
  3531. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3532. $ctx2.sendIdx["error:"]=2;
  3533. //>>excludeEnd("ctx");
  3534. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3535. }, function($ctx2) {$ctx2.fillBlock({subclass:subclass},$ctx1,2)});
  3536. //>>excludeEnd("ctx");
  3537. }));
  3538. $recv($recv(aClass)._traitUsers())._ifNotEmpty_((function(){
  3539. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3540. return $core.withContext(function($ctx2) {
  3541. //>>excludeEnd("ctx");
  3542. return $self._error_($recv($recv(aClass)._name()).__comma(" has trait users."));
  3543. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3544. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  3545. //>>excludeEnd("ctx");
  3546. }));
  3547. $self._deleteClass_(aClass);
  3548. $recv(aClass)._setTraitComposition_([]);
  3549. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3550. $ctx1.sendIdx["setTraitComposition:"]=1;
  3551. //>>excludeEnd("ctx");
  3552. $7=$recv(aClass)._theMetaClass();
  3553. if(($receiver = $7) == null || $receiver.a$nil){
  3554. $7;
  3555. } else {
  3556. var meta;
  3557. meta=$receiver;
  3558. $recv(meta)._setTraitComposition_([]);
  3559. }
  3560. $8=$recv($globals.SystemAnnouncer)._current();
  3561. $10=$recv($globals.ClassRemoved)._new();
  3562. $recv($10)._theClass_(aClass);
  3563. $9=$recv($10)._yourself();
  3564. $recv($8)._announce_($9);
  3565. return self;
  3566. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3567. }, function($ctx1) {$ctx1.fill(self,"removeClass:",{aClass:aClass},$globals.SmalltalkImage)});
  3568. //>>excludeEnd("ctx");
  3569. },
  3570. //>>excludeStart("ide", pragmas.excludeIdeData);
  3571. args: ["aClass"],
  3572. source: "removeClass: aClass\x0a\x09aClass isMetaclass ifTrue: [ self error: aClass asString, ' is a Metaclass and cannot be removed!' ].\x0a\x09aClass allSubclassesDo: [ :subclass | self error: aClass name, ' has a subclass: ', subclass name ].\x0a\x09aClass traitUsers ifNotEmpty: [ self error: aClass name, ' has trait users.' ].\x0a\x09\x0a\x09self deleteClass: aClass.\x0a\x09aClass setTraitComposition: #().\x0a\x09aClass theMetaClass ifNotNil: [ :meta | meta setTraitComposition: #() ].\x0a\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (ClassRemoved new\x0a\x09\x09\x09theClass: aClass;\x0a\x09\x09\x09yourself)",
  3573. referencedClasses: ["SystemAnnouncer", "ClassRemoved"],
  3574. //>>excludeEnd("ide");
  3575. messageSends: ["ifTrue:", "isMetaclass", "error:", ",", "asString", "allSubclassesDo:", "name", "ifNotEmpty:", "traitUsers", "deleteClass:", "setTraitComposition:", "ifNotNil:", "theMetaClass", "announce:", "current", "theClass:", "new", "yourself"]
  3576. }),
  3577. $globals.SmalltalkImage);
  3578. $core.addMethod(
  3579. $core.method({
  3580. selector: "removePackage:",
  3581. protocol: "packages",
  3582. fn: function (packageName){
  3583. var self=this,$self=this;
  3584. var pkg;
  3585. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3586. return $core.withContext(function($ctx1) {
  3587. //>>excludeEnd("ctx");
  3588. pkg=$self._packageAt_ifAbsent_(packageName,(function(){
  3589. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3590. return $core.withContext(function($ctx2) {
  3591. //>>excludeEnd("ctx");
  3592. return $self._error_("Missing package: ".__comma(packageName));
  3593. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3594. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  3595. //>>excludeEnd("ctx");
  3596. }));
  3597. $recv($recv(pkg)._classes())._do_((function(each){
  3598. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3599. return $core.withContext(function($ctx2) {
  3600. //>>excludeEnd("ctx");
  3601. return $self._removeClass_(each);
  3602. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3603. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  3604. //>>excludeEnd("ctx");
  3605. }));
  3606. $recv($self._packageDictionary())._removeKey_(packageName);
  3607. return self;
  3608. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3609. }, function($ctx1) {$ctx1.fill(self,"removePackage:",{packageName:packageName,pkg:pkg},$globals.SmalltalkImage)});
  3610. //>>excludeEnd("ctx");
  3611. },
  3612. //>>excludeStart("ide", pragmas.excludeIdeData);
  3613. args: ["packageName"],
  3614. 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 packageDictionary removeKey: packageName",
  3615. referencedClasses: [],
  3616. //>>excludeEnd("ide");
  3617. messageSends: ["packageAt:ifAbsent:", "error:", ",", "do:", "classes", "removeClass:", "removeKey:", "packageDictionary"]
  3618. }),
  3619. $globals.SmalltalkImage);
  3620. $core.addMethod(
  3621. $core.method({
  3622. selector: "renamePackage:to:",
  3623. protocol: "packages",
  3624. fn: function (packageName,newName){
  3625. var self=this,$self=this;
  3626. var pkg;
  3627. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3628. return $core.withContext(function($ctx1) {
  3629. //>>excludeEnd("ctx");
  3630. var $1,$2,$3;
  3631. pkg=$self._packageAt_ifAbsent_(packageName,(function(){
  3632. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3633. return $core.withContext(function($ctx2) {
  3634. //>>excludeEnd("ctx");
  3635. $1="Missing package: ".__comma(packageName);
  3636. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3637. $ctx2.sendIdx[","]=1;
  3638. //>>excludeEnd("ctx");
  3639. return $self._error_($1);
  3640. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3641. $ctx2.sendIdx["error:"]=1;
  3642. //>>excludeEnd("ctx");
  3643. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3644. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  3645. //>>excludeEnd("ctx");
  3646. }));
  3647. $self._packageAt_ifPresent_(newName,(function(){
  3648. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3649. return $core.withContext(function($ctx2) {
  3650. //>>excludeEnd("ctx");
  3651. return $self._error_("Already exists a package called: ".__comma(newName));
  3652. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3653. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  3654. //>>excludeEnd("ctx");
  3655. }));
  3656. $2=pkg;
  3657. $recv($2)._name_(newName);
  3658. $recv($2)._beDirty();
  3659. $3=$self._packageDictionary();
  3660. $recv($3)._at_put_(newName,pkg);
  3661. $recv($3)._removeKey_(packageName);
  3662. return self;
  3663. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3664. }, function($ctx1) {$ctx1.fill(self,"renamePackage:to:",{packageName:packageName,newName:newName,pkg:pkg},$globals.SmalltalkImage)});
  3665. //>>excludeEnd("ctx");
  3666. },
  3667. //>>excludeStart("ide", pragmas.excludeIdeData);
  3668. args: ["packageName", "newName"],
  3669. 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\x09self packageAt: newName ifPresent: [ self error: 'Already exists a package called: ', newName ].\x0a\x09pkg name: newName; beDirty.\x0a\x09self packageDictionary\x0a\x09\x09at: newName put: pkg;\x0a\x09\x09removeKey: packageName",
  3670. referencedClasses: [],
  3671. //>>excludeEnd("ide");
  3672. messageSends: ["packageAt:ifAbsent:", "error:", ",", "packageAt:ifPresent:", "name:", "beDirty", "at:put:", "packageDictionary", "removeKey:"]
  3673. }),
  3674. $globals.SmalltalkImage);
  3675. $core.addMethod(
  3676. $core.method({
  3677. selector: "reservedWords",
  3678. protocol: "accessing",
  3679. fn: function (){
  3680. var self=this,$self=this;
  3681. return ["break", "case", "catch", "class", "const", "continue", "debugger", "default", "delete", "do", "else", "export", "extends", "finally", "for", "function", "if", "import", "in", "instanceof", "new", "return", "super", "switch", "this", "throw", "try", "typeof", "var", "void", "while", "with", "yield", "let", "static", "arguments", "await", "enum", "implements", "interface", "package", "private", "protected", "public"];
  3682. },
  3683. //>>excludeStart("ide", pragmas.excludeIdeData);
  3684. args: [],
  3685. source: "reservedWords\x0a\x09^ #(\x0a\x09\x09\x22http://www.ecma-international.org/ecma-262/6.0/#sec-keywords\x22\x0a\x09\x09break case catch class const continue debugger\x0a\x09\x09default delete do else export extends finally\x0a\x09\x09for function if import in instanceof new\x0a\x09\x09return super switch this throw try typeof\x0a\x09\x09var void while with yield\x0a\x09\x09\x22in strict mode\x22\x0a\x09\x09let static\x0a\x09\x09\x22Amber protected words: these should not be compiled as-is when in code\x22\x0a\x09\x09arguments\x0a\x09\x09\x22http://www.ecma-international.org/ecma-262/6.0/#sec-future-reserved-words\x22\x0a\x09\x09await enum\x0a\x09\x09\x22in strict mode\x22\x0a\x09\x09implements interface package private protected public\x0a\x09)",
  3686. referencedClasses: [],
  3687. //>>excludeEnd("ide");
  3688. messageSends: []
  3689. }),
  3690. $globals.SmalltalkImage);
  3691. $core.addMethod(
  3692. $core.method({
  3693. selector: "settings",
  3694. protocol: "accessing",
  3695. fn: function (){
  3696. var self=this,$self=this;
  3697. return $globals.SmalltalkSettings;
  3698. },
  3699. //>>excludeStart("ide", pragmas.excludeIdeData);
  3700. args: [],
  3701. source: "settings\x0a\x09^ SmalltalkSettings",
  3702. referencedClasses: ["SmalltalkSettings"],
  3703. //>>excludeEnd("ide");
  3704. messageSends: []
  3705. }),
  3706. $globals.SmalltalkImage);
  3707. $core.addMethod(
  3708. $core.method({
  3709. selector: "version",
  3710. protocol: "accessing",
  3711. fn: function (){
  3712. var self=this,$self=this;
  3713. return "0.21.0-pre";
  3714. },
  3715. //>>excludeStart("ide", pragmas.excludeIdeData);
  3716. args: [],
  3717. source: "version\x0a\x09\x22Answer the version string of Amber\x22\x0a\x09\x0a\x09^ '0.21.0-pre'",
  3718. referencedClasses: [],
  3719. //>>excludeEnd("ide");
  3720. messageSends: []
  3721. }),
  3722. $globals.SmalltalkImage);
  3723. $globals.SmalltalkImage.a$cls.iVarNames = ["current"];
  3724. $core.addMethod(
  3725. $core.method({
  3726. selector: "current",
  3727. protocol: "instance creation",
  3728. fn: function (){
  3729. var self=this,$self=this;
  3730. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3731. return $core.withContext(function($ctx1) {
  3732. //>>excludeEnd("ctx");
  3733. var $1,$receiver;
  3734. $1=$self["@current"];
  3735. if(($receiver = $1) == null || $receiver.a$nil){
  3736. $self["@current"]=(
  3737. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3738. $ctx1.supercall = true,
  3739. //>>excludeEnd("ctx");
  3740. ($globals.SmalltalkImage.a$cls.superclass||$boot.nilAsClass).fn.prototype._new.apply($self, []));
  3741. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3742. $ctx1.supercall = false;
  3743. //>>excludeEnd("ctx");;
  3744. return $self["@current"];
  3745. } else {
  3746. $self._deprecatedAPI();
  3747. return $self["@current"];
  3748. }
  3749. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3750. }, function($ctx1) {$ctx1.fill(self,"current",{},$globals.SmalltalkImage.a$cls)});
  3751. //>>excludeEnd("ctx");
  3752. },
  3753. //>>excludeStart("ide", pragmas.excludeIdeData);
  3754. args: [],
  3755. source: "current\x0a\x09^ current ifNil: [ current := super new ] ifNotNil: [ self deprecatedAPI. current ]",
  3756. referencedClasses: [],
  3757. //>>excludeEnd("ide");
  3758. messageSends: ["ifNil:ifNotNil:", "new", "deprecatedAPI"]
  3759. }),
  3760. $globals.SmalltalkImage.a$cls);
  3761. $core.addMethod(
  3762. $core.method({
  3763. selector: "initialize",
  3764. protocol: "initialization",
  3765. fn: function (){
  3766. var self=this,$self=this;
  3767. var st;
  3768. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3769. return $core.withContext(function($ctx1) {
  3770. //>>excludeEnd("ctx");
  3771. st=$self._current();
  3772. $recv($recv(st)._globals())._at_put_("Smalltalk",st);
  3773. return self;
  3774. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3775. }, function($ctx1) {$ctx1.fill(self,"initialize",{st:st},$globals.SmalltalkImage.a$cls)});
  3776. //>>excludeEnd("ctx");
  3777. },
  3778. //>>excludeStart("ide", pragmas.excludeIdeData);
  3779. args: [],
  3780. source: "initialize\x0a\x09| st |\x0a\x09st := self current.\x0a\x09st globals at: 'Smalltalk' put: st",
  3781. referencedClasses: [],
  3782. //>>excludeEnd("ide");
  3783. messageSends: ["current", "at:put:", "globals"]
  3784. }),
  3785. $globals.SmalltalkImage.a$cls);
  3786. $core.addMethod(
  3787. $core.method({
  3788. selector: "new",
  3789. protocol: "instance creation",
  3790. fn: function (){
  3791. var self=this,$self=this;
  3792. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3793. return $core.withContext(function($ctx1) {
  3794. //>>excludeEnd("ctx");
  3795. $self._shouldNotImplement();
  3796. return self;
  3797. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3798. }, function($ctx1) {$ctx1.fill(self,"new",{},$globals.SmalltalkImage.a$cls)});
  3799. //>>excludeEnd("ctx");
  3800. },
  3801. //>>excludeStart("ide", pragmas.excludeIdeData);
  3802. args: [],
  3803. source: "new\x0a\x09self shouldNotImplement",
  3804. referencedClasses: [],
  3805. //>>excludeEnd("ide");
  3806. messageSends: ["shouldNotImplement"]
  3807. }),
  3808. $globals.SmalltalkImage.a$cls);
  3809. $core.setTraitComposition([{trait: $globals.TThenable}], $globals.JSObjectProxy);
  3810. $core.addMethod(
  3811. $core.method({
  3812. selector: "nextPutJSObject:",
  3813. protocol: "*Kernel-Infrastructure",
  3814. fn: function (aJSObject){
  3815. var self=this,$self=this;
  3816. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3817. return $core.withContext(function($ctx1) {
  3818. //>>excludeEnd("ctx");
  3819. $self._nextPut_(aJSObject);
  3820. return self;
  3821. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3822. }, function($ctx1) {$ctx1.fill(self,"nextPutJSObject:",{aJSObject:aJSObject},$globals.ProtoStream)});
  3823. //>>excludeEnd("ctx");
  3824. },
  3825. //>>excludeStart("ide", pragmas.excludeIdeData);
  3826. args: ["aJSObject"],
  3827. source: "nextPutJSObject: aJSObject\x0a\x09self nextPut: aJSObject",
  3828. referencedClasses: [],
  3829. //>>excludeEnd("ide");
  3830. messageSends: ["nextPut:"]
  3831. }),
  3832. $globals.ProtoStream);
  3833. $core.addMethod(
  3834. $core.method({
  3835. selector: "asJavaScriptPropertyName",
  3836. protocol: "*Kernel-Infrastructure",
  3837. fn: function (){
  3838. var self=this,$self=this;
  3839. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3840. return $core.withContext(function($ctx1) {
  3841. //>>excludeEnd("ctx");
  3842. return $core.st2prop(self);
  3843. return self;
  3844. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3845. }, function($ctx1) {$ctx1.fill(self,"asJavaScriptPropertyName",{},$globals.String)});
  3846. //>>excludeEnd("ctx");
  3847. },
  3848. //>>excludeStart("ide", pragmas.excludeIdeData);
  3849. args: [],
  3850. source: "asJavaScriptPropertyName\x0a<inlineJS: 'return $core.st2prop(self)'>",
  3851. referencedClasses: [],
  3852. //>>excludeEnd("ide");
  3853. messageSends: []
  3854. }),
  3855. $globals.String);
  3856. $core.addMethod(
  3857. $core.method({
  3858. selector: "asSetting",
  3859. protocol: "*Kernel-Infrastructure",
  3860. fn: function (){
  3861. var self=this,$self=this;
  3862. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3863. return $core.withContext(function($ctx1) {
  3864. //>>excludeEnd("ctx");
  3865. return $recv($globals.Setting)._at_ifAbsent_(self,nil);
  3866. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3867. }, function($ctx1) {$ctx1.fill(self,"asSetting",{},$globals.String)});
  3868. //>>excludeEnd("ctx");
  3869. },
  3870. //>>excludeStart("ide", pragmas.excludeIdeData);
  3871. args: [],
  3872. source: "asSetting\x0a\x09\x22Answer aSetting dedicated to locally store a value using this string as key.\x0a\x09Nil will be the default value.\x22\x0a\x09^ Setting at: self ifAbsent: nil",
  3873. referencedClasses: ["Setting"],
  3874. //>>excludeEnd("ide");
  3875. messageSends: ["at:ifAbsent:"]
  3876. }),
  3877. $globals.String);
  3878. $core.addMethod(
  3879. $core.method({
  3880. selector: "asSettingIfAbsent:",
  3881. protocol: "*Kernel-Infrastructure",
  3882. fn: function (aDefaultValue){
  3883. var self=this,$self=this;
  3884. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3885. return $core.withContext(function($ctx1) {
  3886. //>>excludeEnd("ctx");
  3887. return $recv($globals.Setting)._at_ifAbsent_(self,aDefaultValue);
  3888. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3889. }, function($ctx1) {$ctx1.fill(self,"asSettingIfAbsent:",{aDefaultValue:aDefaultValue},$globals.String)});
  3890. //>>excludeEnd("ctx");
  3891. },
  3892. //>>excludeStart("ide", pragmas.excludeIdeData);
  3893. args: ["aDefaultValue"],
  3894. source: "asSettingIfAbsent: aDefaultValue\x0a\x09\x22Answer aSetting dedicated to locally store a value using this string as key.\x0a\x09Make this setting to have aDefaultValue.\x22\x0a\x09^ Setting at: self ifAbsent: aDefaultValue",
  3895. referencedClasses: ["Setting"],
  3896. //>>excludeEnd("ide");
  3897. messageSends: ["at:ifAbsent:"]
  3898. }),
  3899. $globals.String);
  3900. $core.addMethod(
  3901. $core.method({
  3902. selector: "settingValue",
  3903. protocol: "*Kernel-Infrastructure",
  3904. fn: function (){
  3905. var self=this,$self=this;
  3906. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3907. return $core.withContext(function($ctx1) {
  3908. //>>excludeEnd("ctx");
  3909. return $recv($self._asSetting())._value();
  3910. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3911. }, function($ctx1) {$ctx1.fill(self,"settingValue",{},$globals.String)});
  3912. //>>excludeEnd("ctx");
  3913. },
  3914. //>>excludeStart("ide", pragmas.excludeIdeData);
  3915. args: [],
  3916. source: "settingValue\x0a\x09^ self asSetting value",
  3917. referencedClasses: [],
  3918. //>>excludeEnd("ide");
  3919. messageSends: ["value", "asSetting"]
  3920. }),
  3921. $globals.String);
  3922. $core.addMethod(
  3923. $core.method({
  3924. selector: "settingValue:",
  3925. protocol: "*Kernel-Infrastructure",
  3926. fn: function (aValue){
  3927. var self=this,$self=this;
  3928. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3929. return $core.withContext(function($ctx1) {
  3930. //>>excludeEnd("ctx");
  3931. return $recv($self._asSetting())._value_(aValue);
  3932. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3933. }, function($ctx1) {$ctx1.fill(self,"settingValue:",{aValue:aValue},$globals.String)});
  3934. //>>excludeEnd("ctx");
  3935. },
  3936. //>>excludeStart("ide", pragmas.excludeIdeData);
  3937. args: ["aValue"],
  3938. source: "settingValue: aValue\x0a\x09\x22Sets the value of the setting that will be locally stored using this string as key.\x0a\x09Note that aValue can be any object that can be stringifyed\x22\x0a\x09^ self asSetting value: aValue",
  3939. referencedClasses: [],
  3940. //>>excludeEnd("ide");
  3941. messageSends: ["value:", "asSetting"]
  3942. }),
  3943. $globals.String);
  3944. $core.addMethod(
  3945. $core.method({
  3946. selector: "settingValueIfAbsent:",
  3947. protocol: "*Kernel-Infrastructure",
  3948. fn: function (aDefaultValue){
  3949. var self=this,$self=this;
  3950. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3951. return $core.withContext(function($ctx1) {
  3952. //>>excludeEnd("ctx");
  3953. return $recv($self._asSettingIfAbsent_(aDefaultValue))._value();
  3954. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3955. }, function($ctx1) {$ctx1.fill(self,"settingValueIfAbsent:",{aDefaultValue:aDefaultValue},$globals.String)});
  3956. //>>excludeEnd("ctx");
  3957. },
  3958. //>>excludeStart("ide", pragmas.excludeIdeData);
  3959. args: ["aDefaultValue"],
  3960. source: "settingValueIfAbsent: aDefaultValue\x0a\x09\x22Answer the value of the locally stored setting using this string as key.\x0a\x09Use aDefaultValue in case no setting is found\x22\x0a\x09^ (self asSettingIfAbsent: aDefaultValue) value",
  3961. referencedClasses: [],
  3962. //>>excludeEnd("ide");
  3963. messageSends: ["value", "asSettingIfAbsent:"]
  3964. }),
  3965. $globals.String);
  3966. });