1
0

Kernel-Classes.deploy.js 22 KB

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