Platform-Services.js 83 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324
  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)._pass();
  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 pass ] ]",
  731. referencedClasses: [],
  732. //>>excludeEnd("ide");
  733. messageSends: ["tryCatch:", "ifTrue:ifFalse:", "isKindOf:", "classNamed:", "name", "value:", "pass"]
  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. $recv(smalltalkError)._wrap();
  1387. $self._handleUnhandledError_(smalltalkError);
  1388. }
  1389. return self;
  1390. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1391. }, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},$globals.ErrorHandler.a$cls)});
  1392. //>>excludeEnd("ctx");
  1393. },
  1394. //>>excludeStart("ide", pragmas.excludeIdeData);
  1395. args: ["anError"],
  1396. 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 ]",
  1397. referencedClasses: ["JavaScriptException"],
  1398. //>>excludeEnd("ide");
  1399. messageSends: ["ifTrue:ifFalse:", "tryCatch:", "isSmalltalkError", "handleUnhandledError:", "on:", "wrap"]
  1400. }),
  1401. $globals.ErrorHandler.a$cls);
  1402. $core.addMethod(
  1403. $core.method({
  1404. selector: "handleUnhandledError:",
  1405. protocol: "error handling",
  1406. fn: function (anError){
  1407. var self=this,$self=this;
  1408. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1409. return $core.withContext(function($ctx1) {
  1410. //>>excludeEnd("ctx");
  1411. var $1;
  1412. $1=$recv(anError)._wasHandled();
  1413. if(!$core.assert($1)){
  1414. $recv($self._current())._handleError_(anError);
  1415. $recv(anError)._beHandled();
  1416. }
  1417. return self;
  1418. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1419. }, function($ctx1) {$ctx1.fill(self,"handleUnhandledError:",{anError:anError},$globals.ErrorHandler.a$cls)});
  1420. //>>excludeEnd("ctx");
  1421. },
  1422. //>>excludeStart("ide", pragmas.excludeIdeData);
  1423. args: ["anError"],
  1424. source: "handleUnhandledError: anError\x0a\x09anError wasHandled ifFalse: [\x0a\x09\x09self current handleError: anError.\x0a\x09\x09anError beHandled ]",
  1425. referencedClasses: [],
  1426. //>>excludeEnd("ide");
  1427. messageSends: ["ifFalse:", "wasHandled", "handleError:", "current", "beHandled"]
  1428. }),
  1429. $globals.ErrorHandler.a$cls);
  1430. $core.addClass("Finder", $globals.Service, [], "Platform-Services");
  1431. //>>excludeStart("ide", pragmas.excludeIdeData);
  1432. $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.";
  1433. //>>excludeEnd("ide");
  1434. $core.addMethod(
  1435. $core.method({
  1436. selector: "findClass:",
  1437. protocol: "finding",
  1438. fn: function (aClass){
  1439. var self=this,$self=this;
  1440. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1441. return $core.withContext(function($ctx1) {
  1442. //>>excludeEnd("ctx");
  1443. return $recv($self._current())._findClass_(aClass);
  1444. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1445. }, function($ctx1) {$ctx1.fill(self,"findClass:",{aClass:aClass},$globals.Finder.a$cls)});
  1446. //>>excludeEnd("ctx");
  1447. },
  1448. //>>excludeStart("ide", pragmas.excludeIdeData);
  1449. args: ["aClass"],
  1450. source: "findClass: aClass\x0a\x09^ self current findClass: aClass",
  1451. referencedClasses: [],
  1452. //>>excludeEnd("ide");
  1453. messageSends: ["findClass:", "current"]
  1454. }),
  1455. $globals.Finder.a$cls);
  1456. $core.addMethod(
  1457. $core.method({
  1458. selector: "findMethod:",
  1459. protocol: "finding",
  1460. fn: function (aCompiledMethod){
  1461. var self=this,$self=this;
  1462. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1463. return $core.withContext(function($ctx1) {
  1464. //>>excludeEnd("ctx");
  1465. return $recv($self._current())._findMethod_(aCompiledMethod);
  1466. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1467. }, function($ctx1) {$ctx1.fill(self,"findMethod:",{aCompiledMethod:aCompiledMethod},$globals.Finder.a$cls)});
  1468. //>>excludeEnd("ctx");
  1469. },
  1470. //>>excludeStart("ide", pragmas.excludeIdeData);
  1471. args: ["aCompiledMethod"],
  1472. source: "findMethod: aCompiledMethod\x0a\x09^ self current findMethod: aCompiledMethod",
  1473. referencedClasses: [],
  1474. //>>excludeEnd("ide");
  1475. messageSends: ["findMethod:", "current"]
  1476. }),
  1477. $globals.Finder.a$cls);
  1478. $core.addMethod(
  1479. $core.method({
  1480. selector: "findString:",
  1481. protocol: "finding",
  1482. fn: function (aString){
  1483. var self=this,$self=this;
  1484. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1485. return $core.withContext(function($ctx1) {
  1486. //>>excludeEnd("ctx");
  1487. return $recv($self._current())._findString_(aString);
  1488. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1489. }, function($ctx1) {$ctx1.fill(self,"findString:",{aString:aString},$globals.Finder.a$cls)});
  1490. //>>excludeEnd("ctx");
  1491. },
  1492. //>>excludeStart("ide", pragmas.excludeIdeData);
  1493. args: ["aString"],
  1494. source: "findString: aString\x0a\x09^ self current findString: aString",
  1495. referencedClasses: [],
  1496. //>>excludeEnd("ide");
  1497. messageSends: ["findString:", "current"]
  1498. }),
  1499. $globals.Finder.a$cls);
  1500. $core.addClass("Inspector", $globals.Service, [], "Platform-Services");
  1501. //>>excludeStart("ide", pragmas.excludeIdeData);
  1502. $globals.Inspector.comment="I am the service responsible for inspecting objects.\x0a\x0aThe default inspector object is the transcript.";
  1503. //>>excludeEnd("ide");
  1504. $core.addMethod(
  1505. $core.method({
  1506. selector: "inspect:",
  1507. protocol: "inspecting",
  1508. fn: function (anObject){
  1509. var self=this,$self=this;
  1510. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1511. return $core.withContext(function($ctx1) {
  1512. //>>excludeEnd("ctx");
  1513. return $recv($self._current())._inspect_(anObject);
  1514. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1515. }, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},$globals.Inspector.a$cls)});
  1516. //>>excludeEnd("ctx");
  1517. },
  1518. //>>excludeStart("ide", pragmas.excludeIdeData);
  1519. args: ["anObject"],
  1520. source: "inspect: anObject\x0a\x09^ self current inspect: anObject",
  1521. referencedClasses: [],
  1522. //>>excludeEnd("ide");
  1523. messageSends: ["inspect:", "current"]
  1524. }),
  1525. $globals.Inspector.a$cls);
  1526. $core.addClass("Platform", $globals.Service, [], "Platform-Services");
  1527. //>>excludeStart("ide", pragmas.excludeIdeData);
  1528. $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";
  1529. //>>excludeEnd("ide");
  1530. $core.addMethod(
  1531. $core.method({
  1532. selector: "globals",
  1533. protocol: "accessing",
  1534. fn: function (){
  1535. var self=this,$self=this;
  1536. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1537. return $core.withContext(function($ctx1) {
  1538. //>>excludeEnd("ctx");
  1539. return $recv($self._current())._globals();
  1540. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1541. }, function($ctx1) {$ctx1.fill(self,"globals",{},$globals.Platform.a$cls)});
  1542. //>>excludeEnd("ctx");
  1543. },
  1544. //>>excludeStart("ide", pragmas.excludeIdeData);
  1545. args: [],
  1546. source: "globals\x0a\x09^ self current globals",
  1547. referencedClasses: [],
  1548. //>>excludeEnd("ide");
  1549. messageSends: ["globals", "current"]
  1550. }),
  1551. $globals.Platform.a$cls);
  1552. $core.addMethod(
  1553. $core.method({
  1554. selector: "includesGlobal:",
  1555. protocol: "testing",
  1556. fn: function (aString){
  1557. var self=this,$self=this;
  1558. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1559. return $core.withContext(function($ctx1) {
  1560. //>>excludeEnd("ctx");
  1561. return $recv($self._globals())._at_ifPresent_ifAbsent_(aString,(function(){
  1562. return true;
  1563. }),(function(){
  1564. return false;
  1565. }));
  1566. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1567. }, function($ctx1) {$ctx1.fill(self,"includesGlobal:",{aString:aString},$globals.Platform.a$cls)});
  1568. //>>excludeEnd("ctx");
  1569. },
  1570. //>>excludeStart("ide", pragmas.excludeIdeData);
  1571. args: ["aString"],
  1572. source: "includesGlobal: aString\x0a\x09^ self globals \x0a\x09\x09at: aString \x0a\x09\x09ifPresent: [ true ] \x0a\x09\x09ifAbsent: [ false ]",
  1573. referencedClasses: [],
  1574. //>>excludeEnd("ide");
  1575. messageSends: ["at:ifPresent:ifAbsent:", "globals"]
  1576. }),
  1577. $globals.Platform.a$cls);
  1578. $core.addMethod(
  1579. $core.method({
  1580. selector: "newXhr",
  1581. protocol: "accessing",
  1582. fn: function (){
  1583. var self=this,$self=this;
  1584. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1585. return $core.withContext(function($ctx1) {
  1586. //>>excludeEnd("ctx");
  1587. return $recv($self._current())._newXhr();
  1588. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1589. }, function($ctx1) {$ctx1.fill(self,"newXhr",{},$globals.Platform.a$cls)});
  1590. //>>excludeEnd("ctx");
  1591. },
  1592. //>>excludeStart("ide", pragmas.excludeIdeData);
  1593. args: [],
  1594. source: "newXhr\x0a\x09^ self current newXhr",
  1595. referencedClasses: [],
  1596. //>>excludeEnd("ide");
  1597. messageSends: ["newXhr", "current"]
  1598. }),
  1599. $globals.Platform.a$cls);
  1600. $core.addClass("ProgressHandler", $globals.Service, [], "Platform-Services");
  1601. //>>excludeStart("ide", pragmas.excludeIdeData);
  1602. $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`.";
  1603. //>>excludeEnd("ide");
  1604. $core.addMethod(
  1605. $core.method({
  1606. selector: "do:on:displaying:",
  1607. protocol: "progress handling",
  1608. fn: function (aBlock,aCollection,aString){
  1609. var self=this,$self=this;
  1610. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1611. return $core.withContext(function($ctx1) {
  1612. //>>excludeEnd("ctx");
  1613. $recv($self._current())._do_on_displaying_(aBlock,aCollection,aString);
  1614. return self;
  1615. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1616. }, function($ctx1) {$ctx1.fill(self,"do:on:displaying:",{aBlock:aBlock,aCollection:aCollection,aString:aString},$globals.ProgressHandler.a$cls)});
  1617. //>>excludeEnd("ctx");
  1618. },
  1619. //>>excludeStart("ide", pragmas.excludeIdeData);
  1620. args: ["aBlock", "aCollection", "aString"],
  1621. source: "do: aBlock on: aCollection displaying: aString\x0a\x09self current do: aBlock on: aCollection displaying: aString",
  1622. referencedClasses: [],
  1623. //>>excludeEnd("ide");
  1624. messageSends: ["do:on:displaying:", "current"]
  1625. }),
  1626. $globals.ProgressHandler.a$cls);
  1627. $core.addClass("Terminal", $globals.Service, [], "Platform-Services");
  1628. //>>excludeStart("ide", pragmas.excludeIdeData);
  1629. $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:'.";
  1630. //>>excludeEnd("ide");
  1631. $core.addMethod(
  1632. $core.method({
  1633. selector: "alert:",
  1634. protocol: "dialogs",
  1635. fn: function (aString){
  1636. var self=this,$self=this;
  1637. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1638. return $core.withContext(function($ctx1) {
  1639. //>>excludeEnd("ctx");
  1640. return $recv($self._current())._alert_(aString);
  1641. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1642. }, function($ctx1) {$ctx1.fill(self,"alert:",{aString:aString},$globals.Terminal.a$cls)});
  1643. //>>excludeEnd("ctx");
  1644. },
  1645. //>>excludeStart("ide", pragmas.excludeIdeData);
  1646. args: ["aString"],
  1647. source: "alert: aString\x0a\x09^ self current alert: aString",
  1648. referencedClasses: [],
  1649. //>>excludeEnd("ide");
  1650. messageSends: ["alert:", "current"]
  1651. }),
  1652. $globals.Terminal.a$cls);
  1653. $core.addMethod(
  1654. $core.method({
  1655. selector: "confirm:",
  1656. protocol: "dialogs",
  1657. fn: function (aString){
  1658. var self=this,$self=this;
  1659. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1660. return $core.withContext(function($ctx1) {
  1661. //>>excludeEnd("ctx");
  1662. return $recv($self._current())._confirm_(aString);
  1663. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1664. }, function($ctx1) {$ctx1.fill(self,"confirm:",{aString:aString},$globals.Terminal.a$cls)});
  1665. //>>excludeEnd("ctx");
  1666. },
  1667. //>>excludeStart("ide", pragmas.excludeIdeData);
  1668. args: ["aString"],
  1669. source: "confirm: aString\x0a\x09^ self current confirm: aString",
  1670. referencedClasses: [],
  1671. //>>excludeEnd("ide");
  1672. messageSends: ["confirm:", "current"]
  1673. }),
  1674. $globals.Terminal.a$cls);
  1675. $core.addMethod(
  1676. $core.method({
  1677. selector: "prompt:",
  1678. protocol: "dialogs",
  1679. fn: function (aString){
  1680. var self=this,$self=this;
  1681. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1682. return $core.withContext(function($ctx1) {
  1683. //>>excludeEnd("ctx");
  1684. return $recv($self._current())._prompt_(aString);
  1685. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1686. }, function($ctx1) {$ctx1.fill(self,"prompt:",{aString:aString},$globals.Terminal.a$cls)});
  1687. //>>excludeEnd("ctx");
  1688. },
  1689. //>>excludeStart("ide", pragmas.excludeIdeData);
  1690. args: ["aString"],
  1691. source: "prompt: aString\x0a\x09^ self current prompt: aString",
  1692. referencedClasses: [],
  1693. //>>excludeEnd("ide");
  1694. messageSends: ["prompt:", "current"]
  1695. }),
  1696. $globals.Terminal.a$cls);
  1697. $core.addMethod(
  1698. $core.method({
  1699. selector: "prompt:default:",
  1700. protocol: "dialogs",
  1701. fn: function (aString,defaultString){
  1702. var self=this,$self=this;
  1703. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1704. return $core.withContext(function($ctx1) {
  1705. //>>excludeEnd("ctx");
  1706. return $recv($self._current())._prompt_default_(aString,defaultString);
  1707. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1708. }, function($ctx1) {$ctx1.fill(self,"prompt:default:",{aString:aString,defaultString:defaultString},$globals.Terminal.a$cls)});
  1709. //>>excludeEnd("ctx");
  1710. },
  1711. //>>excludeStart("ide", pragmas.excludeIdeData);
  1712. args: ["aString", "defaultString"],
  1713. source: "prompt: aString default: defaultString\x0a\x09^ self current prompt: aString default: defaultString",
  1714. referencedClasses: [],
  1715. //>>excludeEnd("ide");
  1716. messageSends: ["prompt:default:", "current"]
  1717. }),
  1718. $globals.Terminal.a$cls);
  1719. $core.addClass("Transcript", $globals.Service, [], "Platform-Services");
  1720. //>>excludeStart("ide", pragmas.excludeIdeData);
  1721. $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.";
  1722. //>>excludeEnd("ide");
  1723. $core.addMethod(
  1724. $core.method({
  1725. selector: "clear",
  1726. protocol: "printing",
  1727. fn: function (){
  1728. var self=this,$self=this;
  1729. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1730. return $core.withContext(function($ctx1) {
  1731. //>>excludeEnd("ctx");
  1732. $recv($self._current())._clear();
  1733. return self;
  1734. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1735. }, function($ctx1) {$ctx1.fill(self,"clear",{},$globals.Transcript.a$cls)});
  1736. //>>excludeEnd("ctx");
  1737. },
  1738. //>>excludeStart("ide", pragmas.excludeIdeData);
  1739. args: [],
  1740. source: "clear\x0a\x09self current clear",
  1741. referencedClasses: [],
  1742. //>>excludeEnd("ide");
  1743. messageSends: ["clear", "current"]
  1744. }),
  1745. $globals.Transcript.a$cls);
  1746. $core.addMethod(
  1747. $core.method({
  1748. selector: "cr",
  1749. protocol: "printing",
  1750. fn: function (){
  1751. var self=this,$self=this;
  1752. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1753. return $core.withContext(function($ctx1) {
  1754. //>>excludeEnd("ctx");
  1755. $recv($self._current())._show_($recv($globals.String)._cr());
  1756. return self;
  1757. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1758. }, function($ctx1) {$ctx1.fill(self,"cr",{},$globals.Transcript.a$cls)});
  1759. //>>excludeEnd("ctx");
  1760. },
  1761. //>>excludeStart("ide", pragmas.excludeIdeData);
  1762. args: [],
  1763. source: "cr\x0a\x09self current show: String cr",
  1764. referencedClasses: ["String"],
  1765. //>>excludeEnd("ide");
  1766. messageSends: ["show:", "current", "cr"]
  1767. }),
  1768. $globals.Transcript.a$cls);
  1769. $core.addMethod(
  1770. $core.method({
  1771. selector: "inspect:",
  1772. protocol: "printing",
  1773. fn: function (anObject){
  1774. var self=this,$self=this;
  1775. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1776. return $core.withContext(function($ctx1) {
  1777. //>>excludeEnd("ctx");
  1778. $self._show_(anObject);
  1779. return self;
  1780. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1781. }, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},$globals.Transcript.a$cls)});
  1782. //>>excludeEnd("ctx");
  1783. },
  1784. //>>excludeStart("ide", pragmas.excludeIdeData);
  1785. args: ["anObject"],
  1786. source: "inspect: anObject\x0a\x09self show: anObject",
  1787. referencedClasses: [],
  1788. //>>excludeEnd("ide");
  1789. messageSends: ["show:"]
  1790. }),
  1791. $globals.Transcript.a$cls);
  1792. $core.addMethod(
  1793. $core.method({
  1794. selector: "open",
  1795. protocol: "instance creation",
  1796. fn: function (){
  1797. var self=this,$self=this;
  1798. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1799. return $core.withContext(function($ctx1) {
  1800. //>>excludeEnd("ctx");
  1801. $recv($self._current())._open();
  1802. return self;
  1803. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1804. }, function($ctx1) {$ctx1.fill(self,"open",{},$globals.Transcript.a$cls)});
  1805. //>>excludeEnd("ctx");
  1806. },
  1807. //>>excludeStart("ide", pragmas.excludeIdeData);
  1808. args: [],
  1809. source: "open\x0a\x09self current open",
  1810. referencedClasses: [],
  1811. //>>excludeEnd("ide");
  1812. messageSends: ["open", "current"]
  1813. }),
  1814. $globals.Transcript.a$cls);
  1815. $core.addMethod(
  1816. $core.method({
  1817. selector: "show:",
  1818. protocol: "printing",
  1819. fn: function (anObject){
  1820. var self=this,$self=this;
  1821. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1822. return $core.withContext(function($ctx1) {
  1823. //>>excludeEnd("ctx");
  1824. $recv($self._current())._show_(anObject);
  1825. return self;
  1826. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1827. }, function($ctx1) {$ctx1.fill(self,"show:",{anObject:anObject},$globals.Transcript.a$cls)});
  1828. //>>excludeEnd("ctx");
  1829. },
  1830. //>>excludeStart("ide", pragmas.excludeIdeData);
  1831. args: ["anObject"],
  1832. source: "show: anObject\x0a\x09self current show: anObject",
  1833. referencedClasses: [],
  1834. //>>excludeEnd("ide");
  1835. messageSends: ["show:", "current"]
  1836. }),
  1837. $globals.Transcript.a$cls);
  1838. $core.addMethod(
  1839. $core.method({
  1840. selector: "inspectOn:",
  1841. protocol: "*Platform-Services",
  1842. fn: function (anInspector){
  1843. var self=this,$self=this;
  1844. var variables;
  1845. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1846. return $core.withContext(function($ctx1) {
  1847. //>>excludeEnd("ctx");
  1848. variables=$recv($globals.Dictionary)._new();
  1849. $recv(variables)._at_put_("#self",self);
  1850. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1851. $ctx1.sendIdx["at:put:"]=1;
  1852. //>>excludeEnd("ctx");
  1853. $recv(variables)._at_put_("#keys",$self._keys());
  1854. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1855. $ctx1.sendIdx["at:put:"]=2;
  1856. //>>excludeEnd("ctx");
  1857. $self._keysAndValuesDo_((function(key,value){
  1858. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1859. return $core.withContext(function($ctx2) {
  1860. //>>excludeEnd("ctx");
  1861. return $recv(variables)._at_put_(key,value);
  1862. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1863. }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1,1)});
  1864. //>>excludeEnd("ctx");
  1865. }));
  1866. $recv(anInspector)._setLabel_($self._printString());
  1867. $recv(anInspector)._setVariables_(variables);
  1868. return self;
  1869. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1870. }, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables},$globals.AssociativeCollection)});
  1871. //>>excludeEnd("ctx");
  1872. },
  1873. //>>excludeStart("ide", pragmas.excludeIdeData);
  1874. args: ["anInspector"],
  1875. 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",
  1876. referencedClasses: ["Dictionary"],
  1877. //>>excludeEnd("ide");
  1878. messageSends: ["new", "at:put:", "keys", "keysAndValuesDo:", "setLabel:", "printString", "setVariables:"]
  1879. }),
  1880. $globals.AssociativeCollection);
  1881. $core.addMethod(
  1882. $core.method({
  1883. selector: "inspectOn:",
  1884. protocol: "*Platform-Services",
  1885. fn: function (anInspector){
  1886. var self=this,$self=this;
  1887. var variables;
  1888. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1889. return $core.withContext(function($ctx1) {
  1890. //>>excludeEnd("ctx");
  1891. variables=$recv($globals.Dictionary)._new();
  1892. $recv(variables)._at_put_("#self",self);
  1893. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1894. $ctx1.sendIdx["at:put:"]=1;
  1895. //>>excludeEnd("ctx");
  1896. $self._withIndexDo_((function(each,i){
  1897. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1898. return $core.withContext(function($ctx2) {
  1899. //>>excludeEnd("ctx");
  1900. return $recv(variables)._at_put_(i,each);
  1901. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1902. }, function($ctx2) {$ctx2.fillBlock({each:each,i:i},$ctx1,1)});
  1903. //>>excludeEnd("ctx");
  1904. }));
  1905. $recv(anInspector)._setLabel_($self._printString());
  1906. $recv(anInspector)._setVariables_(variables);
  1907. return self;
  1908. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1909. }, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables},$globals.Collection)});
  1910. //>>excludeEnd("ctx");
  1911. },
  1912. //>>excludeStart("ide", pragmas.excludeIdeData);
  1913. args: ["anInspector"],
  1914. 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",
  1915. referencedClasses: ["Dictionary"],
  1916. //>>excludeEnd("ide");
  1917. messageSends: ["new", "at:put:", "withIndexDo:", "setLabel:", "printString", "setVariables:"]
  1918. }),
  1919. $globals.Collection);
  1920. $core.addMethod(
  1921. $core.method({
  1922. selector: "inspectOn:",
  1923. protocol: "*Platform-Services",
  1924. fn: function (anInspector){
  1925. var self=this,$self=this;
  1926. var variables;
  1927. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1928. return $core.withContext(function($ctx1) {
  1929. //>>excludeEnd("ctx");
  1930. variables=$recv($globals.Dictionary)._new();
  1931. $recv(variables)._at_put_("#self",self);
  1932. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1933. $ctx1.sendIdx["at:put:"]=1;
  1934. //>>excludeEnd("ctx");
  1935. $recv(variables)._at_put_("#year",$self._year());
  1936. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1937. $ctx1.sendIdx["at:put:"]=2;
  1938. //>>excludeEnd("ctx");
  1939. $recv(variables)._at_put_("#month",$self._month());
  1940. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1941. $ctx1.sendIdx["at:put:"]=3;
  1942. //>>excludeEnd("ctx");
  1943. $recv(variables)._at_put_("#day",$self._day());
  1944. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1945. $ctx1.sendIdx["at:put:"]=4;
  1946. //>>excludeEnd("ctx");
  1947. $recv(variables)._at_put_("#hours",$self._hours());
  1948. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1949. $ctx1.sendIdx["at:put:"]=5;
  1950. //>>excludeEnd("ctx");
  1951. $recv(variables)._at_put_("#minutes",$self._minutes());
  1952. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1953. $ctx1.sendIdx["at:put:"]=6;
  1954. //>>excludeEnd("ctx");
  1955. $recv(variables)._at_put_("#seconds",$self._seconds());
  1956. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1957. $ctx1.sendIdx["at:put:"]=7;
  1958. //>>excludeEnd("ctx");
  1959. $recv(variables)._at_put_("#milliseconds",$self._milliseconds());
  1960. $recv(anInspector)._setLabel_($self._printString());
  1961. $recv(anInspector)._setVariables_(variables);
  1962. return self;
  1963. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1964. }, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables},$globals.Date)});
  1965. //>>excludeEnd("ctx");
  1966. },
  1967. //>>excludeStart("ide", pragmas.excludeIdeData);
  1968. args: ["anInspector"],
  1969. 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",
  1970. referencedClasses: ["Dictionary"],
  1971. //>>excludeEnd("ide");
  1972. messageSends: ["new", "at:put:", "year", "month", "day", "hours", "minutes", "seconds", "milliseconds", "setLabel:", "printString", "setVariables:"]
  1973. }),
  1974. $globals.Date);
  1975. $core.addMethod(
  1976. $core.method({
  1977. selector: "inspectOn:",
  1978. protocol: "*Platform-Services",
  1979. fn: function (anInspector){
  1980. var self=this,$self=this;
  1981. var variables;
  1982. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1983. return $core.withContext(function($ctx1) {
  1984. //>>excludeEnd("ctx");
  1985. variables=$recv($globals.Dictionary)._new();
  1986. $recv(variables)._at_put_("#self",$self._jsObject());
  1987. $recv(anInspector)._setLabel_($self._printString());
  1988. $recv($globals.JSObjectProxy)._addObjectVariablesTo_ofProxy_(variables,self);
  1989. $recv(anInspector)._setVariables_(variables);
  1990. return self;
  1991. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1992. }, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables},$globals.JSObjectProxy)});
  1993. //>>excludeEnd("ctx");
  1994. },
  1995. //>>excludeStart("ide", pragmas.excludeIdeData);
  1996. args: ["anInspector"],
  1997. 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",
  1998. referencedClasses: ["Dictionary", "JSObjectProxy"],
  1999. //>>excludeEnd("ide");
  2000. messageSends: ["new", "at:put:", "jsObject", "setLabel:", "printString", "addObjectVariablesTo:ofProxy:", "setVariables:"]
  2001. }),
  2002. $globals.JSObjectProxy);
  2003. $core.addMethod(
  2004. $core.method({
  2005. selector: "inspectOn:",
  2006. protocol: "*Platform-Services",
  2007. fn: function (anInspector){
  2008. var self=this,$self=this;
  2009. var variables;
  2010. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2011. return $core.withContext(function($ctx1) {
  2012. //>>excludeEnd("ctx");
  2013. variables=$recv($globals.Dictionary)._new();
  2014. $recv(variables)._at_put_("#self",self);
  2015. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2016. $ctx1.sendIdx["at:put:"]=1;
  2017. //>>excludeEnd("ctx");
  2018. $recv(variables)._at_put_("#home",$self._home());
  2019. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2020. $ctx1.sendIdx["at:put:"]=2;
  2021. //>>excludeEnd("ctx");
  2022. $recv(variables)._at_put_("#receiver",$self._receiver());
  2023. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2024. $ctx1.sendIdx["at:put:"]=3;
  2025. //>>excludeEnd("ctx");
  2026. $recv(variables)._at_put_("#selector",$self._selector());
  2027. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2028. $ctx1.sendIdx["at:put:"]=4;
  2029. //>>excludeEnd("ctx");
  2030. $recv(variables)._at_put_("#locals",$self._locals());
  2031. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2032. $ctx1.sendIdx["at:put:"]=5;
  2033. //>>excludeEnd("ctx");
  2034. $recv($recv($self._class())._instanceVariableNames())._do_((function(each){
  2035. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2036. return $core.withContext(function($ctx2) {
  2037. //>>excludeEnd("ctx");
  2038. return $recv(variables)._at_put_(each,$self._instVarAt_(each));
  2039. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2040. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2041. //>>excludeEnd("ctx");
  2042. }));
  2043. $recv(anInspector)._setLabel_($self._printString());
  2044. $recv(anInspector)._setVariables_(variables);
  2045. return self;
  2046. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2047. }, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables},$globals.MethodContext)});
  2048. //>>excludeEnd("ctx");
  2049. },
  2050. //>>excludeStart("ide", pragmas.excludeIdeData);
  2051. args: ["anInspector"],
  2052. 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",
  2053. referencedClasses: ["Dictionary"],
  2054. //>>excludeEnd("ide");
  2055. messageSends: ["new", "at:put:", "home", "receiver", "selector", "locals", "do:", "instanceVariableNames", "class", "instVarAt:", "setLabel:", "printString", "setVariables:"]
  2056. }),
  2057. $globals.MethodContext);
  2058. $core.addMethod(
  2059. $core.method({
  2060. selector: "inspectOn:",
  2061. protocol: "*Platform-Services",
  2062. fn: function (anInspector){
  2063. var self=this,$self=this;
  2064. var variables;
  2065. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2066. return $core.withContext(function($ctx1) {
  2067. //>>excludeEnd("ctx");
  2068. variables=$recv($globals.Dictionary)._new();
  2069. $recv(variables)._at_put_("#self",self);
  2070. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2071. $ctx1.sendIdx["at:put:"]=1;
  2072. //>>excludeEnd("ctx");
  2073. $recv($recv($self._class())._allInstanceVariableNames())._do_((function(each){
  2074. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2075. return $core.withContext(function($ctx2) {
  2076. //>>excludeEnd("ctx");
  2077. return $recv(variables)._at_put_(each,$self._instVarAt_(each));
  2078. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2079. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2080. //>>excludeEnd("ctx");
  2081. }));
  2082. $recv(anInspector)._setLabel_($self._printString());
  2083. $recv(anInspector)._setVariables_(variables);
  2084. return self;
  2085. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2086. }, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables},$globals.Object)});
  2087. //>>excludeEnd("ctx");
  2088. },
  2089. //>>excludeStart("ide", pragmas.excludeIdeData);
  2090. args: ["anInspector"],
  2091. 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",
  2092. referencedClasses: ["Dictionary"],
  2093. //>>excludeEnd("ide");
  2094. messageSends: ["new", "at:put:", "do:", "allInstanceVariableNames", "class", "instVarAt:", "setLabel:", "printString", "setVariables:"]
  2095. }),
  2096. $globals.Object);
  2097. $core.addMethod(
  2098. $core.method({
  2099. selector: "do:displayingProgress:",
  2100. protocol: "*Platform-Services",
  2101. fn: function (aBlock,aString){
  2102. var self=this,$self=this;
  2103. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2104. return $core.withContext(function($ctx1) {
  2105. //>>excludeEnd("ctx");
  2106. $recv($globals.ProgressHandler)._do_on_displaying_(aBlock,self,aString);
  2107. return self;
  2108. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2109. }, function($ctx1) {$ctx1.fill(self,"do:displayingProgress:",{aBlock:aBlock,aString:aString},$globals.SequenceableCollection)});
  2110. //>>excludeEnd("ctx");
  2111. },
  2112. //>>excludeStart("ide", pragmas.excludeIdeData);
  2113. args: ["aBlock", "aString"],
  2114. source: "do: aBlock displayingProgress: aString\x0a\x09ProgressHandler \x0a\x09\x09do: aBlock \x0a\x09\x09on: self \x0a\x09\x09displaying: aString",
  2115. referencedClasses: ["ProgressHandler"],
  2116. //>>excludeEnd("ide");
  2117. messageSends: ["do:on:displaying:"]
  2118. }),
  2119. $globals.SequenceableCollection);
  2120. $core.addMethod(
  2121. $core.method({
  2122. selector: "inspectOn:",
  2123. protocol: "*Platform-Services",
  2124. fn: function (anInspector){
  2125. var self=this,$self=this;
  2126. var variables,i;
  2127. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2128. return $core.withContext(function($ctx1) {
  2129. //>>excludeEnd("ctx");
  2130. variables=$recv($globals.Dictionary)._new();
  2131. $recv(variables)._at_put_("#self",self);
  2132. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2133. $ctx1.sendIdx["at:put:"]=1;
  2134. //>>excludeEnd("ctx");
  2135. i=(1);
  2136. $self._do_((function(each){
  2137. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2138. return $core.withContext(function($ctx2) {
  2139. //>>excludeEnd("ctx");
  2140. $recv(variables)._at_put_(i,each);
  2141. i=$recv(i).__plus((1));
  2142. return i;
  2143. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2144. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2145. //>>excludeEnd("ctx");
  2146. }));
  2147. $recv(anInspector)._setLabel_($self._printString());
  2148. $recv(anInspector)._setVariables_(variables);
  2149. return self;
  2150. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2151. }, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables,i:i},$globals.Set)});
  2152. //>>excludeEnd("ctx");
  2153. },
  2154. //>>excludeStart("ide", pragmas.excludeIdeData);
  2155. args: ["anInspector"],
  2156. 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",
  2157. referencedClasses: ["Dictionary"],
  2158. //>>excludeEnd("ide");
  2159. messageSends: ["new", "at:put:", "do:", "+", "setLabel:", "printString", "setVariables:"]
  2160. }),
  2161. $globals.Set);
  2162. $core.addMethod(
  2163. $core.method({
  2164. selector: "inspectOn:",
  2165. protocol: "*Platform-Services",
  2166. fn: function (anInspector){
  2167. var self=this,$self=this;
  2168. var label;
  2169. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2170. return $core.withContext(function($ctx1) {
  2171. //>>excludeEnd("ctx");
  2172. var $3,$2,$1,$5,$4;
  2173. (
  2174. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2175. $ctx1.supercall = true,
  2176. //>>excludeEnd("ctx");
  2177. ($globals.String.superclass||$boot.nilAsClass).fn.prototype._inspectOn_.apply($self, [anInspector]));
  2178. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2179. $ctx1.supercall = false;
  2180. //>>excludeEnd("ctx");;
  2181. $3=$self._printString();
  2182. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2183. $ctx1.sendIdx["printString"]=1;
  2184. //>>excludeEnd("ctx");
  2185. $2=$recv($3)._size();
  2186. $1=$recv($2).__gt((30));
  2187. if($core.assert($1)){
  2188. $5=$self._printString();
  2189. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2190. $ctx1.sendIdx["printString"]=2;
  2191. //>>excludeEnd("ctx");
  2192. $4=$recv($5)._copyFrom_to_((1),(30));
  2193. label=$recv($4).__comma("...'");
  2194. label;
  2195. } else {
  2196. label=$self._printString();
  2197. label;
  2198. }
  2199. $recv(anInspector)._setLabel_(label);
  2200. return self;
  2201. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2202. }, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,label:label},$globals.String)});
  2203. //>>excludeEnd("ctx");
  2204. },
  2205. //>>excludeStart("ide", pragmas.excludeIdeData);
  2206. args: ["anInspector"],
  2207. 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",
  2208. referencedClasses: [],
  2209. //>>excludeEnd("ide");
  2210. messageSends: ["inspectOn:", "ifTrue:ifFalse:", ">", "size", "printString", ",", "copyFrom:to:", "setLabel:"]
  2211. }),
  2212. $globals.String);
  2213. });