2
0

Platform-Services.js 82 KB

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