Platform-Services.js 96 KB

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