Kernel-Infrastructure.js 126 KB

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