Platform-Services.js 91 KB

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