Platform-Services.js 94 KB

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