Platform-Services.js 92 KB

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