Platform-Services.js 81 KB

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