Kernel-Infrastructure.deploy.js 62 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779
  1. (function(smalltalk,nil,_st){
  2. smalltalk.addPackage('Kernel-Infrastructure');
  3. smalltalk.addClass('InspectorHandler', smalltalk.Object, [], 'Kernel-Infrastructure');
  4. smalltalk.InspectorHandler.klass.iVarNames = ['inspector'];
  5. smalltalk.addMethod(
  6. smalltalk.method({
  7. selector: "inspect:",
  8. fn: function (anObject){
  9. var self=this;
  10. return smalltalk.withContext(function($ctx1) {
  11. var $1;
  12. $1=_st(self._inspector())._inspect_(anObject);
  13. return $1;
  14. }, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},smalltalk.InspectorHandler.klass)})},
  15. messageSends: ["inspect:", "inspector"]}),
  16. smalltalk.InspectorHandler.klass);
  17. smalltalk.addMethod(
  18. smalltalk.method({
  19. selector: "inspector",
  20. fn: function (){
  21. var self=this;
  22. function $Transcript(){return smalltalk.Transcript||(typeof Transcript=="undefined"?nil:Transcript)}
  23. return smalltalk.withContext(function($ctx1) {
  24. var $2,$1;
  25. $2=self["@inspector"];
  26. if(($receiver = $2) == nil || $receiver == undefined){
  27. self["@inspector"]=$Transcript();
  28. $1=self["@inspector"];
  29. } else {
  30. $1=$2;
  31. };
  32. return $1;
  33. }, function($ctx1) {$ctx1.fill(self,"inspector",{},smalltalk.InspectorHandler.klass)})},
  34. messageSends: ["ifNil:"]}),
  35. smalltalk.InspectorHandler.klass);
  36. smalltalk.addMethod(
  37. smalltalk.method({
  38. selector: "register:",
  39. fn: function (anInspector){
  40. var self=this;
  41. return smalltalk.withContext(function($ctx1) {
  42. self["@inspector"]=anInspector;
  43. return self}, function($ctx1) {$ctx1.fill(self,"register:",{anInspector:anInspector},smalltalk.InspectorHandler.klass)})},
  44. messageSends: []}),
  45. smalltalk.InspectorHandler.klass);
  46. smalltalk.addClass('InterfacingObject', smalltalk.Object, [], 'Kernel-Infrastructure');
  47. smalltalk.addMethod(
  48. smalltalk.method({
  49. selector: "ajax:",
  50. fn: function (anObject){
  51. var self=this;
  52. function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  53. return smalltalk.withContext(function($ctx1) {
  54. var $1;
  55. $1=_st($PlatformInterface())._ajax_(anObject);
  56. return $1;
  57. }, function($ctx1) {$ctx1.fill(self,"ajax:",{anObject:anObject},smalltalk.InterfacingObject)})},
  58. messageSends: ["ajax:"]}),
  59. smalltalk.InterfacingObject);
  60. smalltalk.addMethod(
  61. smalltalk.method({
  62. selector: "alert:",
  63. fn: function (aString){
  64. var self=this;
  65. function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  66. return smalltalk.withContext(function($ctx1) {
  67. var $1;
  68. $1=_st($PlatformInterface())._alert_(aString);
  69. return $1;
  70. }, function($ctx1) {$ctx1.fill(self,"alert:",{aString:aString},smalltalk.InterfacingObject)})},
  71. messageSends: ["alert:"]}),
  72. smalltalk.InterfacingObject);
  73. smalltalk.addMethod(
  74. smalltalk.method({
  75. selector: "confirm:",
  76. fn: function (aString){
  77. var self=this;
  78. function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  79. return smalltalk.withContext(function($ctx1) {
  80. var $1;
  81. $1=_st($PlatformInterface())._confirm_(aString);
  82. return $1;
  83. }, function($ctx1) {$ctx1.fill(self,"confirm:",{aString:aString},smalltalk.InterfacingObject)})},
  84. messageSends: ["confirm:"]}),
  85. smalltalk.InterfacingObject);
  86. smalltalk.addMethod(
  87. smalltalk.method({
  88. selector: "prompt:",
  89. fn: function (aString){
  90. var self=this;
  91. function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  92. return smalltalk.withContext(function($ctx1) {
  93. var $1;
  94. $1=_st($PlatformInterface())._prompt_(aString);
  95. return $1;
  96. }, function($ctx1) {$ctx1.fill(self,"prompt:",{aString:aString},smalltalk.InterfacingObject)})},
  97. messageSends: ["prompt:"]}),
  98. smalltalk.InterfacingObject);
  99. smalltalk.addClass('Environment', smalltalk.InterfacingObject, [], 'Kernel-Infrastructure');
  100. smalltalk.addMethod(
  101. smalltalk.method({
  102. selector: "addInstVarNamed:to:",
  103. fn: function (aString,aClass){
  104. var self=this;
  105. return smalltalk.withContext(function($ctx1) {
  106. var $1,$2;
  107. $1=_st(_st(aClass)._instanceVariableNames())._copy();
  108. _st($1)._add_(aString);
  109. $2=_st($1)._yourself();
  110. _st(self._classBuilder())._addSubclassOf_named_instanceVariableNames_package_(_st(aClass)._superclass(),_st(aClass)._name(),$2,_st(_st(aClass)._package())._name());
  111. return self}, function($ctx1) {$ctx1.fill(self,"addInstVarNamed:to:",{aString:aString,aClass:aClass},smalltalk.Environment)})},
  112. messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "superclass", "name", "add:", "copy", "instanceVariableNames", "yourself", "package", "classBuilder"]}),
  113. smalltalk.Environment);
  114. smalltalk.addMethod(
  115. smalltalk.method({
  116. selector: "allSelectors",
  117. fn: function (){
  118. var self=this;
  119. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  120. return smalltalk.withContext(function($ctx1) {
  121. var $1;
  122. $1=_st(_st(_st($Smalltalk())._current())._at_("allSelectors"))._value();
  123. return $1;
  124. }, function($ctx1) {$ctx1.fill(self,"allSelectors",{},smalltalk.Environment)})},
  125. messageSends: ["value", "at:", "current"]}),
  126. smalltalk.Environment);
  127. smalltalk.addMethod(
  128. smalltalk.method({
  129. selector: "availableClassNames",
  130. fn: function (){
  131. var self=this;
  132. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  133. return smalltalk.withContext(function($ctx1) {
  134. var $1;
  135. $1=_st(_st(_st($Smalltalk())._current())._classes())._collect_((function(each){
  136. return smalltalk.withContext(function($ctx2) {
  137. return _st(each)._name();
  138. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  139. return $1;
  140. }, function($ctx1) {$ctx1.fill(self,"availableClassNames",{},smalltalk.Environment)})},
  141. messageSends: ["collect:", "name", "classes", "current"]}),
  142. smalltalk.Environment);
  143. smalltalk.addMethod(
  144. smalltalk.method({
  145. selector: "availablePackageNames",
  146. fn: function (){
  147. var self=this;
  148. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  149. return smalltalk.withContext(function($ctx1) {
  150. var $1;
  151. $1=_st(_st(_st($Smalltalk())._current())._packages())._collect_((function(each){
  152. return smalltalk.withContext(function($ctx2) {
  153. return _st(each)._name();
  154. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  155. return $1;
  156. }, function($ctx1) {$ctx1.fill(self,"availablePackageNames",{},smalltalk.Environment)})},
  157. messageSends: ["collect:", "name", "packages", "current"]}),
  158. smalltalk.Environment);
  159. smalltalk.addMethod(
  160. smalltalk.method({
  161. selector: "availableProtocolsFor:",
  162. fn: function (aClass){
  163. var self=this;
  164. var protocols;
  165. return smalltalk.withContext(function($ctx1) {
  166. var $1,$2;
  167. protocols=_st(aClass)._protocols();
  168. $1=_st(aClass)._superclass();
  169. if(($receiver = $1) == nil || $receiver == undefined){
  170. $1;
  171. } else {
  172. _st(protocols)._addAll_(self._availableProtocolsFor_(_st(aClass)._superclass()));
  173. };
  174. $2=_st(_st(protocols)._asSet())._asArray();
  175. return $2;
  176. }, function($ctx1) {$ctx1.fill(self,"availableProtocolsFor:",{aClass:aClass,protocols:protocols},smalltalk.Environment)})},
  177. messageSends: ["protocols", "ifNotNil:", "addAll:", "availableProtocolsFor:", "superclass", "asArray", "asSet"]}),
  178. smalltalk.Environment);
  179. smalltalk.addMethod(
  180. smalltalk.method({
  181. selector: "classBuilder",
  182. fn: function (){
  183. var self=this;
  184. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  185. return smalltalk.withContext(function($ctx1) {
  186. var $1;
  187. $1=_st($ClassBuilder())._new();
  188. return $1;
  189. }, function($ctx1) {$ctx1.fill(self,"classBuilder",{},smalltalk.Environment)})},
  190. messageSends: ["new"]}),
  191. smalltalk.Environment);
  192. smalltalk.addMethod(
  193. smalltalk.method({
  194. selector: "classNamed:",
  195. fn: function (aString){
  196. var self=this;
  197. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  198. return smalltalk.withContext(function($ctx1) {
  199. var $2,$1;
  200. $2=_st(_st($Smalltalk())._current())._at_(_st(aString)._asSymbol());
  201. if(($receiver = $2) == nil || $receiver == undefined){
  202. $1=self._error_("Invalid class name");
  203. } else {
  204. $1=$2;
  205. };
  206. return $1;
  207. }, function($ctx1) {$ctx1.fill(self,"classNamed:",{aString:aString},smalltalk.Environment)})},
  208. messageSends: ["ifNil:", "error:", "at:", "asSymbol", "current"]}),
  209. smalltalk.Environment);
  210. smalltalk.addMethod(
  211. smalltalk.method({
  212. selector: "classes",
  213. fn: function (){
  214. var self=this;
  215. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  216. return smalltalk.withContext(function($ctx1) {
  217. var $1;
  218. $1=_st(_st($Smalltalk())._current())._classes();
  219. return $1;
  220. }, function($ctx1) {$ctx1.fill(self,"classes",{},smalltalk.Environment)})},
  221. messageSends: ["classes", "current"]}),
  222. smalltalk.Environment);
  223. smalltalk.addMethod(
  224. smalltalk.method({
  225. selector: "commitPackage:",
  226. fn: function (aPackage){
  227. var self=this;
  228. return smalltalk.withContext(function($ctx1) {
  229. _st(aPackage)._commit();
  230. return self}, function($ctx1) {$ctx1.fill(self,"commitPackage:",{aPackage:aPackage},smalltalk.Environment)})},
  231. messageSends: ["commit"]}),
  232. smalltalk.Environment);
  233. smalltalk.addMethod(
  234. smalltalk.method({
  235. selector: "compileClassComment:for:",
  236. fn: function (aString,aClass){
  237. var self=this;
  238. return smalltalk.withContext(function($ctx1) {
  239. _st(aClass)._comment_(aString);
  240. return self}, function($ctx1) {$ctx1.fill(self,"compileClassComment:for:",{aString:aString,aClass:aClass},smalltalk.Environment)})},
  241. messageSends: ["comment:"]}),
  242. smalltalk.Environment);
  243. smalltalk.addMethod(
  244. smalltalk.method({
  245. selector: "compileClassDefinition:",
  246. fn: function (aString){
  247. var self=this;
  248. function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
  249. return smalltalk.withContext(function($ctx1) {
  250. self._eval_on_(aString,_st($DoIt())._new());
  251. return self}, function($ctx1) {$ctx1.fill(self,"compileClassDefinition:",{aString:aString},smalltalk.Environment)})},
  252. messageSends: ["eval:on:", "new"]}),
  253. smalltalk.Environment);
  254. smalltalk.addMethod(
  255. smalltalk.method({
  256. selector: "compileMethod:for:protocol:",
  257. fn: function (sourceCode,class_,protocol){
  258. var self=this;
  259. return smalltalk.withContext(function($ctx1) {
  260. var $1;
  261. $1=_st(class_)._compile_category_(sourceCode,protocol);
  262. return $1;
  263. }, function($ctx1) {$ctx1.fill(self,"compileMethod:for:protocol:",{sourceCode:sourceCode,class_:class_,protocol:protocol},smalltalk.Environment)})},
  264. messageSends: ["compile:category:"]}),
  265. smalltalk.Environment);
  266. smalltalk.addMethod(
  267. smalltalk.method({
  268. selector: "copyClass:to:",
  269. fn: function (aClass,aClassName){
  270. var self=this;
  271. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  272. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  273. return smalltalk.withContext(function($ctx1) {
  274. var $1;
  275. $1=_st(_st($Smalltalk())._current())._at_(aClassName);
  276. if(($receiver = $1) == nil || $receiver == undefined){
  277. $1;
  278. } else {
  279. self._error_(_st("A class named ".__comma(aClassName)).__comma(" already exists"));
  280. };
  281. _st(_st($ClassBuilder())._new())._copyClass_named_(aClass,aClassName);
  282. return self}, function($ctx1) {$ctx1.fill(self,"copyClass:to:",{aClass:aClass,aClassName:aClassName},smalltalk.Environment)})},
  283. messageSends: ["ifNotNil:", "error:", ",", "at:", "current", "copyClass:named:", "new"]}),
  284. smalltalk.Environment);
  285. smalltalk.addMethod(
  286. smalltalk.method({
  287. selector: "eval:on:",
  288. fn: function (aString,aReceiver){
  289. var self=this;
  290. var compiler;
  291. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  292. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  293. return smalltalk.withContext(function($ctx1) {
  294. var $1,$2;
  295. var $early={};
  296. try {
  297. compiler=_st($Compiler())._new();
  298. _st((function(){
  299. return smalltalk.withContext(function($ctx2) {
  300. return _st(compiler)._parseExpression_(aString);
  301. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($Error(),(function(ex){
  302. return smalltalk.withContext(function($ctx2) {
  303. $1=self._alert_(_st(ex)._messageText());
  304. throw $early=[$1];
  305. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})}));
  306. $2=_st(compiler)._evaluateExpression_on_(aString,aReceiver);
  307. return $2;
  308. }
  309. catch(e) {if(e===$early)return e[0]; throw e}
  310. }, function($ctx1) {$ctx1.fill(self,"eval:on:",{aString:aString,aReceiver:aReceiver,compiler:compiler},smalltalk.Environment)})},
  311. messageSends: ["new", "on:do:", "alert:", "messageText", "parseExpression:", "evaluateExpression:on:"]}),
  312. smalltalk.Environment);
  313. smalltalk.addMethod(
  314. smalltalk.method({
  315. selector: "evaluate:on:do:",
  316. fn: function (aBlock,anErrorClass,exceptionBlock){
  317. var self=this;
  318. return smalltalk.withContext(function($ctx1) {
  319. var $1;
  320. self._try_catch_(aBlock,(function(exception){
  321. return smalltalk.withContext(function($ctx2) {
  322. $1=_st(exception)._isKindOf_(self._classNamed_(_st(anErrorClass)._name()));
  323. if(smalltalk.assert($1)){
  324. return _st(exceptionBlock)._value_(exception);
  325. } else {
  326. return _st(exception)._signal();
  327. };
  328. }, function($ctx2) {$ctx2.fillBlock({exception:exception},$ctx1)})}));
  329. return self}, function($ctx1) {$ctx1.fill(self,"evaluate:on:do:",{aBlock:aBlock,anErrorClass:anErrorClass,exceptionBlock:exceptionBlock},smalltalk.Environment)})},
  330. messageSends: ["try:catch:", "ifTrue:ifFalse:", "value:", "signal", "isKindOf:", "classNamed:", "name"]}),
  331. smalltalk.Environment);
  332. smalltalk.addMethod(
  333. smalltalk.method({
  334. selector: "inspect:",
  335. fn: function (anObject){
  336. var self=this;
  337. function $InspectorHandler(){return smalltalk.InspectorHandler||(typeof InspectorHandler=="undefined"?nil:InspectorHandler)}
  338. return smalltalk.withContext(function($ctx1) {
  339. _st(_st($InspectorHandler())._inspector())._inspect_(anObject);
  340. return self}, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},smalltalk.Environment)})},
  341. messageSends: ["inspect:", "inspector"]}),
  342. smalltalk.Environment);
  343. smalltalk.addMethod(
  344. smalltalk.method({
  345. selector: "moveClass:toPackage:",
  346. fn: function (aClass,aPackageName){
  347. var self=this;
  348. var package_;
  349. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  350. return smalltalk.withContext(function($ctx1) {
  351. var $1,$2,$3;
  352. package_=_st($Package())._named_(aPackageName);
  353. $1=package_;
  354. if(($receiver = $1) == nil || $receiver == undefined){
  355. self._error_("Invalid package name");
  356. } else {
  357. $1;
  358. };
  359. $2=_st(package_).__eq_eq(_st(aClass)._package());
  360. if(smalltalk.assert($2)){
  361. $3=self;
  362. return $3;
  363. };
  364. _st(aClass)._package_(package_);
  365. return self}, function($ctx1) {$ctx1.fill(self,"moveClass:toPackage:",{aClass:aClass,aPackageName:aPackageName,package_:package_},smalltalk.Environment)})},
  366. messageSends: ["named:", "ifNil:", "error:", "ifTrue:", "==", "package", "package:"]}),
  367. smalltalk.Environment);
  368. smalltalk.addMethod(
  369. smalltalk.method({
  370. selector: "moveMethod:toClass:",
  371. fn: function (aMethod,aClassName){
  372. var self=this;
  373. var destinationClass;
  374. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  375. return smalltalk.withContext(function($ctx1) {
  376. var $1,$2,$3;
  377. destinationClass=_st(_st($Smalltalk())._current())._at_(_st(aClassName)._asSymbol());
  378. $1=destinationClass;
  379. if(($receiver = $1) == nil || $receiver == undefined){
  380. self._error_("Invalid class name");
  381. } else {
  382. $1;
  383. };
  384. $2=_st(destinationClass).__eq_eq(_st(aMethod)._methodClass());
  385. if(smalltalk.assert($2)){
  386. $3=self;
  387. return $3;
  388. };
  389. _st(destinationClass)._compile_category_(_st(aMethod)._source(),_st(aMethod)._protocol());
  390. _st(_st(aMethod)._methodClass())._removeCompiledMethod_(aMethod);
  391. return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:",{aMethod:aMethod,aClassName:aClassName,destinationClass:destinationClass},smalltalk.Environment)})},
  392. messageSends: ["at:", "asSymbol", "current", "ifNil:", "error:", "ifTrue:", "==", "methodClass", "compile:category:", "source", "protocol", "removeCompiledMethod:"]}),
  393. smalltalk.Environment);
  394. smalltalk.addMethod(
  395. smalltalk.method({
  396. selector: "moveMethod:toProtocol:",
  397. fn: function (aMethod,aProtocol){
  398. var self=this;
  399. return smalltalk.withContext(function($ctx1) {
  400. _st(aMethod)._category_(aProtocol);
  401. return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toProtocol:",{aMethod:aMethod,aProtocol:aProtocol},smalltalk.Environment)})},
  402. messageSends: ["category:"]}),
  403. smalltalk.Environment);
  404. smalltalk.addMethod(
  405. smalltalk.method({
  406. selector: "packages",
  407. fn: function (){
  408. var self=this;
  409. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  410. return smalltalk.withContext(function($ctx1) {
  411. var $1;
  412. $1=_st(_st($Smalltalk())._current())._packages();
  413. return $1;
  414. }, function($ctx1) {$ctx1.fill(self,"packages",{},smalltalk.Environment)})},
  415. messageSends: ["packages", "current"]}),
  416. smalltalk.Environment);
  417. smalltalk.addMethod(
  418. smalltalk.method({
  419. selector: "registerErrorHandler:",
  420. fn: function (anErrorHandler){
  421. var self=this;
  422. function $ErrorHandler(){return smalltalk.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  423. return smalltalk.withContext(function($ctx1) {
  424. _st($ErrorHandler())._setCurrent_(anErrorHandler);
  425. return self}, function($ctx1) {$ctx1.fill(self,"registerErrorHandler:",{anErrorHandler:anErrorHandler},smalltalk.Environment)})},
  426. messageSends: ["setCurrent:"]}),
  427. smalltalk.Environment);
  428. smalltalk.addMethod(
  429. smalltalk.method({
  430. selector: "registerInspector:",
  431. fn: function (anInspector){
  432. var self=this;
  433. function $InspectorHandler(){return smalltalk.InspectorHandler||(typeof InspectorHandler=="undefined"?nil:InspectorHandler)}
  434. return smalltalk.withContext(function($ctx1) {
  435. _st($InspectorHandler())._register_(anInspector);
  436. return self}, function($ctx1) {$ctx1.fill(self,"registerInspector:",{anInspector:anInspector},smalltalk.Environment)})},
  437. messageSends: ["register:"]}),
  438. smalltalk.Environment);
  439. smalltalk.addMethod(
  440. smalltalk.method({
  441. selector: "registerProgressHandler:",
  442. fn: function (aProgressHandler){
  443. var self=this;
  444. function $ProgressHandler(){return smalltalk.ProgressHandler||(typeof ProgressHandler=="undefined"?nil:ProgressHandler)}
  445. return smalltalk.withContext(function($ctx1) {
  446. _st($ProgressHandler())._setCurrent_(aProgressHandler);
  447. return self}, function($ctx1) {$ctx1.fill(self,"registerProgressHandler:",{aProgressHandler:aProgressHandler},smalltalk.Environment)})},
  448. messageSends: ["setCurrent:"]}),
  449. smalltalk.Environment);
  450. smalltalk.addMethod(
  451. smalltalk.method({
  452. selector: "removeClass:",
  453. fn: function (aClass){
  454. var self=this;
  455. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  456. return smalltalk.withContext(function($ctx1) {
  457. _st(_st($Smalltalk())._current())._removeClass_(aClass);
  458. return self}, function($ctx1) {$ctx1.fill(self,"removeClass:",{aClass:aClass},smalltalk.Environment)})},
  459. messageSends: ["removeClass:", "current"]}),
  460. smalltalk.Environment);
  461. smalltalk.addMethod(
  462. smalltalk.method({
  463. selector: "removeMethod:",
  464. fn: function (aMethod){
  465. var self=this;
  466. return smalltalk.withContext(function($ctx1) {
  467. _st(_st(aMethod)._methodClass())._removeCompiledMethod_(aMethod);
  468. return self}, function($ctx1) {$ctx1.fill(self,"removeMethod:",{aMethod:aMethod},smalltalk.Environment)})},
  469. messageSends: ["removeCompiledMethod:", "methodClass"]}),
  470. smalltalk.Environment);
  471. smalltalk.addMethod(
  472. smalltalk.method({
  473. selector: "removeProtocol:from:",
  474. fn: function (aString,aClass){
  475. var self=this;
  476. return smalltalk.withContext(function($ctx1) {
  477. _st(_st(_st(aClass)._methods())._select_((function(each){
  478. return smalltalk.withContext(function($ctx2) {
  479. return _st(_st(each)._protocol()).__eq(aString);
  480. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._do_((function(each){
  481. return smalltalk.withContext(function($ctx2) {
  482. return _st(aClass)._removeCompiledMethod_(each);
  483. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  484. return self}, function($ctx1) {$ctx1.fill(self,"removeProtocol:from:",{aString:aString,aClass:aClass},smalltalk.Environment)})},
  485. messageSends: ["do:", "removeCompiledMethod:", "select:", "=", "protocol", "methods"]}),
  486. smalltalk.Environment);
  487. smalltalk.addMethod(
  488. smalltalk.method({
  489. selector: "renameClass:to:",
  490. fn: function (aClass,aClassName){
  491. var self=this;
  492. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  493. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  494. return smalltalk.withContext(function($ctx1) {
  495. var $1;
  496. $1=_st(_st($Smalltalk())._current())._at_(aClassName);
  497. if(($receiver = $1) == nil || $receiver == undefined){
  498. $1;
  499. } else {
  500. self._error_(_st("A class named ".__comma(aClassName)).__comma(" already exists"));
  501. };
  502. _st(_st($ClassBuilder())._new())._renameClass_to_(aClass,aClassName);
  503. return self}, function($ctx1) {$ctx1.fill(self,"renameClass:to:",{aClass:aClass,aClassName:aClassName},smalltalk.Environment)})},
  504. messageSends: ["ifNotNil:", "error:", ",", "at:", "current", "renameClass:to:", "new"]}),
  505. smalltalk.Environment);
  506. smalltalk.addMethod(
  507. smalltalk.method({
  508. selector: "renameProtocol:to:in:",
  509. fn: function (aString,anotherString,aClass){
  510. var self=this;
  511. return smalltalk.withContext(function($ctx1) {
  512. _st(_st(_st(aClass)._methods())._select_((function(each){
  513. return smalltalk.withContext(function($ctx2) {
  514. return _st(_st(each)._protocol()).__eq(aString);
  515. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._do_((function(each){
  516. return smalltalk.withContext(function($ctx2) {
  517. return _st(each)._protocol_(anotherString);
  518. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  519. return self}, function($ctx1) {$ctx1.fill(self,"renameProtocol:to:in:",{aString:aString,anotherString:anotherString,aClass:aClass},smalltalk.Environment)})},
  520. messageSends: ["do:", "protocol:", "select:", "=", "protocol", "methods"]}),
  521. smalltalk.Environment);
  522. smalltalk.addMethod(
  523. smalltalk.method({
  524. selector: "setClassCommentOf:to:",
  525. fn: function (aClass,aString){
  526. var self=this;
  527. return smalltalk.withContext(function($ctx1) {
  528. _st(aClass)._comment_(aString);
  529. return self}, function($ctx1) {$ctx1.fill(self,"setClassCommentOf:to:",{aClass:aClass,aString:aString},smalltalk.Environment)})},
  530. messageSends: ["comment:"]}),
  531. smalltalk.Environment);
  532. smalltalk.addMethod(
  533. smalltalk.method({
  534. selector: "systemAnnouncer",
  535. fn: function (){
  536. var self=this;
  537. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  538. return smalltalk.withContext(function($ctx1) {
  539. var $1;
  540. $1=_st(_st(_st($Smalltalk())._current())._at_("SystemAnnouncer"))._current();
  541. return $1;
  542. }, function($ctx1) {$ctx1.fill(self,"systemAnnouncer",{},smalltalk.Environment)})},
  543. messageSends: ["current", "at:"]}),
  544. smalltalk.Environment);
  545. smalltalk.addClass('JSObjectProxy', smalltalk.Object, ['jsObject'], 'Kernel-Infrastructure');
  546. smalltalk.addMethod(
  547. smalltalk.method({
  548. selector: "addObjectVariablesTo:",
  549. fn: function (aDictionary){
  550. var self=this;
  551. return smalltalk.withContext(function($ctx1) {
  552. for(var i in self['@jsObject']) {
  553. aDictionary._at_put_(i, self['@jsObject'][i]);
  554. }
  555. ;
  556. return self}, function($ctx1) {$ctx1.fill(self,"addObjectVariablesTo:",{aDictionary:aDictionary},smalltalk.JSObjectProxy)})},
  557. messageSends: []}),
  558. smalltalk.JSObjectProxy);
  559. smalltalk.addMethod(
  560. smalltalk.method({
  561. selector: "at:",
  562. fn: function (aString){
  563. var self=this;
  564. return smalltalk.withContext(function($ctx1) {
  565. return self['@jsObject'][aString];
  566. return self}, function($ctx1) {$ctx1.fill(self,"at:",{aString:aString},smalltalk.JSObjectProxy)})},
  567. messageSends: []}),
  568. smalltalk.JSObjectProxy);
  569. smalltalk.addMethod(
  570. smalltalk.method({
  571. selector: "at:ifAbsent:",
  572. fn: function (aString,aBlock){
  573. var self=this;
  574. return smalltalk.withContext(function($ctx1) {
  575. var obj = self['@jsObject'];
  576. return aString in obj ? obj[aString] : aBlock._value();
  577. ;
  578. return self}, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{aString:aString,aBlock:aBlock},smalltalk.JSObjectProxy)})},
  579. messageSends: []}),
  580. smalltalk.JSObjectProxy);
  581. smalltalk.addMethod(
  582. smalltalk.method({
  583. selector: "at:ifPresent:",
  584. fn: function (aString,aBlock){
  585. var self=this;
  586. return smalltalk.withContext(function($ctx1) {
  587. var obj = self['@jsObject'];
  588. return aString in obj ? aBlock._value_(obj[aString]) : nil;
  589. ;
  590. return self}, function($ctx1) {$ctx1.fill(self,"at:ifPresent:",{aString:aString,aBlock:aBlock},smalltalk.JSObjectProxy)})},
  591. messageSends: []}),
  592. smalltalk.JSObjectProxy);
  593. smalltalk.addMethod(
  594. smalltalk.method({
  595. selector: "at:ifPresent:ifAbsent:",
  596. fn: function (aString,aBlock,anotherBlock){
  597. var self=this;
  598. return smalltalk.withContext(function($ctx1) {
  599. var obj = self['@jsObject'];
  600. return aString in obj ? aBlock._value_(obj[aString]) : anotherBlock._value();
  601. ;
  602. return self}, function($ctx1) {$ctx1.fill(self,"at:ifPresent:ifAbsent:",{aString:aString,aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.JSObjectProxy)})},
  603. messageSends: []}),
  604. smalltalk.JSObjectProxy);
  605. smalltalk.addMethod(
  606. smalltalk.method({
  607. selector: "at:put:",
  608. fn: function (aString,anObject){
  609. var self=this;
  610. return smalltalk.withContext(function($ctx1) {
  611. self['@jsObject'][aString] = anObject;
  612. return self}, function($ctx1) {$ctx1.fill(self,"at:put:",{aString:aString,anObject:anObject},smalltalk.JSObjectProxy)})},
  613. messageSends: []}),
  614. smalltalk.JSObjectProxy);
  615. smalltalk.addMethod(
  616. smalltalk.method({
  617. selector: "doesNotUnderstand:",
  618. fn: function (aMessage){
  619. var self=this;
  620. return smalltalk.withContext(function($ctx1) {
  621. var $2,$1;
  622. $2=self._lookupProperty_(_st(_st(aMessage)._selector())._asJavaScriptSelector());
  623. if(($receiver = $2) == nil || $receiver == undefined){
  624. $1=smalltalk.JSObjectProxy.superclass.fn.prototype._doesNotUnderstand_.apply(_st(self), [aMessage]);
  625. } else {
  626. var jsSelector;
  627. jsSelector=$receiver;
  628. $1=self._forwardMessage_withArguments_(jsSelector,_st(aMessage)._arguments());
  629. };
  630. return $1;
  631. }, function($ctx1) {$ctx1.fill(self,"doesNotUnderstand:",{aMessage:aMessage},smalltalk.JSObjectProxy)})},
  632. messageSends: ["ifNil:ifNotNil:", "doesNotUnderstand:", "forwardMessage:withArguments:", "arguments", "lookupProperty:", "asJavaScriptSelector", "selector"]}),
  633. smalltalk.JSObjectProxy);
  634. smalltalk.addMethod(
  635. smalltalk.method({
  636. selector: "forwardMessage:withArguments:",
  637. fn: function (aString,anArray){
  638. var self=this;
  639. return smalltalk.withContext(function($ctx1) {
  640. return smalltalk.send(self._jsObject(), aString, anArray);
  641. ;
  642. return self}, function($ctx1) {$ctx1.fill(self,"forwardMessage:withArguments:",{aString:aString,anArray:anArray},smalltalk.JSObjectProxy)})},
  643. messageSends: []}),
  644. smalltalk.JSObjectProxy);
  645. smalltalk.addMethod(
  646. smalltalk.method({
  647. selector: "inspectOn:",
  648. fn: function (anInspector){
  649. var self=this;
  650. var variables;
  651. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  652. return smalltalk.withContext(function($ctx1) {
  653. variables=_st($Dictionary())._new();
  654. _st(variables)._at_put_("#self",self._jsObject());
  655. _st(anInspector)._setLabel_(self._printString());
  656. self._addObjectVariablesTo_(variables);
  657. _st(anInspector)._setVariables_(variables);
  658. return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables},smalltalk.JSObjectProxy)})},
  659. messageSends: ["new", "at:put:", "jsObject", "setLabel:", "printString", "addObjectVariablesTo:", "setVariables:"]}),
  660. smalltalk.JSObjectProxy);
  661. smalltalk.addMethod(
  662. smalltalk.method({
  663. selector: "jsObject",
  664. fn: function (){
  665. var self=this;
  666. return smalltalk.withContext(function($ctx1) {
  667. var $1;
  668. $1=self["@jsObject"];
  669. return $1;
  670. }, function($ctx1) {$ctx1.fill(self,"jsObject",{},smalltalk.JSObjectProxy)})},
  671. messageSends: []}),
  672. smalltalk.JSObjectProxy);
  673. smalltalk.addMethod(
  674. smalltalk.method({
  675. selector: "jsObject:",
  676. fn: function (aJSObject){
  677. var self=this;
  678. return smalltalk.withContext(function($ctx1) {
  679. self["@jsObject"]=aJSObject;
  680. return self}, function($ctx1) {$ctx1.fill(self,"jsObject:",{aJSObject:aJSObject},smalltalk.JSObjectProxy)})},
  681. messageSends: []}),
  682. smalltalk.JSObjectProxy);
  683. smalltalk.addMethod(
  684. smalltalk.method({
  685. selector: "keysAndValuesDo:",
  686. fn: function (aBlock){
  687. var self=this;
  688. return smalltalk.withContext(function($ctx1) {
  689. var o = self['@jsObject'];
  690. for(var i in o) {
  691. aBlock._value_value_(i, o[i]);
  692. }
  693. ;
  694. return self}, function($ctx1) {$ctx1.fill(self,"keysAndValuesDo:",{aBlock:aBlock},smalltalk.JSObjectProxy)})},
  695. messageSends: []}),
  696. smalltalk.JSObjectProxy);
  697. smalltalk.addMethod(
  698. smalltalk.method({
  699. selector: "lookupProperty:",
  700. fn: function (aString){
  701. var self=this;
  702. return smalltalk.withContext(function($ctx1) {
  703. return aString in self._jsObject() ? aString : nil;
  704. return self}, function($ctx1) {$ctx1.fill(self,"lookupProperty:",{aString:aString},smalltalk.JSObjectProxy)})},
  705. messageSends: []}),
  706. smalltalk.JSObjectProxy);
  707. smalltalk.addMethod(
  708. smalltalk.method({
  709. selector: "printOn:",
  710. fn: function (aStream){
  711. var self=this;
  712. return smalltalk.withContext(function($ctx1) {
  713. _st(aStream)._nextPutAll_(_st(self._jsObject())._toString());
  714. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.JSObjectProxy)})},
  715. messageSends: ["nextPutAll:", "toString", "jsObject"]}),
  716. smalltalk.JSObjectProxy);
  717. smalltalk.addMethod(
  718. smalltalk.method({
  719. selector: "value",
  720. fn: function (){
  721. var self=this;
  722. return smalltalk.withContext(function($ctx1) {
  723. var $1;
  724. $1=self._at_ifAbsent_("value",(function(){
  725. return smalltalk.withContext(function($ctx2) {
  726. return smalltalk.JSObjectProxy.superclass.fn.prototype._value.apply(_st(self), []);
  727. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  728. return $1;
  729. }, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.JSObjectProxy)})},
  730. messageSends: ["at:ifAbsent:", "value"]}),
  731. smalltalk.JSObjectProxy);
  732. smalltalk.addMethod(
  733. smalltalk.method({
  734. selector: "on:",
  735. fn: function (aJSObject){
  736. var self=this;
  737. return smalltalk.withContext(function($ctx1) {
  738. var $2,$3,$1;
  739. $2=self._new();
  740. _st($2)._jsObject_(aJSObject);
  741. $3=_st($2)._yourself();
  742. $1=$3;
  743. return $1;
  744. }, function($ctx1) {$ctx1.fill(self,"on:",{aJSObject:aJSObject},smalltalk.JSObjectProxy.klass)})},
  745. messageSends: ["jsObject:", "new", "yourself"]}),
  746. smalltalk.JSObjectProxy.klass);
  747. smalltalk.addClass('Organizer', smalltalk.Object, [], 'Kernel-Infrastructure');
  748. smalltalk.addMethod(
  749. smalltalk.method({
  750. selector: "addElement:",
  751. fn: function (anObject){
  752. var self=this;
  753. return smalltalk.withContext(function($ctx1) {
  754. self.elements.addElement(anObject);
  755. return self}, function($ctx1) {$ctx1.fill(self,"addElement:",{anObject:anObject},smalltalk.Organizer)})},
  756. messageSends: []}),
  757. smalltalk.Organizer);
  758. smalltalk.addMethod(
  759. smalltalk.method({
  760. selector: "elements",
  761. fn: function (){
  762. var self=this;
  763. return smalltalk.withContext(function($ctx1) {
  764. var $1;
  765. $1=_st(self._basicAt_("elements"))._copy();
  766. return $1;
  767. }, function($ctx1) {$ctx1.fill(self,"elements",{},smalltalk.Organizer)})},
  768. messageSends: ["copy", "basicAt:"]}),
  769. smalltalk.Organizer);
  770. smalltalk.addMethod(
  771. smalltalk.method({
  772. selector: "removeElement:",
  773. fn: function (anObject){
  774. var self=this;
  775. return smalltalk.withContext(function($ctx1) {
  776. self.elements.removeElement(anObject);
  777. return self}, function($ctx1) {$ctx1.fill(self,"removeElement:",{anObject:anObject},smalltalk.Organizer)})},
  778. messageSends: []}),
  779. smalltalk.Organizer);
  780. smalltalk.addClass('ClassOrganizer', smalltalk.Organizer, [], 'Kernel-Infrastructure');
  781. smalltalk.addMethod(
  782. smalltalk.method({
  783. selector: "addElement:",
  784. fn: function (aString){
  785. var self=this;
  786. function $ProtocolAdded(){return smalltalk.ProtocolAdded||(typeof ProtocolAdded=="undefined"?nil:ProtocolAdded)}
  787. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  788. return smalltalk.withContext(function($ctx1) {
  789. var $1,$2;
  790. smalltalk.ClassOrganizer.superclass.fn.prototype._addElement_.apply(_st(self), [aString]);
  791. $1=_st($ProtocolAdded())._new();
  792. _st($1)._protocol_(aString);
  793. _st($1)._theClass_(self._theClass());
  794. $2=_st($1)._yourself();
  795. _st(_st($SystemAnnouncer())._current())._announce_($2);
  796. return self}, function($ctx1) {$ctx1.fill(self,"addElement:",{aString:aString},smalltalk.ClassOrganizer)})},
  797. messageSends: ["addElement:", "announce:", "protocol:", "new", "theClass:", "theClass", "yourself", "current"]}),
  798. smalltalk.ClassOrganizer);
  799. smalltalk.addMethod(
  800. smalltalk.method({
  801. selector: "removeElement:",
  802. fn: function (aString){
  803. var self=this;
  804. function $ProtocolRemoved(){return smalltalk.ProtocolRemoved||(typeof ProtocolRemoved=="undefined"?nil:ProtocolRemoved)}
  805. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  806. return smalltalk.withContext(function($ctx1) {
  807. var $1,$2;
  808. smalltalk.ClassOrganizer.superclass.fn.prototype._removeElement_.apply(_st(self), [aString]);
  809. $1=_st($ProtocolRemoved())._new();
  810. _st($1)._protocol_(aString);
  811. _st($1)._theClass_(self._theClass());
  812. $2=_st($1)._yourself();
  813. _st(_st($SystemAnnouncer())._current())._announce_($2);
  814. return self}, function($ctx1) {$ctx1.fill(self,"removeElement:",{aString:aString},smalltalk.ClassOrganizer)})},
  815. messageSends: ["removeElement:", "announce:", "protocol:", "new", "theClass:", "theClass", "yourself", "current"]}),
  816. smalltalk.ClassOrganizer);
  817. smalltalk.addMethod(
  818. smalltalk.method({
  819. selector: "theClass",
  820. fn: function (){
  821. var self=this;
  822. return smalltalk.withContext(function($ctx1) {
  823. return self.theClass ;
  824. return self}, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.ClassOrganizer)})},
  825. messageSends: []}),
  826. smalltalk.ClassOrganizer);
  827. smalltalk.addClass('PackageOrganizer', smalltalk.Organizer, [], 'Kernel-Infrastructure');
  828. smalltalk.addClass('Package', smalltalk.Object, ['extension'], 'Kernel-Infrastructure');
  829. smalltalk.addMethod(
  830. smalltalk.method({
  831. selector: "classes",
  832. fn: function (){
  833. var self=this;
  834. return smalltalk.withContext(function($ctx1) {
  835. var $1;
  836. $1=_st(self._organization())._elements();
  837. return $1;
  838. }, function($ctx1) {$ctx1.fill(self,"classes",{},smalltalk.Package)})},
  839. messageSends: ["elements", "organization"]}),
  840. smalltalk.Package);
  841. smalltalk.addMethod(
  842. smalltalk.method({
  843. selector: "isPackage",
  844. fn: function (){
  845. var self=this;
  846. return smalltalk.withContext(function($ctx1) {
  847. return true;
  848. }, function($ctx1) {$ctx1.fill(self,"isPackage",{},smalltalk.Package)})},
  849. messageSends: []}),
  850. smalltalk.Package);
  851. smalltalk.addMethod(
  852. smalltalk.method({
  853. selector: "loadDependencies",
  854. fn: function (){
  855. var self=this;
  856. var classes,packages;
  857. return smalltalk.withContext(function($ctx1) {
  858. var $2,$3,$1;
  859. classes=self._loadDependencyClasses();
  860. $2=_st(_st(classes)._collect_((function(each){
  861. return smalltalk.withContext(function($ctx2) {
  862. return _st(each)._package();
  863. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._asSet();
  864. _st($2)._remove_ifAbsent_(self,(function(){
  865. return smalltalk.withContext(function($ctx2) {
  866. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  867. $3=_st($2)._yourself();
  868. $1=$3;
  869. return $1;
  870. }, function($ctx1) {$ctx1.fill(self,"loadDependencies",{classes:classes,packages:packages},smalltalk.Package)})},
  871. messageSends: ["loadDependencyClasses", "remove:ifAbsent:", "asSet", "collect:", "package", "yourself"]}),
  872. smalltalk.Package);
  873. smalltalk.addMethod(
  874. smalltalk.method({
  875. selector: "loadDependencyClasses",
  876. fn: function (){
  877. var self=this;
  878. var starCategoryName;
  879. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  880. return smalltalk.withContext(function($ctx1) {
  881. var $2,$3,$1;
  882. starCategoryName="*".__comma(self._name());
  883. $2=_st(_st(self._classes())._collect_((function(each){
  884. return smalltalk.withContext(function($ctx2) {
  885. return _st(each)._superclass();
  886. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._asSet();
  887. _st($2)._remove_ifAbsent_(nil,(function(){
  888. return smalltalk.withContext(function($ctx2) {
  889. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  890. _st($2)._addAll_(_st(_st(_st($Smalltalk())._current())._classes())._select_((function(each){
  891. return smalltalk.withContext(function($ctx2) {
  892. return _st(_st(each)._protocols())._includes_(starCategoryName);
  893. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})));
  894. $3=_st($2)._yourself();
  895. $1=$3;
  896. return $1;
  897. }, function($ctx1) {$ctx1.fill(self,"loadDependencyClasses",{starCategoryName:starCategoryName},smalltalk.Package)})},
  898. messageSends: [",", "name", "remove:ifAbsent:", "asSet", "collect:", "superclass", "classes", "addAll:", "select:", "includes:", "protocols", "current", "yourself"]}),
  899. smalltalk.Package);
  900. smalltalk.addMethod(
  901. smalltalk.method({
  902. selector: "name",
  903. fn: function (){
  904. var self=this;
  905. return smalltalk.withContext(function($ctx1) {
  906. return self.pkgName;
  907. return self}, function($ctx1) {$ctx1.fill(self,"name",{},smalltalk.Package)})},
  908. messageSends: []}),
  909. smalltalk.Package);
  910. smalltalk.addMethod(
  911. smalltalk.method({
  912. selector: "name:",
  913. fn: function (aString){
  914. var self=this;
  915. return smalltalk.withContext(function($ctx1) {
  916. self.pkgName = aString;
  917. return self}, function($ctx1) {$ctx1.fill(self,"name:",{aString:aString},smalltalk.Package)})},
  918. messageSends: []}),
  919. smalltalk.Package);
  920. smalltalk.addMethod(
  921. smalltalk.method({
  922. selector: "organization",
  923. fn: function (){
  924. var self=this;
  925. return smalltalk.withContext(function($ctx1) {
  926. var $1;
  927. $1=self._basicAt_("organization");
  928. return $1;
  929. }, function($ctx1) {$ctx1.fill(self,"organization",{},smalltalk.Package)})},
  930. messageSends: ["basicAt:"]}),
  931. smalltalk.Package);
  932. smalltalk.addMethod(
  933. smalltalk.method({
  934. selector: "printOn:",
  935. fn: function (aStream){
  936. var self=this;
  937. return smalltalk.withContext(function($ctx1) {
  938. var $1,$2;
  939. smalltalk.Package.superclass.fn.prototype._printOn_.apply(_st(self), [aStream]);
  940. $1=aStream;
  941. _st($1)._nextPutAll_(" (");
  942. _st($1)._nextPutAll_(self._name());
  943. $2=_st($1)._nextPutAll_(")");
  944. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Package)})},
  945. messageSends: ["printOn:", "nextPutAll:", "name"]}),
  946. smalltalk.Package);
  947. smalltalk.addMethod(
  948. smalltalk.method({
  949. selector: "setupClasses",
  950. fn: function (){
  951. var self=this;
  952. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  953. return smalltalk.withContext(function($ctx1) {
  954. var $1,$2;
  955. $1=self._classes();
  956. _st($1)._do_((function(each){
  957. return smalltalk.withContext(function($ctx2) {
  958. return _st(_st($ClassBuilder())._new())._setupClass_(each);
  959. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  960. $2=_st($1)._do_((function(each){
  961. return smalltalk.withContext(function($ctx2) {
  962. return _st(each)._initialize();
  963. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  964. return self}, function($ctx1) {$ctx1.fill(self,"setupClasses",{},smalltalk.Package)})},
  965. messageSends: ["do:", "setupClass:", "new", "classes", "initialize"]}),
  966. smalltalk.Package);
  967. smalltalk.addMethod(
  968. smalltalk.method({
  969. selector: "sortedClasses",
  970. fn: function (){
  971. var self=this;
  972. return smalltalk.withContext(function($ctx1) {
  973. var $1;
  974. $1=_st(self._class())._sortedClasses_(self._classes());
  975. return $1;
  976. }, function($ctx1) {$ctx1.fill(self,"sortedClasses",{},smalltalk.Package)})},
  977. messageSends: ["sortedClasses:", "classes", "class"]}),
  978. smalltalk.Package);
  979. smalltalk.Package.klass.iVarNames = ['defaultCommitPathJs','defaultCommitPathSt'];
  980. smalltalk.addMethod(
  981. smalltalk.method({
  982. selector: "load:",
  983. fn: function (aPackageName){
  984. var self=this;
  985. return smalltalk.withContext(function($ctx1) {
  986. self._deprecatedAPI();
  987. self._load_prefix_(aPackageName,_st(self._defaultCommitPathJs()).__comma("/"));
  988. return self}, function($ctx1) {$ctx1.fill(self,"load:",{aPackageName:aPackageName},smalltalk.Package.klass)})},
  989. messageSends: ["deprecatedAPI", "load:prefix:", ",", "defaultCommitPathJs"]}),
  990. smalltalk.Package.klass);
  991. smalltalk.addMethod(
  992. smalltalk.method({
  993. selector: "load:prefix:",
  994. fn: function (aPackageName,aPrefix){
  995. var self=this;
  996. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  997. function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  998. return smalltalk.withContext(function($ctx1) {
  999. self._deprecatedAPI();
  1000. _st($PlatformInterface())._ajax_(smalltalk.HashedCollection._from_(["url".__minus_gt(_st(_st(aPrefix).__comma(aPackageName)).__comma(".js")),"dataType".__minus_gt("script"),"success".__minus_gt((function(){
  1001. return smalltalk.withContext(function($ctx2) {
  1002. return _st(_st($Package())._named_(aPackageName))._setupClasses();
  1003. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))]));
  1004. return self}, function($ctx1) {$ctx1.fill(self,"load:prefix:",{aPackageName:aPackageName,aPrefix:aPrefix},smalltalk.Package.klass)})},
  1005. messageSends: ["deprecatedAPI", "ajax:", "->", ",", "setupClasses", "named:"]}),
  1006. smalltalk.Package.klass);
  1007. smalltalk.addMethod(
  1008. smalltalk.method({
  1009. selector: "named:",
  1010. fn: function (aPackageName){
  1011. var self=this;
  1012. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1013. return smalltalk.withContext(function($ctx1) {
  1014. var $1;
  1015. $1=_st(_st($Smalltalk())._current())._packageAt_(aPackageName);
  1016. return $1;
  1017. }, function($ctx1) {$ctx1.fill(self,"named:",{aPackageName:aPackageName},smalltalk.Package.klass)})},
  1018. messageSends: ["packageAt:", "current"]}),
  1019. smalltalk.Package.klass);
  1020. smalltalk.addMethod(
  1021. smalltalk.method({
  1022. selector: "named:ifAbsent:",
  1023. fn: function (aPackageName,aBlock){
  1024. var self=this;
  1025. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1026. return smalltalk.withContext(function($ctx1) {
  1027. var $1;
  1028. $1=_st(_st($Smalltalk())._current())._packageAt_ifAbsent_(aPackageName,aBlock);
  1029. return $1;
  1030. }, function($ctx1) {$ctx1.fill(self,"named:ifAbsent:",{aPackageName:aPackageName,aBlock:aBlock},smalltalk.Package.klass)})},
  1031. messageSends: ["packageAt:ifAbsent:", "current"]}),
  1032. smalltalk.Package.klass);
  1033. smalltalk.addMethod(
  1034. smalltalk.method({
  1035. selector: "sortedClasses:",
  1036. fn: function (classes){
  1037. var self=this;
  1038. var children,others,nodes,expandedClasses;
  1039. function $ClassSorterNode(){return smalltalk.ClassSorterNode||(typeof ClassSorterNode=="undefined"?nil:ClassSorterNode)}
  1040. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  1041. return smalltalk.withContext(function($ctx1) {
  1042. var $1,$2;
  1043. children=[];
  1044. others=[];
  1045. _st(classes)._do_((function(each){
  1046. return smalltalk.withContext(function($ctx2) {
  1047. $1=_st(classes)._includes_(_st(each)._superclass());
  1048. if(smalltalk.assert($1)){
  1049. return _st(others)._add_(each);
  1050. } else {
  1051. return _st(children)._add_(each);
  1052. };
  1053. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1054. nodes=_st(children)._collect_((function(each){
  1055. return smalltalk.withContext(function($ctx2) {
  1056. return _st($ClassSorterNode())._on_classes_level_(each,others,(0));
  1057. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1058. nodes=_st(nodes)._sorted_((function(a,b){
  1059. return smalltalk.withContext(function($ctx2) {
  1060. return _st(_st(_st(a)._theClass())._name()).__lt_eq(_st(_st(b)._theClass())._name());
  1061. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})}));
  1062. expandedClasses=_st($Array())._new();
  1063. _st(nodes)._do_((function(aNode){
  1064. return smalltalk.withContext(function($ctx2) {
  1065. return _st(aNode)._traverseClassesWith_(expandedClasses);
  1066. }, function($ctx2) {$ctx2.fillBlock({aNode:aNode},$ctx1)})}));
  1067. $2=expandedClasses;
  1068. return $2;
  1069. }, function($ctx1) {$ctx1.fill(self,"sortedClasses:",{classes:classes,children:children,others:others,nodes:nodes,expandedClasses:expandedClasses},smalltalk.Package.klass)})},
  1070. messageSends: ["do:", "ifFalse:ifTrue:", "add:", "includes:", "superclass", "collect:", "on:classes:level:", "sorted:", "<=", "name", "theClass", "new", "traverseClassesWith:"]}),
  1071. smalltalk.Package.klass);
  1072. smalltalk.addClass('PlatformInterface', smalltalk.Object, [], 'Kernel-Infrastructure');
  1073. smalltalk.PlatformInterface.klass.iVarNames = ['worker'];
  1074. smalltalk.addMethod(
  1075. smalltalk.method({
  1076. selector: "ajax:",
  1077. fn: function (anObject){
  1078. var self=this;
  1079. return smalltalk.withContext(function($ctx1) {
  1080. var $2,$1;
  1081. $2=self["@worker"];
  1082. if(($receiver = $2) == nil || $receiver == undefined){
  1083. $1=self._error_("ajax: not available");
  1084. } else {
  1085. $1=_st(self["@worker"])._ajax_(anObject);
  1086. };
  1087. return $1;
  1088. }, function($ctx1) {$ctx1.fill(self,"ajax:",{anObject:anObject},smalltalk.PlatformInterface.klass)})},
  1089. messageSends: ["ifNotNil:ifNil:", "ajax:", "error:"]}),
  1090. smalltalk.PlatformInterface.klass);
  1091. smalltalk.addMethod(
  1092. smalltalk.method({
  1093. selector: "alert:",
  1094. fn: function (aString){
  1095. var self=this;
  1096. return smalltalk.withContext(function($ctx1) {
  1097. var $2,$1;
  1098. $2=self["@worker"];
  1099. if(($receiver = $2) == nil || $receiver == undefined){
  1100. $1=self._error_("alert: not available");
  1101. } else {
  1102. $1=_st(self["@worker"])._alert_(aString);
  1103. };
  1104. return $1;
  1105. }, function($ctx1) {$ctx1.fill(self,"alert:",{aString:aString},smalltalk.PlatformInterface.klass)})},
  1106. messageSends: ["ifNotNil:ifNil:", "alert:", "error:"]}),
  1107. smalltalk.PlatformInterface.klass);
  1108. smalltalk.addMethod(
  1109. smalltalk.method({
  1110. selector: "confirm:",
  1111. fn: function (aString){
  1112. var self=this;
  1113. return smalltalk.withContext(function($ctx1) {
  1114. var $2,$1;
  1115. $2=self["@worker"];
  1116. if(($receiver = $2) == nil || $receiver == undefined){
  1117. $1=self._error_("confirm: not available");
  1118. } else {
  1119. $1=_st(self["@worker"])._confirm_(aString);
  1120. };
  1121. return $1;
  1122. }, function($ctx1) {$ctx1.fill(self,"confirm:",{aString:aString},smalltalk.PlatformInterface.klass)})},
  1123. messageSends: ["ifNotNil:ifNil:", "confirm:", "error:"]}),
  1124. smalltalk.PlatformInterface.klass);
  1125. smalltalk.addMethod(
  1126. smalltalk.method({
  1127. selector: "existsGlobal:",
  1128. fn: function (aString){
  1129. var self=this;
  1130. function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  1131. return smalltalk.withContext(function($ctx1) {
  1132. var $1;
  1133. $1=_st(_st($PlatformInterface())._globals())._at_ifPresent_ifAbsent_(aString,(function(){
  1134. return smalltalk.withContext(function($ctx2) {
  1135. return true;
  1136. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),(function(){
  1137. return smalltalk.withContext(function($ctx2) {
  1138. return false;
  1139. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1140. return $1;
  1141. }, function($ctx1) {$ctx1.fill(self,"existsGlobal:",{aString:aString},smalltalk.PlatformInterface.klass)})},
  1142. messageSends: ["at:ifPresent:ifAbsent:", "globals"]}),
  1143. smalltalk.PlatformInterface.klass);
  1144. smalltalk.addMethod(
  1145. smalltalk.method({
  1146. selector: "globals",
  1147. fn: function (){
  1148. var self=this;
  1149. return smalltalk.withContext(function($ctx1) {
  1150. return (new Function('return this'))();;
  1151. return self}, function($ctx1) {$ctx1.fill(self,"globals",{},smalltalk.PlatformInterface.klass)})},
  1152. messageSends: []}),
  1153. smalltalk.PlatformInterface.klass);
  1154. smalltalk.addMethod(
  1155. smalltalk.method({
  1156. selector: "initialize",
  1157. fn: function (){
  1158. var self=this;
  1159. var candidate;
  1160. function $BrowserInterface(){return smalltalk.BrowserInterface||(typeof BrowserInterface=="undefined"?nil:BrowserInterface)}
  1161. return smalltalk.withContext(function($ctx1) {
  1162. var $1,$2,$3;
  1163. smalltalk.PlatformInterface.klass.superclass.fn.prototype._initialize.apply(_st(self), []);
  1164. $1=$BrowserInterface();
  1165. if(($receiver = $1) == nil || $receiver == undefined){
  1166. $1;
  1167. } else {
  1168. candidate=_st($BrowserInterface())._new();
  1169. candidate;
  1170. $2=_st(candidate)._isAvailable();
  1171. if(smalltalk.assert($2)){
  1172. self._setWorker_(candidate);
  1173. $3=self;
  1174. return $3;
  1175. };
  1176. };
  1177. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{candidate:candidate},smalltalk.PlatformInterface.klass)})},
  1178. messageSends: ["initialize", "ifNotNil:", "new", "ifTrue:", "setWorker:", "isAvailable"]}),
  1179. smalltalk.PlatformInterface.klass);
  1180. smalltalk.addMethod(
  1181. smalltalk.method({
  1182. selector: "prompt:",
  1183. fn: function (aString){
  1184. var self=this;
  1185. return smalltalk.withContext(function($ctx1) {
  1186. var $2,$1;
  1187. $2=self["@worker"];
  1188. if(($receiver = $2) == nil || $receiver == undefined){
  1189. $1=self._error_("prompt: not available");
  1190. } else {
  1191. $1=_st(self["@worker"])._prompt_(aString);
  1192. };
  1193. return $1;
  1194. }, function($ctx1) {$ctx1.fill(self,"prompt:",{aString:aString},smalltalk.PlatformInterface.klass)})},
  1195. messageSends: ["ifNotNil:ifNil:", "prompt:", "error:"]}),
  1196. smalltalk.PlatformInterface.klass);
  1197. smalltalk.addMethod(
  1198. smalltalk.method({
  1199. selector: "setWorker:",
  1200. fn: function (anObject){
  1201. var self=this;
  1202. return smalltalk.withContext(function($ctx1) {
  1203. self["@worker"]=anObject;
  1204. return self}, function($ctx1) {$ctx1.fill(self,"setWorker:",{anObject:anObject},smalltalk.PlatformInterface.klass)})},
  1205. messageSends: []}),
  1206. smalltalk.PlatformInterface.klass);
  1207. smalltalk.addClass('ProgressHandler', smalltalk.Object, [], 'Kernel-Infrastructure');
  1208. smalltalk.addMethod(
  1209. smalltalk.method({
  1210. selector: "do:on:displaying:",
  1211. fn: function (aBlock,aCollection,aString){
  1212. var self=this;
  1213. return smalltalk.withContext(function($ctx1) {
  1214. _st(aCollection)._do_(aBlock);
  1215. return self}, function($ctx1) {$ctx1.fill(self,"do:on:displaying:",{aBlock:aBlock,aCollection:aCollection,aString:aString},smalltalk.ProgressHandler)})},
  1216. messageSends: ["do:"]}),
  1217. smalltalk.ProgressHandler);
  1218. smalltalk.ProgressHandler.klass.iVarNames = ['current'];
  1219. smalltalk.addMethod(
  1220. smalltalk.method({
  1221. selector: "current",
  1222. fn: function (){
  1223. var self=this;
  1224. return smalltalk.withContext(function($ctx1) {
  1225. var $2,$1;
  1226. $2=self["@current"];
  1227. if(($receiver = $2) == nil || $receiver == undefined){
  1228. self["@current"]=self._new();
  1229. $1=self["@current"];
  1230. } else {
  1231. $1=$2;
  1232. };
  1233. return $1;
  1234. }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.ProgressHandler.klass)})},
  1235. messageSends: ["ifNil:", "new"]}),
  1236. smalltalk.ProgressHandler.klass);
  1237. smalltalk.addMethod(
  1238. smalltalk.method({
  1239. selector: "initialize",
  1240. fn: function (){
  1241. var self=this;
  1242. return smalltalk.withContext(function($ctx1) {
  1243. self._register();
  1244. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ProgressHandler.klass)})},
  1245. messageSends: ["register"]}),
  1246. smalltalk.ProgressHandler.klass);
  1247. smalltalk.addMethod(
  1248. smalltalk.method({
  1249. selector: "register",
  1250. fn: function (){
  1251. var self=this;
  1252. function $ProgressHandler(){return smalltalk.ProgressHandler||(typeof ProgressHandler=="undefined"?nil:ProgressHandler)}
  1253. return smalltalk.withContext(function($ctx1) {
  1254. _st($ProgressHandler())._setCurrent_(self._new());
  1255. return self}, function($ctx1) {$ctx1.fill(self,"register",{},smalltalk.ProgressHandler.klass)})},
  1256. messageSends: ["setCurrent:", "new"]}),
  1257. smalltalk.ProgressHandler.klass);
  1258. smalltalk.addMethod(
  1259. smalltalk.method({
  1260. selector: "setCurrent:",
  1261. fn: function (anHandler){
  1262. var self=this;
  1263. return smalltalk.withContext(function($ctx1) {
  1264. self["@current"]=anHandler;
  1265. return self}, function($ctx1) {$ctx1.fill(self,"setCurrent:",{anHandler:anHandler},smalltalk.ProgressHandler.klass)})},
  1266. messageSends: []}),
  1267. smalltalk.ProgressHandler.klass);
  1268. smalltalk.addClass('Smalltalk', smalltalk.Object, [], 'Kernel-Infrastructure');
  1269. smalltalk.addMethod(
  1270. smalltalk.method({
  1271. selector: "addGlobalJsVariable:",
  1272. fn: function (aString){
  1273. var self=this;
  1274. return smalltalk.withContext(function($ctx1) {
  1275. _st(self._globalJsVariables())._add_(aString);
  1276. return self}, function($ctx1) {$ctx1.fill(self,"addGlobalJsVariable:",{aString:aString},smalltalk.Smalltalk)})},
  1277. messageSends: ["add:", "globalJsVariables"]}),
  1278. smalltalk.Smalltalk);
  1279. smalltalk.addMethod(
  1280. smalltalk.method({
  1281. selector: "asSmalltalkException:",
  1282. fn: function (anObject){
  1283. var self=this;
  1284. function $JavaScriptException(){return smalltalk.JavaScriptException||(typeof JavaScriptException=="undefined"?nil:JavaScriptException)}
  1285. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  1286. return smalltalk.withContext(function($ctx1) {
  1287. var $2,$1;
  1288. $2=_st(self._isSmalltalkObject_(anObject))._and_((function(){
  1289. return smalltalk.withContext(function($ctx2) {
  1290. return _st(anObject)._isKindOf_($Error());
  1291. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1292. if(smalltalk.assert($2)){
  1293. $1=anObject;
  1294. } else {
  1295. $1=_st($JavaScriptException())._on_(anObject);
  1296. };
  1297. return $1;
  1298. }, function($ctx1) {$ctx1.fill(self,"asSmalltalkException:",{anObject:anObject},smalltalk.Smalltalk)})},
  1299. messageSends: ["ifTrue:ifFalse:", "on:", "and:", "isKindOf:", "isSmalltalkObject:"]}),
  1300. smalltalk.Smalltalk);
  1301. smalltalk.addMethod(
  1302. smalltalk.method({
  1303. selector: "at:",
  1304. fn: function (aString){
  1305. var self=this;
  1306. return smalltalk.withContext(function($ctx1) {
  1307. return self[aString];
  1308. return self}, function($ctx1) {$ctx1.fill(self,"at:",{aString:aString},smalltalk.Smalltalk)})},
  1309. messageSends: []}),
  1310. smalltalk.Smalltalk);
  1311. smalltalk.addMethod(
  1312. smalltalk.method({
  1313. selector: "at:ifAbsent:",
  1314. fn: function (aKey,aBlock){
  1315. var self=this;
  1316. return smalltalk.withContext(function($ctx1) {
  1317. var $2,$3,$1;
  1318. $2=self._includesKey_(aKey);
  1319. $3=(function(){
  1320. return smalltalk.withContext(function($ctx2) {
  1321. return self._at_(aKey);
  1322. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})});
  1323. $1=_st($2)._ifTrue_ifFalse_($3,aBlock);
  1324. return $1;
  1325. }, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{aKey:aKey,aBlock:aBlock},smalltalk.Smalltalk)})},
  1326. messageSends: ["ifTrue:ifFalse:", "includesKey:", "at:"]}),
  1327. smalltalk.Smalltalk);
  1328. smalltalk.addMethod(
  1329. smalltalk.method({
  1330. selector: "basicParse:",
  1331. fn: function (aString){
  1332. var self=this;
  1333. return smalltalk.withContext(function($ctx1) {
  1334. return smalltalk.parser.parse(aString);
  1335. return self}, function($ctx1) {$ctx1.fill(self,"basicParse:",{aString:aString},smalltalk.Smalltalk)})},
  1336. messageSends: []}),
  1337. smalltalk.Smalltalk);
  1338. smalltalk.addMethod(
  1339. smalltalk.method({
  1340. selector: "classes",
  1341. fn: function (){
  1342. var self=this;
  1343. return smalltalk.withContext(function($ctx1) {
  1344. return self.classes();
  1345. return self}, function($ctx1) {$ctx1.fill(self,"classes",{},smalltalk.Smalltalk)})},
  1346. messageSends: []}),
  1347. smalltalk.Smalltalk);
  1348. smalltalk.addMethod(
  1349. smalltalk.method({
  1350. selector: "createPackage:",
  1351. fn: function (packageName){
  1352. var self=this;
  1353. return smalltalk.withContext(function($ctx1) {
  1354. return smalltalk.addPackage(packageName);
  1355. return self}, function($ctx1) {$ctx1.fill(self,"createPackage:",{packageName:packageName},smalltalk.Smalltalk)})},
  1356. messageSends: []}),
  1357. smalltalk.Smalltalk);
  1358. smalltalk.addMethod(
  1359. smalltalk.method({
  1360. selector: "createPackage:properties:",
  1361. fn: function (packageName,aDict){
  1362. var self=this;
  1363. return smalltalk.withContext(function($ctx1) {
  1364. var $1,$2;
  1365. self._deprecatedAPI();
  1366. $1=_st(aDict)._isEmpty();
  1367. if(! smalltalk.assert($1)){
  1368. self._error_("createPackage:properties: called with nonempty properties");
  1369. };
  1370. $2=self._createPackage_(packageName);
  1371. return $2;
  1372. }, function($ctx1) {$ctx1.fill(self,"createPackage:properties:",{packageName:packageName,aDict:aDict},smalltalk.Smalltalk)})},
  1373. messageSends: ["deprecatedAPI", "ifFalse:", "error:", "isEmpty", "createPackage:"]}),
  1374. smalltalk.Smalltalk);
  1375. smalltalk.addMethod(
  1376. smalltalk.method({
  1377. selector: "deleteClass:",
  1378. fn: function (aClass){
  1379. var self=this;
  1380. return smalltalk.withContext(function($ctx1) {
  1381. self.removeClass(aClass);
  1382. return self}, function($ctx1) {$ctx1.fill(self,"deleteClass:",{aClass:aClass},smalltalk.Smalltalk)})},
  1383. messageSends: []}),
  1384. smalltalk.Smalltalk);
  1385. smalltalk.addMethod(
  1386. smalltalk.method({
  1387. selector: "deleteGlobalJsVariable:",
  1388. fn: function (aString){
  1389. var self=this;
  1390. return smalltalk.withContext(function($ctx1) {
  1391. _st(self._globalJsVariables())._remove_ifAbsent_(aString,(function(){
  1392. return smalltalk.withContext(function($ctx2) {
  1393. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1394. return self}, function($ctx1) {$ctx1.fill(self,"deleteGlobalJsVariable:",{aString:aString},smalltalk.Smalltalk)})},
  1395. messageSends: ["remove:ifAbsent:", "globalJsVariables"]}),
  1396. smalltalk.Smalltalk);
  1397. smalltalk.addMethod(
  1398. smalltalk.method({
  1399. selector: "deletePackage:",
  1400. fn: function (packageName){
  1401. var self=this;
  1402. return smalltalk.withContext(function($ctx1) {
  1403. delete smalltalk.packages[packageName];
  1404. return self}, function($ctx1) {$ctx1.fill(self,"deletePackage:",{packageName:packageName},smalltalk.Smalltalk)})},
  1405. messageSends: []}),
  1406. smalltalk.Smalltalk);
  1407. smalltalk.addMethod(
  1408. smalltalk.method({
  1409. selector: "globalJsVariables",
  1410. fn: function (){
  1411. var self=this;
  1412. return smalltalk.withContext(function($ctx1) {
  1413. return self.globalJsVariables;
  1414. return self}, function($ctx1) {$ctx1.fill(self,"globalJsVariables",{},smalltalk.Smalltalk)})},
  1415. messageSends: []}),
  1416. smalltalk.Smalltalk);
  1417. smalltalk.addMethod(
  1418. smalltalk.method({
  1419. selector: "includesKey:",
  1420. fn: function (aKey){
  1421. var self=this;
  1422. return smalltalk.withContext(function($ctx1) {
  1423. return self.hasOwnProperty(aKey);
  1424. return self}, function($ctx1) {$ctx1.fill(self,"includesKey:",{aKey:aKey},smalltalk.Smalltalk)})},
  1425. messageSends: []}),
  1426. smalltalk.Smalltalk);
  1427. smalltalk.addMethod(
  1428. smalltalk.method({
  1429. selector: "isSmalltalkObject:",
  1430. fn: function (anObject){
  1431. var self=this;
  1432. return smalltalk.withContext(function($ctx1) {
  1433. return typeof anObject.klass !== 'undefined';
  1434. return self}, function($ctx1) {$ctx1.fill(self,"isSmalltalkObject:",{anObject:anObject},smalltalk.Smalltalk)})},
  1435. messageSends: []}),
  1436. smalltalk.Smalltalk);
  1437. smalltalk.addMethod(
  1438. smalltalk.method({
  1439. selector: "packageAt:",
  1440. fn: function (packageName){
  1441. var self=this;
  1442. return smalltalk.withContext(function($ctx1) {
  1443. return self.packages[packageName];
  1444. return self}, function($ctx1) {$ctx1.fill(self,"packageAt:",{packageName:packageName},smalltalk.Smalltalk)})},
  1445. messageSends: []}),
  1446. smalltalk.Smalltalk);
  1447. smalltalk.addMethod(
  1448. smalltalk.method({
  1449. selector: "packageAt:ifAbsent:",
  1450. fn: function (packageName,aBlock){
  1451. var self=this;
  1452. return smalltalk.withContext(function($ctx1) {
  1453. var $2,$1;
  1454. $2=self._packageAt_(packageName);
  1455. $1=_st($2)._ifNil_(aBlock);
  1456. return $1;
  1457. }, function($ctx1) {$ctx1.fill(self,"packageAt:ifAbsent:",{packageName:packageName,aBlock:aBlock},smalltalk.Smalltalk)})},
  1458. messageSends: ["ifNil:", "packageAt:"]}),
  1459. smalltalk.Smalltalk);
  1460. smalltalk.addMethod(
  1461. smalltalk.method({
  1462. selector: "packages",
  1463. fn: function (){
  1464. var self=this;
  1465. return smalltalk.withContext(function($ctx1) {
  1466. return self.packages.all();
  1467. return self}, function($ctx1) {$ctx1.fill(self,"packages",{},smalltalk.Smalltalk)})},
  1468. messageSends: []}),
  1469. smalltalk.Smalltalk);
  1470. smalltalk.addMethod(
  1471. smalltalk.method({
  1472. selector: "parse:",
  1473. fn: function (aString){
  1474. var self=this;
  1475. var result;
  1476. return smalltalk.withContext(function($ctx1) {
  1477. var $2,$3,$1;
  1478. self._try_catch_((function(){
  1479. return smalltalk.withContext(function($ctx2) {
  1480. result=self._basicParse_(aString);
  1481. return result;
  1482. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(function(ex){
  1483. return smalltalk.withContext(function($ctx2) {
  1484. return _st(self._parseError_parsing_(ex,aString))._signal();
  1485. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})}));
  1486. $2=result;
  1487. _st($2)._source_(aString);
  1488. $3=_st($2)._yourself();
  1489. $1=$3;
  1490. return $1;
  1491. }, function($ctx1) {$ctx1.fill(self,"parse:",{aString:aString,result:result},smalltalk.Smalltalk)})},
  1492. messageSends: ["try:catch:", "basicParse:", "signal", "parseError:parsing:", "source:", "yourself"]}),
  1493. smalltalk.Smalltalk);
  1494. smalltalk.addMethod(
  1495. smalltalk.method({
  1496. selector: "parseError:parsing:",
  1497. fn: function (anException,aString){
  1498. var self=this;
  1499. function $ParseError(){return smalltalk.ParseError||(typeof ParseError=="undefined"?nil:ParseError)}
  1500. return smalltalk.withContext(function($ctx1) {
  1501. var $1;
  1502. $1=_st(_st($ParseError())._new())._messageText_(_st(_st(_st(_st("Parse error on line ".__comma(_st(anException)._basicAt_("line"))).__comma(" column ")).__comma(_st(anException)._basicAt_("column"))).__comma(" : Unexpected character ")).__comma(_st(anException)._basicAt_("found")));
  1503. return $1;
  1504. }, function($ctx1) {$ctx1.fill(self,"parseError:parsing:",{anException:anException,aString:aString},smalltalk.Smalltalk)})},
  1505. messageSends: ["messageText:", ",", "basicAt:", "new"]}),
  1506. smalltalk.Smalltalk);
  1507. smalltalk.addMethod(
  1508. smalltalk.method({
  1509. selector: "pseudoVariableNames",
  1510. fn: function (){
  1511. var self=this;
  1512. return smalltalk.withContext(function($ctx1) {
  1513. var $1;
  1514. $1=["self", "super", "nil", "true", "false", "thisContext"];
  1515. return $1;
  1516. }, function($ctx1) {$ctx1.fill(self,"pseudoVariableNames",{},smalltalk.Smalltalk)})},
  1517. messageSends: []}),
  1518. smalltalk.Smalltalk);
  1519. smalltalk.addMethod(
  1520. smalltalk.method({
  1521. selector: "readJSObject:",
  1522. fn: function (anObject){
  1523. var self=this;
  1524. return smalltalk.withContext(function($ctx1) {
  1525. return self.readJSObject(anObject);
  1526. return self}, function($ctx1) {$ctx1.fill(self,"readJSObject:",{anObject:anObject},smalltalk.Smalltalk)})},
  1527. messageSends: []}),
  1528. smalltalk.Smalltalk);
  1529. smalltalk.addMethod(
  1530. smalltalk.method({
  1531. selector: "removeClass:",
  1532. fn: function (aClass){
  1533. var self=this;
  1534. function $ClassRemoved(){return smalltalk.ClassRemoved||(typeof ClassRemoved=="undefined"?nil:ClassRemoved)}
  1535. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  1536. return smalltalk.withContext(function($ctx1) {
  1537. var $1,$2,$3;
  1538. $1=_st(aClass)._isMetaclass();
  1539. if(smalltalk.assert($1)){
  1540. self._error_(_st(_st(aClass)._asString()).__comma(" is a Metaclass and cannot be removed!"));
  1541. };
  1542. self._deleteClass_(aClass);
  1543. $2=_st($ClassRemoved())._new();
  1544. _st($2)._theClass_(aClass);
  1545. $3=_st($2)._yourself();
  1546. _st(_st($SystemAnnouncer())._current())._announce_($3);
  1547. return self}, function($ctx1) {$ctx1.fill(self,"removeClass:",{aClass:aClass},smalltalk.Smalltalk)})},
  1548. messageSends: ["ifTrue:", "error:", ",", "asString", "isMetaclass", "deleteClass:", "announce:", "theClass:", "new", "yourself", "current"]}),
  1549. smalltalk.Smalltalk);
  1550. smalltalk.addMethod(
  1551. smalltalk.method({
  1552. selector: "removePackage:",
  1553. fn: function (packageName){
  1554. var self=this;
  1555. var pkg;
  1556. return smalltalk.withContext(function($ctx1) {
  1557. pkg=self._packageAt_ifAbsent_(packageName,(function(){
  1558. return smalltalk.withContext(function($ctx2) {
  1559. return self._error_("Missing package: ".__comma(packageName));
  1560. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1561. _st(_st(pkg)._classes())._do_((function(each){
  1562. return smalltalk.withContext(function($ctx2) {
  1563. return self._removeClass_(each);
  1564. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1565. self._deletePackage_(packageName);
  1566. return self}, function($ctx1) {$ctx1.fill(self,"removePackage:",{packageName:packageName,pkg:pkg},smalltalk.Smalltalk)})},
  1567. messageSends: ["packageAt:ifAbsent:", "error:", ",", "do:", "removeClass:", "classes", "deletePackage:"]}),
  1568. smalltalk.Smalltalk);
  1569. smalltalk.addMethod(
  1570. smalltalk.method({
  1571. selector: "renamePackage:to:",
  1572. fn: function (packageName,newName){
  1573. var self=this;
  1574. var pkg;
  1575. return smalltalk.withContext(function($ctx1) {
  1576. var $1;
  1577. pkg=self._packageAt_ifAbsent_(packageName,(function(){
  1578. return smalltalk.withContext(function($ctx2) {
  1579. return self._error_("Missing package: ".__comma(packageName));
  1580. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1581. $1=self._packageAt_(newName);
  1582. if(($receiver = $1) == nil || $receiver == undefined){
  1583. $1;
  1584. } else {
  1585. self._error_("Already exists a package called: ".__comma(newName));
  1586. };
  1587. _st(self._basicAt_("packages"))._at_put_(newName,pkg);
  1588. _st(pkg)._name_(newName);
  1589. self._deletePackage_(packageName);
  1590. return self}, function($ctx1) {$ctx1.fill(self,"renamePackage:to:",{packageName:packageName,newName:newName,pkg:pkg},smalltalk.Smalltalk)})},
  1591. messageSends: ["packageAt:ifAbsent:", "error:", ",", "ifNotNil:", "packageAt:", "at:put:", "basicAt:", "name:", "deletePackage:"]}),
  1592. smalltalk.Smalltalk);
  1593. smalltalk.addMethod(
  1594. smalltalk.method({
  1595. selector: "reservedWords",
  1596. fn: function (){
  1597. var self=this;
  1598. return smalltalk.withContext(function($ctx1) {
  1599. return self.reservedWords;
  1600. return self}, function($ctx1) {$ctx1.fill(self,"reservedWords",{},smalltalk.Smalltalk)})},
  1601. messageSends: []}),
  1602. smalltalk.Smalltalk);
  1603. smalltalk.addMethod(
  1604. smalltalk.method({
  1605. selector: "version",
  1606. fn: function (){
  1607. var self=this;
  1608. return smalltalk.withContext(function($ctx1) {
  1609. return "0.11.0";
  1610. }, function($ctx1) {$ctx1.fill(self,"version",{},smalltalk.Smalltalk)})},
  1611. messageSends: []}),
  1612. smalltalk.Smalltalk);
  1613. smalltalk.Smalltalk.klass.iVarNames = ['current'];
  1614. smalltalk.addMethod(
  1615. smalltalk.method({
  1616. selector: "current",
  1617. fn: function (){
  1618. var self=this;
  1619. return smalltalk.withContext(function($ctx1) {
  1620. return smalltalk;
  1621. return self}, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.Smalltalk.klass)})},
  1622. messageSends: []}),
  1623. smalltalk.Smalltalk.klass);
  1624. smalltalk.addMethod(
  1625. smalltalk.method({
  1626. selector: "asJavaScriptSelector",
  1627. fn: function (){
  1628. var self=this;
  1629. return smalltalk.withContext(function($ctx1) {
  1630. var $1;
  1631. $1=self._replace_with_("^([a-zA-Z0-9]*).*$","$1");
  1632. return $1;
  1633. }, function($ctx1) {$ctx1.fill(self,"asJavaScriptSelector",{},smalltalk.String)})},
  1634. messageSends: ["replace:with:"]}),
  1635. smalltalk.String);
  1636. })(global_smalltalk,global_nil,global__st);