Platform-Services.js 96 KB

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