Kernel-Classes.deploy.js 28 KB

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