Platform-Services.js 82 KB

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