2
0

Kernel-Classes.deploy.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778
  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. smalltalk.addMethod(aMethod.selector._asSelector(), aMethod, self);
  10. return self;}
  11. }),
  12. smalltalk.Behavior);
  13. smalltalk.addMethod(
  14. "_allInstanceVariableNames",
  15. smalltalk.method({
  16. selector: "allInstanceVariableNames",
  17. fn: function (){
  18. var self=this;
  19. var result=nil;
  20. (result=smalltalk.send(smalltalk.send(self, "_instanceVariableNames", []), "_copy", []));
  21. (($receiver = smalltalk.send(self, "_superclass", [])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(result, "_addAll_", [smalltalk.send(smalltalk.send(self, "_superclass", []), "_allInstanceVariableNames", [])]);})() : nil;
  22. return result;
  23. return self;}
  24. }),
  25. smalltalk.Behavior);
  26. smalltalk.addMethod(
  27. "_allSubclasses",
  28. smalltalk.method({
  29. selector: "allSubclasses",
  30. fn: function (){
  31. var self=this;
  32. var result=nil;
  33. (result=smalltalk.send(self, "_subclasses", []));
  34. smalltalk.send(smalltalk.send(self, "_subclasses", []), "_do_", [(function(each){return smalltalk.send(result, "_addAll_", [smalltalk.send(each, "_allSubclasses", [])]);})]);
  35. return result;
  36. return self;}
  37. }),
  38. smalltalk.Behavior);
  39. smalltalk.addMethod(
  40. "_basicNew",
  41. smalltalk.method({
  42. selector: "basicNew",
  43. fn: function (){
  44. var self=this;
  45. return new self.fn();
  46. return self;}
  47. }),
  48. smalltalk.Behavior);
  49. smalltalk.addMethod(
  50. "_canUnderstand_",
  51. smalltalk.method({
  52. selector: "canUnderstand:",
  53. fn: function (aSelector){
  54. var self=this;
  55. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_methodDictionary", []), "_keys", []), "_includes_", [smalltalk.send(aSelector, "_asString", [])]), "_or_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_superclass", []), "_notNil", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(self, "_superclass", []), "_canUnderstand_", [aSelector]);})]);})]);
  56. return self;}
  57. }),
  58. smalltalk.Behavior);
  59. smalltalk.addMethod(
  60. "_comment",
  61. smalltalk.method({
  62. selector: "comment",
  63. fn: function (){
  64. var self=this;
  65. return (($receiver = smalltalk.send(self, "_basicAt_", ["comment"])) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
  66. return self;}
  67. }),
  68. smalltalk.Behavior);
  69. smalltalk.addMethod(
  70. "_comment_",
  71. smalltalk.method({
  72. selector: "comment:",
  73. fn: function (aString){
  74. var self=this;
  75. smalltalk.send(self, "_basicAt_put_", ["comment", aString]);
  76. return self;}
  77. }),
  78. smalltalk.Behavior);
  79. smalltalk.addMethod(
  80. "_commentStamp",
  81. smalltalk.method({
  82. selector: "commentStamp",
  83. fn: function (){
  84. var self=this;
  85. return (function($rec){smalltalk.send($rec, "_class_", [self]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.ClassCommentReader || ClassCommentReader), "_new", []));
  86. return self;}
  87. }),
  88. smalltalk.Behavior);
  89. smalltalk.addMethod(
  90. "_commentStamp_prior_",
  91. smalltalk.method({
  92. selector: "commentStamp:prior:",
  93. fn: function (aStamp, prior){
  94. var self=this;
  95. return smalltalk.send(self, "_commentStamp", []);
  96. return self;}
  97. }),
  98. smalltalk.Behavior);
  99. smalltalk.addMethod(
  100. "_compile_",
  101. smalltalk.method({
  102. selector: "compile:",
  103. fn: function (aString){
  104. var self=this;
  105. smalltalk.send(self, "_compile_category_", [aString, ""]);
  106. return self;}
  107. }),
  108. smalltalk.Behavior);
  109. smalltalk.addMethod(
  110. "_compile_category_",
  111. smalltalk.method({
  112. selector: "compile:category:",
  113. fn: function (aString, anotherString){
  114. var self=this;
  115. (function($rec){smalltalk.send($rec, "_install_forClass_category_", [aString, self, anotherString]);return smalltalk.send($rec, "_setupClass_", [self]);})(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []));
  116. return self;}
  117. }),
  118. smalltalk.Behavior);
  119. smalltalk.addMethod(
  120. "_inheritsFrom_",
  121. smalltalk.method({
  122. selector: "inheritsFrom:",
  123. fn: function (aClass){
  124. var self=this;
  125. return smalltalk.send(smalltalk.send(aClass, "_allSubclasses", []), "_includes_", [self]);
  126. return self;}
  127. }),
  128. smalltalk.Behavior);
  129. smalltalk.addMethod(
  130. "_instanceVariableNames",
  131. smalltalk.method({
  132. selector: "instanceVariableNames",
  133. fn: function (){
  134. var self=this;
  135. return self.iVarNames;
  136. return self;}
  137. }),
  138. smalltalk.Behavior);
  139. smalltalk.addMethod(
  140. "_methodAt_",
  141. smalltalk.method({
  142. selector: "methodAt:",
  143. fn: function (aString){
  144. var self=this;
  145. return smalltalk.methods(self)[aString];
  146. return self;}
  147. }),
  148. smalltalk.Behavior);
  149. smalltalk.addMethod(
  150. "_methodDictionary",
  151. smalltalk.method({
  152. selector: "methodDictionary",
  153. fn: function (){
  154. var self=this;
  155. var dict = smalltalk.HashedCollection._new();
  156. var methods = self.fn.prototype.methods;
  157. for(var i in methods) {
  158. if(methods[i].selector) {
  159. dict._at_put_(methods[i].selector, methods[i]);
  160. }
  161. };
  162. return dict;
  163. return self;}
  164. }),
  165. smalltalk.Behavior);
  166. smalltalk.addMethod(
  167. "_methodsFor_",
  168. smalltalk.method({
  169. selector: "methodsFor:",
  170. fn: function (aString){
  171. var self=this;
  172. return (function($rec){smalltalk.send($rec, "_class_category_", [self, aString]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.ClassCategoryReader || ClassCategoryReader), "_new", []));
  173. return self;}
  174. }),
  175. smalltalk.Behavior);
  176. smalltalk.addMethod(
  177. "_methodsFor_stamp_",
  178. smalltalk.method({
  179. selector: "methodsFor:stamp:",
  180. fn: function (aString, aStamp){
  181. var self=this;
  182. return smalltalk.send(self, "_methodsFor_", [aString]);
  183. return self;}
  184. }),
  185. smalltalk.Behavior);
  186. smalltalk.addMethod(
  187. "_name",
  188. smalltalk.method({
  189. selector: "name",
  190. fn: function (){
  191. var self=this;
  192. return self.className || nil;
  193. return self;}
  194. }),
  195. smalltalk.Behavior);
  196. smalltalk.addMethod(
  197. "_new",
  198. smalltalk.method({
  199. selector: "new",
  200. fn: function (){
  201. var self=this;
  202. return smalltalk.send(smalltalk.send(self, "_basicNew", []), "_initialize", []);
  203. return self;}
  204. }),
  205. smalltalk.Behavior);
  206. smalltalk.addMethod(
  207. "_protocols",
  208. smalltalk.method({
  209. selector: "protocols",
  210. fn: function (){
  211. var self=this;
  212. var protocols=nil;
  213. (protocols=smalltalk.send((smalltalk.Array || Array), "_new", []));
  214. smalltalk.send(smalltalk.send(self, "_methodDictionary", []), "_do_", [(function(each){return ((($receiver = smalltalk.send(protocols, "_includes_", [smalltalk.send(each, "_category", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(protocols, "_add_", [smalltalk.send(each, "_category", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(protocols, "_add_", [smalltalk.send(each, "_category", [])]);})]));})]);
  215. return smalltalk.send(protocols, "_sort", []);
  216. return self;}
  217. }),
  218. smalltalk.Behavior);
  219. smalltalk.addMethod(
  220. "_protocolsDo_",
  221. smalltalk.method({
  222. selector: "protocolsDo:",
  223. fn: function (aBlock){
  224. var self=this;
  225. var methodsByCategory=nil;
  226. (methodsByCategory=smalltalk.send((smalltalk.HashedCollection || HashedCollection), "_new", []));
  227. smalltalk.send(smalltalk.send(smalltalk.send(self, "_methodDictionary", []), "_values", []), "_do_", [(function(m){return smalltalk.send(smalltalk.send(methodsByCategory, "_at_ifAbsentPut_", [smalltalk.send(m, "_category", []), (function(){return smalltalk.send((smalltalk.Array || Array), "_new", []);})]), "_add_", [m]);})]);
  228. smalltalk.send(smalltalk.send(self, "_protocols", []), "_do_", [(function(category){return smalltalk.send(aBlock, "_value_value_", [category, smalltalk.send(methodsByCategory, "_at_", [category])]);})]);
  229. return self;}
  230. }),
  231. smalltalk.Behavior);
  232. smalltalk.addMethod(
  233. "_prototype",
  234. smalltalk.method({
  235. selector: "prototype",
  236. fn: function (){
  237. var self=this;
  238. return self.fn.prototype;
  239. return self;}
  240. }),
  241. smalltalk.Behavior);
  242. smalltalk.addMethod(
  243. "_removeCompiledMethod_",
  244. smalltalk.method({
  245. selector: "removeCompiledMethod:",
  246. fn: function (aMethod){
  247. var self=this;
  248. delete self.fn.prototype[aMethod.selector._asSelector()];
  249. delete self.fn.prototype.methods[aMethod.selector];
  250. smalltalk.init(self);;
  251. return self;}
  252. }),
  253. smalltalk.Behavior);
  254. smalltalk.addMethod(
  255. "_subclasses",
  256. smalltalk.method({
  257. selector: "subclasses",
  258. fn: function (){
  259. var self=this;
  260. return smalltalk.subclasses(self);
  261. return self;}
  262. }),
  263. smalltalk.Behavior);
  264. smalltalk.addMethod(
  265. "_superclass",
  266. smalltalk.method({
  267. selector: "superclass",
  268. fn: function (){
  269. var self=this;
  270. return self.superclass || nil;
  271. return self;}
  272. }),
  273. smalltalk.Behavior);
  274. smalltalk.addMethod(
  275. "_withAllSubclasses",
  276. smalltalk.method({
  277. selector: "withAllSubclasses",
  278. fn: function (){
  279. var self=this;
  280. return (function($rec){smalltalk.send($rec, "_addAll_", [smalltalk.send(self, "_allSubclasses", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Array || Array), "_with_", [self]));
  281. return self;}
  282. }),
  283. smalltalk.Behavior);
  284. smalltalk.addClass('Class', smalltalk.Behavior, [], 'Kernel-Classes');
  285. smalltalk.addMethod(
  286. "_category",
  287. smalltalk.method({
  288. selector: "category",
  289. fn: function (){
  290. var self=this;
  291. return (($receiver = smalltalk.send(self, "_package", [])) == nil || $receiver == undefined) ? (function(){return "Unclassified";})() : (function(){return smalltalk.send(smalltalk.send(self, "_package", []), "_name", []);})();
  292. return self;}
  293. }),
  294. smalltalk.Class);
  295. smalltalk.addMethod(
  296. "_isClass",
  297. smalltalk.method({
  298. selector: "isClass",
  299. fn: function (){
  300. var self=this;
  301. return true;
  302. return self;}
  303. }),
  304. smalltalk.Class);
  305. smalltalk.addMethod(
  306. "_package",
  307. smalltalk.method({
  308. selector: "package",
  309. fn: function (){
  310. var self=this;
  311. return self.pkg;
  312. return self;}
  313. }),
  314. smalltalk.Class);
  315. smalltalk.addMethod(
  316. "_package_",
  317. smalltalk.method({
  318. selector: "package:",
  319. fn: function (aPackage){
  320. var self=this;
  321. self.pkg = aPackage;
  322. return self;}
  323. }),
  324. smalltalk.Class);
  325. smalltalk.addMethod(
  326. "_printString",
  327. smalltalk.method({
  328. selector: "printString",
  329. fn: function (){
  330. var self=this;
  331. return smalltalk.send(self, "_name", []);
  332. return self;}
  333. }),
  334. smalltalk.Class);
  335. smalltalk.addMethod(
  336. "_rename_",
  337. smalltalk.method({
  338. selector: "rename:",
  339. fn: function (aString){
  340. var self=this;
  341. smalltalk[aString] = self;
  342. delete smalltalk[self.className];
  343. self.className = aString;
  344. ;
  345. return self;}
  346. }),
  347. smalltalk.Class);
  348. smalltalk.addMethod(
  349. "_subclass_instanceVariableNames_",
  350. smalltalk.method({
  351. selector: "subclass:instanceVariableNames:",
  352. fn: function (aString, anotherString){
  353. var self=this;
  354. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, anotherString, nil]);
  355. return self;}
  356. }),
  357. smalltalk.Class);
  358. smalltalk.addMethod(
  359. "_subclass_instanceVariableNames_category_",
  360. smalltalk.method({
  361. selector: "subclass:instanceVariableNames:category:",
  362. fn: function (aString, aString2, aString3){
  363. var self=this;
  364. smalltalk.send(self, "_deprecatedAPI", []);
  365. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
  366. return self;}
  367. }),
  368. smalltalk.Class);
  369. smalltalk.addMethod(
  370. "_subclass_instanceVariableNames_classVariableNames_poolDictionaries_category_",
  371. smalltalk.method({
  372. selector: "subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:",
  373. fn: function (aString, aString2, classVars, pools, aString3){
  374. var self=this;
  375. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
  376. return self;}
  377. }),
  378. smalltalk.Class);
  379. smalltalk.addMethod(
  380. "_subclass_instanceVariableNames_package_",
  381. smalltalk.method({
  382. selector: "subclass:instanceVariableNames:package:",
  383. fn: function (aString, aString2, aString3){
  384. var self=this;
  385. return smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_superclass_subclass_instanceVariableNames_package_", [self, smalltalk.send(aString, "_asString", []), aString2, aString3]);
  386. return self;}
  387. }),
  388. smalltalk.Class);
  389. smalltalk.addClass('Metaclass', smalltalk.Behavior, [], 'Kernel-Classes');
  390. smalltalk.addMethod(
  391. "_instanceClass",
  392. smalltalk.method({
  393. selector: "instanceClass",
  394. fn: function (){
  395. var self=this;
  396. return self.instanceClass;
  397. return self;}
  398. }),
  399. smalltalk.Metaclass);
  400. smalltalk.addMethod(
  401. "_instanceVariableNames_",
  402. smalltalk.method({
  403. selector: "instanceVariableNames:",
  404. fn: function (aCollection){
  405. var self=this;
  406. smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_class_instanceVariableNames_", [self, aCollection]);
  407. return self;}
  408. }),
  409. smalltalk.Metaclass);
  410. smalltalk.addMethod(
  411. "_isMetaclass",
  412. smalltalk.method({
  413. selector: "isMetaclass",
  414. fn: function (){
  415. var self=this;
  416. return true;
  417. return self;}
  418. }),
  419. smalltalk.Metaclass);
  420. smalltalk.addMethod(
  421. "_printString",
  422. smalltalk.method({
  423. selector: "printString",
  424. fn: function (){
  425. var self=this;
  426. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_instanceClass", []), "_name", []), "__comma", [" class"]);
  427. return self;}
  428. }),
  429. smalltalk.Metaclass);
  430. smalltalk.addClass('ClassBuilder', smalltalk.Object, [], 'Kernel-Classes');
  431. smalltalk.addMethod(
  432. "_addSubclassOf_named_instanceVariableNames_",
  433. smalltalk.method({
  434. selector: "addSubclassOf:named:instanceVariableNames:",
  435. fn: function (aClass, aString, aCollection){
  436. var self=this;
  437. smalltalk.addClass(aString, aClass, aCollection);
  438. return smalltalk[aString];
  439. return self;}
  440. }),
  441. smalltalk.ClassBuilder);
  442. smalltalk.addMethod(
  443. "_addSubclassOf_named_instanceVariableNames_package_",
  444. smalltalk.method({
  445. selector: "addSubclassOf:named:instanceVariableNames:package:",
  446. fn: function (aClass, aString, aCollection, packageName){
  447. var self=this;
  448. smalltalk.addClass(aString, aClass, aCollection, packageName);
  449. return smalltalk[aString];
  450. return self;}
  451. }),
  452. smalltalk.ClassBuilder);
  453. smalltalk.addMethod(
  454. "_class_instanceVariableNames_",
  455. smalltalk.method({
  456. selector: "class:instanceVariableNames:",
  457. fn: function (aClass, aString){
  458. var self=this;
  459. ((($receiver = smalltalk.send(aClass, "_isMetaclass", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_name", []), "__comma", [" is not a metaclass"])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_name", []), "__comma", [" is not a metaclass"])]);})]));
  460. smalltalk.send(aClass, "_basicAt_put_", ["iVarNames", smalltalk.send(self, "_instanceVariableNamesFor_", [aString])]);
  461. smalltalk.send(self, "_setupClass_", [aClass]);
  462. return self;}
  463. }),
  464. smalltalk.ClassBuilder);
  465. smalltalk.addMethod(
  466. "_copyClass_named_",
  467. smalltalk.method({
  468. selector: "copyClass:named:",
  469. fn: function (aClass, aString){
  470. var self=this;
  471. var newClass=nil;
  472. (newClass=smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_package_", [smalltalk.send(aClass, "_superclass", []), aString, smalltalk.send(aClass, "_instanceVariableNames", []), smalltalk.send(smalltalk.send(aClass, "_package", []), "_name", [])]));
  473. smalltalk.send(self, "_setupClass_", [newClass]);
  474. smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_values", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_install_forClass_category_", [smalltalk.send(each, "_source", []), newClass, smalltalk.send(each, "_category", [])]);})]);
  475. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_methodDictionary", []), "_values", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_install_forClass_category_", [smalltalk.send(each, "_source", []), smalltalk.send(newClass, "_class", []), smalltalk.send(each, "_category", [])]);})]);
  476. smalltalk.send(self, "_setupClass_", [newClass]);
  477. return newClass;
  478. return self;}
  479. }),
  480. smalltalk.ClassBuilder);
  481. smalltalk.addMethod(
  482. "_instanceVariableNamesFor_",
  483. smalltalk.method({
  484. selector: "instanceVariableNamesFor:",
  485. fn: function (aString){
  486. var self=this;
  487. return smalltalk.send(smalltalk.send(aString, "_tokenize_", [" "]), "_reject_", [(function(each){return smalltalk.send(each, "_isEmpty", []);})]);
  488. return self;}
  489. }),
  490. smalltalk.ClassBuilder);
  491. smalltalk.addMethod(
  492. "_setupClass_",
  493. smalltalk.method({
  494. selector: "setupClass:",
  495. fn: function (aClass){
  496. var self=this;
  497. smalltalk.init(aClass);;
  498. return self;}
  499. }),
  500. smalltalk.ClassBuilder);
  501. smalltalk.addMethod(
  502. "_superclass_subclass_",
  503. smalltalk.method({
  504. selector: "superclass:subclass:",
  505. fn: function (aClass, aString){
  506. var self=this;
  507. return smalltalk.send(self, "_superclass_subclass_instanceVariableNames_package_", [aClass, aString, "", nil]);
  508. return self;}
  509. }),
  510. smalltalk.ClassBuilder);
  511. smalltalk.addMethod(
  512. "_superclass_subclass_instanceVariableNames_package_",
  513. smalltalk.method({
  514. selector: "superclass:subclass:instanceVariableNames:package:",
  515. fn: function (aClass, aString, aString2, aString3){
  516. var self=this;
  517. var newClass=nil;
  518. (newClass=smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_package_", [aClass, aString, smalltalk.send(self, "_instanceVariableNamesFor_", [aString2]), (($receiver = aString3) == nil || $receiver == undefined) ? (function(){return "unclassified";})() : $receiver]));
  519. smalltalk.send(self, "_setupClass_", [newClass]);
  520. return newClass;
  521. return self;}
  522. }),
  523. smalltalk.ClassBuilder);
  524. smalltalk.addClass('ClassCategoryReader', smalltalk.Object, ['class', 'category', 'chunkParser'], 'Kernel-Classes');
  525. smalltalk.addMethod(
  526. "_class_category_",
  527. smalltalk.method({
  528. selector: "class:category:",
  529. fn: function (aClass, aString){
  530. var self=this;
  531. (self['@class']=aClass);
  532. (self['@category']=aString);
  533. return self;}
  534. }),
  535. smalltalk.ClassCategoryReader);
  536. smalltalk.addMethod(
  537. "_compileMethod_",
  538. smalltalk.method({
  539. selector: "compileMethod:",
  540. fn: function (aString){
  541. var self=this;
  542. smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_install_forClass_category_", [aString, self['@class'], self['@category']]);
  543. return self;}
  544. }),
  545. smalltalk.ClassCategoryReader);
  546. smalltalk.addMethod(
  547. "_initialize",
  548. smalltalk.method({
  549. selector: "initialize",
  550. fn: function (){
  551. var self=this;
  552. smalltalk.send(self, "_initialize", [], smalltalk.ClassCategoryReader.superclass || nil);
  553. (self['@chunkParser']=smalltalk.send((smalltalk.ChunkParser || ChunkParser), "_new", []));
  554. return self;}
  555. }),
  556. smalltalk.ClassCategoryReader);
  557. smalltalk.addMethod(
  558. "_scanFrom_",
  559. smalltalk.method({
  560. selector: "scanFrom:",
  561. fn: function (aChunkParser){
  562. var self=this;
  563. var chunk=nil;
  564. (function(){while(!(function(){(chunk=smalltalk.send(aChunkParser, "_nextChunk", []));return smalltalk.send(chunk, "_isEmpty", []);})()) {(function(){return smalltalk.send(self, "_compileMethod_", [chunk]);})()}})();
  565. smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_setupClass_", [self['@class']]);
  566. return self;}
  567. }),
  568. smalltalk.ClassCategoryReader);
  569. smalltalk.addClass('ClassCommentReader', smalltalk.Object, ['class', 'chunkParser'], 'Kernel-Classes');
  570. smalltalk.addMethod(
  571. "_class_",
  572. smalltalk.method({
  573. selector: "class:",
  574. fn: function (aClass){
  575. var self=this;
  576. (self['@class']=aClass);
  577. return self;}
  578. }),
  579. smalltalk.ClassCommentReader);
  580. smalltalk.addMethod(
  581. "_initialize",
  582. smalltalk.method({
  583. selector: "initialize",
  584. fn: function (){
  585. var self=this;
  586. smalltalk.send(self, "_initialize", [], smalltalk.ClassCommentReader.superclass || nil);
  587. (self['@chunkParser']=smalltalk.send((smalltalk.ChunkParser || ChunkParser), "_new", []));
  588. return self;}
  589. }),
  590. smalltalk.ClassCommentReader);
  591. smalltalk.addMethod(
  592. "_scanFrom_",
  593. smalltalk.method({
  594. selector: "scanFrom:",
  595. fn: function (aChunkParser){
  596. var self=this;
  597. var chunk=nil;
  598. (chunk=smalltalk.send(aChunkParser, "_nextChunk", []));
  599. ((($receiver = smalltalk.send(chunk, "_isEmpty", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_setComment_", [chunk]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_setComment_", [chunk]);})]));
  600. return self;}
  601. }),
  602. smalltalk.ClassCommentReader);
  603. smalltalk.addMethod(
  604. "_setComment_",
  605. smalltalk.method({
  606. selector: "setComment:",
  607. fn: function (aString){
  608. var self=this;
  609. smalltalk.send(self['@class'], "_comment_", [aString]);
  610. return self;}
  611. }),
  612. smalltalk.ClassCommentReader);
  613. smalltalk.addClass('ClassSorterNode', smalltalk.Object, ['theClass', 'level', 'nodes'], 'Kernel-Classes');
  614. smalltalk.addMethod(
  615. "_getNodesFrom_",
  616. smalltalk.method({
  617. selector: "getNodesFrom:",
  618. fn: function (aCollection){
  619. var self=this;
  620. var children=nil;
  621. var others=nil;
  622. (children=[]);
  623. (others=[]);
  624. smalltalk.send(aCollection, "_do_", [(function(each){return ((($receiver = smalltalk.send(smalltalk.send(each, "_superclass", []), "__eq", [smalltalk.send(self, "_theClass", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(children, "_add_", [each]);})() : (function(){return smalltalk.send(others, "_add_", [each]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(children, "_add_", [each]);}), (function(){return smalltalk.send(others, "_add_", [each]);})]));})]);
  625. (self['@nodes']=smalltalk.send(children, "_collect_", [(function(each){return smalltalk.send((smalltalk.ClassSorterNode || ClassSorterNode), "_on_classes_level_", [each, others, ((($receiver = smalltalk.send(self, "_level", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);})]));
  626. return self;}
  627. }),
  628. smalltalk.ClassSorterNode);
  629. smalltalk.addMethod(
  630. "_level",
  631. smalltalk.method({
  632. selector: "level",
  633. fn: function (){
  634. var self=this;
  635. return self['@level'];
  636. return self;}
  637. }),
  638. smalltalk.ClassSorterNode);
  639. smalltalk.addMethod(
  640. "_level_",
  641. smalltalk.method({
  642. selector: "level:",
  643. fn: function (anInteger){
  644. var self=this;
  645. (self['@level']=anInteger);
  646. return self;}
  647. }),
  648. smalltalk.ClassSorterNode);
  649. smalltalk.addMethod(
  650. "_nodes",
  651. smalltalk.method({
  652. selector: "nodes",
  653. fn: function (){
  654. var self=this;
  655. return self['@nodes'];
  656. return self;}
  657. }),
  658. smalltalk.ClassSorterNode);
  659. smalltalk.addMethod(
  660. "_theClass",
  661. smalltalk.method({
  662. selector: "theClass",
  663. fn: function (){
  664. var self=this;
  665. return self['@theClass'];
  666. return self;}
  667. }),
  668. smalltalk.ClassSorterNode);
  669. smalltalk.addMethod(
  670. "_theClass_",
  671. smalltalk.method({
  672. selector: "theClass:",
  673. fn: function (aClass){
  674. var self=this;
  675. (self['@theClass']=aClass);
  676. return self;}
  677. }),
  678. smalltalk.ClassSorterNode);
  679. smalltalk.addMethod(
  680. "_traverseClassesWith_",
  681. smalltalk.method({
  682. selector: "traverseClassesWith:",
  683. fn: function (aCollection){
  684. var self=this;
  685. smalltalk.send(aCollection, "_add_", [smalltalk.send(self, "_theClass", [])]);
  686. smalltalk.send(smalltalk.send(smalltalk.send(self, "_nodes", []), "_sorted_", [(function(a, b){return ((($receiver = smalltalk.send(smalltalk.send(a, "_theClass", []), "_name", [])).klass === smalltalk.Number) ? $receiver <=smalltalk.send(smalltalk.send(b, "_theClass", []), "_name", []) : smalltalk.send($receiver, "__lt_eq", [smalltalk.send(smalltalk.send(b, "_theClass", []), "_name", [])]));})]), "_do_", [(function(aNode){return smalltalk.send(aNode, "_traverseClassesWith_", [aCollection]);})]);
  687. return self;}
  688. }),
  689. smalltalk.ClassSorterNode);
  690. smalltalk.addMethod(
  691. "_on_classes_level_",
  692. smalltalk.method({
  693. selector: "on:classes:level:",
  694. fn: function (aClass, aCollection, anInteger){
  695. var self=this;
  696. return (function($rec){smalltalk.send($rec, "_theClass_", [aClass]);smalltalk.send($rec, "_level_", [anInteger]);smalltalk.send($rec, "_getNodesFrom_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  697. return self;}
  698. }),
  699. smalltalk.ClassSorterNode.klass);