Platform-Services.js 96 KB

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