Platform-Services.js 83 KB

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