Kernel-Infrastructure.js 146 KB

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