1
0

Kernel-Classes.deploy.js 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317
  1. smalltalk.addPackage('Kernel-Classes', {});
  2. smalltalk.addClass('Behavior', smalltalk.Object, [], 'Kernel-Classes');
  3. smalltalk.addMethod(
  4. "_addCompiledMethod_",
  5. smalltalk.method({
  6. selector: "addCompiledMethod:",
  7. fn: function (aMethod){
  8. var self=this;
  9. return smalltalk.withContext(function($ctx1) { var $1,$2;
  10. _st(self)._basicAddCompiledMethod_(aMethod);
  11. $1=_st((smalltalk.MethodAdded || MethodAdded))._new();
  12. _st($1)._theClass_(self);
  13. _st($1)._method_(aMethod);
  14. $2=_st($1)._yourself();
  15. _st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($2);
  16. return self}, function($ctx1) {$ctx1.fill(self,"addCompiledMethod:",{aMethod:aMethod}, smalltalk.Behavior)})}
  17. }),
  18. smalltalk.Behavior);
  19. smalltalk.addMethod(
  20. "_allInstanceVariableNames",
  21. smalltalk.method({
  22. selector: "allInstanceVariableNames",
  23. fn: function (){
  24. var self=this;
  25. var result;
  26. return smalltalk.withContext(function($ctx1) { var $1,$2;
  27. result=_st(_st(self)._instanceVariableNames())._copy();
  28. $1=_st(self)._superclass();
  29. if(($receiver = $1) == nil || $receiver == undefined){
  30. $1;
  31. } else {
  32. _st(result)._addAll_(_st(_st(self)._superclass())._allInstanceVariableNames());
  33. };
  34. $2=result;
  35. return $2;
  36. }, function($ctx1) {$ctx1.fill(self,"allInstanceVariableNames",{result:result}, smalltalk.Behavior)})}
  37. }),
  38. smalltalk.Behavior);
  39. smalltalk.addMethod(
  40. "_allSubclasses",
  41. smalltalk.method({
  42. selector: "allSubclasses",
  43. fn: function (){
  44. var self=this;
  45. var result;
  46. return smalltalk.withContext(function($ctx1) { var $1;
  47. result=_st(self)._subclasses();
  48. _st(_st(self)._subclasses())._do_((function(each){
  49. return smalltalk.withContext(function($ctx2) { return _st(result)._addAll_(_st(each)._allSubclasses());
  50. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  51. $1=result;
  52. return $1;
  53. }, function($ctx1) {$ctx1.fill(self,"allSubclasses",{result:result}, smalltalk.Behavior)})}
  54. }),
  55. smalltalk.Behavior);
  56. smalltalk.addMethod(
  57. "_allSuperclasses",
  58. smalltalk.method({
  59. selector: "allSuperclasses",
  60. fn: function (){
  61. var self=this;
  62. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$2;
  63. $1=_st(self)._superclass();
  64. if(($receiver = $1) == nil || $receiver == undefined){
  65. return [];
  66. } else {
  67. $1;
  68. };
  69. $3=_st((smalltalk.OrderedCollection || OrderedCollection))._with_(_st(self)._superclass());
  70. _st($3)._addAll_(_st(_st(self)._superclass())._allSuperclasses());
  71. $4=_st($3)._yourself();
  72. $2=$4;
  73. return $2;
  74. }, function($ctx1) {$ctx1.fill(self,"allSuperclasses",{}, smalltalk.Behavior)})}
  75. }),
  76. smalltalk.Behavior);
  77. smalltalk.addMethod(
  78. "_basicAddCompiledMethod_",
  79. smalltalk.method({
  80. selector: "basicAddCompiledMethod:",
  81. fn: function (aMethod){
  82. var self=this;
  83. return smalltalk.withContext(function($ctx1) { smalltalk.addMethod(aMethod.selector._asSelector(), aMethod, self);
  84. return self}, function($ctx1) {$ctx1.fill(self,"basicAddCompiledMethod:",{aMethod:aMethod}, smalltalk.Behavior)})}
  85. }),
  86. smalltalk.Behavior);
  87. smalltalk.addMethod(
  88. "_basicNew",
  89. smalltalk.method({
  90. selector: "basicNew",
  91. fn: function (){
  92. var self=this;
  93. return smalltalk.withContext(function($ctx1) { return new self.fn();
  94. return self}, function($ctx1) {$ctx1.fill(self,"basicNew",{}, smalltalk.Behavior)})}
  95. }),
  96. smalltalk.Behavior);
  97. smalltalk.addMethod(
  98. "_basicRemoveCompiledMethod_",
  99. smalltalk.method({
  100. selector: "basicRemoveCompiledMethod:",
  101. fn: function (aMethod){
  102. var self=this;
  103. return smalltalk.withContext(function($ctx1) {
  104. smalltalk.removeMethod(aMethod)
  105. smalltalk.init(self);
  106. ;
  107. return self}, function($ctx1) {$ctx1.fill(self,"basicRemoveCompiledMethod:",{aMethod:aMethod}, smalltalk.Behavior)})}
  108. }),
  109. smalltalk.Behavior);
  110. smalltalk.addMethod(
  111. "_canUnderstand_",
  112. smalltalk.method({
  113. selector: "canUnderstand:",
  114. fn: function (aSelector){
  115. var self=this;
  116. return smalltalk.withContext(function($ctx1) { var $1;
  117. $1=_st(_st(_st(_st(self)._methodDictionary())._keys())._includes_(_st(aSelector)._asString()))._or_((function(){
  118. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(self)._superclass())._notNil())._and_((function(){
  119. return smalltalk.withContext(function($ctx3) { return _st(_st(self)._superclass())._canUnderstand_(aSelector);
  120. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  121. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  122. return $1;
  123. }, function($ctx1) {$ctx1.fill(self,"canUnderstand:",{aSelector:aSelector}, smalltalk.Behavior)})}
  124. }),
  125. smalltalk.Behavior);
  126. smalltalk.addMethod(
  127. "_comment",
  128. smalltalk.method({
  129. selector: "comment",
  130. fn: function (){
  131. var self=this;
  132. return smalltalk.withContext(function($ctx1) { var $2,$1;
  133. $2=_st(self)._basicAt_("comment");
  134. if(($receiver = $2) == nil || $receiver == undefined){
  135. $1="";
  136. } else {
  137. $1=$2;
  138. };
  139. return $1;
  140. }, function($ctx1) {$ctx1.fill(self,"comment",{}, smalltalk.Behavior)})}
  141. }),
  142. smalltalk.Behavior);
  143. smalltalk.addMethod(
  144. "_comment_",
  145. smalltalk.method({
  146. selector: "comment:",
  147. fn: function (aString){
  148. var self=this;
  149. return smalltalk.withContext(function($ctx1) { var $1,$2;
  150. _st(self)._basicAt_put_("comment",aString);
  151. $1=_st((smalltalk.ClassCommentChanged || ClassCommentChanged))._new();
  152. _st($1)._theClass_(self);
  153. $2=_st($1)._yourself();
  154. _st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($2);
  155. return self}, function($ctx1) {$ctx1.fill(self,"comment:",{aString:aString}, smalltalk.Behavior)})}
  156. }),
  157. smalltalk.Behavior);
  158. smalltalk.addMethod(
  159. "_commentStamp",
  160. smalltalk.method({
  161. selector: "commentStamp",
  162. fn: function (){
  163. var self=this;
  164. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  165. $2=_st((smalltalk.ClassCommentReader || ClassCommentReader))._new();
  166. _st($2)._class_(self);
  167. $3=_st($2)._yourself();
  168. $1=$3;
  169. return $1;
  170. }, function($ctx1) {$ctx1.fill(self,"commentStamp",{}, smalltalk.Behavior)})}
  171. }),
  172. smalltalk.Behavior);
  173. smalltalk.addMethod(
  174. "_commentStamp_prior_",
  175. smalltalk.method({
  176. selector: "commentStamp:prior:",
  177. fn: function (aStamp,prior){
  178. var self=this;
  179. return smalltalk.withContext(function($ctx1) { var $1;
  180. $1=_st(self)._commentStamp();
  181. return $1;
  182. }, function($ctx1) {$ctx1.fill(self,"commentStamp:prior:",{aStamp:aStamp,prior:prior}, smalltalk.Behavior)})}
  183. }),
  184. smalltalk.Behavior);
  185. smalltalk.addMethod(
  186. "_compile_",
  187. smalltalk.method({
  188. selector: "compile:",
  189. fn: function (aString){
  190. var self=this;
  191. return smalltalk.withContext(function($ctx1) { _st(self)._compile_category_(aString,"");
  192. return self}, function($ctx1) {$ctx1.fill(self,"compile:",{aString:aString}, smalltalk.Behavior)})}
  193. }),
  194. smalltalk.Behavior);
  195. smalltalk.addMethod(
  196. "_compile_category_",
  197. smalltalk.method({
  198. selector: "compile:category:",
  199. fn: function (aString,anotherString){
  200. var self=this;
  201. return smalltalk.withContext(function($ctx1) { _st(_st((smalltalk.Compiler || Compiler))._new())._install_forClass_category_(aString,self,anotherString);
  202. return self}, function($ctx1) {$ctx1.fill(self,"compile:category:",{aString:aString,anotherString:anotherString}, smalltalk.Behavior)})}
  203. }),
  204. smalltalk.Behavior);
  205. smalltalk.addMethod(
  206. "_definition",
  207. smalltalk.method({
  208. selector: "definition",
  209. fn: function (){
  210. var self=this;
  211. return smalltalk.withContext(function($ctx1) { return "";
  212. }, function($ctx1) {$ctx1.fill(self,"definition",{}, smalltalk.Behavior)})}
  213. }),
  214. smalltalk.Behavior);
  215. smalltalk.addMethod(
  216. "_includesSelector_",
  217. smalltalk.method({
  218. selector: "includesSelector:",
  219. fn: function (aSymbol){
  220. var self=this;
  221. return smalltalk.withContext(function($ctx1) { var $1;
  222. $1=_st(_st(self)._methodDictionary())._includesKey_(_st(aSymbol)._asString());
  223. return $1;
  224. }, function($ctx1) {$ctx1.fill(self,"includesSelector:",{aSymbol:aSymbol}, smalltalk.Behavior)})}
  225. }),
  226. smalltalk.Behavior);
  227. smalltalk.addMethod(
  228. "_inheritsFrom_",
  229. smalltalk.method({
  230. selector: "inheritsFrom:",
  231. fn: function (aClass){
  232. var self=this;
  233. return smalltalk.withContext(function($ctx1) { var $1;
  234. $1=_st(_st(aClass)._allSubclasses())._includes_(self);
  235. return $1;
  236. }, function($ctx1) {$ctx1.fill(self,"inheritsFrom:",{aClass:aClass}, smalltalk.Behavior)})}
  237. }),
  238. smalltalk.Behavior);
  239. smalltalk.addMethod(
  240. "_instanceVariableNames",
  241. smalltalk.method({
  242. selector: "instanceVariableNames",
  243. fn: function (){
  244. var self=this;
  245. return smalltalk.withContext(function($ctx1) { return self.iVarNames;
  246. return self}, function($ctx1) {$ctx1.fill(self,"instanceVariableNames",{}, smalltalk.Behavior)})}
  247. }),
  248. smalltalk.Behavior);
  249. smalltalk.addMethod(
  250. "_lookupSelector_",
  251. smalltalk.method({
  252. selector: "lookupSelector:",
  253. fn: function (selector){
  254. var self=this;
  255. var lookupClass;
  256. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$2;
  257. var $early={};
  258. try {
  259. lookupClass=self;
  260. $1=(function(){
  261. return smalltalk.withContext(function($ctx2) { return _st(lookupClass).__eq(nil);
  262. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  263. $2=(function(){
  264. return smalltalk.withContext(function($ctx2) { $3=_st(lookupClass)._includesSelector_(selector);
  265. if(smalltalk.assert($3)){
  266. $4=_st(lookupClass)._methodAt_(selector);
  267. throw $early=[$4];
  268. };
  269. lookupClass=_st(lookupClass)._superclass();
  270. return lookupClass;
  271. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  272. _st($1)._whileFalse_($2);
  273. return nil;
  274. }
  275. catch(e) {if(e===$early)return e[0]; throw e}
  276. }, function($ctx1) {$ctx1.fill(self,"lookupSelector:",{selector:selector,lookupClass:lookupClass}, smalltalk.Behavior)})}
  277. }),
  278. smalltalk.Behavior);
  279. smalltalk.addMethod(
  280. "_methodAt_",
  281. smalltalk.method({
  282. selector: "methodAt:",
  283. fn: function (aSymbol){
  284. var self=this;
  285. return smalltalk.withContext(function($ctx1) { var $1;
  286. $1=_st(_st(self)._methodDictionary())._at_(_st(aSymbol)._asString());
  287. return $1;
  288. }, function($ctx1) {$ctx1.fill(self,"methodAt:",{aSymbol:aSymbol}, smalltalk.Behavior)})}
  289. }),
  290. smalltalk.Behavior);
  291. smalltalk.addMethod(
  292. "_methodDictionary",
  293. smalltalk.method({
  294. selector: "methodDictionary",
  295. fn: function (){
  296. var self=this;
  297. return smalltalk.withContext(function($ctx1) { var dict = smalltalk.HashedCollection._new();
  298. var methods = self.methods;
  299. for(var i in methods) {
  300. if(methods[i].selector) {
  301. dict._at_put_(methods[i].selector, methods[i]);
  302. }
  303. };
  304. return dict;
  305. return self}, function($ctx1) {$ctx1.fill(self,"methodDictionary",{}, smalltalk.Behavior)})}
  306. }),
  307. smalltalk.Behavior);
  308. smalltalk.addMethod(
  309. "_methods",
  310. smalltalk.method({
  311. selector: "methods",
  312. fn: function (){
  313. var self=this;
  314. return smalltalk.withContext(function($ctx1) { var $1;
  315. $1=_st(_st(self)._methodDictionary())._values();
  316. return $1;
  317. }, function($ctx1) {$ctx1.fill(self,"methods",{}, smalltalk.Behavior)})}
  318. }),
  319. smalltalk.Behavior);
  320. smalltalk.addMethod(
  321. "_methodsFor_",
  322. smalltalk.method({
  323. selector: "methodsFor:",
  324. fn: function (aString){
  325. var self=this;
  326. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  327. $2=_st((smalltalk.ClassCategoryReader || ClassCategoryReader))._new();
  328. _st($2)._class_category_(self,aString);
  329. $3=_st($2)._yourself();
  330. $1=$3;
  331. return $1;
  332. }, function($ctx1) {$ctx1.fill(self,"methodsFor:",{aString:aString}, smalltalk.Behavior)})}
  333. }),
  334. smalltalk.Behavior);
  335. smalltalk.addMethod(
  336. "_methodsFor_stamp_",
  337. smalltalk.method({
  338. selector: "methodsFor:stamp:",
  339. fn: function (aString,aStamp){
  340. var self=this;
  341. return smalltalk.withContext(function($ctx1) { var $1;
  342. $1=_st(self)._methodsFor_(aString);
  343. return $1;
  344. }, function($ctx1) {$ctx1.fill(self,"methodsFor:stamp:",{aString:aString,aStamp:aStamp}, smalltalk.Behavior)})}
  345. }),
  346. smalltalk.Behavior);
  347. smalltalk.addMethod(
  348. "_methodsInProtocol_",
  349. smalltalk.method({
  350. selector: "methodsInProtocol:",
  351. fn: function (aString){
  352. var self=this;
  353. return smalltalk.withContext(function($ctx1) { var $1;
  354. $1=_st(_st(_st(self)._methodDictionary())._values())._select_((function(each){
  355. return smalltalk.withContext(function($ctx2) { return _st(_st(each)._protocol()).__eq(aString);
  356. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  357. return $1;
  358. }, function($ctx1) {$ctx1.fill(self,"methodsInProtocol:",{aString:aString}, smalltalk.Behavior)})}
  359. }),
  360. smalltalk.Behavior);
  361. smalltalk.addMethod(
  362. "_name",
  363. smalltalk.method({
  364. selector: "name",
  365. fn: function (){
  366. var self=this;
  367. return smalltalk.withContext(function($ctx1) { return self.className || nil;
  368. return self}, function($ctx1) {$ctx1.fill(self,"name",{}, smalltalk.Behavior)})}
  369. }),
  370. smalltalk.Behavior);
  371. smalltalk.addMethod(
  372. "_new",
  373. smalltalk.method({
  374. selector: "new",
  375. fn: function (){
  376. var self=this;
  377. return smalltalk.withContext(function($ctx1) { var $1;
  378. $1=_st(_st(self)._basicNew())._initialize();
  379. return $1;
  380. }, function($ctx1) {$ctx1.fill(self,"new",{}, smalltalk.Behavior)})}
  381. }),
  382. smalltalk.Behavior);
  383. smalltalk.addMethod(
  384. "_organization",
  385. smalltalk.method({
  386. selector: "organization",
  387. fn: function (){
  388. var self=this;
  389. return smalltalk.withContext(function($ctx1) { var $1;
  390. $1=_st(self)._basicAt_("organization");
  391. return $1;
  392. }, function($ctx1) {$ctx1.fill(self,"organization",{}, smalltalk.Behavior)})}
  393. }),
  394. smalltalk.Behavior);
  395. smalltalk.addMethod(
  396. "_protocols",
  397. smalltalk.method({
  398. selector: "protocols",
  399. fn: function (){
  400. var self=this;
  401. return smalltalk.withContext(function($ctx1) { var $1;
  402. $1=_st(_st(_st(self)._organization())._elements())._sorted();
  403. return $1;
  404. }, function($ctx1) {$ctx1.fill(self,"protocols",{}, smalltalk.Behavior)})}
  405. }),
  406. smalltalk.Behavior);
  407. smalltalk.addMethod(
  408. "_protocolsDo_",
  409. smalltalk.method({
  410. selector: "protocolsDo:",
  411. fn: function (aBlock){
  412. var self=this;
  413. var methodsByCategory;
  414. return smalltalk.withContext(function($ctx1) { methodsByCategory=_st((smalltalk.HashedCollection || HashedCollection))._new();
  415. _st(_st(_st(self)._methodDictionary())._values())._do_((function(m){
  416. return smalltalk.withContext(function($ctx2) { return _st(_st(methodsByCategory)._at_ifAbsentPut_(_st(m)._category(),(function(){
  417. return smalltalk.withContext(function($ctx3) { return _st((smalltalk.Array || Array))._new();
  418. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})})))._add_(m);
  419. }, function($ctx2) {$ctx2.fillBlock({m:m},$ctx1)})}));
  420. _st(_st(self)._protocols())._do_((function(category){
  421. return smalltalk.withContext(function($ctx2) { return _st(aBlock)._value_value_(category,_st(methodsByCategory)._at_(category));
  422. }, function($ctx2) {$ctx2.fillBlock({category:category},$ctx1)})}));
  423. return self}, function($ctx1) {$ctx1.fill(self,"protocolsDo:",{aBlock:aBlock,methodsByCategory:methodsByCategory}, smalltalk.Behavior)})}
  424. }),
  425. smalltalk.Behavior);
  426. smalltalk.addMethod(
  427. "_prototype",
  428. smalltalk.method({
  429. selector: "prototype",
  430. fn: function (){
  431. var self=this;
  432. return smalltalk.withContext(function($ctx1) { return self.fn.prototype;
  433. return self}, function($ctx1) {$ctx1.fill(self,"prototype",{}, smalltalk.Behavior)})}
  434. }),
  435. smalltalk.Behavior);
  436. smalltalk.addMethod(
  437. "_removeCompiledMethod_",
  438. smalltalk.method({
  439. selector: "removeCompiledMethod:",
  440. fn: function (aMethod){
  441. var self=this;
  442. return smalltalk.withContext(function($ctx1) { var $1,$2;
  443. _st(self)._basicRemoveCompiledMethod_(aMethod);
  444. $1=_st((smalltalk.MethodRemoved || MethodRemoved))._new();
  445. _st($1)._theClass_(self);
  446. _st($1)._method_(aMethod);
  447. $2=_st($1)._yourself();
  448. _st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($2);
  449. return self}, function($ctx1) {$ctx1.fill(self,"removeCompiledMethod:",{aMethod:aMethod}, smalltalk.Behavior)})}
  450. }),
  451. smalltalk.Behavior);
  452. smalltalk.addMethod(
  453. "_selectors",
  454. smalltalk.method({
  455. selector: "selectors",
  456. fn: function (){
  457. var self=this;
  458. return smalltalk.withContext(function($ctx1) { var $1;
  459. $1=_st(_st(self)._methodDictionary())._keys();
  460. return $1;
  461. }, function($ctx1) {$ctx1.fill(self,"selectors",{}, smalltalk.Behavior)})}
  462. }),
  463. smalltalk.Behavior);
  464. smalltalk.addMethod(
  465. "_subclasses",
  466. smalltalk.method({
  467. selector: "subclasses",
  468. fn: function (){
  469. var self=this;
  470. return smalltalk.withContext(function($ctx1) { return smalltalk.subclasses(self);
  471. return self}, function($ctx1) {$ctx1.fill(self,"subclasses",{}, smalltalk.Behavior)})}
  472. }),
  473. smalltalk.Behavior);
  474. smalltalk.addMethod(
  475. "_superclass",
  476. smalltalk.method({
  477. selector: "superclass",
  478. fn: function (){
  479. var self=this;
  480. return smalltalk.withContext(function($ctx1) { return self.superclass || nil;
  481. return self}, function($ctx1) {$ctx1.fill(self,"superclass",{}, smalltalk.Behavior)})}
  482. }),
  483. smalltalk.Behavior);
  484. smalltalk.addMethod(
  485. "_theMetaClass",
  486. smalltalk.method({
  487. selector: "theMetaClass",
  488. fn: function (){
  489. var self=this;
  490. return smalltalk.withContext(function($ctx1) { var $1;
  491. $1=_st(self)._class();
  492. return $1;
  493. }, function($ctx1) {$ctx1.fill(self,"theMetaClass",{}, smalltalk.Behavior)})}
  494. }),
  495. smalltalk.Behavior);
  496. smalltalk.addMethod(
  497. "_theNonMetaClass",
  498. smalltalk.method({
  499. selector: "theNonMetaClass",
  500. fn: function (){
  501. var self=this;
  502. return smalltalk.withContext(function($ctx1) { var $1;
  503. $1=self;
  504. return $1;
  505. }, function($ctx1) {$ctx1.fill(self,"theNonMetaClass",{}, smalltalk.Behavior)})}
  506. }),
  507. smalltalk.Behavior);
  508. smalltalk.addMethod(
  509. "_withAllSubclasses",
  510. smalltalk.method({
  511. selector: "withAllSubclasses",
  512. fn: function (){
  513. var self=this;
  514. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  515. $2=_st((smalltalk.Array || Array))._with_(self);
  516. _st($2)._addAll_(_st(self)._allSubclasses());
  517. $3=_st($2)._yourself();
  518. $1=$3;
  519. return $1;
  520. }, function($ctx1) {$ctx1.fill(self,"withAllSubclasses",{}, smalltalk.Behavior)})}
  521. }),
  522. smalltalk.Behavior);
  523. smalltalk.addClass('Class', smalltalk.Behavior, [], 'Kernel-Classes');
  524. smalltalk.addMethod(
  525. "_asJavascript",
  526. smalltalk.method({
  527. selector: "asJavascript",
  528. fn: function (){
  529. var self=this;
  530. return smalltalk.withContext(function($ctx1) { var $1;
  531. $1=_st("smalltalk.").__comma(_st(self)._name());
  532. return $1;
  533. }, function($ctx1) {$ctx1.fill(self,"asJavascript",{}, smalltalk.Class)})}
  534. }),
  535. smalltalk.Class);
  536. smalltalk.addMethod(
  537. "_category",
  538. smalltalk.method({
  539. selector: "category",
  540. fn: function (){
  541. var self=this;
  542. return smalltalk.withContext(function($ctx1) { var $2,$1;
  543. $2=_st(self)._package();
  544. if(($receiver = $2) == nil || $receiver == undefined){
  545. $1="Unclassified";
  546. } else {
  547. $1=_st(_st(self)._package())._name();
  548. };
  549. return $1;
  550. }, function($ctx1) {$ctx1.fill(self,"category",{}, smalltalk.Class)})}
  551. }),
  552. smalltalk.Class);
  553. smalltalk.addMethod(
  554. "_definition",
  555. smalltalk.method({
  556. selector: "definition",
  557. fn: function (){
  558. var self=this;
  559. return smalltalk.withContext(function($ctx1) { var $2,$3,$4,$5,$1;
  560. $1=_st((smalltalk.String || String))._streamContents_((function(stream){
  561. return smalltalk.withContext(function($ctx2) { $2=stream;
  562. _st($2)._nextPutAll_(_st(_st(self)._superclass())._asString());
  563. _st($2)._nextPutAll_(" subclass: #");
  564. _st($2)._nextPutAll_(_st(self)._name());
  565. _st($2)._nextPutAll_(_st(_st((smalltalk.String || String))._lf()).__comma(_st((smalltalk.String || String))._tab()));
  566. $3=_st($2)._nextPutAll_("instanceVariableNames: '");
  567. $3;
  568. _st(_st(self)._instanceVariableNames())._do_separatedBy_((function(each){
  569. return smalltalk.withContext(function($ctx3) { return _st(stream)._nextPutAll_(each);
  570. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}),(function(){
  571. return smalltalk.withContext(function($ctx3) { return _st(stream)._nextPutAll_(" ");
  572. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  573. $4=stream;
  574. _st($4)._nextPutAll_(_st(_st("'").__comma(_st((smalltalk.String || String))._lf())).__comma(_st((smalltalk.String || String))._tab()));
  575. _st($4)._nextPutAll_("package: '");
  576. _st($4)._nextPutAll_(_st(self)._category());
  577. $5=_st($4)._nextPutAll_("'");
  578. return $5;
  579. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
  580. return $1;
  581. }, function($ctx1) {$ctx1.fill(self,"definition",{}, smalltalk.Class)})}
  582. }),
  583. smalltalk.Class);
  584. smalltalk.addMethod(
  585. "_isClass",
  586. smalltalk.method({
  587. selector: "isClass",
  588. fn: function (){
  589. var self=this;
  590. return smalltalk.withContext(function($ctx1) { return true;
  591. }, function($ctx1) {$ctx1.fill(self,"isClass",{}, smalltalk.Class)})}
  592. }),
  593. smalltalk.Class);
  594. smalltalk.addMethod(
  595. "_package",
  596. smalltalk.method({
  597. selector: "package",
  598. fn: function (){
  599. var self=this;
  600. return smalltalk.withContext(function($ctx1) { return self.pkg;
  601. return self}, function($ctx1) {$ctx1.fill(self,"package",{}, smalltalk.Class)})}
  602. }),
  603. smalltalk.Class);
  604. smalltalk.addMethod(
  605. "_package_",
  606. smalltalk.method({
  607. selector: "package:",
  608. fn: function (aPackage){
  609. var self=this;
  610. return smalltalk.withContext(function($ctx1) { self.pkg = aPackage;
  611. return self}, function($ctx1) {$ctx1.fill(self,"package:",{aPackage:aPackage}, smalltalk.Class)})}
  612. }),
  613. smalltalk.Class);
  614. smalltalk.addMethod(
  615. "_printString",
  616. smalltalk.method({
  617. selector: "printString",
  618. fn: function (){
  619. var self=this;
  620. return smalltalk.withContext(function($ctx1) { var $1;
  621. $1=_st(self)._name();
  622. return $1;
  623. }, function($ctx1) {$ctx1.fill(self,"printString",{}, smalltalk.Class)})}
  624. }),
  625. smalltalk.Class);
  626. smalltalk.addMethod(
  627. "_rename_",
  628. smalltalk.method({
  629. selector: "rename:",
  630. fn: function (aString){
  631. var self=this;
  632. return smalltalk.withContext(function($ctx1) { _st(_st((smalltalk.ClassBuilder || ClassBuilder))._new())._renameClass_to_(self,aString);
  633. return self}, function($ctx1) {$ctx1.fill(self,"rename:",{aString:aString}, smalltalk.Class)})}
  634. }),
  635. smalltalk.Class);
  636. smalltalk.addMethod(
  637. "_subclass_instanceVariableNames_",
  638. smalltalk.method({
  639. selector: "subclass:instanceVariableNames:",
  640. fn: function (aString,anotherString){
  641. var self=this;
  642. return smalltalk.withContext(function($ctx1) { var $1;
  643. $1=_st(self)._subclass_instanceVariableNames_package_(aString,anotherString,nil);
  644. return $1;
  645. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:",{aString:aString,anotherString:anotherString}, smalltalk.Class)})}
  646. }),
  647. smalltalk.Class);
  648. smalltalk.addMethod(
  649. "_subclass_instanceVariableNames_category_",
  650. smalltalk.method({
  651. selector: "subclass:instanceVariableNames:category:",
  652. fn: function (aString,aString2,aString3){
  653. var self=this;
  654. return smalltalk.withContext(function($ctx1) { var $1;
  655. _st(self)._deprecatedAPI();
  656. $1=_st(self)._subclass_instanceVariableNames_package_(aString,aString2,aString3);
  657. return $1;
  658. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:category:",{aString:aString,aString2:aString2,aString3:aString3}, smalltalk.Class)})}
  659. }),
  660. smalltalk.Class);
  661. smalltalk.addMethod(
  662. "_subclass_instanceVariableNames_classVariableNames_poolDictionaries_category_",
  663. smalltalk.method({
  664. selector: "subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:",
  665. fn: function (aString,aString2,classVars,pools,aString3){
  666. var self=this;
  667. return smalltalk.withContext(function($ctx1) { var $1;
  668. $1=_st(self)._subclass_instanceVariableNames_package_(aString,aString2,aString3);
  669. return $1;
  670. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:",{aString:aString,aString2:aString2,classVars:classVars,pools:pools,aString3:aString3}, smalltalk.Class)})}
  671. }),
  672. smalltalk.Class);
  673. smalltalk.addMethod(
  674. "_subclass_instanceVariableNames_package_",
  675. smalltalk.method({
  676. selector: "subclass:instanceVariableNames:package:",
  677. fn: function (aString,aString2,aString3){
  678. var self=this;
  679. return smalltalk.withContext(function($ctx1) { var $1;
  680. $1=_st(_st((smalltalk.ClassBuilder || ClassBuilder))._new())._superclass_subclass_instanceVariableNames_package_(self,_st(aString)._asString(),aString2,aString3);
  681. return $1;
  682. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:package:",{aString:aString,aString2:aString2,aString3:aString3}, smalltalk.Class)})}
  683. }),
  684. smalltalk.Class);
  685. smalltalk.addClass('Metaclass', smalltalk.Behavior, [], 'Kernel-Classes');
  686. smalltalk.addMethod(
  687. "_asJavascript",
  688. smalltalk.method({
  689. selector: "asJavascript",
  690. fn: function (){
  691. var self=this;
  692. return smalltalk.withContext(function($ctx1) { var $1;
  693. $1=_st(_st("smalltalk.").__comma(_st(_st(self)._instanceClass())._name())).__comma(".klass");
  694. return $1;
  695. }, function($ctx1) {$ctx1.fill(self,"asJavascript",{}, smalltalk.Metaclass)})}
  696. }),
  697. smalltalk.Metaclass);
  698. smalltalk.addMethod(
  699. "_definition",
  700. smalltalk.method({
  701. selector: "definition",
  702. fn: function (){
  703. var self=this;
  704. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  705. $1=_st((smalltalk.String || String))._streamContents_((function(stream){
  706. return smalltalk.withContext(function($ctx2) { $2=stream;
  707. _st($2)._nextPutAll_(_st(self)._asString());
  708. _st($2)._nextPutAll_(" class ");
  709. $3=_st($2)._nextPutAll_("instanceVariableNames: '");
  710. $3;
  711. _st(_st(self)._instanceVariableNames())._do_separatedBy_((function(each){
  712. return smalltalk.withContext(function($ctx3) { return _st(stream)._nextPutAll_(each);
  713. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}),(function(){
  714. return smalltalk.withContext(function($ctx3) { return _st(stream)._nextPutAll_(" ");
  715. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  716. return _st(stream)._nextPutAll_("'");
  717. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
  718. return $1;
  719. }, function($ctx1) {$ctx1.fill(self,"definition",{}, smalltalk.Metaclass)})}
  720. }),
  721. smalltalk.Metaclass);
  722. smalltalk.addMethod(
  723. "_instanceClass",
  724. smalltalk.method({
  725. selector: "instanceClass",
  726. fn: function (){
  727. var self=this;
  728. return smalltalk.withContext(function($ctx1) { return self.instanceClass;
  729. return self}, function($ctx1) {$ctx1.fill(self,"instanceClass",{}, smalltalk.Metaclass)})}
  730. }),
  731. smalltalk.Metaclass);
  732. smalltalk.addMethod(
  733. "_instanceVariableNames_",
  734. smalltalk.method({
  735. selector: "instanceVariableNames:",
  736. fn: function (aCollection){
  737. var self=this;
  738. return smalltalk.withContext(function($ctx1) { _st(_st((smalltalk.ClassBuilder || ClassBuilder))._new())._class_instanceVariableNames_(self,aCollection);
  739. return self}, function($ctx1) {$ctx1.fill(self,"instanceVariableNames:",{aCollection:aCollection}, smalltalk.Metaclass)})}
  740. }),
  741. smalltalk.Metaclass);
  742. smalltalk.addMethod(
  743. "_isMetaclass",
  744. smalltalk.method({
  745. selector: "isMetaclass",
  746. fn: function (){
  747. var self=this;
  748. return smalltalk.withContext(function($ctx1) { return true;
  749. }, function($ctx1) {$ctx1.fill(self,"isMetaclass",{}, smalltalk.Metaclass)})}
  750. }),
  751. smalltalk.Metaclass);
  752. smalltalk.addMethod(
  753. "_printString",
  754. smalltalk.method({
  755. selector: "printString",
  756. fn: function (){
  757. var self=this;
  758. return smalltalk.withContext(function($ctx1) { var $1;
  759. $1=_st(_st(_st(self)._instanceClass())._name()).__comma(" class");
  760. return $1;
  761. }, function($ctx1) {$ctx1.fill(self,"printString",{}, smalltalk.Metaclass)})}
  762. }),
  763. smalltalk.Metaclass);
  764. smalltalk.addMethod(
  765. "_theMetaClass",
  766. smalltalk.method({
  767. selector: "theMetaClass",
  768. fn: function (){
  769. var self=this;
  770. return smalltalk.withContext(function($ctx1) { var $1;
  771. $1=self;
  772. return $1;
  773. }, function($ctx1) {$ctx1.fill(self,"theMetaClass",{}, smalltalk.Metaclass)})}
  774. }),
  775. smalltalk.Metaclass);
  776. smalltalk.addMethod(
  777. "_theNonMetaClass",
  778. smalltalk.method({
  779. selector: "theNonMetaClass",
  780. fn: function (){
  781. var self=this;
  782. return smalltalk.withContext(function($ctx1) { var $1;
  783. $1=_st(self)._instanceClass();
  784. return $1;
  785. }, function($ctx1) {$ctx1.fill(self,"theNonMetaClass",{}, smalltalk.Metaclass)})}
  786. }),
  787. smalltalk.Metaclass);
  788. smalltalk.addClass('ClassBuilder', smalltalk.Object, [], 'Kernel-Classes');
  789. smalltalk.addMethod(
  790. "_addSubclassOf_named_instanceVariableNames_package_",
  791. smalltalk.method({
  792. selector: "addSubclassOf:named:instanceVariableNames:package:",
  793. fn: function (aClass,aString,aCollection,packageName){
  794. var self=this;
  795. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  796. $1=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_(aString);
  797. if(($receiver = $1) == nil || $receiver == undefined){
  798. $1;
  799. } else {
  800. $2=_st(self)._migrateClassNamed_superclass_instanceVariableNames_package_(aString,aClass,aCollection,packageName);
  801. return $2;
  802. };
  803. $3=_st(self)._basicAddSubclassOf_named_instanceVariableNames_package_(aClass,aString,aCollection,packageName);
  804. return $3;
  805. }, function($ctx1) {$ctx1.fill(self,"addSubclassOf:named:instanceVariableNames:package:",{aClass:aClass,aString:aString,aCollection:aCollection,packageName:packageName}, smalltalk.ClassBuilder)})}
  806. }),
  807. smalltalk.ClassBuilder);
  808. smalltalk.addMethod(
  809. "_basicAddSubclassOf_named_instanceVariableNames_package_",
  810. smalltalk.method({
  811. selector: "basicAddSubclassOf:named:instanceVariableNames:package:",
  812. fn: function (aClass,aString,aCollection,packageName){
  813. var self=this;
  814. return smalltalk.withContext(function($ctx1) {
  815. smalltalk.addClass(aString, aClass, aCollection, packageName);
  816. return smalltalk[aString]
  817. ;
  818. return self}, function($ctx1) {$ctx1.fill(self,"basicAddSubclassOf:named:instanceVariableNames:package:",{aClass:aClass,aString:aString,aCollection:aCollection,packageName:packageName}, smalltalk.ClassBuilder)})}
  819. }),
  820. smalltalk.ClassBuilder);
  821. smalltalk.addMethod(
  822. "_basicClass_instanceVariableNames_",
  823. smalltalk.method({
  824. selector: "basicClass:instanceVariableNames:",
  825. fn: function (aClass,aString){
  826. var self=this;
  827. return smalltalk.withContext(function($ctx1) { var $1;
  828. $1=_st(aClass)._isMetaclass();
  829. if(! smalltalk.assert($1)){
  830. _st(self)._error_(_st(_st(aClass)._name()).__comma(" is not a metaclass"));
  831. };
  832. _st(aClass)._basicAt_put_("iVarNames",_st(self)._instanceVariableNamesFor_(aString));
  833. _st(self)._setupClass_(aClass);
  834. return self}, function($ctx1) {$ctx1.fill(self,"basicClass:instanceVariableNames:",{aClass:aClass,aString:aString}, smalltalk.ClassBuilder)})}
  835. }),
  836. smalltalk.ClassBuilder);
  837. smalltalk.addMethod(
  838. "_basicRemoveClass_",
  839. smalltalk.method({
  840. selector: "basicRemoveClass:",
  841. fn: function (aClass){
  842. var self=this;
  843. return smalltalk.withContext(function($ctx1) { smalltalk.removeClass(aClass);
  844. return self}, function($ctx1) {$ctx1.fill(self,"basicRemoveClass:",{aClass:aClass}, smalltalk.ClassBuilder)})}
  845. }),
  846. smalltalk.ClassBuilder);
  847. smalltalk.addMethod(
  848. "_basicRenameClass_to_",
  849. smalltalk.method({
  850. selector: "basicRenameClass:to:",
  851. fn: function (aClass,aString){
  852. var self=this;
  853. return smalltalk.withContext(function($ctx1) {
  854. smalltalk[aString] = aClass;
  855. delete smalltalk[aClass.className];
  856. aClass.className = aString;
  857. ;
  858. return self}, function($ctx1) {$ctx1.fill(self,"basicRenameClass:to:",{aClass:aClass,aString:aString}, smalltalk.ClassBuilder)})}
  859. }),
  860. smalltalk.ClassBuilder);
  861. smalltalk.addMethod(
  862. "_class_instanceVariableNames_",
  863. smalltalk.method({
  864. selector: "class:instanceVariableNames:",
  865. fn: function (aClass,aString){
  866. var self=this;
  867. return smalltalk.withContext(function($ctx1) { var $1,$2;
  868. _st(self)._basicClass_instanceVariableNames_(aClass,aString);
  869. $1=_st((smalltalk.ClassDefinitionChanged || ClassDefinitionChanged))._new();
  870. _st($1)._theClass_(aClass);
  871. $2=_st($1)._yourself();
  872. _st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($2);
  873. return self}, function($ctx1) {$ctx1.fill(self,"class:instanceVariableNames:",{aClass:aClass,aString:aString}, smalltalk.ClassBuilder)})}
  874. }),
  875. smalltalk.ClassBuilder);
  876. smalltalk.addMethod(
  877. "_copyClass_named_",
  878. smalltalk.method({
  879. selector: "copyClass:named:",
  880. fn: function (aClass,aString){
  881. var self=this;
  882. var newClass;
  883. return smalltalk.withContext(function($ctx1) { var $1;
  884. newClass=_st(self)._addSubclassOf_named_instanceVariableNames_package_(_st(aClass)._superclass(),aString,_st(aClass)._instanceVariableNames(),_st(_st(aClass)._package())._name());
  885. _st(self)._setupClass_(newClass);
  886. _st(_st(_st(aClass)._methodDictionary())._values())._do_((function(each){
  887. return smalltalk.withContext(function($ctx2) { return _st(_st((smalltalk.Compiler || Compiler))._new())._install_forClass_category_(_st(each)._source(),newClass,_st(each)._category());
  888. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  889. _st(_st(_st(_st(aClass)._class())._methodDictionary())._values())._do_((function(each){
  890. return smalltalk.withContext(function($ctx2) { return _st(_st((smalltalk.Compiler || Compiler))._new())._install_forClass_category_(_st(each)._source(),_st(newClass)._class(),_st(each)._category());
  891. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  892. _st(self)._setupClass_(newClass);
  893. $1=newClass;
  894. return $1;
  895. }, function($ctx1) {$ctx1.fill(self,"copyClass:named:",{aClass:aClass,aString:aString,newClass:newClass}, smalltalk.ClassBuilder)})}
  896. }),
  897. smalltalk.ClassBuilder);
  898. smalltalk.addMethod(
  899. "_instanceVariableNamesFor_",
  900. smalltalk.method({
  901. selector: "instanceVariableNamesFor:",
  902. fn: function (aString){
  903. var self=this;
  904. return smalltalk.withContext(function($ctx1) { var $1;
  905. $1=_st(_st(aString)._tokenize_(" "))._reject_((function(each){
  906. return smalltalk.withContext(function($ctx2) { return _st(each)._isEmpty();
  907. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  908. return $1;
  909. }, function($ctx1) {$ctx1.fill(self,"instanceVariableNamesFor:",{aString:aString}, smalltalk.ClassBuilder)})}
  910. }),
  911. smalltalk.ClassBuilder);
  912. smalltalk.addMethod(
  913. "_migrateClassNamed_superclass_instanceVariableNames_package_",
  914. smalltalk.method({
  915. selector: "migrateClassNamed:superclass:instanceVariableNames:package:",
  916. fn: function (aString,aClass,aCollection,packageName){
  917. var self=this;
  918. var oldClass,newClass;
  919. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  920. oldClass=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_(aString);
  921. $1=self;
  922. _st($1)._basicRenameClass_to_(oldClass,_st("Old").__comma(aString));
  923. $2=_st($1)._basicRemoveClass_(oldClass);
  924. newClass=_st(self)._addSubclassOf_named_instanceVariableNames_package_(aClass,aString,aCollection,packageName);
  925. _st(self)._setupClass_(newClass);
  926. _st(newClass)._comment_(_st(oldClass)._comment());
  927. _st(_st(_st(oldClass)._methodDictionary())._values())._do_((function(each){
  928. return smalltalk.withContext(function($ctx2) { return _st(_st((smalltalk.Compiler || Compiler))._new())._install_forClass_category_(_st(each)._source(),newClass,_st(each)._category());
  929. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  930. _st(_st(_st(_st(oldClass)._class())._methodDictionary())._values())._do_((function(each){
  931. return smalltalk.withContext(function($ctx2) { return _st(_st((smalltalk.Compiler || Compiler))._new())._install_forClass_category_(_st(each)._source(),_st(newClass)._class(),_st(each)._category());
  932. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  933. _st(self)._setupClass_(newClass);
  934. $3=newClass;
  935. return $3;
  936. }, function($ctx1) {$ctx1.fill(self,"migrateClassNamed:superclass:instanceVariableNames:package:",{aString:aString,aClass:aClass,aCollection:aCollection,packageName:packageName,oldClass:oldClass,newClass:newClass}, smalltalk.ClassBuilder)})}
  937. }),
  938. smalltalk.ClassBuilder);
  939. smalltalk.addMethod(
  940. "_renameClass_to_",
  941. smalltalk.method({
  942. selector: "renameClass:to:",
  943. fn: function (aClass,aString){
  944. var self=this;
  945. return smalltalk.withContext(function($ctx1) { var $1,$2;
  946. _st(self)._basicRenameClass_to_(aClass,aString);
  947. $1=_st((smalltalk.ClassRenamed || ClassRenamed))._new();
  948. _st($1)._theClass_(aClass);
  949. $2=_st($1)._yourself();
  950. _st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($2);
  951. return self}, function($ctx1) {$ctx1.fill(self,"renameClass:to:",{aClass:aClass,aString:aString}, smalltalk.ClassBuilder)})}
  952. }),
  953. smalltalk.ClassBuilder);
  954. smalltalk.addMethod(
  955. "_setupClass_",
  956. smalltalk.method({
  957. selector: "setupClass:",
  958. fn: function (aClass){
  959. var self=this;
  960. return smalltalk.withContext(function($ctx1) { smalltalk.init(aClass);;
  961. return self}, function($ctx1) {$ctx1.fill(self,"setupClass:",{aClass:aClass}, smalltalk.ClassBuilder)})}
  962. }),
  963. smalltalk.ClassBuilder);
  964. smalltalk.addMethod(
  965. "_superclass_subclass_",
  966. smalltalk.method({
  967. selector: "superclass:subclass:",
  968. fn: function (aClass,aString){
  969. var self=this;
  970. return smalltalk.withContext(function($ctx1) { var $1;
  971. $1=_st(self)._superclass_subclass_instanceVariableNames_package_(aClass,aString,"",nil);
  972. return $1;
  973. }, function($ctx1) {$ctx1.fill(self,"superclass:subclass:",{aClass:aClass,aString:aString}, smalltalk.ClassBuilder)})}
  974. }),
  975. smalltalk.ClassBuilder);
  976. smalltalk.addMethod(
  977. "_superclass_subclass_instanceVariableNames_package_",
  978. smalltalk.method({
  979. selector: "superclass:subclass:instanceVariableNames:package:",
  980. fn: function (aClass,aString,aString2,aString3){
  981. var self=this;
  982. var newClass;
  983. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$6,$5,$7,$8,$9;
  984. $1=self;
  985. $2=aClass;
  986. $3=aString;
  987. $4=_st(self)._instanceVariableNamesFor_(aString2);
  988. $6=aString3;
  989. if(($receiver = $6) == nil || $receiver == undefined){
  990. $5="unclassified";
  991. } else {
  992. $5=$6;
  993. };
  994. newClass=_st($1)._addSubclassOf_named_instanceVariableNames_package_($2,$3,$4,$5);
  995. _st(self)._setupClass_(newClass);
  996. $7=_st((smalltalk.ClassAdded || ClassAdded))._new();
  997. _st($7)._theClass_(newClass);
  998. $8=_st($7)._yourself();
  999. _st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($8);
  1000. $9=newClass;
  1001. return $9;
  1002. }, function($ctx1) {$ctx1.fill(self,"superclass:subclass:instanceVariableNames:package:",{aClass:aClass,aString:aString,aString2:aString2,aString3:aString3,newClass:newClass}, smalltalk.ClassBuilder)})}
  1003. }),
  1004. smalltalk.ClassBuilder);
  1005. smalltalk.addClass('ClassCategoryReader', smalltalk.Object, ['class', 'category'], 'Kernel-Classes');
  1006. smalltalk.addMethod(
  1007. "_class_category_",
  1008. smalltalk.method({
  1009. selector: "class:category:",
  1010. fn: function (aClass,aString){
  1011. var self=this;
  1012. return smalltalk.withContext(function($ctx1) { self["@class"]=aClass;
  1013. self["@category"]=aString;
  1014. return self}, function($ctx1) {$ctx1.fill(self,"class:category:",{aClass:aClass,aString:aString}, smalltalk.ClassCategoryReader)})}
  1015. }),
  1016. smalltalk.ClassCategoryReader);
  1017. smalltalk.addMethod(
  1018. "_compileMethod_",
  1019. smalltalk.method({
  1020. selector: "compileMethod:",
  1021. fn: function (aString){
  1022. var self=this;
  1023. return smalltalk.withContext(function($ctx1) { _st(_st((smalltalk.Compiler || Compiler))._new())._install_forClass_category_(aString,self["@class"],self["@category"]);
  1024. return self}, function($ctx1) {$ctx1.fill(self,"compileMethod:",{aString:aString}, smalltalk.ClassCategoryReader)})}
  1025. }),
  1026. smalltalk.ClassCategoryReader);
  1027. smalltalk.addMethod(
  1028. "_initialize",
  1029. smalltalk.method({
  1030. selector: "initialize",
  1031. fn: function (){
  1032. var self=this;
  1033. return smalltalk.withContext(function($ctx1) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  1034. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.ClassCategoryReader)})}
  1035. }),
  1036. smalltalk.ClassCategoryReader);
  1037. smalltalk.addMethod(
  1038. "_scanFrom_",
  1039. smalltalk.method({
  1040. selector: "scanFrom:",
  1041. fn: function (aChunkParser){
  1042. var self=this;
  1043. var chunk;
  1044. return smalltalk.withContext(function($ctx1) { _st((function(){
  1045. return smalltalk.withContext(function($ctx2) { chunk=_st(aChunkParser)._nextChunk();
  1046. chunk;
  1047. return _st(chunk)._isEmpty();
  1048. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  1049. return smalltalk.withContext(function($ctx2) { return _st(self)._compileMethod_(chunk);
  1050. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1051. _st(_st((smalltalk.Compiler || Compiler))._new())._setupClass_(self["@class"]);
  1052. return self}, function($ctx1) {$ctx1.fill(self,"scanFrom:",{aChunkParser:aChunkParser,chunk:chunk}, smalltalk.ClassCategoryReader)})}
  1053. }),
  1054. smalltalk.ClassCategoryReader);
  1055. smalltalk.addClass('ClassCommentReader', smalltalk.Object, ['class'], 'Kernel-Classes');
  1056. smalltalk.addMethod(
  1057. "_class_",
  1058. smalltalk.method({
  1059. selector: "class:",
  1060. fn: function (aClass){
  1061. var self=this;
  1062. return smalltalk.withContext(function($ctx1) { self["@class"]=aClass;
  1063. return self}, function($ctx1) {$ctx1.fill(self,"class:",{aClass:aClass}, smalltalk.ClassCommentReader)})}
  1064. }),
  1065. smalltalk.ClassCommentReader);
  1066. smalltalk.addMethod(
  1067. "_initialize",
  1068. smalltalk.method({
  1069. selector: "initialize",
  1070. fn: function (){
  1071. var self=this;
  1072. return smalltalk.withContext(function($ctx1) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  1073. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.ClassCommentReader)})}
  1074. }),
  1075. smalltalk.ClassCommentReader);
  1076. smalltalk.addMethod(
  1077. "_scanFrom_",
  1078. smalltalk.method({
  1079. selector: "scanFrom:",
  1080. fn: function (aChunkParser){
  1081. var self=this;
  1082. var chunk;
  1083. return smalltalk.withContext(function($ctx1) { var $1;
  1084. chunk=_st(aChunkParser)._nextChunk();
  1085. $1=_st(chunk)._isEmpty();
  1086. if(! smalltalk.assert($1)){
  1087. _st(self)._setComment_(chunk);
  1088. };
  1089. return self}, function($ctx1) {$ctx1.fill(self,"scanFrom:",{aChunkParser:aChunkParser,chunk:chunk}, smalltalk.ClassCommentReader)})}
  1090. }),
  1091. smalltalk.ClassCommentReader);
  1092. smalltalk.addMethod(
  1093. "_setComment_",
  1094. smalltalk.method({
  1095. selector: "setComment:",
  1096. fn: function (aString){
  1097. var self=this;
  1098. return smalltalk.withContext(function($ctx1) { _st(self["@class"])._comment_(aString);
  1099. return self}, function($ctx1) {$ctx1.fill(self,"setComment:",{aString:aString}, smalltalk.ClassCommentReader)})}
  1100. }),
  1101. smalltalk.ClassCommentReader);
  1102. smalltalk.addClass('ClassSorterNode', smalltalk.Object, ['theClass', 'level', 'nodes'], 'Kernel-Classes');
  1103. smalltalk.addMethod(
  1104. "_getNodesFrom_",
  1105. smalltalk.method({
  1106. selector: "getNodesFrom:",
  1107. fn: function (aCollection){
  1108. var self=this;
  1109. var children,others;
  1110. return smalltalk.withContext(function($ctx1) { var $1,$3,$2;
  1111. children=[];
  1112. others=[];
  1113. $1=aCollection;
  1114. $2=(function(each){
  1115. return smalltalk.withContext(function($ctx2) { $3=_st(_st(each)._superclass()).__eq(_st(self)._theClass());
  1116. if(smalltalk.assert($3)){
  1117. return _st(children)._add_(each);
  1118. } else {
  1119. return _st(others)._add_(each);
  1120. };
  1121. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})});
  1122. _st($1)._do_($2);
  1123. self["@nodes"]=_st(children)._collect_((function(each){
  1124. return smalltalk.withContext(function($ctx2) { return _st((smalltalk.ClassSorterNode || ClassSorterNode))._on_classes_level_(each,others,_st(_st(self)._level()).__plus((1)));
  1125. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1126. return self}, function($ctx1) {$ctx1.fill(self,"getNodesFrom:",{aCollection:aCollection,children:children,others:others}, smalltalk.ClassSorterNode)})}
  1127. }),
  1128. smalltalk.ClassSorterNode);
  1129. smalltalk.addMethod(
  1130. "_level",
  1131. smalltalk.method({
  1132. selector: "level",
  1133. fn: function (){
  1134. var self=this;
  1135. return smalltalk.withContext(function($ctx1) { var $1;
  1136. $1=self["@level"];
  1137. return $1;
  1138. }, function($ctx1) {$ctx1.fill(self,"level",{}, smalltalk.ClassSorterNode)})}
  1139. }),
  1140. smalltalk.ClassSorterNode);
  1141. smalltalk.addMethod(
  1142. "_level_",
  1143. smalltalk.method({
  1144. selector: "level:",
  1145. fn: function (anInteger){
  1146. var self=this;
  1147. return smalltalk.withContext(function($ctx1) { self["@level"]=anInteger;
  1148. return self}, function($ctx1) {$ctx1.fill(self,"level:",{anInteger:anInteger}, smalltalk.ClassSorterNode)})}
  1149. }),
  1150. smalltalk.ClassSorterNode);
  1151. smalltalk.addMethod(
  1152. "_nodes",
  1153. smalltalk.method({
  1154. selector: "nodes",
  1155. fn: function (){
  1156. var self=this;
  1157. return smalltalk.withContext(function($ctx1) { var $1;
  1158. $1=self["@nodes"];
  1159. return $1;
  1160. }, function($ctx1) {$ctx1.fill(self,"nodes",{}, smalltalk.ClassSorterNode)})}
  1161. }),
  1162. smalltalk.ClassSorterNode);
  1163. smalltalk.addMethod(
  1164. "_theClass",
  1165. smalltalk.method({
  1166. selector: "theClass",
  1167. fn: function (){
  1168. var self=this;
  1169. return smalltalk.withContext(function($ctx1) { var $1;
  1170. $1=self["@theClass"];
  1171. return $1;
  1172. }, function($ctx1) {$ctx1.fill(self,"theClass",{}, smalltalk.ClassSorterNode)})}
  1173. }),
  1174. smalltalk.ClassSorterNode);
  1175. smalltalk.addMethod(
  1176. "_theClass_",
  1177. smalltalk.method({
  1178. selector: "theClass:",
  1179. fn: function (aClass){
  1180. var self=this;
  1181. return smalltalk.withContext(function($ctx1) { self["@theClass"]=aClass;
  1182. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass}, smalltalk.ClassSorterNode)})}
  1183. }),
  1184. smalltalk.ClassSorterNode);
  1185. smalltalk.addMethod(
  1186. "_traverseClassesWith_",
  1187. smalltalk.method({
  1188. selector: "traverseClassesWith:",
  1189. fn: function (aCollection){
  1190. var self=this;
  1191. return smalltalk.withContext(function($ctx1) { _st(aCollection)._add_(_st(self)._theClass());
  1192. _st(_st(_st(self)._nodes())._sorted_((function(a,b){
  1193. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(a)._theClass())._name()).__lt_eq(_st(_st(b)._theClass())._name());
  1194. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(aNode){
  1195. return smalltalk.withContext(function($ctx2) { return _st(aNode)._traverseClassesWith_(aCollection);
  1196. }, function($ctx2) {$ctx2.fillBlock({aNode:aNode},$ctx1)})}));
  1197. return self}, function($ctx1) {$ctx1.fill(self,"traverseClassesWith:",{aCollection:aCollection}, smalltalk.ClassSorterNode)})}
  1198. }),
  1199. smalltalk.ClassSorterNode);
  1200. smalltalk.addMethod(
  1201. "_on_classes_level_",
  1202. smalltalk.method({
  1203. selector: "on:classes:level:",
  1204. fn: function (aClass,aCollection,anInteger){
  1205. var self=this;
  1206. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  1207. $2=_st(self)._new();
  1208. _st($2)._theClass_(aClass);
  1209. _st($2)._level_(anInteger);
  1210. _st($2)._getNodesFrom_(aCollection);
  1211. $3=_st($2)._yourself();
  1212. $1=$3;
  1213. return $1;
  1214. }, function($ctx1) {$ctx1.fill(self,"on:classes:level:",{aClass:aClass,aCollection:aCollection,anInteger:anInteger}, smalltalk.ClassSorterNode.klass)})}
  1215. }),
  1216. smalltalk.ClassSorterNode.klass);