1
0

Platform-Services.js 80 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275
  1. define(["amber/boot", "amber_core/Kernel-Collections", "amber_core/Kernel-Infrastructure", "amber_core/Kernel-Methods", "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("Platform-Services");
  6. $core.packages["Platform-Services"].innerEval = function (expr) { return eval(expr); };
  7. $core.packages["Platform-Services"].transport = {"type":"amd","amdNamespace":"amber_core"};
  8. $core.addClass("ConsoleErrorHandler", $globals.Object, [], "Platform-Services");
  9. //>>excludeStart("ide", pragmas.excludeIdeData);
  10. $globals.ConsoleErrorHandler.comment="I am manage Smalltalk errors, displaying the stack in the console.";
  11. //>>excludeEnd("ide");
  12. $core.addMethod(
  13. $core.method({
  14. selector: "handleError:",
  15. protocol: "error handling",
  16. fn: function (anError){
  17. var self=this;
  18. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  19. return $core.withContext(function($ctx1) {
  20. //>>excludeEnd("ctx");
  21. var $1,$receiver;
  22. $1=$recv(anError)._context();
  23. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  24. $ctx1.sendIdx["context"]=1;
  25. //>>excludeEnd("ctx");
  26. if(($receiver = $1) == null || $receiver.isNil){
  27. $1;
  28. } else {
  29. self._logErrorContext_($recv(anError)._context());
  30. }
  31. self._logError_(anError);
  32. return self;
  33. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  34. }, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},$globals.ConsoleErrorHandler)});
  35. //>>excludeEnd("ctx");
  36. },
  37. //>>excludeStart("ide", pragmas.excludeIdeData);
  38. args: ["anError"],
  39. source: "handleError: anError\x0a\x09anError context ifNotNil: [ self logErrorContext: anError context ].\x0a\x09self logError: anError",
  40. referencedClasses: [],
  41. //>>excludeEnd("ide");
  42. messageSends: ["ifNotNil:", "context", "logErrorContext:", "logError:"]
  43. }),
  44. $globals.ConsoleErrorHandler);
  45. $core.addMethod(
  46. $core.method({
  47. selector: "log:",
  48. protocol: "private",
  49. fn: function (aString){
  50. var self=this;
  51. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  52. return $core.withContext(function($ctx1) {
  53. //>>excludeEnd("ctx");
  54. $recv(console)._log_(aString);
  55. return self;
  56. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  57. }, function($ctx1) {$ctx1.fill(self,"log:",{aString:aString},$globals.ConsoleErrorHandler)});
  58. //>>excludeEnd("ctx");
  59. },
  60. //>>excludeStart("ide", pragmas.excludeIdeData);
  61. args: ["aString"],
  62. source: "log: aString\x0a\x09console log: aString",
  63. referencedClasses: [],
  64. //>>excludeEnd("ide");
  65. messageSends: ["log:"]
  66. }),
  67. $globals.ConsoleErrorHandler);
  68. $core.addMethod(
  69. $core.method({
  70. selector: "logContext:",
  71. protocol: "private",
  72. fn: function (aContext){
  73. var self=this;
  74. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  75. return $core.withContext(function($ctx1) {
  76. //>>excludeEnd("ctx");
  77. var $1,$receiver;
  78. $1=$recv(aContext)._home();
  79. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  80. $ctx1.sendIdx["home"]=1;
  81. //>>excludeEnd("ctx");
  82. if(($receiver = $1) == null || $receiver.isNil){
  83. $1;
  84. } else {
  85. self._logContext_($recv(aContext)._home());
  86. }
  87. self._log_($recv(aContext)._asString());
  88. return self;
  89. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  90. }, function($ctx1) {$ctx1.fill(self,"logContext:",{aContext:aContext},$globals.ConsoleErrorHandler)});
  91. //>>excludeEnd("ctx");
  92. },
  93. //>>excludeStart("ide", pragmas.excludeIdeData);
  94. args: ["aContext"],
  95. source: "logContext: aContext\x0a\x09aContext home ifNotNil: [\x0a\x09\x09self logContext: aContext home ].\x0a\x09self log: aContext asString",
  96. referencedClasses: [],
  97. //>>excludeEnd("ide");
  98. messageSends: ["ifNotNil:", "home", "logContext:", "log:", "asString"]
  99. }),
  100. $globals.ConsoleErrorHandler);
  101. $core.addMethod(
  102. $core.method({
  103. selector: "logError:",
  104. protocol: "private",
  105. fn: function (anError){
  106. var self=this;
  107. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  108. return $core.withContext(function($ctx1) {
  109. //>>excludeEnd("ctx");
  110. self._log_($recv(anError)._messageText());
  111. return self;
  112. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  113. }, function($ctx1) {$ctx1.fill(self,"logError:",{anError:anError},$globals.ConsoleErrorHandler)});
  114. //>>excludeEnd("ctx");
  115. },
  116. //>>excludeStart("ide", pragmas.excludeIdeData);
  117. args: ["anError"],
  118. source: "logError: anError\x0a\x09self log: anError messageText",
  119. referencedClasses: [],
  120. //>>excludeEnd("ide");
  121. messageSends: ["log:", "messageText"]
  122. }),
  123. $globals.ConsoleErrorHandler);
  124. $core.addMethod(
  125. $core.method({
  126. selector: "logErrorContext:",
  127. protocol: "private",
  128. fn: function (aContext){
  129. var self=this;
  130. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  131. return $core.withContext(function($ctx1) {
  132. //>>excludeEnd("ctx");
  133. var $1,$receiver;
  134. if(($receiver = aContext) == null || $receiver.isNil){
  135. aContext;
  136. } else {
  137. $1=$recv(aContext)._home();
  138. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  139. $ctx1.sendIdx["home"]=1;
  140. //>>excludeEnd("ctx");
  141. if(($receiver = $1) == null || $receiver.isNil){
  142. $1;
  143. } else {
  144. self._logContext_($recv(aContext)._home());
  145. }
  146. }
  147. return self;
  148. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  149. }, function($ctx1) {$ctx1.fill(self,"logErrorContext:",{aContext:aContext},$globals.ConsoleErrorHandler)});
  150. //>>excludeEnd("ctx");
  151. },
  152. //>>excludeStart("ide", pragmas.excludeIdeData);
  153. args: ["aContext"],
  154. source: "logErrorContext: aContext\x0a\x09aContext ifNotNil: [\x0a\x09\x09aContext home ifNotNil: [\x0a\x09\x09\x09self logContext: aContext home ]]",
  155. referencedClasses: [],
  156. //>>excludeEnd("ide");
  157. messageSends: ["ifNotNil:", "home", "logContext:"]
  158. }),
  159. $globals.ConsoleErrorHandler);
  160. $globals.ConsoleErrorHandler.klass.iVarNames = ["current"];
  161. $core.addMethod(
  162. $core.method({
  163. selector: "initialize",
  164. protocol: "initialization",
  165. fn: function (){
  166. var self=this;
  167. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  168. return $core.withContext(function($ctx1) {
  169. //>>excludeEnd("ctx");
  170. $recv($globals.ErrorHandler)._registerIfNone_(self._new());
  171. return self;
  172. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  173. }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.ConsoleErrorHandler.klass)});
  174. //>>excludeEnd("ctx");
  175. },
  176. //>>excludeStart("ide", pragmas.excludeIdeData);
  177. args: [],
  178. source: "initialize\x0a\x09ErrorHandler registerIfNone: self new",
  179. referencedClasses: ["ErrorHandler"],
  180. //>>excludeEnd("ide");
  181. messageSends: ["registerIfNone:", "new"]
  182. }),
  183. $globals.ConsoleErrorHandler.klass);
  184. $core.addClass("ConsoleTranscript", $globals.Object, ["textarea"], "Platform-Services");
  185. //>>excludeStart("ide", pragmas.excludeIdeData);
  186. $globals.ConsoleTranscript.comment="I am a specific transcript emitting to the JavaScript console.\x0a\x0aIf no other transcript is registered, I am the default.";
  187. //>>excludeEnd("ide");
  188. $core.addMethod(
  189. $core.method({
  190. selector: "clear",
  191. protocol: "printing",
  192. fn: function (){
  193. var self=this;
  194. return self;
  195. },
  196. //>>excludeStart("ide", pragmas.excludeIdeData);
  197. args: [],
  198. source: "clear\x0a\x09\x22no op\x22",
  199. referencedClasses: [],
  200. //>>excludeEnd("ide");
  201. messageSends: []
  202. }),
  203. $globals.ConsoleTranscript);
  204. $core.addMethod(
  205. $core.method({
  206. selector: "cr",
  207. protocol: "printing",
  208. fn: function (){
  209. var self=this;
  210. return self;
  211. },
  212. //>>excludeStart("ide", pragmas.excludeIdeData);
  213. args: [],
  214. source: "cr\x0a\x09\x22no op\x22",
  215. referencedClasses: [],
  216. //>>excludeEnd("ide");
  217. messageSends: []
  218. }),
  219. $globals.ConsoleTranscript);
  220. $core.addMethod(
  221. $core.method({
  222. selector: "open",
  223. protocol: "actions",
  224. fn: function (){
  225. var self=this;
  226. return self;
  227. },
  228. //>>excludeStart("ide", pragmas.excludeIdeData);
  229. args: [],
  230. source: "open",
  231. referencedClasses: [],
  232. //>>excludeEnd("ide");
  233. messageSends: []
  234. }),
  235. $globals.ConsoleTranscript);
  236. $core.addMethod(
  237. $core.method({
  238. selector: "show:",
  239. protocol: "printing",
  240. fn: function (anObject){
  241. var self=this;
  242. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  243. return $core.withContext(function($ctx1) {
  244. //>>excludeEnd("ctx");
  245. console.log(String($recv(anObject)._asString()));
  246. return self;
  247. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  248. }, function($ctx1) {$ctx1.fill(self,"show:",{anObject:anObject},$globals.ConsoleTranscript)});
  249. //>>excludeEnd("ctx");
  250. },
  251. //>>excludeStart("ide", pragmas.excludeIdeData);
  252. args: ["anObject"],
  253. source: "show: anObject\x0a\x22Smalltalk objects should have no trouble displaying themselves on the Transcript; Javascript objects don't know how, so must be wrapped in a JSObectProxy.\x22\x0a<inlineJS: 'console.log(String($recv(anObject)._asString()))'>",
  254. referencedClasses: [],
  255. //>>excludeEnd("ide");
  256. messageSends: []
  257. }),
  258. $globals.ConsoleTranscript);
  259. $core.addMethod(
  260. $core.method({
  261. selector: "initialize",
  262. protocol: "initialization",
  263. fn: function (){
  264. var self=this;
  265. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  266. return $core.withContext(function($ctx1) {
  267. //>>excludeEnd("ctx");
  268. $recv($globals.Transcript)._registerIfNone_(self._new());
  269. return self;
  270. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  271. }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.ConsoleTranscript.klass)});
  272. //>>excludeEnd("ctx");
  273. },
  274. //>>excludeStart("ide", pragmas.excludeIdeData);
  275. args: [],
  276. source: "initialize\x0a\x09Transcript registerIfNone: self new",
  277. referencedClasses: ["Transcript"],
  278. //>>excludeEnd("ide");
  279. messageSends: ["registerIfNone:", "new"]
  280. }),
  281. $globals.ConsoleTranscript.klass);
  282. $core.addClass("Environment", $globals.Object, [], "Platform-Services");
  283. //>>excludeStart("ide", pragmas.excludeIdeData);
  284. $globals.Environment.comment="I provide an unified entry point to manipulate Amber packages, classes and methods.\x0a\x0aTypical use cases include IDEs, remote access and restricting browsing.";
  285. //>>excludeEnd("ide");
  286. $core.addMethod(
  287. $core.method({
  288. selector: "addInstVarNamed:to:",
  289. protocol: "compiling",
  290. fn: function (aString,aClass){
  291. var self=this;
  292. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  293. return $core.withContext(function($ctx1) {
  294. //>>excludeEnd("ctx");
  295. var $1,$2,$3,$5,$4;
  296. $1=self._classBuilder();
  297. $2=$recv(aClass)._superclass();
  298. $3=$recv(aClass)._name();
  299. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  300. $ctx1.sendIdx["name"]=1;
  301. //>>excludeEnd("ctx");
  302. $5=$recv($recv(aClass)._instanceVariableNames())._copy();
  303. $recv($5)._add_(aString);
  304. $4=$recv($5)._yourself();
  305. $recv($1)._addSubclassOf_named_instanceVariableNames_package_($2,$3,$4,$recv($recv(aClass)._package())._name());
  306. return self;
  307. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  308. }, function($ctx1) {$ctx1.fill(self,"addInstVarNamed:to:",{aString:aString,aClass:aClass},$globals.Environment)});
  309. //>>excludeEnd("ctx");
  310. },
  311. //>>excludeStart("ide", pragmas.excludeIdeData);
  312. args: ["aString", "aClass"],
  313. source: "addInstVarNamed: aString to: aClass\x0a\x09self classBuilder\x0a\x09\x09addSubclassOf: aClass superclass \x0a\x09\x09named: aClass name \x0a\x09\x09instanceVariableNames: (aClass instanceVariableNames copy add: aString; yourself)\x0a\x09\x09package: aClass package name",
  314. referencedClasses: [],
  315. //>>excludeEnd("ide");
  316. messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "classBuilder", "superclass", "name", "add:", "copy", "instanceVariableNames", "yourself", "package"]
  317. }),
  318. $globals.Environment);
  319. $core.addMethod(
  320. $core.method({
  321. selector: "allSelectors",
  322. protocol: "accessing",
  323. fn: function (){
  324. var self=this;
  325. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  326. return $core.withContext(function($ctx1) {
  327. //>>excludeEnd("ctx");
  328. return $recv($recv($globals.Smalltalk)._core())._allSelectors();
  329. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  330. }, function($ctx1) {$ctx1.fill(self,"allSelectors",{},$globals.Environment)});
  331. //>>excludeEnd("ctx");
  332. },
  333. //>>excludeStart("ide", pragmas.excludeIdeData);
  334. args: [],
  335. source: "allSelectors\x0a\x09^ Smalltalk core allSelectors",
  336. referencedClasses: ["Smalltalk"],
  337. //>>excludeEnd("ide");
  338. messageSends: ["allSelectors", "core"]
  339. }),
  340. $globals.Environment);
  341. $core.addMethod(
  342. $core.method({
  343. selector: "availableClassNames",
  344. protocol: "accessing",
  345. fn: function (){
  346. var self=this;
  347. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  348. return $core.withContext(function($ctx1) {
  349. //>>excludeEnd("ctx");
  350. return $recv($recv($globals.Smalltalk)._classes())._collect_((function(each){
  351. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  352. return $core.withContext(function($ctx2) {
  353. //>>excludeEnd("ctx");
  354. return $recv(each)._name();
  355. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  356. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  357. //>>excludeEnd("ctx");
  358. }));
  359. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  360. }, function($ctx1) {$ctx1.fill(self,"availableClassNames",{},$globals.Environment)});
  361. //>>excludeEnd("ctx");
  362. },
  363. //>>excludeStart("ide", pragmas.excludeIdeData);
  364. args: [],
  365. source: "availableClassNames\x0a\x09^ Smalltalk classes \x0a\x09\x09collect: [ :each | each name ]",
  366. referencedClasses: ["Smalltalk"],
  367. //>>excludeEnd("ide");
  368. messageSends: ["collect:", "classes", "name"]
  369. }),
  370. $globals.Environment);
  371. $core.addMethod(
  372. $core.method({
  373. selector: "availablePackageNames",
  374. protocol: "accessing",
  375. fn: function (){
  376. var self=this;
  377. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  378. return $core.withContext(function($ctx1) {
  379. //>>excludeEnd("ctx");
  380. return $recv($recv($globals.Smalltalk)._packages())._collect_((function(each){
  381. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  382. return $core.withContext(function($ctx2) {
  383. //>>excludeEnd("ctx");
  384. return $recv(each)._name();
  385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  386. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  387. //>>excludeEnd("ctx");
  388. }));
  389. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  390. }, function($ctx1) {$ctx1.fill(self,"availablePackageNames",{},$globals.Environment)});
  391. //>>excludeEnd("ctx");
  392. },
  393. //>>excludeStart("ide", pragmas.excludeIdeData);
  394. args: [],
  395. source: "availablePackageNames\x0a\x09^ Smalltalk packages \x0a\x09\x09collect: [ :each | each name ]",
  396. referencedClasses: ["Smalltalk"],
  397. //>>excludeEnd("ide");
  398. messageSends: ["collect:", "packages", "name"]
  399. }),
  400. $globals.Environment);
  401. $core.addMethod(
  402. $core.method({
  403. selector: "availableProtocolsFor:",
  404. protocol: "accessing",
  405. fn: function (aClass){
  406. var self=this;
  407. var protocols;
  408. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  409. return $core.withContext(function($ctx1) {
  410. //>>excludeEnd("ctx");
  411. var $1,$receiver;
  412. protocols=$recv(aClass)._protocols();
  413. $1=$recv(aClass)._superclass();
  414. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  415. $ctx1.sendIdx["superclass"]=1;
  416. //>>excludeEnd("ctx");
  417. if(($receiver = $1) == null || $receiver.isNil){
  418. $1;
  419. } else {
  420. $recv(protocols)._addAll_(self._availableProtocolsFor_($recv(aClass)._superclass()));
  421. }
  422. return $recv($recv($recv(protocols)._asSet())._asArray())._sort();
  423. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  424. }, function($ctx1) {$ctx1.fill(self,"availableProtocolsFor:",{aClass:aClass,protocols:protocols},$globals.Environment)});
  425. //>>excludeEnd("ctx");
  426. },
  427. //>>excludeStart("ide", pragmas.excludeIdeData);
  428. args: ["aClass"],
  429. source: "availableProtocolsFor: aClass\x0a\x09| protocols |\x0a\x09\x0a\x09protocols := aClass protocols.\x0a\x09aClass superclass ifNotNil: [ protocols addAll: (self availableProtocolsFor: aClass superclass) ].\x0a\x09^ protocols asSet asArray sort",
  430. referencedClasses: [],
  431. //>>excludeEnd("ide");
  432. messageSends: ["protocols", "ifNotNil:", "superclass", "addAll:", "availableProtocolsFor:", "sort", "asArray", "asSet"]
  433. }),
  434. $globals.Environment);
  435. $core.addMethod(
  436. $core.method({
  437. selector: "classBuilder",
  438. protocol: "accessing",
  439. fn: function (){
  440. var self=this;
  441. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  442. return $core.withContext(function($ctx1) {
  443. //>>excludeEnd("ctx");
  444. return $recv($globals.ClassBuilder)._new();
  445. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  446. }, function($ctx1) {$ctx1.fill(self,"classBuilder",{},$globals.Environment)});
  447. //>>excludeEnd("ctx");
  448. },
  449. //>>excludeStart("ide", pragmas.excludeIdeData);
  450. args: [],
  451. source: "classBuilder\x0a\x09^ ClassBuilder new",
  452. referencedClasses: ["ClassBuilder"],
  453. //>>excludeEnd("ide");
  454. messageSends: ["new"]
  455. }),
  456. $globals.Environment);
  457. $core.addMethod(
  458. $core.method({
  459. selector: "classNamed:",
  460. protocol: "accessing",
  461. fn: function (aString){
  462. var self=this;
  463. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  464. return $core.withContext(function($ctx1) {
  465. //>>excludeEnd("ctx");
  466. var $1,$receiver;
  467. $1=$recv($recv($globals.Smalltalk)._globals())._at_($recv(aString)._asSymbol());
  468. if(($receiver = $1) == null || $receiver.isNil){
  469. return self._error_("Invalid class name");
  470. } else {
  471. return $1;
  472. }
  473. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  474. }, function($ctx1) {$ctx1.fill(self,"classNamed:",{aString:aString},$globals.Environment)});
  475. //>>excludeEnd("ctx");
  476. },
  477. //>>excludeStart("ide", pragmas.excludeIdeData);
  478. args: ["aString"],
  479. source: "classNamed: aString\x0a\x09^ (Smalltalk globals at: aString asSymbol)\x0a\x09\x09ifNil: [ self error: 'Invalid class name' ]",
  480. referencedClasses: ["Smalltalk"],
  481. //>>excludeEnd("ide");
  482. messageSends: ["ifNil:", "at:", "globals", "asSymbol", "error:"]
  483. }),
  484. $globals.Environment);
  485. $core.addMethod(
  486. $core.method({
  487. selector: "classes",
  488. protocol: "accessing",
  489. fn: function (){
  490. var self=this;
  491. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  492. return $core.withContext(function($ctx1) {
  493. //>>excludeEnd("ctx");
  494. return $recv($globals.Smalltalk)._classes();
  495. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  496. }, function($ctx1) {$ctx1.fill(self,"classes",{},$globals.Environment)});
  497. //>>excludeEnd("ctx");
  498. },
  499. //>>excludeStart("ide", pragmas.excludeIdeData);
  500. args: [],
  501. source: "classes\x0a\x09^ Smalltalk classes",
  502. referencedClasses: ["Smalltalk"],
  503. //>>excludeEnd("ide");
  504. messageSends: ["classes"]
  505. }),
  506. $globals.Environment);
  507. $core.addMethod(
  508. $core.method({
  509. selector: "commitPackage:onSuccess:onError:",
  510. protocol: "actions",
  511. fn: function (aPackage,aBlock,anotherBlock){
  512. var self=this;
  513. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  514. return $core.withContext(function($ctx1) {
  515. //>>excludeEnd("ctx");
  516. $recv($recv(aPackage)._transport())._commitOnSuccess_onError_(aBlock,anotherBlock);
  517. return self;
  518. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  519. }, function($ctx1) {$ctx1.fill(self,"commitPackage:onSuccess:onError:",{aPackage:aPackage,aBlock:aBlock,anotherBlock:anotherBlock},$globals.Environment)});
  520. //>>excludeEnd("ctx");
  521. },
  522. //>>excludeStart("ide", pragmas.excludeIdeData);
  523. args: ["aPackage", "aBlock", "anotherBlock"],
  524. source: "commitPackage: aPackage onSuccess: aBlock onError: anotherBlock\x0a\x09aPackage transport\x0a\x09\x09commitOnSuccess: aBlock\x0a\x09\x09onError: anotherBlock",
  525. referencedClasses: [],
  526. //>>excludeEnd("ide");
  527. messageSends: ["commitOnSuccess:onError:", "transport"]
  528. }),
  529. $globals.Environment);
  530. $core.addMethod(
  531. $core.method({
  532. selector: "compileClassComment:for:",
  533. protocol: "compiling",
  534. fn: function (aString,aClass){
  535. var self=this;
  536. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  537. return $core.withContext(function($ctx1) {
  538. //>>excludeEnd("ctx");
  539. $recv(aClass)._comment_(aString);
  540. return self;
  541. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  542. }, function($ctx1) {$ctx1.fill(self,"compileClassComment:for:",{aString:aString,aClass:aClass},$globals.Environment)});
  543. //>>excludeEnd("ctx");
  544. },
  545. //>>excludeStart("ide", pragmas.excludeIdeData);
  546. args: ["aString", "aClass"],
  547. source: "compileClassComment: aString for: aClass\x0a\x09aClass comment: aString",
  548. referencedClasses: [],
  549. //>>excludeEnd("ide");
  550. messageSends: ["comment:"]
  551. }),
  552. $globals.Environment);
  553. $core.addMethod(
  554. $core.method({
  555. selector: "compileClassDefinition:",
  556. protocol: "compiling",
  557. fn: function (aString){
  558. var self=this;
  559. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  560. return $core.withContext(function($ctx1) {
  561. //>>excludeEnd("ctx");
  562. $recv((function(){
  563. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  564. return $core.withContext(function($ctx2) {
  565. //>>excludeEnd("ctx");
  566. return self._evaluate_for_(aString,$recv($globals.DoIt)._new());
  567. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  568. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  569. //>>excludeEnd("ctx");
  570. }))._on_do_($globals.Error,(function(error){
  571. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  572. return $core.withContext(function($ctx2) {
  573. //>>excludeEnd("ctx");
  574. return $recv($globals.Terminal)._alert_($recv(error)._messageText());
  575. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  576. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1,2)});
  577. //>>excludeEnd("ctx");
  578. }));
  579. return self;
  580. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  581. }, function($ctx1) {$ctx1.fill(self,"compileClassDefinition:",{aString:aString},$globals.Environment)});
  582. //>>excludeEnd("ctx");
  583. },
  584. //>>excludeStart("ide", pragmas.excludeIdeData);
  585. args: ["aString"],
  586. source: "compileClassDefinition: aString\x0a\x09[ self evaluate: aString for: DoIt new ]\x0a\x09\x09on: Error\x0a\x09\x09do: [ :error | Terminal alert: error messageText ]",
  587. referencedClasses: ["DoIt", "Error", "Terminal"],
  588. //>>excludeEnd("ide");
  589. messageSends: ["on:do:", "evaluate:for:", "new", "alert:", "messageText"]
  590. }),
  591. $globals.Environment);
  592. $core.addMethod(
  593. $core.method({
  594. selector: "compileMethod:for:protocol:",
  595. protocol: "compiling",
  596. fn: function (sourceCode,class_,protocol){
  597. var self=this;
  598. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  599. return $core.withContext(function($ctx1) {
  600. //>>excludeEnd("ctx");
  601. return $recv(class_)._compile_protocol_(sourceCode,protocol);
  602. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  603. }, function($ctx1) {$ctx1.fill(self,"compileMethod:for:protocol:",{sourceCode:sourceCode,class_:class_,protocol:protocol},$globals.Environment)});
  604. //>>excludeEnd("ctx");
  605. },
  606. //>>excludeStart("ide", pragmas.excludeIdeData);
  607. args: ["sourceCode", "class", "protocol"],
  608. source: "compileMethod: sourceCode for: class protocol: protocol\x0a\x09^ class\x0a\x09\x09compile: sourceCode\x0a\x09\x09protocol: protocol",
  609. referencedClasses: [],
  610. //>>excludeEnd("ide");
  611. messageSends: ["compile:protocol:"]
  612. }),
  613. $globals.Environment);
  614. $core.addMethod(
  615. $core.method({
  616. selector: "copyClass:to:",
  617. protocol: "actions",
  618. fn: function (aClass,aClassName){
  619. var self=this;
  620. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  621. return $core.withContext(function($ctx1) {
  622. //>>excludeEnd("ctx");
  623. var $1,$2,$receiver;
  624. $1=$recv($recv($globals.Smalltalk)._globals())._at_(aClassName);
  625. if(($receiver = $1) == null || $receiver.isNil){
  626. $1;
  627. } else {
  628. $2=$recv("A class named ".__comma(aClassName)).__comma(" already exists");
  629. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  630. $ctx1.sendIdx[","]=1;
  631. //>>excludeEnd("ctx");
  632. self._error_($2);
  633. }
  634. $recv($recv($globals.ClassBuilder)._new())._copyClass_named_(aClass,aClassName);
  635. return self;
  636. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  637. }, function($ctx1) {$ctx1.fill(self,"copyClass:to:",{aClass:aClass,aClassName:aClassName},$globals.Environment)});
  638. //>>excludeEnd("ctx");
  639. },
  640. //>>excludeStart("ide", pragmas.excludeIdeData);
  641. args: ["aClass", "aClassName"],
  642. source: "copyClass: aClass to: aClassName\x0a\x09(Smalltalk globals at: aClassName)\x0a\x09\x09ifNotNil: [ self error: 'A class named ', aClassName, ' already exists' ].\x0a\x09\x09\x0a\x09ClassBuilder new copyClass: aClass named: aClassName",
  643. referencedClasses: ["Smalltalk", "ClassBuilder"],
  644. //>>excludeEnd("ide");
  645. messageSends: ["ifNotNil:", "at:", "globals", "error:", ",", "copyClass:named:", "new"]
  646. }),
  647. $globals.Environment);
  648. $core.addMethod(
  649. $core.method({
  650. selector: "doItReceiver",
  651. protocol: "accessing",
  652. fn: function (){
  653. var self=this;
  654. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  655. return $core.withContext(function($ctx1) {
  656. //>>excludeEnd("ctx");
  657. return $recv($globals.DoIt)._new();
  658. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  659. }, function($ctx1) {$ctx1.fill(self,"doItReceiver",{},$globals.Environment)});
  660. //>>excludeEnd("ctx");
  661. },
  662. //>>excludeStart("ide", pragmas.excludeIdeData);
  663. args: [],
  664. source: "doItReceiver\x0a\x09^ DoIt new",
  665. referencedClasses: ["DoIt"],
  666. //>>excludeEnd("ide");
  667. messageSends: ["new"]
  668. }),
  669. $globals.Environment);
  670. $core.addMethod(
  671. $core.method({
  672. selector: "evaluate:for:",
  673. protocol: "evaluating",
  674. fn: function (aString,anObject){
  675. var self=this;
  676. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  677. return $core.withContext(function($ctx1) {
  678. //>>excludeEnd("ctx");
  679. return $recv($globals.Evaluator)._evaluate_for_(aString,anObject);
  680. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  681. }, function($ctx1) {$ctx1.fill(self,"evaluate:for:",{aString:aString,anObject:anObject},$globals.Environment)});
  682. //>>excludeEnd("ctx");
  683. },
  684. //>>excludeStart("ide", pragmas.excludeIdeData);
  685. args: ["aString", "anObject"],
  686. source: "evaluate: aString for: anObject\x0a\x09^ Evaluator evaluate: aString for: anObject",
  687. referencedClasses: ["Evaluator"],
  688. //>>excludeEnd("ide");
  689. messageSends: ["evaluate:for:"]
  690. }),
  691. $globals.Environment);
  692. $core.addMethod(
  693. $core.method({
  694. selector: "evaluate:on:do:",
  695. protocol: "error handling",
  696. fn: function (aBlock,anErrorClass,exceptionBlock){
  697. var self=this;
  698. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  699. return $core.withContext(function($ctx1) {
  700. //>>excludeEnd("ctx");
  701. var $1;
  702. $recv(aBlock)._tryCatch_((function(exception){
  703. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  704. return $core.withContext(function($ctx2) {
  705. //>>excludeEnd("ctx");
  706. $1=$recv(exception)._isKindOf_(self._classNamed_($recv(anErrorClass)._name()));
  707. if($core.assert($1)){
  708. return $recv(exceptionBlock)._value_(exception);
  709. } else {
  710. return $recv(exception)._resignal();
  711. }
  712. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  713. }, function($ctx2) {$ctx2.fillBlock({exception:exception},$ctx1,1)});
  714. //>>excludeEnd("ctx");
  715. }));
  716. return self;
  717. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  718. }, function($ctx1) {$ctx1.fill(self,"evaluate:on:do:",{aBlock:aBlock,anErrorClass:anErrorClass,exceptionBlock:exceptionBlock},$globals.Environment)});
  719. //>>excludeEnd("ctx");
  720. },
  721. //>>excludeStart("ide", pragmas.excludeIdeData);
  722. args: ["aBlock", "anErrorClass", "exceptionBlock"],
  723. source: "evaluate: aBlock on: anErrorClass do: exceptionBlock\x0a\x09\x22Evaluate a block and catch exceptions happening on the environment stack\x22\x0a\x09\x0a\x09aBlock tryCatch: [ :exception | \x0a\x09\x09(exception isKindOf: (self classNamed: anErrorClass name))\x0a\x09\x09\x09ifTrue: [ exceptionBlock value: exception ]\x0a \x09\x09\x09ifFalse: [ exception resignal ] ]",
  724. referencedClasses: [],
  725. //>>excludeEnd("ide");
  726. messageSends: ["tryCatch:", "ifTrue:ifFalse:", "isKindOf:", "classNamed:", "name", "value:", "resignal"]
  727. }),
  728. $globals.Environment);
  729. $core.addMethod(
  730. $core.method({
  731. selector: "inspect:",
  732. protocol: "actions",
  733. fn: function (anObject){
  734. var self=this;
  735. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  736. return $core.withContext(function($ctx1) {
  737. //>>excludeEnd("ctx");
  738. $recv($globals.Inspector)._inspect_(anObject);
  739. return self;
  740. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  741. }, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},$globals.Environment)});
  742. //>>excludeEnd("ctx");
  743. },
  744. //>>excludeStart("ide", pragmas.excludeIdeData);
  745. args: ["anObject"],
  746. source: "inspect: anObject\x0a\x09Inspector inspect: anObject",
  747. referencedClasses: ["Inspector"],
  748. //>>excludeEnd("ide");
  749. messageSends: ["inspect:"]
  750. }),
  751. $globals.Environment);
  752. $core.addMethod(
  753. $core.method({
  754. selector: "moveClass:toPackage:",
  755. protocol: "actions",
  756. fn: function (aClass,aPackageName){
  757. var self=this;
  758. var package_;
  759. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  760. return $core.withContext(function($ctx1) {
  761. //>>excludeEnd("ctx");
  762. var $1,$2,$receiver;
  763. package_=$recv($globals.Package)._named_(aPackageName);
  764. $1=package_;
  765. if(($receiver = $1) == null || $receiver.isNil){
  766. self._error_("Invalid package name");
  767. } else {
  768. $1;
  769. }
  770. $2=$recv(package_).__eq_eq($recv(aClass)._package());
  771. if($core.assert($2)){
  772. return self;
  773. }
  774. $recv(aClass)._package_(package_);
  775. $recv(aClass)._recompile();
  776. return self;
  777. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  778. }, function($ctx1) {$ctx1.fill(self,"moveClass:toPackage:",{aClass:aClass,aPackageName:aPackageName,package_:package_},$globals.Environment)});
  779. //>>excludeEnd("ctx");
  780. },
  781. //>>excludeStart("ide", pragmas.excludeIdeData);
  782. args: ["aClass", "aPackageName"],
  783. source: "moveClass: aClass toPackage: aPackageName\x0a\x09| package |\x0a\x09\x0a\x09package := Package named: aPackageName.\x0a\x09package ifNil: [ self error: 'Invalid package name' ].\x0a\x09package == aClass package ifTrue: [ ^ self ].\x0a\x09\x0a\x09aClass package: package.\x0a\x09aClass recompile",
  784. referencedClasses: ["Package"],
  785. //>>excludeEnd("ide");
  786. messageSends: ["named:", "ifNil:", "error:", "ifTrue:", "==", "package", "package:", "recompile"]
  787. }),
  788. $globals.Environment);
  789. $core.addMethod(
  790. $core.method({
  791. selector: "moveMethod:toClass:",
  792. protocol: "actions",
  793. fn: function (aMethod,aClassName){
  794. var self=this;
  795. var destinationClass;
  796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  797. return $core.withContext(function($ctx1) {
  798. //>>excludeEnd("ctx");
  799. var $2,$3,$1,$5,$4;
  800. destinationClass=self._classNamed_(aClassName);
  801. $2=destinationClass;
  802. $3=$recv(aMethod)._methodClass();
  803. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  804. $ctx1.sendIdx["methodClass"]=1;
  805. //>>excludeEnd("ctx");
  806. $1=$recv($2).__eq_eq($3);
  807. if($core.assert($1)){
  808. return self;
  809. }
  810. $5=$recv(aMethod)._methodClass();
  811. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  812. $ctx1.sendIdx["methodClass"]=2;
  813. //>>excludeEnd("ctx");
  814. $4=$recv($5)._isMetaclass();
  815. if($core.assert($4)){
  816. destinationClass=$recv(destinationClass)._theMetaClass();
  817. destinationClass;
  818. }
  819. $recv(destinationClass)._compile_protocol_($recv(aMethod)._source(),$recv(aMethod)._protocol());
  820. $recv($recv(aMethod)._methodClass())._removeCompiledMethod_(aMethod);
  821. return self;
  822. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  823. }, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:",{aMethod:aMethod,aClassName:aClassName,destinationClass:destinationClass},$globals.Environment)});
  824. //>>excludeEnd("ctx");
  825. },
  826. //>>excludeStart("ide", pragmas.excludeIdeData);
  827. args: ["aMethod", "aClassName"],
  828. source: "moveMethod: aMethod toClass: aClassName\x0a\x09| destinationClass |\x0a\x09\x0a\x09destinationClass := self classNamed: aClassName.\x0a\x09destinationClass == aMethod methodClass ifTrue: [ ^ self ].\x0a\x09\x0a\x09aMethod methodClass isMetaclass ifTrue: [ \x0a\x09\x09destinationClass := destinationClass theMetaClass ].\x0a\x09\x0a\x09destinationClass \x0a\x09\x09compile: aMethod source\x0a\x09\x09protocol: aMethod protocol.\x0a\x09aMethod methodClass \x0a\x09\x09removeCompiledMethod: aMethod",
  829. referencedClasses: [],
  830. //>>excludeEnd("ide");
  831. messageSends: ["classNamed:", "ifTrue:", "==", "methodClass", "isMetaclass", "theMetaClass", "compile:protocol:", "source", "protocol", "removeCompiledMethod:"]
  832. }),
  833. $globals.Environment);
  834. $core.addMethod(
  835. $core.method({
  836. selector: "moveMethod:toProtocol:",
  837. protocol: "actions",
  838. fn: function (aMethod,aProtocol){
  839. var self=this;
  840. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  841. return $core.withContext(function($ctx1) {
  842. //>>excludeEnd("ctx");
  843. $recv(aMethod)._protocol_(aProtocol);
  844. $recv($recv(aMethod)._methodClass())._compile_protocol_($recv(aMethod)._source(),$recv(aMethod)._protocol());
  845. return self;
  846. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  847. }, function($ctx1) {$ctx1.fill(self,"moveMethod:toProtocol:",{aMethod:aMethod,aProtocol:aProtocol},$globals.Environment)});
  848. //>>excludeEnd("ctx");
  849. },
  850. //>>excludeStart("ide", pragmas.excludeIdeData);
  851. args: ["aMethod", "aProtocol"],
  852. source: "moveMethod: aMethod toProtocol: aProtocol\x0a\x09aMethod protocol: aProtocol.\x0a\x0a\x09aMethod methodClass\x0a\x09\x09compile: aMethod source\x0a\x09\x09protocol: aMethod protocol",
  853. referencedClasses: [],
  854. //>>excludeEnd("ide");
  855. messageSends: ["protocol:", "compile:protocol:", "methodClass", "source", "protocol"]
  856. }),
  857. $globals.Environment);
  858. $core.addMethod(
  859. $core.method({
  860. selector: "packages",
  861. protocol: "accessing",
  862. fn: function (){
  863. var self=this;
  864. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  865. return $core.withContext(function($ctx1) {
  866. //>>excludeEnd("ctx");
  867. return $recv($globals.Smalltalk)._packages();
  868. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  869. }, function($ctx1) {$ctx1.fill(self,"packages",{},$globals.Environment)});
  870. //>>excludeEnd("ctx");
  871. },
  872. //>>excludeStart("ide", pragmas.excludeIdeData);
  873. args: [],
  874. source: "packages\x0a\x09^ Smalltalk packages",
  875. referencedClasses: ["Smalltalk"],
  876. //>>excludeEnd("ide");
  877. messageSends: ["packages"]
  878. }),
  879. $globals.Environment);
  880. $core.addMethod(
  881. $core.method({
  882. selector: "registerErrorHandler:",
  883. protocol: "services",
  884. fn: function (anErrorHandler){
  885. var self=this;
  886. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  887. return $core.withContext(function($ctx1) {
  888. //>>excludeEnd("ctx");
  889. $recv($globals.ErrorHandler)._register_(anErrorHandler);
  890. return self;
  891. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  892. }, function($ctx1) {$ctx1.fill(self,"registerErrorHandler:",{anErrorHandler:anErrorHandler},$globals.Environment)});
  893. //>>excludeEnd("ctx");
  894. },
  895. //>>excludeStart("ide", pragmas.excludeIdeData);
  896. args: ["anErrorHandler"],
  897. source: "registerErrorHandler: anErrorHandler\x0a\x09ErrorHandler register: anErrorHandler",
  898. referencedClasses: ["ErrorHandler"],
  899. //>>excludeEnd("ide");
  900. messageSends: ["register:"]
  901. }),
  902. $globals.Environment);
  903. $core.addMethod(
  904. $core.method({
  905. selector: "registerFinder:",
  906. protocol: "services",
  907. fn: function (aFinder){
  908. var self=this;
  909. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  910. return $core.withContext(function($ctx1) {
  911. //>>excludeEnd("ctx");
  912. $recv($globals.Finder)._register_(aFinder);
  913. return self;
  914. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  915. }, function($ctx1) {$ctx1.fill(self,"registerFinder:",{aFinder:aFinder},$globals.Environment)});
  916. //>>excludeEnd("ctx");
  917. },
  918. //>>excludeStart("ide", pragmas.excludeIdeData);
  919. args: ["aFinder"],
  920. source: "registerFinder: aFinder\x0a\x09Finder register: aFinder",
  921. referencedClasses: ["Finder"],
  922. //>>excludeEnd("ide");
  923. messageSends: ["register:"]
  924. }),
  925. $globals.Environment);
  926. $core.addMethod(
  927. $core.method({
  928. selector: "registerInspector:",
  929. protocol: "services",
  930. fn: function (anInspector){
  931. var self=this;
  932. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  933. return $core.withContext(function($ctx1) {
  934. //>>excludeEnd("ctx");
  935. $recv($globals.Inspector)._register_(anInspector);
  936. return self;
  937. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  938. }, function($ctx1) {$ctx1.fill(self,"registerInspector:",{anInspector:anInspector},$globals.Environment)});
  939. //>>excludeEnd("ctx");
  940. },
  941. //>>excludeStart("ide", pragmas.excludeIdeData);
  942. args: ["anInspector"],
  943. source: "registerInspector: anInspector\x0a\x09Inspector register: anInspector",
  944. referencedClasses: ["Inspector"],
  945. //>>excludeEnd("ide");
  946. messageSends: ["register:"]
  947. }),
  948. $globals.Environment);
  949. $core.addMethod(
  950. $core.method({
  951. selector: "registerProgressHandler:",
  952. protocol: "services",
  953. fn: function (aProgressHandler){
  954. var self=this;
  955. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  956. return $core.withContext(function($ctx1) {
  957. //>>excludeEnd("ctx");
  958. $recv($globals.ProgressHandler)._register_(aProgressHandler);
  959. return self;
  960. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  961. }, function($ctx1) {$ctx1.fill(self,"registerProgressHandler:",{aProgressHandler:aProgressHandler},$globals.Environment)});
  962. //>>excludeEnd("ctx");
  963. },
  964. //>>excludeStart("ide", pragmas.excludeIdeData);
  965. args: ["aProgressHandler"],
  966. source: "registerProgressHandler: aProgressHandler\x0a\x09ProgressHandler register: aProgressHandler",
  967. referencedClasses: ["ProgressHandler"],
  968. //>>excludeEnd("ide");
  969. messageSends: ["register:"]
  970. }),
  971. $globals.Environment);
  972. $core.addMethod(
  973. $core.method({
  974. selector: "registerTranscript:",
  975. protocol: "services",
  976. fn: function (aTranscript){
  977. var self=this;
  978. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  979. return $core.withContext(function($ctx1) {
  980. //>>excludeEnd("ctx");
  981. $recv($globals.Transcript)._register_(aTranscript);
  982. return self;
  983. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  984. }, function($ctx1) {$ctx1.fill(self,"registerTranscript:",{aTranscript:aTranscript},$globals.Environment)});
  985. //>>excludeEnd("ctx");
  986. },
  987. //>>excludeStart("ide", pragmas.excludeIdeData);
  988. args: ["aTranscript"],
  989. source: "registerTranscript: aTranscript\x0a\x09Transcript register: aTranscript",
  990. referencedClasses: ["Transcript"],
  991. //>>excludeEnd("ide");
  992. messageSends: ["register:"]
  993. }),
  994. $globals.Environment);
  995. $core.addMethod(
  996. $core.method({
  997. selector: "removeClass:",
  998. protocol: "actions",
  999. fn: function (aClass){
  1000. var self=this;
  1001. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1002. return $core.withContext(function($ctx1) {
  1003. //>>excludeEnd("ctx");
  1004. $recv($globals.Smalltalk)._removeClass_(aClass);
  1005. return self;
  1006. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1007. }, function($ctx1) {$ctx1.fill(self,"removeClass:",{aClass:aClass},$globals.Environment)});
  1008. //>>excludeEnd("ctx");
  1009. },
  1010. //>>excludeStart("ide", pragmas.excludeIdeData);
  1011. args: ["aClass"],
  1012. source: "removeClass: aClass\x0a\x09Smalltalk removeClass: aClass",
  1013. referencedClasses: ["Smalltalk"],
  1014. //>>excludeEnd("ide");
  1015. messageSends: ["removeClass:"]
  1016. }),
  1017. $globals.Environment);
  1018. $core.addMethod(
  1019. $core.method({
  1020. selector: "removeMethod:",
  1021. protocol: "actions",
  1022. fn: function (aMethod){
  1023. var self=this;
  1024. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1025. return $core.withContext(function($ctx1) {
  1026. //>>excludeEnd("ctx");
  1027. $recv($recv(aMethod)._methodClass())._removeCompiledMethod_(aMethod);
  1028. return self;
  1029. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1030. }, function($ctx1) {$ctx1.fill(self,"removeMethod:",{aMethod:aMethod},$globals.Environment)});
  1031. //>>excludeEnd("ctx");
  1032. },
  1033. //>>excludeStart("ide", pragmas.excludeIdeData);
  1034. args: ["aMethod"],
  1035. source: "removeMethod: aMethod\x0a\x09aMethod methodClass removeCompiledMethod: aMethod",
  1036. referencedClasses: [],
  1037. //>>excludeEnd("ide");
  1038. messageSends: ["removeCompiledMethod:", "methodClass"]
  1039. }),
  1040. $globals.Environment);
  1041. $core.addMethod(
  1042. $core.method({
  1043. selector: "removeProtocol:from:",
  1044. protocol: "actions",
  1045. fn: function (aString,aClass){
  1046. var self=this;
  1047. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1048. return $core.withContext(function($ctx1) {
  1049. //>>excludeEnd("ctx");
  1050. $recv($recv(aClass)._methodsInProtocol_(aString))._do_((function(each){
  1051. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1052. return $core.withContext(function($ctx2) {
  1053. //>>excludeEnd("ctx");
  1054. return $recv(aClass)._removeCompiledMethod_(each);
  1055. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1056. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  1057. //>>excludeEnd("ctx");
  1058. }));
  1059. return self;
  1060. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1061. }, function($ctx1) {$ctx1.fill(self,"removeProtocol:from:",{aString:aString,aClass:aClass},$globals.Environment)});
  1062. //>>excludeEnd("ctx");
  1063. },
  1064. //>>excludeStart("ide", pragmas.excludeIdeData);
  1065. args: ["aString", "aClass"],
  1066. source: "removeProtocol: aString from: aClass\x0a\x09(aClass methodsInProtocol: aString)\x0a\x09\x09do: [ :each | aClass removeCompiledMethod: each ]",
  1067. referencedClasses: [],
  1068. //>>excludeEnd("ide");
  1069. messageSends: ["do:", "methodsInProtocol:", "removeCompiledMethod:"]
  1070. }),
  1071. $globals.Environment);
  1072. $core.addMethod(
  1073. $core.method({
  1074. selector: "renameClass:to:",
  1075. protocol: "actions",
  1076. fn: function (aClass,aClassName){
  1077. var self=this;
  1078. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1079. return $core.withContext(function($ctx1) {
  1080. //>>excludeEnd("ctx");
  1081. var $1,$2,$receiver;
  1082. $1=$recv($recv($globals.Smalltalk)._globals())._at_(aClassName);
  1083. if(($receiver = $1) == null || $receiver.isNil){
  1084. $1;
  1085. } else {
  1086. $2=$recv("A class named ".__comma(aClassName)).__comma(" already exists");
  1087. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1088. $ctx1.sendIdx[","]=1;
  1089. //>>excludeEnd("ctx");
  1090. self._error_($2);
  1091. }
  1092. $recv($recv($globals.ClassBuilder)._new())._renameClass_to_(aClass,aClassName);
  1093. return self;
  1094. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1095. }, function($ctx1) {$ctx1.fill(self,"renameClass:to:",{aClass:aClass,aClassName:aClassName},$globals.Environment)});
  1096. //>>excludeEnd("ctx");
  1097. },
  1098. //>>excludeStart("ide", pragmas.excludeIdeData);
  1099. args: ["aClass", "aClassName"],
  1100. source: "renameClass: aClass to: aClassName\x0a\x09(Smalltalk globals at: aClassName)\x0a\x09\x09ifNotNil: [ self error: 'A class named ', aClassName, ' already exists' ].\x0a\x09\x09\x0a\x09ClassBuilder new renameClass: aClass to: aClassName",
  1101. referencedClasses: ["Smalltalk", "ClassBuilder"],
  1102. //>>excludeEnd("ide");
  1103. messageSends: ["ifNotNil:", "at:", "globals", "error:", ",", "renameClass:to:", "new"]
  1104. }),
  1105. $globals.Environment);
  1106. $core.addMethod(
  1107. $core.method({
  1108. selector: "renamePackage:to:",
  1109. protocol: "actions",
  1110. fn: function (aPackageName,aNewPackageName){
  1111. var self=this;
  1112. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1113. return $core.withContext(function($ctx1) {
  1114. //>>excludeEnd("ctx");
  1115. var $1,$2,$receiver;
  1116. $1=$recv($recv($globals.Smalltalk)._globals())._at_(aNewPackageName);
  1117. if(($receiver = $1) == null || $receiver.isNil){
  1118. $1;
  1119. } else {
  1120. $2=$recv("A package named ".__comma(aNewPackageName)).__comma(" already exists");
  1121. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1122. $ctx1.sendIdx[","]=1;
  1123. //>>excludeEnd("ctx");
  1124. self._error_($2);
  1125. }
  1126. $recv($globals.Smalltalk)._renamePackage_to_(aPackageName,aNewPackageName);
  1127. return self;
  1128. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1129. }, function($ctx1) {$ctx1.fill(self,"renamePackage:to:",{aPackageName:aPackageName,aNewPackageName:aNewPackageName},$globals.Environment)});
  1130. //>>excludeEnd("ctx");
  1131. },
  1132. //>>excludeStart("ide", pragmas.excludeIdeData);
  1133. args: ["aPackageName", "aNewPackageName"],
  1134. source: "renamePackage: aPackageName to: aNewPackageName\x0a (Smalltalk globals at: aNewPackageName)\x0a ifNotNil: [ self error: 'A package named ', aNewPackageName, ' already exists' ].\x0a\x0a Smalltalk renamePackage: aPackageName to: aNewPackageName",
  1135. referencedClasses: ["Smalltalk"],
  1136. //>>excludeEnd("ide");
  1137. messageSends: ["ifNotNil:", "at:", "globals", "error:", ",", "renamePackage:to:"]
  1138. }),
  1139. $globals.Environment);
  1140. $core.addMethod(
  1141. $core.method({
  1142. selector: "renameProtocol:to:in:",
  1143. protocol: "actions",
  1144. fn: function (aString,anotherString,aClass){
  1145. var self=this;
  1146. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1147. return $core.withContext(function($ctx1) {
  1148. //>>excludeEnd("ctx");
  1149. $recv($recv(aClass)._methodsInProtocol_(aString))._do_((function(each){
  1150. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1151. return $core.withContext(function($ctx2) {
  1152. //>>excludeEnd("ctx");
  1153. return $recv(each)._protocol_(anotherString);
  1154. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1155. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  1156. //>>excludeEnd("ctx");
  1157. }));
  1158. return self;
  1159. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1160. }, function($ctx1) {$ctx1.fill(self,"renameProtocol:to:in:",{aString:aString,anotherString:anotherString,aClass:aClass},$globals.Environment)});
  1161. //>>excludeEnd("ctx");
  1162. },
  1163. //>>excludeStart("ide", pragmas.excludeIdeData);
  1164. args: ["aString", "anotherString", "aClass"],
  1165. source: "renameProtocol: aString to: anotherString in: aClass\x0a\x09(aClass methodsInProtocol: aString)\x0a\x09\x09do: [ :each | each protocol: anotherString ]",
  1166. referencedClasses: [],
  1167. //>>excludeEnd("ide");
  1168. messageSends: ["do:", "methodsInProtocol:", "protocol:"]
  1169. }),
  1170. $globals.Environment);
  1171. $core.addMethod(
  1172. $core.method({
  1173. selector: "setClassCommentOf:to:",
  1174. protocol: "actions",
  1175. fn: function (aClass,aString){
  1176. var self=this;
  1177. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1178. return $core.withContext(function($ctx1) {
  1179. //>>excludeEnd("ctx");
  1180. $recv(aClass)._comment_(aString);
  1181. return self;
  1182. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1183. }, function($ctx1) {$ctx1.fill(self,"setClassCommentOf:to:",{aClass:aClass,aString:aString},$globals.Environment)});
  1184. //>>excludeEnd("ctx");
  1185. },
  1186. //>>excludeStart("ide", pragmas.excludeIdeData);
  1187. args: ["aClass", "aString"],
  1188. source: "setClassCommentOf: aClass to: aString\x0a\x09aClass comment: aString",
  1189. referencedClasses: [],
  1190. //>>excludeEnd("ide");
  1191. messageSends: ["comment:"]
  1192. }),
  1193. $globals.Environment);
  1194. $core.addMethod(
  1195. $core.method({
  1196. selector: "systemAnnouncer",
  1197. protocol: "accessing",
  1198. fn: function (){
  1199. var self=this;
  1200. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1201. return $core.withContext(function($ctx1) {
  1202. //>>excludeEnd("ctx");
  1203. return $recv($recv($recv($globals.Smalltalk)._globals())._at_("SystemAnnouncer"))._current();
  1204. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1205. }, function($ctx1) {$ctx1.fill(self,"systemAnnouncer",{},$globals.Environment)});
  1206. //>>excludeEnd("ctx");
  1207. },
  1208. //>>excludeStart("ide", pragmas.excludeIdeData);
  1209. args: [],
  1210. source: "systemAnnouncer\x0a\x09^ (Smalltalk globals at: #SystemAnnouncer) current",
  1211. referencedClasses: ["Smalltalk"],
  1212. //>>excludeEnd("ide");
  1213. messageSends: ["current", "at:", "globals"]
  1214. }),
  1215. $globals.Environment);
  1216. $core.addClass("NullProgressHandler", $globals.Object, [], "Platform-Services");
  1217. //>>excludeStart("ide", pragmas.excludeIdeData);
  1218. $globals.NullProgressHandler.comment="I am the default progress handler. I do not display any progress, and simply iterate over the collection.";
  1219. //>>excludeEnd("ide");
  1220. $core.addMethod(
  1221. $core.method({
  1222. selector: "do:on:displaying:",
  1223. protocol: "progress handling",
  1224. fn: function (aBlock,aCollection,aString){
  1225. var self=this;
  1226. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1227. return $core.withContext(function($ctx1) {
  1228. //>>excludeEnd("ctx");
  1229. $recv(aCollection)._do_(aBlock);
  1230. return self;
  1231. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1232. }, function($ctx1) {$ctx1.fill(self,"do:on:displaying:",{aBlock:aBlock,aCollection:aCollection,aString:aString},$globals.NullProgressHandler)});
  1233. //>>excludeEnd("ctx");
  1234. },
  1235. //>>excludeStart("ide", pragmas.excludeIdeData);
  1236. args: ["aBlock", "aCollection", "aString"],
  1237. source: "do: aBlock on: aCollection displaying: aString\x0a\x09aCollection do: aBlock",
  1238. referencedClasses: [],
  1239. //>>excludeEnd("ide");
  1240. messageSends: ["do:"]
  1241. }),
  1242. $globals.NullProgressHandler);
  1243. $globals.NullProgressHandler.klass.iVarNames = ["current"];
  1244. $core.addMethod(
  1245. $core.method({
  1246. selector: "initialize",
  1247. protocol: "initialization",
  1248. fn: function (){
  1249. var self=this;
  1250. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1251. return $core.withContext(function($ctx1) {
  1252. //>>excludeEnd("ctx");
  1253. $recv($globals.ProgressHandler)._registerIfNone_(self._new());
  1254. return self;
  1255. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1256. }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.NullProgressHandler.klass)});
  1257. //>>excludeEnd("ctx");
  1258. },
  1259. //>>excludeStart("ide", pragmas.excludeIdeData);
  1260. args: [],
  1261. source: "initialize\x0a\x09ProgressHandler registerIfNone: self new",
  1262. referencedClasses: ["ProgressHandler"],
  1263. //>>excludeEnd("ide");
  1264. messageSends: ["registerIfNone:", "new"]
  1265. }),
  1266. $globals.NullProgressHandler.klass);
  1267. $core.addClass("Service", $globals.Object, [], "Platform-Services");
  1268. //>>excludeStart("ide", pragmas.excludeIdeData);
  1269. $globals.Service.comment="I implement the basic behavior for class registration to a service.\x0a\x0aSee the `Transcript` class for a concrete service.\x0a\x0a## API\x0a\x0aUse class-side methods `#register:` and `#registerIfNone:` to register classes to a specific service.";
  1270. //>>excludeEnd("ide");
  1271. $globals.Service.klass.iVarNames = ["current"];
  1272. $core.addMethod(
  1273. $core.method({
  1274. selector: "current",
  1275. protocol: "accessing",
  1276. fn: function (){
  1277. var self=this;
  1278. return self["@current"];
  1279. },
  1280. //>>excludeStart("ide", pragmas.excludeIdeData);
  1281. args: [],
  1282. source: "current\x0a\x09^ current",
  1283. referencedClasses: [],
  1284. //>>excludeEnd("ide");
  1285. messageSends: []
  1286. }),
  1287. $globals.Service.klass);
  1288. $core.addMethod(
  1289. $core.method({
  1290. selector: "new",
  1291. protocol: "instance creation",
  1292. fn: function (){
  1293. var self=this;
  1294. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1295. return $core.withContext(function($ctx1) {
  1296. //>>excludeEnd("ctx");
  1297. self._shouldNotImplement();
  1298. return self;
  1299. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1300. }, function($ctx1) {$ctx1.fill(self,"new",{},$globals.Service.klass)});
  1301. //>>excludeEnd("ctx");
  1302. },
  1303. //>>excludeStart("ide", pragmas.excludeIdeData);
  1304. args: [],
  1305. source: "new\x0a\x09self shouldNotImplement",
  1306. referencedClasses: [],
  1307. //>>excludeEnd("ide");
  1308. messageSends: ["shouldNotImplement"]
  1309. }),
  1310. $globals.Service.klass);
  1311. $core.addMethod(
  1312. $core.method({
  1313. selector: "register:",
  1314. protocol: "registration",
  1315. fn: function (anObject){
  1316. var self=this;
  1317. self["@current"]=anObject;
  1318. return self;
  1319. },
  1320. //>>excludeStart("ide", pragmas.excludeIdeData);
  1321. args: ["anObject"],
  1322. source: "register: anObject\x0a\x09current := anObject",
  1323. referencedClasses: [],
  1324. //>>excludeEnd("ide");
  1325. messageSends: []
  1326. }),
  1327. $globals.Service.klass);
  1328. $core.addMethod(
  1329. $core.method({
  1330. selector: "registerIfNone:",
  1331. protocol: "registration",
  1332. fn: function (anObject){
  1333. var self=this;
  1334. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1335. return $core.withContext(function($ctx1) {
  1336. //>>excludeEnd("ctx");
  1337. var $1,$receiver;
  1338. $1=self._current();
  1339. if(($receiver = $1) == null || $receiver.isNil){
  1340. self._register_(anObject);
  1341. } else {
  1342. $1;
  1343. }
  1344. return self;
  1345. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1346. }, function($ctx1) {$ctx1.fill(self,"registerIfNone:",{anObject:anObject},$globals.Service.klass)});
  1347. //>>excludeEnd("ctx");
  1348. },
  1349. //>>excludeStart("ide", pragmas.excludeIdeData);
  1350. args: ["anObject"],
  1351. source: "registerIfNone: anObject\x0a\x09self current ifNil: [ self register: anObject ]",
  1352. referencedClasses: [],
  1353. //>>excludeEnd("ide");
  1354. messageSends: ["ifNil:", "current", "register:"]
  1355. }),
  1356. $globals.Service.klass);
  1357. $core.addClass("ErrorHandler", $globals.Service, [], "Platform-Services");
  1358. //>>excludeStart("ide", pragmas.excludeIdeData);
  1359. $globals.ErrorHandler.comment="I am the service used to handle Smalltalk errors.\x0aSee `boot.js` `handleError()` function.\x0a\x0aRegistered service instances must implement `#handleError:` to perform an action on the thrown exception.";
  1360. //>>excludeEnd("ide");
  1361. $core.addMethod(
  1362. $core.method({
  1363. selector: "handleError:",
  1364. protocol: "error handling",
  1365. fn: function (anError){
  1366. var self=this;
  1367. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1368. return $core.withContext(function($ctx1) {
  1369. //>>excludeEnd("ctx");
  1370. self._handleUnhandledError_(anError);
  1371. return self;
  1372. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1373. }, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},$globals.ErrorHandler.klass)});
  1374. //>>excludeEnd("ctx");
  1375. },
  1376. //>>excludeStart("ide", pragmas.excludeIdeData);
  1377. args: ["anError"],
  1378. source: "handleError: anError\x0a\x09self handleUnhandledError: anError",
  1379. referencedClasses: [],
  1380. //>>excludeEnd("ide");
  1381. messageSends: ["handleUnhandledError:"]
  1382. }),
  1383. $globals.ErrorHandler.klass);
  1384. $core.addMethod(
  1385. $core.method({
  1386. selector: "handleUnhandledError:",
  1387. protocol: "error handling",
  1388. fn: function (anError){
  1389. var self=this;
  1390. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1391. return $core.withContext(function($ctx1) {
  1392. //>>excludeEnd("ctx");
  1393. var $1;
  1394. $1=$recv(anError)._wasHandled();
  1395. if($core.assert($1)){
  1396. return self;
  1397. }
  1398. return $recv(self._current())._handleError_(anError);
  1399. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1400. }, function($ctx1) {$ctx1.fill(self,"handleUnhandledError:",{anError:anError},$globals.ErrorHandler.klass)});
  1401. //>>excludeEnd("ctx");
  1402. },
  1403. //>>excludeStart("ide", pragmas.excludeIdeData);
  1404. args: ["anError"],
  1405. source: "handleUnhandledError: anError\x0a\x09anError wasHandled ifTrue: [ ^ self ].\x0a\x09\x0a\x09^ self current handleError: anError",
  1406. referencedClasses: [],
  1407. //>>excludeEnd("ide");
  1408. messageSends: ["ifTrue:", "wasHandled", "handleError:", "current"]
  1409. }),
  1410. $globals.ErrorHandler.klass);
  1411. $core.addClass("Finder", $globals.Service, [], "Platform-Services");
  1412. //>>excludeStart("ide", pragmas.excludeIdeData);
  1413. $globals.Finder.comment="I am the service responsible for finding classes/methods.\x0a__There is no default finder.__\x0a\x0a## API\x0a\x0aUse `#browse` on an object to find it.";
  1414. //>>excludeEnd("ide");
  1415. $core.addMethod(
  1416. $core.method({
  1417. selector: "findClass:",
  1418. protocol: "finding",
  1419. fn: function (aClass){
  1420. var self=this;
  1421. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1422. return $core.withContext(function($ctx1) {
  1423. //>>excludeEnd("ctx");
  1424. return $recv(self._current())._findClass_(aClass);
  1425. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1426. }, function($ctx1) {$ctx1.fill(self,"findClass:",{aClass:aClass},$globals.Finder.klass)});
  1427. //>>excludeEnd("ctx");
  1428. },
  1429. //>>excludeStart("ide", pragmas.excludeIdeData);
  1430. args: ["aClass"],
  1431. source: "findClass: aClass\x0a\x09^ self current findClass: aClass",
  1432. referencedClasses: [],
  1433. //>>excludeEnd("ide");
  1434. messageSends: ["findClass:", "current"]
  1435. }),
  1436. $globals.Finder.klass);
  1437. $core.addMethod(
  1438. $core.method({
  1439. selector: "findMethod:",
  1440. protocol: "finding",
  1441. fn: function (aCompiledMethod){
  1442. var self=this;
  1443. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1444. return $core.withContext(function($ctx1) {
  1445. //>>excludeEnd("ctx");
  1446. return $recv(self._current())._findMethod_(aCompiledMethod);
  1447. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1448. }, function($ctx1) {$ctx1.fill(self,"findMethod:",{aCompiledMethod:aCompiledMethod},$globals.Finder.klass)});
  1449. //>>excludeEnd("ctx");
  1450. },
  1451. //>>excludeStart("ide", pragmas.excludeIdeData);
  1452. args: ["aCompiledMethod"],
  1453. source: "findMethod: aCompiledMethod\x0a\x09^ self current findMethod: aCompiledMethod",
  1454. referencedClasses: [],
  1455. //>>excludeEnd("ide");
  1456. messageSends: ["findMethod:", "current"]
  1457. }),
  1458. $globals.Finder.klass);
  1459. $core.addMethod(
  1460. $core.method({
  1461. selector: "findString:",
  1462. protocol: "finding",
  1463. fn: function (aString){
  1464. var self=this;
  1465. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1466. return $core.withContext(function($ctx1) {
  1467. //>>excludeEnd("ctx");
  1468. return $recv(self._current())._findString_(aString);
  1469. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1470. }, function($ctx1) {$ctx1.fill(self,"findString:",{aString:aString},$globals.Finder.klass)});
  1471. //>>excludeEnd("ctx");
  1472. },
  1473. //>>excludeStart("ide", pragmas.excludeIdeData);
  1474. args: ["aString"],
  1475. source: "findString: aString\x0a\x09^ self current findString: aString",
  1476. referencedClasses: [],
  1477. //>>excludeEnd("ide");
  1478. messageSends: ["findString:", "current"]
  1479. }),
  1480. $globals.Finder.klass);
  1481. $core.addClass("Inspector", $globals.Service, [], "Platform-Services");
  1482. //>>excludeStart("ide", pragmas.excludeIdeData);
  1483. $globals.Inspector.comment="I am the service responsible for inspecting objects.\x0a\x0aThe default inspector object is the transcript.";
  1484. //>>excludeEnd("ide");
  1485. $core.addMethod(
  1486. $core.method({
  1487. selector: "inspect:",
  1488. protocol: "inspecting",
  1489. fn: function (anObject){
  1490. var self=this;
  1491. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1492. return $core.withContext(function($ctx1) {
  1493. //>>excludeEnd("ctx");
  1494. return $recv(self._current())._inspect_(anObject);
  1495. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1496. }, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},$globals.Inspector.klass)});
  1497. //>>excludeEnd("ctx");
  1498. },
  1499. //>>excludeStart("ide", pragmas.excludeIdeData);
  1500. args: ["anObject"],
  1501. source: "inspect: anObject\x0a\x09^ self current inspect: anObject",
  1502. referencedClasses: [],
  1503. //>>excludeEnd("ide");
  1504. messageSends: ["inspect:", "current"]
  1505. }),
  1506. $globals.Inspector.klass);
  1507. $core.addClass("Platform", $globals.Service, [], "Platform-Services");
  1508. //>>excludeStart("ide", pragmas.excludeIdeData);
  1509. $globals.Platform.comment="I am bridge to JS environment.\x0a\x0a## API\x0a\x0a Platform globals. \x22JS global object\x22\x0a Platform newXHR \x22new XMLHttpRequest() or its shim\x22";
  1510. //>>excludeEnd("ide");
  1511. $core.addMethod(
  1512. $core.method({
  1513. selector: "globals",
  1514. protocol: "accessing",
  1515. fn: function (){
  1516. var self=this;
  1517. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1518. return $core.withContext(function($ctx1) {
  1519. //>>excludeEnd("ctx");
  1520. return $recv(self._current())._globals();
  1521. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1522. }, function($ctx1) {$ctx1.fill(self,"globals",{},$globals.Platform.klass)});
  1523. //>>excludeEnd("ctx");
  1524. },
  1525. //>>excludeStart("ide", pragmas.excludeIdeData);
  1526. args: [],
  1527. source: "globals\x0a\x09^ self current globals",
  1528. referencedClasses: [],
  1529. //>>excludeEnd("ide");
  1530. messageSends: ["globals", "current"]
  1531. }),
  1532. $globals.Platform.klass);
  1533. $core.addMethod(
  1534. $core.method({
  1535. selector: "newXhr",
  1536. protocol: "accessing",
  1537. fn: function (){
  1538. var self=this;
  1539. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1540. return $core.withContext(function($ctx1) {
  1541. //>>excludeEnd("ctx");
  1542. return $recv(self._current())._newXhr();
  1543. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1544. }, function($ctx1) {$ctx1.fill(self,"newXhr",{},$globals.Platform.klass)});
  1545. //>>excludeEnd("ctx");
  1546. },
  1547. //>>excludeStart("ide", pragmas.excludeIdeData);
  1548. args: [],
  1549. source: "newXhr\x0a\x09^ self current newXhr",
  1550. referencedClasses: [],
  1551. //>>excludeEnd("ide");
  1552. messageSends: ["newXhr", "current"]
  1553. }),
  1554. $globals.Platform.klass);
  1555. $core.addClass("ProgressHandler", $globals.Service, [], "Platform-Services");
  1556. //>>excludeStart("ide", pragmas.excludeIdeData);
  1557. $globals.ProgressHandler.comment="I am used to manage progress in collection iterations, see `SequenceableCollection >> #do:displayingProgress:`.\x0a\x0aRegistered instances must implement `#do:on:displaying:`.\x0a\x0aThe default behavior is to simply iterate over the collection, using `NullProgressHandler`.";
  1558. //>>excludeEnd("ide");
  1559. $core.addMethod(
  1560. $core.method({
  1561. selector: "do:on:displaying:",
  1562. protocol: "progress handling",
  1563. fn: function (aBlock,aCollection,aString){
  1564. var self=this;
  1565. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1566. return $core.withContext(function($ctx1) {
  1567. //>>excludeEnd("ctx");
  1568. $recv(self._current())._do_on_displaying_(aBlock,aCollection,aString);
  1569. return self;
  1570. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1571. }, function($ctx1) {$ctx1.fill(self,"do:on:displaying:",{aBlock:aBlock,aCollection:aCollection,aString:aString},$globals.ProgressHandler.klass)});
  1572. //>>excludeEnd("ctx");
  1573. },
  1574. //>>excludeStart("ide", pragmas.excludeIdeData);
  1575. args: ["aBlock", "aCollection", "aString"],
  1576. source: "do: aBlock on: aCollection displaying: aString\x0a\x09self current do: aBlock on: aCollection displaying: aString",
  1577. referencedClasses: [],
  1578. //>>excludeEnd("ide");
  1579. messageSends: ["do:on:displaying:", "current"]
  1580. }),
  1581. $globals.ProgressHandler.klass);
  1582. $core.addClass("Terminal", $globals.Service, [], "Platform-Services");
  1583. //>>excludeStart("ide", pragmas.excludeIdeData);
  1584. $globals.Terminal.comment="I am UI interface service.\x0a\x0a## API\x0a\x0a Terminal alert: 'Hey, there is a problem'.\x0a Terminal confirm: 'Affirmative?'.\x0a Terminal prompt: 'Your name:'.";
  1585. //>>excludeEnd("ide");
  1586. $core.addMethod(
  1587. $core.method({
  1588. selector: "alert:",
  1589. protocol: "dialogs",
  1590. fn: function (aString){
  1591. var self=this;
  1592. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1593. return $core.withContext(function($ctx1) {
  1594. //>>excludeEnd("ctx");
  1595. return $recv(self._current())._alert_(aString);
  1596. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1597. }, function($ctx1) {$ctx1.fill(self,"alert:",{aString:aString},$globals.Terminal.klass)});
  1598. //>>excludeEnd("ctx");
  1599. },
  1600. //>>excludeStart("ide", pragmas.excludeIdeData);
  1601. args: ["aString"],
  1602. source: "alert: aString\x0a\x09^ self current alert: aString",
  1603. referencedClasses: [],
  1604. //>>excludeEnd("ide");
  1605. messageSends: ["alert:", "current"]
  1606. }),
  1607. $globals.Terminal.klass);
  1608. $core.addMethod(
  1609. $core.method({
  1610. selector: "confirm:",
  1611. protocol: "dialogs",
  1612. fn: function (aString){
  1613. var self=this;
  1614. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1615. return $core.withContext(function($ctx1) {
  1616. //>>excludeEnd("ctx");
  1617. return $recv(self._current())._confirm_(aString);
  1618. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1619. }, function($ctx1) {$ctx1.fill(self,"confirm:",{aString:aString},$globals.Terminal.klass)});
  1620. //>>excludeEnd("ctx");
  1621. },
  1622. //>>excludeStart("ide", pragmas.excludeIdeData);
  1623. args: ["aString"],
  1624. source: "confirm: aString\x0a\x09^ self current confirm: aString",
  1625. referencedClasses: [],
  1626. //>>excludeEnd("ide");
  1627. messageSends: ["confirm:", "current"]
  1628. }),
  1629. $globals.Terminal.klass);
  1630. $core.addMethod(
  1631. $core.method({
  1632. selector: "prompt:",
  1633. protocol: "dialogs",
  1634. fn: function (aString){
  1635. var self=this;
  1636. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1637. return $core.withContext(function($ctx1) {
  1638. //>>excludeEnd("ctx");
  1639. return $recv(self._current())._prompt_(aString);
  1640. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1641. }, function($ctx1) {$ctx1.fill(self,"prompt:",{aString:aString},$globals.Terminal.klass)});
  1642. //>>excludeEnd("ctx");
  1643. },
  1644. //>>excludeStart("ide", pragmas.excludeIdeData);
  1645. args: ["aString"],
  1646. source: "prompt: aString\x0a\x09^ self current prompt: aString",
  1647. referencedClasses: [],
  1648. //>>excludeEnd("ide");
  1649. messageSends: ["prompt:", "current"]
  1650. }),
  1651. $globals.Terminal.klass);
  1652. $core.addMethod(
  1653. $core.method({
  1654. selector: "prompt:default:",
  1655. protocol: "dialogs",
  1656. fn: function (aString,defaultString){
  1657. var self=this;
  1658. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1659. return $core.withContext(function($ctx1) {
  1660. //>>excludeEnd("ctx");
  1661. return $recv(self._current())._prompt_default_(aString,defaultString);
  1662. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1663. }, function($ctx1) {$ctx1.fill(self,"prompt:default:",{aString:aString,defaultString:defaultString},$globals.Terminal.klass)});
  1664. //>>excludeEnd("ctx");
  1665. },
  1666. //>>excludeStart("ide", pragmas.excludeIdeData);
  1667. args: ["aString", "defaultString"],
  1668. source: "prompt: aString default: defaultString\x0a\x09^ self current prompt: aString default: defaultString",
  1669. referencedClasses: [],
  1670. //>>excludeEnd("ide");
  1671. messageSends: ["prompt:default:", "current"]
  1672. }),
  1673. $globals.Terminal.klass);
  1674. $core.addClass("Transcript", $globals.Service, [], "Platform-Services");
  1675. //>>excludeStart("ide", pragmas.excludeIdeData);
  1676. $globals.Transcript.comment="I am a facade for Transcript actions.\x0a\x0aI delegate actions to the currently registered transcript.\x0a\x0a## API\x0a\x0a Transcript \x0a show: 'hello world';\x0a cr;\x0a show: anObject.";
  1677. //>>excludeEnd("ide");
  1678. $core.addMethod(
  1679. $core.method({
  1680. selector: "clear",
  1681. protocol: "printing",
  1682. fn: function (){
  1683. var self=this;
  1684. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1685. return $core.withContext(function($ctx1) {
  1686. //>>excludeEnd("ctx");
  1687. $recv(self._current())._clear();
  1688. return self;
  1689. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1690. }, function($ctx1) {$ctx1.fill(self,"clear",{},$globals.Transcript.klass)});
  1691. //>>excludeEnd("ctx");
  1692. },
  1693. //>>excludeStart("ide", pragmas.excludeIdeData);
  1694. args: [],
  1695. source: "clear\x0a\x09self current clear",
  1696. referencedClasses: [],
  1697. //>>excludeEnd("ide");
  1698. messageSends: ["clear", "current"]
  1699. }),
  1700. $globals.Transcript.klass);
  1701. $core.addMethod(
  1702. $core.method({
  1703. selector: "cr",
  1704. protocol: "printing",
  1705. fn: function (){
  1706. var self=this;
  1707. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1708. return $core.withContext(function($ctx1) {
  1709. //>>excludeEnd("ctx");
  1710. $recv(self._current())._show_($recv($globals.String)._cr());
  1711. return self;
  1712. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1713. }, function($ctx1) {$ctx1.fill(self,"cr",{},$globals.Transcript.klass)});
  1714. //>>excludeEnd("ctx");
  1715. },
  1716. //>>excludeStart("ide", pragmas.excludeIdeData);
  1717. args: [],
  1718. source: "cr\x0a\x09self current show: String cr",
  1719. referencedClasses: ["String"],
  1720. //>>excludeEnd("ide");
  1721. messageSends: ["show:", "current", "cr"]
  1722. }),
  1723. $globals.Transcript.klass);
  1724. $core.addMethod(
  1725. $core.method({
  1726. selector: "inspect:",
  1727. protocol: "printing",
  1728. fn: function (anObject){
  1729. var self=this;
  1730. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1731. return $core.withContext(function($ctx1) {
  1732. //>>excludeEnd("ctx");
  1733. self._show_(anObject);
  1734. return self;
  1735. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1736. }, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},$globals.Transcript.klass)});
  1737. //>>excludeEnd("ctx");
  1738. },
  1739. //>>excludeStart("ide", pragmas.excludeIdeData);
  1740. args: ["anObject"],
  1741. source: "inspect: anObject\x0a\x09self show: anObject",
  1742. referencedClasses: [],
  1743. //>>excludeEnd("ide");
  1744. messageSends: ["show:"]
  1745. }),
  1746. $globals.Transcript.klass);
  1747. $core.addMethod(
  1748. $core.method({
  1749. selector: "open",
  1750. protocol: "instance creation",
  1751. fn: function (){
  1752. var self=this;
  1753. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1754. return $core.withContext(function($ctx1) {
  1755. //>>excludeEnd("ctx");
  1756. $recv(self._current())._open();
  1757. return self;
  1758. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1759. }, function($ctx1) {$ctx1.fill(self,"open",{},$globals.Transcript.klass)});
  1760. //>>excludeEnd("ctx");
  1761. },
  1762. //>>excludeStart("ide", pragmas.excludeIdeData);
  1763. args: [],
  1764. source: "open\x0a\x09self current open",
  1765. referencedClasses: [],
  1766. //>>excludeEnd("ide");
  1767. messageSends: ["open", "current"]
  1768. }),
  1769. $globals.Transcript.klass);
  1770. $core.addMethod(
  1771. $core.method({
  1772. selector: "show:",
  1773. protocol: "printing",
  1774. fn: function (anObject){
  1775. var self=this;
  1776. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1777. return $core.withContext(function($ctx1) {
  1778. //>>excludeEnd("ctx");
  1779. $recv(self._current())._show_(anObject);
  1780. return self;
  1781. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1782. }, function($ctx1) {$ctx1.fill(self,"show:",{anObject:anObject},$globals.Transcript.klass)});
  1783. //>>excludeEnd("ctx");
  1784. },
  1785. //>>excludeStart("ide", pragmas.excludeIdeData);
  1786. args: ["anObject"],
  1787. source: "show: anObject\x0a\x09self current show: anObject",
  1788. referencedClasses: [],
  1789. //>>excludeEnd("ide");
  1790. messageSends: ["show:", "current"]
  1791. }),
  1792. $globals.Transcript.klass);
  1793. $core.addMethod(
  1794. $core.method({
  1795. selector: "inspectOn:",
  1796. protocol: "*Platform-Services",
  1797. fn: function (anInspector){
  1798. var self=this;
  1799. var variables;
  1800. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1801. return $core.withContext(function($ctx1) {
  1802. //>>excludeEnd("ctx");
  1803. variables=$recv($globals.Dictionary)._new();
  1804. $recv(variables)._at_put_("#self",self);
  1805. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1806. $ctx1.sendIdx["at:put:"]=1;
  1807. //>>excludeEnd("ctx");
  1808. $recv(variables)._at_put_("#keys",self._keys());
  1809. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1810. $ctx1.sendIdx["at:put:"]=2;
  1811. //>>excludeEnd("ctx");
  1812. self._keysAndValuesDo_((function(key,value){
  1813. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1814. return $core.withContext(function($ctx2) {
  1815. //>>excludeEnd("ctx");
  1816. return $recv(variables)._at_put_(key,value);
  1817. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1818. }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1,1)});
  1819. //>>excludeEnd("ctx");
  1820. }));
  1821. $recv(anInspector)._setLabel_(self._printString());
  1822. $recv(anInspector)._setVariables_(variables);
  1823. return self;
  1824. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1825. }, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables},$globals.AssociativeCollection)});
  1826. //>>excludeEnd("ctx");
  1827. },
  1828. //>>excludeStart("ide", pragmas.excludeIdeData);
  1829. args: ["anInspector"],
  1830. source: "inspectOn: anInspector\x0a\x09| variables |\x0a\x09variables := Dictionary new.\x0a\x09variables at: '#self' put: self.\x0a\x09variables at: '#keys' put: self keys.\x0a\x09self keysAndValuesDo: [ :key :value |\x0a\x09\x09variables at: key put: value ].\x0a\x09anInspector\x0a\x09\x09setLabel: self printString;\x0a\x09\x09setVariables: variables",
  1831. referencedClasses: ["Dictionary"],
  1832. //>>excludeEnd("ide");
  1833. messageSends: ["new", "at:put:", "keys", "keysAndValuesDo:", "setLabel:", "printString", "setVariables:"]
  1834. }),
  1835. $globals.AssociativeCollection);
  1836. $core.addMethod(
  1837. $core.method({
  1838. selector: "inspectOn:",
  1839. protocol: "*Platform-Services",
  1840. fn: function (anInspector){
  1841. var self=this;
  1842. var variables;
  1843. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1844. return $core.withContext(function($ctx1) {
  1845. //>>excludeEnd("ctx");
  1846. variables=$recv($globals.Dictionary)._new();
  1847. $recv(variables)._at_put_("#self",self);
  1848. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1849. $ctx1.sendIdx["at:put:"]=1;
  1850. //>>excludeEnd("ctx");
  1851. self._withIndexDo_((function(each,i){
  1852. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1853. return $core.withContext(function($ctx2) {
  1854. //>>excludeEnd("ctx");
  1855. return $recv(variables)._at_put_(i,each);
  1856. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1857. }, function($ctx2) {$ctx2.fillBlock({each:each,i:i},$ctx1,1)});
  1858. //>>excludeEnd("ctx");
  1859. }));
  1860. $recv(anInspector)._setLabel_(self._printString());
  1861. $recv(anInspector)._setVariables_(variables);
  1862. return self;
  1863. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1864. }, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables},$globals.Collection)});
  1865. //>>excludeEnd("ctx");
  1866. },
  1867. //>>excludeStart("ide", pragmas.excludeIdeData);
  1868. args: ["anInspector"],
  1869. source: "inspectOn: anInspector\x0a\x09| variables |\x0a\x09variables := Dictionary new.\x0a\x09variables at: '#self' put: self.\x0a\x09self withIndexDo: [ :each :i |\x0a\x09\x09variables at: i put: each ].\x0a\x09anInspector\x0a\x09\x09setLabel: self printString;\x0a\x09\x09setVariables: variables",
  1870. referencedClasses: ["Dictionary"],
  1871. //>>excludeEnd("ide");
  1872. messageSends: ["new", "at:put:", "withIndexDo:", "setLabel:", "printString", "setVariables:"]
  1873. }),
  1874. $globals.Collection);
  1875. $core.addMethod(
  1876. $core.method({
  1877. selector: "inspectOn:",
  1878. protocol: "*Platform-Services",
  1879. fn: function (anInspector){
  1880. var self=this;
  1881. var variables;
  1882. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1883. return $core.withContext(function($ctx1) {
  1884. //>>excludeEnd("ctx");
  1885. variables=$recv($globals.Dictionary)._new();
  1886. $recv(variables)._at_put_("#self",self);
  1887. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1888. $ctx1.sendIdx["at:put:"]=1;
  1889. //>>excludeEnd("ctx");
  1890. $recv(variables)._at_put_("#year",self._year());
  1891. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1892. $ctx1.sendIdx["at:put:"]=2;
  1893. //>>excludeEnd("ctx");
  1894. $recv(variables)._at_put_("#month",self._month());
  1895. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1896. $ctx1.sendIdx["at:put:"]=3;
  1897. //>>excludeEnd("ctx");
  1898. $recv(variables)._at_put_("#day",self._day());
  1899. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1900. $ctx1.sendIdx["at:put:"]=4;
  1901. //>>excludeEnd("ctx");
  1902. $recv(variables)._at_put_("#hours",self._hours());
  1903. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1904. $ctx1.sendIdx["at:put:"]=5;
  1905. //>>excludeEnd("ctx");
  1906. $recv(variables)._at_put_("#minutes",self._minutes());
  1907. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1908. $ctx1.sendIdx["at:put:"]=6;
  1909. //>>excludeEnd("ctx");
  1910. $recv(variables)._at_put_("#seconds",self._seconds());
  1911. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1912. $ctx1.sendIdx["at:put:"]=7;
  1913. //>>excludeEnd("ctx");
  1914. $recv(variables)._at_put_("#milliseconds",self._milliseconds());
  1915. $recv(anInspector)._setLabel_(self._printString());
  1916. $recv(anInspector)._setVariables_(variables);
  1917. return self;
  1918. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1919. }, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables},$globals.Date)});
  1920. //>>excludeEnd("ctx");
  1921. },
  1922. //>>excludeStart("ide", pragmas.excludeIdeData);
  1923. args: ["anInspector"],
  1924. source: "inspectOn: anInspector\x0a\x09| variables |\x0a\x09variables := Dictionary new.\x0a\x09variables at: '#self' put: self.\x0a\x09variables at: '#year' put: self year.\x0a\x09variables at: '#month' put: self month.\x0a\x09variables at: '#day' put: self day.\x0a\x09variables at: '#hours' put: self hours.\x0a\x09variables at: '#minutes' put: self minutes.\x0a\x09variables at: '#seconds' put: self seconds.\x0a\x09variables at: '#milliseconds' put: self milliseconds.\x0a\x09anInspector\x0a\x09\x09setLabel: self printString;\x0a\x09\x09setVariables: variables",
  1925. referencedClasses: ["Dictionary"],
  1926. //>>excludeEnd("ide");
  1927. messageSends: ["new", "at:put:", "year", "month", "day", "hours", "minutes", "seconds", "milliseconds", "setLabel:", "printString", "setVariables:"]
  1928. }),
  1929. $globals.Date);
  1930. $core.addMethod(
  1931. $core.method({
  1932. selector: "inspectOn:",
  1933. protocol: "*Platform-Services",
  1934. fn: function (anInspector){
  1935. var self=this;
  1936. var variables;
  1937. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1938. return $core.withContext(function($ctx1) {
  1939. //>>excludeEnd("ctx");
  1940. variables=$recv($globals.Dictionary)._new();
  1941. $recv(variables)._at_put_("#self",self._jsObject());
  1942. $recv(anInspector)._setLabel_(self._printString());
  1943. $recv($globals.JSObjectProxy)._addObjectVariablesTo_ofProxy_(variables,self);
  1944. $recv(anInspector)._setVariables_(variables);
  1945. return self;
  1946. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1947. }, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables},$globals.JSObjectProxy)});
  1948. //>>excludeEnd("ctx");
  1949. },
  1950. //>>excludeStart("ide", pragmas.excludeIdeData);
  1951. args: ["anInspector"],
  1952. source: "inspectOn: anInspector\x0a\x09| variables |\x0a\x09variables := Dictionary new.\x0a\x09variables at: '#self' put: self jsObject.\x0a\x09anInspector setLabel: self printString.\x0a\x09JSObjectProxy addObjectVariablesTo: variables ofProxy: self.\x0a\x09anInspector setVariables: variables",
  1953. referencedClasses: ["Dictionary", "JSObjectProxy"],
  1954. //>>excludeEnd("ide");
  1955. messageSends: ["new", "at:put:", "jsObject", "setLabel:", "printString", "addObjectVariablesTo:ofProxy:", "setVariables:"]
  1956. }),
  1957. $globals.JSObjectProxy);
  1958. $core.addMethod(
  1959. $core.method({
  1960. selector: "inspectOn:",
  1961. protocol: "*Platform-Services",
  1962. fn: function (anInspector){
  1963. var self=this;
  1964. var variables;
  1965. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1966. return $core.withContext(function($ctx1) {
  1967. //>>excludeEnd("ctx");
  1968. variables=$recv($globals.Dictionary)._new();
  1969. $recv(variables)._at_put_("#self",self);
  1970. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1971. $ctx1.sendIdx["at:put:"]=1;
  1972. //>>excludeEnd("ctx");
  1973. $recv(variables)._at_put_("#home",self._home());
  1974. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1975. $ctx1.sendIdx["at:put:"]=2;
  1976. //>>excludeEnd("ctx");
  1977. $recv(variables)._at_put_("#receiver",self._receiver());
  1978. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1979. $ctx1.sendIdx["at:put:"]=3;
  1980. //>>excludeEnd("ctx");
  1981. $recv(variables)._at_put_("#selector",self._selector());
  1982. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1983. $ctx1.sendIdx["at:put:"]=4;
  1984. //>>excludeEnd("ctx");
  1985. $recv(variables)._at_put_("#locals",self._locals());
  1986. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1987. $ctx1.sendIdx["at:put:"]=5;
  1988. //>>excludeEnd("ctx");
  1989. $recv($recv(self._class())._instanceVariableNames())._do_((function(each){
  1990. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1991. return $core.withContext(function($ctx2) {
  1992. //>>excludeEnd("ctx");
  1993. return $recv(variables)._at_put_(each,self._instVarAt_(each));
  1994. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1995. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  1996. //>>excludeEnd("ctx");
  1997. }));
  1998. $recv(anInspector)._setLabel_(self._printString());
  1999. $recv(anInspector)._setVariables_(variables);
  2000. return self;
  2001. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2002. }, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables},$globals.MethodContext)});
  2003. //>>excludeEnd("ctx");
  2004. },
  2005. //>>excludeStart("ide", pragmas.excludeIdeData);
  2006. args: ["anInspector"],
  2007. source: "inspectOn: anInspector\x0a\x09| variables |\x0a\x09variables := Dictionary new.\x0a\x09variables at: '#self' put: self.\x0a\x09variables at: '#home' put: self home.\x0a\x09variables at: '#receiver' put: self receiver.\x0a\x09variables at: '#selector' put: self selector.\x0a\x09variables at: '#locals' put: self locals.\x0a\x09self class instanceVariableNames do: [ :each |\x0a\x09\x09variables at: each put: (self instVarAt: each) ].\x0a\x09anInspector\x0a\x09\x09setLabel: self printString;\x0a\x09\x09setVariables: variables",
  2008. referencedClasses: ["Dictionary"],
  2009. //>>excludeEnd("ide");
  2010. messageSends: ["new", "at:put:", "home", "receiver", "selector", "locals", "do:", "instanceVariableNames", "class", "instVarAt:", "setLabel:", "printString", "setVariables:"]
  2011. }),
  2012. $globals.MethodContext);
  2013. $core.addMethod(
  2014. $core.method({
  2015. selector: "inspectOn:",
  2016. protocol: "*Platform-Services",
  2017. fn: function (anInspector){
  2018. var self=this;
  2019. var variables;
  2020. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2021. return $core.withContext(function($ctx1) {
  2022. //>>excludeEnd("ctx");
  2023. variables=$recv($globals.Dictionary)._new();
  2024. $recv(variables)._at_put_("#self",self);
  2025. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2026. $ctx1.sendIdx["at:put:"]=1;
  2027. //>>excludeEnd("ctx");
  2028. $recv($recv(self._class())._allInstanceVariableNames())._do_((function(each){
  2029. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2030. return $core.withContext(function($ctx2) {
  2031. //>>excludeEnd("ctx");
  2032. return $recv(variables)._at_put_(each,self._instVarAt_(each));
  2033. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2034. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2035. //>>excludeEnd("ctx");
  2036. }));
  2037. $recv(anInspector)._setLabel_(self._printString());
  2038. $recv(anInspector)._setVariables_(variables);
  2039. return self;
  2040. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2041. }, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables},$globals.Object)});
  2042. //>>excludeEnd("ctx");
  2043. },
  2044. //>>excludeStart("ide", pragmas.excludeIdeData);
  2045. args: ["anInspector"],
  2046. source: "inspectOn: anInspector\x0a\x09| variables |\x0a\x09variables := Dictionary new.\x0a\x09variables at: '#self' put: self.\x0a\x09self class allInstanceVariableNames do: [ :each |\x0a\x09\x09variables at: each put: (self instVarAt: each) ].\x0a\x09anInspector\x0a\x09\x09setLabel: self printString;\x0a\x09\x09setVariables: variables",
  2047. referencedClasses: ["Dictionary"],
  2048. //>>excludeEnd("ide");
  2049. messageSends: ["new", "at:put:", "do:", "allInstanceVariableNames", "class", "instVarAt:", "setLabel:", "printString", "setVariables:"]
  2050. }),
  2051. $globals.Object);
  2052. $core.addMethod(
  2053. $core.method({
  2054. selector: "do:displayingProgress:",
  2055. protocol: "*Platform-Services",
  2056. fn: function (aBlock,aString){
  2057. var self=this;
  2058. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2059. return $core.withContext(function($ctx1) {
  2060. //>>excludeEnd("ctx");
  2061. $recv($globals.ProgressHandler)._do_on_displaying_(aBlock,self,aString);
  2062. return self;
  2063. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2064. }, function($ctx1) {$ctx1.fill(self,"do:displayingProgress:",{aBlock:aBlock,aString:aString},$globals.SequenceableCollection)});
  2065. //>>excludeEnd("ctx");
  2066. },
  2067. //>>excludeStart("ide", pragmas.excludeIdeData);
  2068. args: ["aBlock", "aString"],
  2069. source: "do: aBlock displayingProgress: aString\x0a\x09ProgressHandler \x0a\x09\x09do: aBlock \x0a\x09\x09on: self \x0a\x09\x09displaying: aString",
  2070. referencedClasses: ["ProgressHandler"],
  2071. //>>excludeEnd("ide");
  2072. messageSends: ["do:on:displaying:"]
  2073. }),
  2074. $globals.SequenceableCollection);
  2075. $core.addMethod(
  2076. $core.method({
  2077. selector: "inspectOn:",
  2078. protocol: "*Platform-Services",
  2079. fn: function (anInspector){
  2080. var self=this;
  2081. var variables,i;
  2082. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2083. return $core.withContext(function($ctx1) {
  2084. //>>excludeEnd("ctx");
  2085. variables=$recv($globals.Dictionary)._new();
  2086. $recv(variables)._at_put_("#self",self);
  2087. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2088. $ctx1.sendIdx["at:put:"]=1;
  2089. //>>excludeEnd("ctx");
  2090. i=(1);
  2091. self._do_((function(each){
  2092. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2093. return $core.withContext(function($ctx2) {
  2094. //>>excludeEnd("ctx");
  2095. $recv(variables)._at_put_(i,each);
  2096. i=$recv(i).__plus((1));
  2097. return i;
  2098. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2099. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2100. //>>excludeEnd("ctx");
  2101. }));
  2102. $recv(anInspector)._setLabel_(self._printString());
  2103. $recv(anInspector)._setVariables_(variables);
  2104. return self;
  2105. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2106. }, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables,i:i},$globals.Set)});
  2107. //>>excludeEnd("ctx");
  2108. },
  2109. //>>excludeStart("ide", pragmas.excludeIdeData);
  2110. args: ["anInspector"],
  2111. source: "inspectOn: anInspector\x0a\x09| variables i |\x0a\x09variables := Dictionary new.\x0a\x09variables at: '#self' put: self.\x0a\x09i := 1.\x0a\x09self do: [ :each |\x0a\x09\x09variables at: i put: each.\x0a\x09\x09i := i + 1 ].\x0a\x09anInspector\x0a\x09\x09setLabel: self printString;\x0a\x09\x09setVariables: variables",
  2112. referencedClasses: ["Dictionary"],
  2113. //>>excludeEnd("ide");
  2114. messageSends: ["new", "at:put:", "do:", "+", "setLabel:", "printString", "setVariables:"]
  2115. }),
  2116. $globals.Set);
  2117. $core.addMethod(
  2118. $core.method({
  2119. selector: "inspectOn:",
  2120. protocol: "*Platform-Services",
  2121. fn: function (anInspector){
  2122. var self=this;
  2123. var label;
  2124. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2125. return $core.withContext(function($ctx1) {
  2126. //>>excludeEnd("ctx");
  2127. var $3,$2,$1,$5,$4;
  2128. (
  2129. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2130. $ctx1.supercall = true,
  2131. //>>excludeEnd("ctx");
  2132. ($globals.String.superclass||$boot.nilAsClass).fn.prototype._inspectOn_.apply($recv(self), [anInspector]));
  2133. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2134. $ctx1.supercall = false;
  2135. //>>excludeEnd("ctx");;
  2136. $3=self._printString();
  2137. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2138. $ctx1.sendIdx["printString"]=1;
  2139. //>>excludeEnd("ctx");
  2140. $2=$recv($3)._size();
  2141. $1=$recv($2).__gt((30));
  2142. if($core.assert($1)){
  2143. $5=self._printString();
  2144. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2145. $ctx1.sendIdx["printString"]=2;
  2146. //>>excludeEnd("ctx");
  2147. $4=$recv($5)._copyFrom_to_((1),(30));
  2148. label=$recv($4).__comma("...'");
  2149. label;
  2150. } else {
  2151. label=self._printString();
  2152. label;
  2153. }
  2154. $recv(anInspector)._setLabel_(label);
  2155. return self;
  2156. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2157. }, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,label:label},$globals.String)});
  2158. //>>excludeEnd("ctx");
  2159. },
  2160. //>>excludeStart("ide", pragmas.excludeIdeData);
  2161. args: ["anInspector"],
  2162. source: "inspectOn: anInspector\x0a\x09| label |\x0a\x09super inspectOn: anInspector.\x0a\x09self printString size > 30\x0a\x09\x09ifTrue: [ label := (self printString copyFrom: 1 to: 30), '...''' ]\x0a\x09\x09ifFalse: [ label := self printString ].\x0a\x09anInspector setLabel: label",
  2163. referencedClasses: [],
  2164. //>>excludeEnd("ide");
  2165. messageSends: ["inspectOn:", "ifTrue:ifFalse:", ">", "size", "printString", ",", "copyFrom:to:", "setLabel:"]
  2166. }),
  2167. $globals.String);
  2168. });