Platform-Services.js 82 KB

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