Platform-Services.js 95 KB

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