Kernel-Classes.deploy.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826
  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. var compiler=nil;
  116. var method=nil;
  117. (compiler=smalltalk.send((smalltalk.Compiler || Compiler), "_new", []));
  118. (method=smalltalk.send(compiler, "_install_forClass_category_", [aString, self, anotherString]));
  119. smalltalk.send(compiler, "_setupClass_", [self]);
  120. return smalltalk.send(method, "_selector", []);
  121. return self;}
  122. }),
  123. smalltalk.Behavior);
  124. smalltalk.addMethod(
  125. "_inheritsFrom_",
  126. smalltalk.method({
  127. selector: "inheritsFrom:",
  128. fn: function (aClass){
  129. var self=this;
  130. return smalltalk.send(smalltalk.send(aClass, "_allSubclasses", []), "_includes_", [self]);
  131. return self;}
  132. }),
  133. smalltalk.Behavior);
  134. smalltalk.addMethod(
  135. "_instanceVariableNames",
  136. smalltalk.method({
  137. selector: "instanceVariableNames",
  138. fn: function (){
  139. var self=this;
  140. return self.iVarNames;
  141. return self;}
  142. }),
  143. smalltalk.Behavior);
  144. smalltalk.addMethod(
  145. "_methodAt_",
  146. smalltalk.method({
  147. selector: "methodAt:",
  148. fn: function (aString){
  149. var self=this;
  150. return smalltalk.methods(self)[aString];
  151. return self;}
  152. }),
  153. smalltalk.Behavior);
  154. smalltalk.addMethod(
  155. "_methodDictionary",
  156. smalltalk.method({
  157. selector: "methodDictionary",
  158. fn: function (){
  159. var self=this;
  160. var dict = smalltalk.HashedCollection._new();
  161. var methods = self.fn.prototype.methods;
  162. for(var i in methods) {
  163. if(methods[i].selector) {
  164. dict._at_put_(methods[i].selector, methods[i]);
  165. }
  166. };
  167. return dict;
  168. return self;}
  169. }),
  170. smalltalk.Behavior);
  171. smalltalk.addMethod(
  172. "_methodsFor_",
  173. smalltalk.method({
  174. selector: "methodsFor:",
  175. fn: function (aString){
  176. var self=this;
  177. return (function($rec){smalltalk.send($rec, "_class_category_", [self, aString]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.ClassCategoryReader || ClassCategoryReader), "_new", []));
  178. return self;}
  179. }),
  180. smalltalk.Behavior);
  181. smalltalk.addMethod(
  182. "_methodsFor_stamp_",
  183. smalltalk.method({
  184. selector: "methodsFor:stamp:",
  185. fn: function (aString, aStamp){
  186. var self=this;
  187. return smalltalk.send(self, "_methodsFor_", [aString]);
  188. return self;}
  189. }),
  190. smalltalk.Behavior);
  191. smalltalk.addMethod(
  192. "_name",
  193. smalltalk.method({
  194. selector: "name",
  195. fn: function (){
  196. var self=this;
  197. return self.className || nil;
  198. return self;}
  199. }),
  200. smalltalk.Behavior);
  201. smalltalk.addMethod(
  202. "_new",
  203. smalltalk.method({
  204. selector: "new",
  205. fn: function (){
  206. var self=this;
  207. return smalltalk.send(smalltalk.send(self, "_basicNew", []), "_initialize", []);
  208. return self;}
  209. }),
  210. smalltalk.Behavior);
  211. smalltalk.addMethod(
  212. "_protocols",
  213. smalltalk.method({
  214. selector: "protocols",
  215. fn: function (){
  216. var self=this;
  217. var protocols=nil;
  218. (protocols=smalltalk.send((smalltalk.Array || Array), "_new", []));
  219. 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", [])]);})]));})]);
  220. return smalltalk.send(protocols, "_sort", []);
  221. return self;}
  222. }),
  223. smalltalk.Behavior);
  224. smalltalk.addMethod(
  225. "_protocolsDo_",
  226. smalltalk.method({
  227. selector: "protocolsDo:",
  228. fn: function (aBlock){
  229. var self=this;
  230. var methodsByCategory=nil;
  231. (methodsByCategory=smalltalk.send((smalltalk.HashedCollection || HashedCollection), "_new", []));
  232. 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]);})]);
  233. smalltalk.send(smalltalk.send(self, "_protocols", []), "_do_", [(function(category){return smalltalk.send(aBlock, "_value_value_", [category, smalltalk.send(methodsByCategory, "_at_", [category])]);})]);
  234. return self;}
  235. }),
  236. smalltalk.Behavior);
  237. smalltalk.addMethod(
  238. "_prototype",
  239. smalltalk.method({
  240. selector: "prototype",
  241. fn: function (){
  242. var self=this;
  243. return self.fn.prototype;
  244. return self;}
  245. }),
  246. smalltalk.Behavior);
  247. smalltalk.addMethod(
  248. "_removeCompiledMethod_",
  249. smalltalk.method({
  250. selector: "removeCompiledMethod:",
  251. fn: function (aMethod){
  252. var self=this;
  253. delete self.fn.prototype[aMethod.selector._asSelector()];
  254. delete self.fn.prototype.methods[aMethod.selector];
  255. smalltalk.init(self);;
  256. return self;}
  257. }),
  258. smalltalk.Behavior);
  259. smalltalk.addMethod(
  260. "_removeSelector_",
  261. smalltalk.method({
  262. selector: "removeSelector:",
  263. fn: function (aString){
  264. var self=this;
  265. smalltalk.send(self, "_removeCompiledMethod_", [smalltalk.send(self, "_methodAt_", [aString])]);
  266. return self;}
  267. }),
  268. smalltalk.Behavior);
  269. smalltalk.addMethod(
  270. "_subclasses",
  271. smalltalk.method({
  272. selector: "subclasses",
  273. fn: function (){
  274. var self=this;
  275. return smalltalk.subclasses(self);
  276. return self;}
  277. }),
  278. smalltalk.Behavior);
  279. smalltalk.addMethod(
  280. "_superclass",
  281. smalltalk.method({
  282. selector: "superclass",
  283. fn: function (){
  284. var self=this;
  285. return self.superclass || nil;
  286. return self;}
  287. }),
  288. smalltalk.Behavior);
  289. smalltalk.addMethod(
  290. "_withAllSubclasses",
  291. smalltalk.method({
  292. selector: "withAllSubclasses",
  293. fn: function (){
  294. var self=this;
  295. return (function($rec){smalltalk.send($rec, "_addAll_", [smalltalk.send(self, "_allSubclasses", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Array || Array), "_with_", [self]));
  296. return self;}
  297. }),
  298. smalltalk.Behavior);
  299. smalltalk.addClass('Class', smalltalk.Behavior, [], 'Kernel-Classes');
  300. smalltalk.addMethod(
  301. "_category",
  302. smalltalk.method({
  303. selector: "category",
  304. fn: function (){
  305. var self=this;
  306. return (($receiver = smalltalk.send(self, "_package", [])) == nil || $receiver == undefined) ? (function(){return "Unclassified";})() : (function(){return smalltalk.send(smalltalk.send(self, "_package", []), "_name", []);})();
  307. return self;}
  308. }),
  309. smalltalk.Class);
  310. smalltalk.addMethod(
  311. "_definition",
  312. smalltalk.method({
  313. selector: "definition",
  314. fn: function (){
  315. var self=this;
  316. var stream=nil;
  317. (stream=smalltalk.send("", "_writeStream", []));
  318. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(self, "_superclass", []), "_asString", [])]);smalltalk.send($rec, "_nextPutAll_", [" subclass: #"]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_name", [])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send((smalltalk.String || String), "_lf", []), "__comma", [smalltalk.send((smalltalk.String || String), "_tab", [])])]);return smalltalk.send($rec, "_nextPutAll_", ["instanceVariableNames: '"]);})(stream);
  319. smalltalk.send(smalltalk.send(self, "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(stream, "_nextPutAll_", [each]);}), (function(){return smalltalk.send(stream, "_nextPutAll_", [" "]);})]);
  320. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("'", "__comma", [smalltalk.send((smalltalk.String || String), "_lf", [])]), "__comma", [smalltalk.send((smalltalk.String || String), "_tab", [])])]);smalltalk.send($rec, "_nextPutAll_", ["package: '"]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_category", [])]);return smalltalk.send($rec, "_nextPutAll_", ["'"]);})(stream);
  321. return smalltalk.send(stream, "_contents", []);
  322. return self;}
  323. }),
  324. smalltalk.Class);
  325. smalltalk.addMethod(
  326. "_isClass",
  327. smalltalk.method({
  328. selector: "isClass",
  329. fn: function (){
  330. var self=this;
  331. return true;
  332. return self;}
  333. }),
  334. smalltalk.Class);
  335. smalltalk.addMethod(
  336. "_package",
  337. smalltalk.method({
  338. selector: "package",
  339. fn: function (){
  340. var self=this;
  341. return self.pkg;
  342. return self;}
  343. }),
  344. smalltalk.Class);
  345. smalltalk.addMethod(
  346. "_package_",
  347. smalltalk.method({
  348. selector: "package:",
  349. fn: function (aPackage){
  350. var self=this;
  351. self.pkg = aPackage;
  352. return self;}
  353. }),
  354. smalltalk.Class);
  355. smalltalk.addMethod(
  356. "_printString",
  357. smalltalk.method({
  358. selector: "printString",
  359. fn: function (){
  360. var self=this;
  361. return smalltalk.send(self, "_name", []);
  362. return self;}
  363. }),
  364. smalltalk.Class);
  365. smalltalk.addMethod(
  366. "_rename_",
  367. smalltalk.method({
  368. selector: "rename:",
  369. fn: function (aString){
  370. var self=this;
  371. smalltalk[aString] = self;
  372. delete smalltalk[self.className];
  373. self.className = aString;
  374. ;
  375. return self;}
  376. }),
  377. smalltalk.Class);
  378. smalltalk.addMethod(
  379. "_subclass_instanceVariableNames_",
  380. smalltalk.method({
  381. selector: "subclass:instanceVariableNames:",
  382. fn: function (aString, anotherString){
  383. var self=this;
  384. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, anotherString, nil]);
  385. return self;}
  386. }),
  387. smalltalk.Class);
  388. smalltalk.addMethod(
  389. "_subclass_instanceVariableNames_category_",
  390. smalltalk.method({
  391. selector: "subclass:instanceVariableNames:category:",
  392. fn: function (aString, aString2, aString3){
  393. var self=this;
  394. smalltalk.send(self, "_deprecatedAPI", []);
  395. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
  396. return self;}
  397. }),
  398. smalltalk.Class);
  399. smalltalk.addMethod(
  400. "_subclass_instanceVariableNames_classVariableNames_poolDictionaries_category_",
  401. smalltalk.method({
  402. selector: "subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:",
  403. fn: function (aString, aString2, classVars, pools, aString3){
  404. var self=this;
  405. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
  406. return self;}
  407. }),
  408. smalltalk.Class);
  409. smalltalk.addMethod(
  410. "_subclass_instanceVariableNames_package_",
  411. smalltalk.method({
  412. selector: "subclass:instanceVariableNames:package:",
  413. fn: function (aString, aString2, aString3){
  414. var self=this;
  415. return smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_superclass_subclass_instanceVariableNames_package_", [self, smalltalk.send(aString, "_asString", []), aString2, aString3]);
  416. return self;}
  417. }),
  418. smalltalk.Class);
  419. smalltalk.addClass('Metaclass', smalltalk.Behavior, [], 'Kernel-Classes');
  420. smalltalk.addMethod(
  421. "_definition",
  422. smalltalk.method({
  423. selector: "definition",
  424. fn: function (){
  425. var self=this;
  426. var stream=nil;
  427. (stream=smalltalk.send("", "_writeStream", []));
  428. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_asString", [])]);return smalltalk.send($rec, "_nextPutAll_", [" instanceVariableNames: '"]);})(stream);
  429. smalltalk.send(smalltalk.send(self, "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(stream, "_nextPutAll_", [each]);}), (function(){return smalltalk.send(stream, "_nextPutAll_", [" "]);})]);
  430. smalltalk.send(stream, "_nextPutAll_", ["'"]);
  431. return smalltalk.send(stream, "_contents", []);
  432. return self;}
  433. }),
  434. smalltalk.Metaclass);
  435. smalltalk.addMethod(
  436. "_instanceClass",
  437. smalltalk.method({
  438. selector: "instanceClass",
  439. fn: function (){
  440. var self=this;
  441. return self.instanceClass;
  442. return self;}
  443. }),
  444. smalltalk.Metaclass);
  445. smalltalk.addMethod(
  446. "_instanceVariableNames_",
  447. smalltalk.method({
  448. selector: "instanceVariableNames:",
  449. fn: function (aCollection){
  450. var self=this;
  451. smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_class_instanceVariableNames_", [self, aCollection]);
  452. return self;}
  453. }),
  454. smalltalk.Metaclass);
  455. smalltalk.addMethod(
  456. "_isMetaclass",
  457. smalltalk.method({
  458. selector: "isMetaclass",
  459. fn: function (){
  460. var self=this;
  461. return true;
  462. return self;}
  463. }),
  464. smalltalk.Metaclass);
  465. smalltalk.addMethod(
  466. "_printString",
  467. smalltalk.method({
  468. selector: "printString",
  469. fn: function (){
  470. var self=this;
  471. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_instanceClass", []), "_name", []), "__comma", [" class"]);
  472. return self;}
  473. }),
  474. smalltalk.Metaclass);
  475. smalltalk.addClass('ClassBuilder', smalltalk.Object, [], 'Kernel-Classes');
  476. smalltalk.addMethod(
  477. "_addSubclassOf_named_instanceVariableNames_",
  478. smalltalk.method({
  479. selector: "addSubclassOf:named:instanceVariableNames:",
  480. fn: function (aClass, aString, aCollection){
  481. var self=this;
  482. smalltalk.addClass(aString, aClass, aCollection);
  483. return smalltalk[aString];
  484. return self;}
  485. }),
  486. smalltalk.ClassBuilder);
  487. smalltalk.addMethod(
  488. "_addSubclassOf_named_instanceVariableNames_package_",
  489. smalltalk.method({
  490. selector: "addSubclassOf:named:instanceVariableNames:package:",
  491. fn: function (aClass, aString, aCollection, packageName){
  492. var self=this;
  493. smalltalk.addClass(aString, aClass, aCollection, packageName);
  494. return smalltalk[aString];
  495. return self;}
  496. }),
  497. smalltalk.ClassBuilder);
  498. smalltalk.addMethod(
  499. "_class_instanceVariableNames_",
  500. smalltalk.method({
  501. selector: "class:instanceVariableNames:",
  502. fn: function (aClass, aString){
  503. var self=this;
  504. ((($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"])]);})]));
  505. smalltalk.send(aClass, "_basicAt_put_", ["iVarNames", smalltalk.send(self, "_instanceVariableNamesFor_", [aString])]);
  506. smalltalk.send(self, "_setupClass_", [aClass]);
  507. return self;}
  508. }),
  509. smalltalk.ClassBuilder);
  510. smalltalk.addMethod(
  511. "_copyClass_named_",
  512. smalltalk.method({
  513. selector: "copyClass:named:",
  514. fn: function (aClass, aString){
  515. var self=this;
  516. var newClass=nil;
  517. (newClass=smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_package_", [smalltalk.send(aClass, "_superclass", []), aString, smalltalk.send(aClass, "_instanceVariableNames", []), smalltalk.send(smalltalk.send(aClass, "_package", []), "_name", [])]));
  518. smalltalk.send(self, "_setupClass_", [newClass]);
  519. 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", [])]);})]);
  520. 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", [])]);})]);
  521. smalltalk.send(self, "_setupClass_", [newClass]);
  522. return newClass;
  523. return self;}
  524. }),
  525. smalltalk.ClassBuilder);
  526. smalltalk.addMethod(
  527. "_instanceVariableNamesFor_",
  528. smalltalk.method({
  529. selector: "instanceVariableNamesFor:",
  530. fn: function (aString){
  531. var self=this;
  532. return smalltalk.send(smalltalk.send(aString, "_tokenize_", [" "]), "_reject_", [(function(each){return smalltalk.send(each, "_isEmpty", []);})]);
  533. return self;}
  534. }),
  535. smalltalk.ClassBuilder);
  536. smalltalk.addMethod(
  537. "_setupClass_",
  538. smalltalk.method({
  539. selector: "setupClass:",
  540. fn: function (aClass){
  541. var self=this;
  542. smalltalk.init(aClass);;
  543. return self;}
  544. }),
  545. smalltalk.ClassBuilder);
  546. smalltalk.addMethod(
  547. "_superclass_subclass_",
  548. smalltalk.method({
  549. selector: "superclass:subclass:",
  550. fn: function (aClass, aString){
  551. var self=this;
  552. return smalltalk.send(self, "_superclass_subclass_instanceVariableNames_package_", [aClass, aString, "", nil]);
  553. return self;}
  554. }),
  555. smalltalk.ClassBuilder);
  556. smalltalk.addMethod(
  557. "_superclass_subclass_instanceVariableNames_package_",
  558. smalltalk.method({
  559. selector: "superclass:subclass:instanceVariableNames:package:",
  560. fn: function (aClass, aString, aString2, aString3){
  561. var self=this;
  562. var newClass=nil;
  563. (newClass=smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_package_", [aClass, aString, smalltalk.send(self, "_instanceVariableNamesFor_", [aString2]), (($receiver = aString3) == nil || $receiver == undefined) ? (function(){return "unclassified";})() : $receiver]));
  564. smalltalk.send(self, "_setupClass_", [newClass]);
  565. return newClass;
  566. return self;}
  567. }),
  568. smalltalk.ClassBuilder);
  569. smalltalk.addClass('ClassCategoryReader', smalltalk.Object, ['class', 'category', 'chunkParser'], 'Kernel-Classes');
  570. smalltalk.addMethod(
  571. "_class_category_",
  572. smalltalk.method({
  573. selector: "class:category:",
  574. fn: function (aClass, aString){
  575. var self=this;
  576. (self['@class']=aClass);
  577. (self['@category']=aString);
  578. return self;}
  579. }),
  580. smalltalk.ClassCategoryReader);
  581. smalltalk.addMethod(
  582. "_compileMethod_",
  583. smalltalk.method({
  584. selector: "compileMethod:",
  585. fn: function (aString){
  586. var self=this;
  587. smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_install_forClass_category_", [aString, self['@class'], self['@category']]);
  588. return self;}
  589. }),
  590. smalltalk.ClassCategoryReader);
  591. smalltalk.addMethod(
  592. "_initialize",
  593. smalltalk.method({
  594. selector: "initialize",
  595. fn: function (){
  596. var self=this;
  597. smalltalk.send(self, "_initialize", [], smalltalk.ClassCategoryReader.superclass || nil);
  598. (self['@chunkParser']=smalltalk.send((smalltalk.ChunkParser || ChunkParser), "_new", []));
  599. return self;}
  600. }),
  601. smalltalk.ClassCategoryReader);
  602. smalltalk.addMethod(
  603. "_scanFrom_",
  604. smalltalk.method({
  605. selector: "scanFrom:",
  606. fn: function (aChunkParser){
  607. var self=this;
  608. var chunk=nil;
  609. (function(){while(!(function(){(chunk=smalltalk.send(aChunkParser, "_nextChunk", []));return smalltalk.send(chunk, "_isEmpty", []);})()) {(function(){return smalltalk.send(self, "_compileMethod_", [chunk]);})()}})();
  610. smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_setupClass_", [self['@class']]);
  611. return self;}
  612. }),
  613. smalltalk.ClassCategoryReader);
  614. smalltalk.addClass('ClassCommentReader', smalltalk.Object, ['class', 'chunkParser'], 'Kernel-Classes');
  615. smalltalk.addMethod(
  616. "_class_",
  617. smalltalk.method({
  618. selector: "class:",
  619. fn: function (aClass){
  620. var self=this;
  621. (self['@class']=aClass);
  622. return self;}
  623. }),
  624. smalltalk.ClassCommentReader);
  625. smalltalk.addMethod(
  626. "_initialize",
  627. smalltalk.method({
  628. selector: "initialize",
  629. fn: function (){
  630. var self=this;
  631. smalltalk.send(self, "_initialize", [], smalltalk.ClassCommentReader.superclass || nil);
  632. (self['@chunkParser']=smalltalk.send((smalltalk.ChunkParser || ChunkParser), "_new", []));
  633. return self;}
  634. }),
  635. smalltalk.ClassCommentReader);
  636. smalltalk.addMethod(
  637. "_scanFrom_",
  638. smalltalk.method({
  639. selector: "scanFrom:",
  640. fn: function (aChunkParser){
  641. var self=this;
  642. var chunk=nil;
  643. (chunk=smalltalk.send(aChunkParser, "_nextChunk", []));
  644. ((($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]);})]));
  645. return self;}
  646. }),
  647. smalltalk.ClassCommentReader);
  648. smalltalk.addMethod(
  649. "_setComment_",
  650. smalltalk.method({
  651. selector: "setComment:",
  652. fn: function (aString){
  653. var self=this;
  654. smalltalk.send(self['@class'], "_comment_", [aString]);
  655. return self;}
  656. }),
  657. smalltalk.ClassCommentReader);
  658. smalltalk.addClass('ClassSorterNode', smalltalk.Object, ['theClass', 'level', 'nodes'], 'Kernel-Classes');
  659. smalltalk.addMethod(
  660. "_getNodesFrom_",
  661. smalltalk.method({
  662. selector: "getNodesFrom:",
  663. fn: function (aCollection){
  664. var self=this;
  665. var children=nil;
  666. var others=nil;
  667. (children=[]);
  668. (others=[]);
  669. 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]);})]));})]);
  670. (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)]))]);})]));
  671. return self;}
  672. }),
  673. smalltalk.ClassSorterNode);
  674. smalltalk.addMethod(
  675. "_level",
  676. smalltalk.method({
  677. selector: "level",
  678. fn: function (){
  679. var self=this;
  680. return self['@level'];
  681. return self;}
  682. }),
  683. smalltalk.ClassSorterNode);
  684. smalltalk.addMethod(
  685. "_level_",
  686. smalltalk.method({
  687. selector: "level:",
  688. fn: function (anInteger){
  689. var self=this;
  690. (self['@level']=anInteger);
  691. return self;}
  692. }),
  693. smalltalk.ClassSorterNode);
  694. smalltalk.addMethod(
  695. "_nodes",
  696. smalltalk.method({
  697. selector: "nodes",
  698. fn: function (){
  699. var self=this;
  700. return self['@nodes'];
  701. return self;}
  702. }),
  703. smalltalk.ClassSorterNode);
  704. smalltalk.addMethod(
  705. "_theClass",
  706. smalltalk.method({
  707. selector: "theClass",
  708. fn: function (){
  709. var self=this;
  710. return self['@theClass'];
  711. return self;}
  712. }),
  713. smalltalk.ClassSorterNode);
  714. smalltalk.addMethod(
  715. "_theClass_",
  716. smalltalk.method({
  717. selector: "theClass:",
  718. fn: function (aClass){
  719. var self=this;
  720. (self['@theClass']=aClass);
  721. return self;}
  722. }),
  723. smalltalk.ClassSorterNode);
  724. smalltalk.addMethod(
  725. "_traverseClassesWith_",
  726. smalltalk.method({
  727. selector: "traverseClassesWith:",
  728. fn: function (aCollection){
  729. var self=this;
  730. smalltalk.send(aCollection, "_add_", [smalltalk.send(self, "_theClass", [])]);
  731. 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]);})]);
  732. return self;}
  733. }),
  734. smalltalk.ClassSorterNode);
  735. smalltalk.addMethod(
  736. "_on_classes_level_",
  737. smalltalk.method({
  738. selector: "on:classes:level:",
  739. fn: function (aClass, aCollection, anInteger){
  740. var self=this;
  741. 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", []));
  742. return self;}
  743. }),
  744. smalltalk.ClassSorterNode.klass);