Kernel-Classes.js 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570
  1. smalltalk.addPackage('Kernel-Classes', {});
  2. smalltalk.addClass('Behavior', smalltalk.Object, [], 'Kernel-Classes');
  3. smalltalk.Behavior.comment="Behavior is the superclass of all class objects. \x0a\x0aIt defines the protocol for creating instances of a class with `#basicNew` and `#new` (see `boot.js` for class constructors details).\x0aInstances know about the subclass/superclass relationships between classes, contain the description that instances are created from, \x0aand hold the method dictionary that's associated with each class.\x0a\x0aBehavior also provides methods for compiling methods, examining the method dictionary, and iterating over the class hierarchy."
  4. smalltalk.addMethod(
  5. "_addCompiledMethod_",
  6. smalltalk.method({
  7. selector: "addCompiledMethod:",
  8. category: 'compiling',
  9. fn: function (aMethod){
  10. var self=this;
  11. var $1,$2;
  12. smalltalk.addMethod(aMethod.selector._asSelector(), aMethod, self);
  13. ;
  14. $1=smalltalk.send((smalltalk.MethodAdded || MethodAdded),"_new",[]);
  15. smalltalk.send($1,"_theClass_",[self]);
  16. smalltalk.send($1,"_method_",[aMethod]);
  17. $2=smalltalk.send($1,"_yourself",[]);
  18. smalltalk.send(smalltalk.send((smalltalk.SystemAnnouncer || SystemAnnouncer),"_current",[]),"_announce_",[$2]);
  19. return self},
  20. args: ["aMethod"],
  21. source: "addCompiledMethod: aMethod\x0a\x09<smalltalk.addMethod(aMethod.selector._asSelector(), aMethod, self)>.\x0a \x0a SystemAnnouncer current\x0a \x09\x09announce: (MethodAdded new\x0a \x09theClass: self;\x0a method: aMethod;\x0a yourself)",
  22. messageSends: ["announce:", "theClass:", "new", "method:", "yourself", "current"],
  23. referencedClasses: ["MethodAdded", "SystemAnnouncer"]
  24. }),
  25. smalltalk.Behavior);
  26. smalltalk.addMethod(
  27. "_allInstanceVariableNames",
  28. smalltalk.method({
  29. selector: "allInstanceVariableNames",
  30. category: 'accessing',
  31. fn: function (){
  32. var self=this;
  33. var $1;
  34. var result;
  35. result=smalltalk.send(smalltalk.send(self,"_instanceVariableNames",[]),"_copy",[]);
  36. $1=smalltalk.send(self,"_superclass",[]);
  37. if(($receiver = $1) == nil || $receiver == undefined){
  38. $1;
  39. } else {
  40. smalltalk.send(result,"_addAll_",[smalltalk.send(smalltalk.send(self,"_superclass",[]),"_allInstanceVariableNames",[])]);
  41. };
  42. return result;
  43. },
  44. args: [],
  45. source: "allInstanceVariableNames\x0a\x09| result |\x0a\x09result := self instanceVariableNames copy.\x0a\x09self superclass ifNotNil: [\x0a\x09 result addAll: self superclass allInstanceVariableNames].\x0a\x09^result",
  46. messageSends: ["copy", "instanceVariableNames", "ifNotNil:", "addAll:", "allInstanceVariableNames", "superclass"],
  47. referencedClasses: []
  48. }),
  49. smalltalk.Behavior);
  50. smalltalk.addMethod(
  51. "_allSubclasses",
  52. smalltalk.method({
  53. selector: "allSubclasses",
  54. category: 'accessing',
  55. fn: function (){
  56. var self=this;
  57. var result;
  58. result=smalltalk.send(self,"_subclasses",[]);
  59. smalltalk.send(smalltalk.send(self,"_subclasses",[]),"_do_",[(function(each){
  60. return smalltalk.send(result,"_addAll_",[smalltalk.send(each,"_allSubclasses",[])]);
  61. })]);
  62. return result;
  63. },
  64. args: [],
  65. source: "allSubclasses\x0a\x09| result |\x0a\x09result := self subclasses.\x0a\x09self subclasses do: [:each |\x0a\x09 result addAll: each allSubclasses].\x0a\x09^result",
  66. messageSends: ["subclasses", "do:", "addAll:", "allSubclasses"],
  67. referencedClasses: []
  68. }),
  69. smalltalk.Behavior);
  70. smalltalk.addMethod(
  71. "_allSuperclasses",
  72. smalltalk.method({
  73. selector: "allSuperclasses",
  74. category: 'accessing',
  75. fn: function (){
  76. var self=this;
  77. var $1,$3,$4,$2;
  78. $1=smalltalk.send(self,"_superclass",[]);
  79. if(($receiver = $1) == nil || $receiver == undefined){
  80. return [];
  81. } else {
  82. $1;
  83. };
  84. $3=smalltalk.send((smalltalk.OrderedCollection || OrderedCollection),"_with_",[smalltalk.send(self,"_superclass",[])]);
  85. smalltalk.send($3,"_addAll_",[smalltalk.send(smalltalk.send(self,"_superclass",[]),"_allSuperclasses",[])]);
  86. $4=smalltalk.send($3,"_yourself",[]);
  87. $2=$4;
  88. return $2;
  89. },
  90. args: [],
  91. source: "allSuperclasses\x0a\x09\x0a self superclass ifNil: [ ^ #() ].\x0a \x0a\x09^ (OrderedCollection with: self superclass) \x0a \x09addAll: self superclass allSuperclasses;\x0a yourself",
  92. messageSends: ["ifNil:", "superclass", "addAll:", "allSuperclasses", "with:", "yourself"],
  93. referencedClasses: ["OrderedCollection"]
  94. }),
  95. smalltalk.Behavior);
  96. smalltalk.addMethod(
  97. "_basicNew",
  98. smalltalk.method({
  99. selector: "basicNew",
  100. category: 'instance creation',
  101. fn: function (){
  102. var self=this;
  103. return new self.fn();
  104. ;
  105. return self},
  106. args: [],
  107. source: "basicNew\x0a\x09<return new self.fn()>",
  108. messageSends: [],
  109. referencedClasses: []
  110. }),
  111. smalltalk.Behavior);
  112. smalltalk.addMethod(
  113. "_canUnderstand_",
  114. smalltalk.method({
  115. selector: "canUnderstand:",
  116. category: 'testing',
  117. fn: function (aSelector){
  118. var self=this;
  119. var $1;
  120. $1=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self,"_methodDictionary",[]),"_keys",[]),"_includes_",[smalltalk.send(aSelector,"_asString",[])]),"_or_",[(function(){
  121. return smalltalk.send(smalltalk.send(smalltalk.send(self,"_superclass",[]),"_notNil",[]),"_and_",[(function(){
  122. return smalltalk.send(smalltalk.send(self,"_superclass",[]),"_canUnderstand_",[aSelector]);
  123. })]);
  124. })]);
  125. return $1;
  126. },
  127. args: ["aSelector"],
  128. source: "canUnderstand: aSelector\x0a\x09^(self methodDictionary keys includes: aSelector asString) or: [\x0a\x09\x09self superclass notNil and: [self superclass canUnderstand: aSelector]]",
  129. messageSends: ["or:", "and:", "canUnderstand:", "superclass", "notNil", "includes:", "asString", "keys", "methodDictionary"],
  130. referencedClasses: []
  131. }),
  132. smalltalk.Behavior);
  133. smalltalk.addMethod(
  134. "_comment",
  135. smalltalk.method({
  136. selector: "comment",
  137. category: 'accessing',
  138. fn: function (){
  139. var self=this;
  140. var $2,$1;
  141. $2=smalltalk.send(self,"_basicAt_",["comment"]);
  142. if(($receiver = $2) == nil || $receiver == undefined){
  143. $1="";
  144. } else {
  145. $1=$2;
  146. };
  147. return $1;
  148. },
  149. args: [],
  150. source: "comment\x0a ^(self basicAt: 'comment') ifNil: ['']",
  151. messageSends: ["ifNil:", "basicAt:"],
  152. referencedClasses: []
  153. }),
  154. smalltalk.Behavior);
  155. smalltalk.addMethod(
  156. "_comment_",
  157. smalltalk.method({
  158. selector: "comment:",
  159. category: 'accessing',
  160. fn: function (aString){
  161. var self=this;
  162. var $1,$2;
  163. smalltalk.send(self,"_basicAt_put_",["comment",aString]);
  164. $1=smalltalk.send((smalltalk.ClassCommentChanged || ClassCommentChanged),"_new",[]);
  165. smalltalk.send($1,"_theClass_",[self]);
  166. $2=smalltalk.send($1,"_yourself",[]);
  167. smalltalk.send(smalltalk.send((smalltalk.SystemAnnouncer || SystemAnnouncer),"_current",[]),"_announce_",[$2]);
  168. return self},
  169. args: ["aString"],
  170. source: "comment: aString\x0a self basicAt: 'comment' put: aString.\x0a SystemAnnouncer current\x0a \x09announce: (ClassCommentChanged new\x0a \x09theClass: self;\x0a yourself)",
  171. messageSends: ["basicAt:put:", "announce:", "theClass:", "new", "yourself", "current"],
  172. referencedClasses: ["ClassCommentChanged", "SystemAnnouncer"]
  173. }),
  174. smalltalk.Behavior);
  175. smalltalk.addMethod(
  176. "_commentStamp",
  177. smalltalk.method({
  178. selector: "commentStamp",
  179. category: 'accessing',
  180. fn: function (){
  181. var self=this;
  182. var $2,$3,$1;
  183. $2=smalltalk.send((smalltalk.ClassCommentReader || ClassCommentReader),"_new",[]);
  184. smalltalk.send($2,"_class_",[self]);
  185. $3=smalltalk.send($2,"_yourself",[]);
  186. $1=$3;
  187. return $1;
  188. },
  189. args: [],
  190. source: "commentStamp\x0a ^ClassCommentReader new\x0a\x09class: self;\x0a\x09yourself",
  191. messageSends: ["class:", "new", "yourself"],
  192. referencedClasses: ["ClassCommentReader"]
  193. }),
  194. smalltalk.Behavior);
  195. smalltalk.addMethod(
  196. "_commentStamp_prior_",
  197. smalltalk.method({
  198. selector: "commentStamp:prior:",
  199. category: 'accessing',
  200. fn: function (aStamp,prior){
  201. var self=this;
  202. var $1;
  203. $1=smalltalk.send(self,"_commentStamp",[]);
  204. return $1;
  205. },
  206. args: ["aStamp", "prior"],
  207. source: "commentStamp: aStamp prior: prior\x0a ^self commentStamp",
  208. messageSends: ["commentStamp"],
  209. referencedClasses: []
  210. }),
  211. smalltalk.Behavior);
  212. smalltalk.addMethod(
  213. "_compile_",
  214. smalltalk.method({
  215. selector: "compile:",
  216. category: 'compiling',
  217. fn: function (aString){
  218. var self=this;
  219. smalltalk.send(self,"_compile_category_",[aString,""]);
  220. return self},
  221. args: ["aString"],
  222. source: "compile: aString\x0a\x09self compile: aString category: ''",
  223. messageSends: ["compile:category:"],
  224. referencedClasses: []
  225. }),
  226. smalltalk.Behavior);
  227. smalltalk.addMethod(
  228. "_compile_category_",
  229. smalltalk.method({
  230. selector: "compile:category:",
  231. category: 'compiling',
  232. fn: function (aString,anotherString){
  233. var self=this;
  234. smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler),"_new",[]),"_install_forClass_category_",[aString,self,anotherString]);
  235. return self},
  236. args: ["aString", "anotherString"],
  237. source: "compile: aString category: anotherString\x0a\x09Compiler new\x0a\x09\x09install: aString \x0a forClass: self \x0a category: anotherString",
  238. messageSends: ["install:forClass:category:", "new"],
  239. referencedClasses: ["Compiler"]
  240. }),
  241. smalltalk.Behavior);
  242. smalltalk.addMethod(
  243. "_definition",
  244. smalltalk.method({
  245. selector: "definition",
  246. category: 'accessing',
  247. fn: function (){
  248. var self=this;
  249. return "";
  250. },
  251. args: [],
  252. source: "definition\x0a\x09^ ''",
  253. messageSends: [],
  254. referencedClasses: []
  255. }),
  256. smalltalk.Behavior);
  257. smalltalk.addMethod(
  258. "_inheritsFrom_",
  259. smalltalk.method({
  260. selector: "inheritsFrom:",
  261. category: 'testing',
  262. fn: function (aClass){
  263. var self=this;
  264. var $1;
  265. $1=smalltalk.send(smalltalk.send(aClass,"_allSubclasses",[]),"_includes_",[self]);
  266. return $1;
  267. },
  268. args: ["aClass"],
  269. source: "inheritsFrom: aClass\x0a\x09^aClass allSubclasses includes: self",
  270. messageSends: ["includes:", "allSubclasses"],
  271. referencedClasses: []
  272. }),
  273. smalltalk.Behavior);
  274. smalltalk.addMethod(
  275. "_instanceVariableNames",
  276. smalltalk.method({
  277. selector: "instanceVariableNames",
  278. category: 'accessing',
  279. fn: function (){
  280. var self=this;
  281. return self.iVarNames;
  282. ;
  283. return self},
  284. args: [],
  285. source: "instanceVariableNames\x0a\x09<return self.iVarNames>",
  286. messageSends: [],
  287. referencedClasses: []
  288. }),
  289. smalltalk.Behavior);
  290. smalltalk.addMethod(
  291. "_methodAt_",
  292. smalltalk.method({
  293. selector: "methodAt:",
  294. category: 'accessing',
  295. fn: function (aSymbol){
  296. var self=this;
  297. return smalltalk.methods(self)[aSymbol._asString()];
  298. ;
  299. return self},
  300. args: ["aSymbol"],
  301. source: "methodAt: aSymbol\x0a\x09<return smalltalk.methods(self)[aSymbol._asString()]>",
  302. messageSends: [],
  303. referencedClasses: []
  304. }),
  305. smalltalk.Behavior);
  306. smalltalk.addMethod(
  307. "_methodDictionary",
  308. smalltalk.method({
  309. selector: "methodDictionary",
  310. category: 'accessing',
  311. fn: function (){
  312. var self=this;
  313. var dict = smalltalk.HashedCollection._new();
  314. var methods = self.fn.prototype.methods;
  315. for(var i in methods) {
  316. if(methods[i].selector) {
  317. dict._at_put_(methods[i].selector, methods[i]);
  318. }
  319. };
  320. return dict;
  321. ;
  322. return self},
  323. args: [],
  324. source: "methodDictionary\x0a\x09<var dict = smalltalk.HashedCollection._new();\x0a\x09var methods = self.fn.prototype.methods;\x0a\x09for(var i in methods) {\x0a\x09\x09if(methods[i].selector) {\x0a\x09\x09\x09dict._at_put_(methods[i].selector, methods[i]);\x0a\x09\x09}\x0a\x09};\x0a\x09return dict>",
  325. messageSends: [],
  326. referencedClasses: []
  327. }),
  328. smalltalk.Behavior);
  329. smalltalk.addMethod(
  330. "_methods",
  331. smalltalk.method({
  332. selector: "methods",
  333. category: 'accessing',
  334. fn: function (){
  335. var self=this;
  336. var $1;
  337. $1=smalltalk.send(smalltalk.send(self,"_methodDictionary",[]),"_values",[]);
  338. return $1;
  339. },
  340. args: [],
  341. source: "methods\x0a\x09^ self methodDictionary values",
  342. messageSends: ["values", "methodDictionary"],
  343. referencedClasses: []
  344. }),
  345. smalltalk.Behavior);
  346. smalltalk.addMethod(
  347. "_methodsFor_",
  348. smalltalk.method({
  349. selector: "methodsFor:",
  350. category: 'accessing',
  351. fn: function (aString){
  352. var self=this;
  353. var $2,$3,$1;
  354. $2=smalltalk.send((smalltalk.ClassCategoryReader || ClassCategoryReader),"_new",[]);
  355. smalltalk.send($2,"_class_category_",[self,aString]);
  356. $3=smalltalk.send($2,"_yourself",[]);
  357. $1=$3;
  358. return $1;
  359. },
  360. args: ["aString"],
  361. source: "methodsFor: aString\x0a\x09^ClassCategoryReader new\x0a\x09 class: self category: aString;\x0a\x09 yourself",
  362. messageSends: ["class:category:", "new", "yourself"],
  363. referencedClasses: ["ClassCategoryReader"]
  364. }),
  365. smalltalk.Behavior);
  366. smalltalk.addMethod(
  367. "_methodsFor_stamp_",
  368. smalltalk.method({
  369. selector: "methodsFor:stamp:",
  370. category: 'accessing',
  371. fn: function (aString,aStamp){
  372. var self=this;
  373. var $1;
  374. $1=smalltalk.send(self,"_methodsFor_",[aString]);
  375. return $1;
  376. },
  377. args: ["aString", "aStamp"],
  378. source: "methodsFor: aString stamp: aStamp\x0a\x09\x22Added for compatibility, right now ignores stamp.\x22\x0a\x09^self methodsFor: aString",
  379. messageSends: ["methodsFor:"],
  380. referencedClasses: []
  381. }),
  382. smalltalk.Behavior);
  383. smalltalk.addMethod(
  384. "_methodsInProtocol_",
  385. smalltalk.method({
  386. selector: "methodsInProtocol:",
  387. category: 'accessing',
  388. fn: function (aString){
  389. var self=this;
  390. var $1;
  391. $1=smalltalk.send(smalltalk.send(smalltalk.send(self,"_methodDictionary",[]),"_values",[]),"_select_",[(function(each){
  392. return smalltalk.send(smalltalk.send(each,"_protocol",[]),"__eq",[aString]);
  393. })]);
  394. return $1;
  395. },
  396. args: ["aString"],
  397. source: "methodsInProtocol: aString\x0a\x09^ self methodDictionary values select: [ :each | each protocol = aString ]",
  398. messageSends: ["select:", "=", "protocol", "values", "methodDictionary"],
  399. referencedClasses: []
  400. }),
  401. smalltalk.Behavior);
  402. smalltalk.addMethod(
  403. "_name",
  404. smalltalk.method({
  405. selector: "name",
  406. category: 'accessing',
  407. fn: function (){
  408. var self=this;
  409. return self.className || nil;
  410. ;
  411. return self},
  412. args: [],
  413. source: "name\x0a\x09<return self.className || nil>",
  414. messageSends: [],
  415. referencedClasses: []
  416. }),
  417. smalltalk.Behavior);
  418. smalltalk.addMethod(
  419. "_new",
  420. smalltalk.method({
  421. selector: "new",
  422. category: 'instance creation',
  423. fn: function (){
  424. var self=this;
  425. var $1;
  426. $1=smalltalk.send(smalltalk.send(self,"_basicNew",[]),"_initialize",[]);
  427. return $1;
  428. },
  429. args: [],
  430. source: "new\x0a\x09^self basicNew initialize",
  431. messageSends: ["initialize", "basicNew"],
  432. referencedClasses: []
  433. }),
  434. smalltalk.Behavior);
  435. smalltalk.addMethod(
  436. "_organization",
  437. smalltalk.method({
  438. selector: "organization",
  439. category: 'accessing',
  440. fn: function (){
  441. var self=this;
  442. var $1;
  443. $1=smalltalk.send(self,"_basicAt_",["organization"]);
  444. return $1;
  445. },
  446. args: [],
  447. source: "organization\x0a\x09^ self basicAt: 'organization'",
  448. messageSends: ["basicAt:"],
  449. referencedClasses: []
  450. }),
  451. smalltalk.Behavior);
  452. smalltalk.addMethod(
  453. "_protocols",
  454. smalltalk.method({
  455. selector: "protocols",
  456. category: 'accessing',
  457. fn: function (){
  458. var self=this;
  459. var $1;
  460. $1=smalltalk.send(smalltalk.send(smalltalk.send(self,"_organization",[]),"_elements",[]),"_sorted",[]);
  461. return $1;
  462. },
  463. args: [],
  464. source: "protocols\x0a ^ self organization elements sorted",
  465. messageSends: ["sorted", "elements", "organization"],
  466. referencedClasses: []
  467. }),
  468. smalltalk.Behavior);
  469. smalltalk.addMethod(
  470. "_protocolsDo_",
  471. smalltalk.method({
  472. selector: "protocolsDo:",
  473. category: 'accessing',
  474. fn: function (aBlock){
  475. var self=this;
  476. var methodsByCategory;
  477. methodsByCategory=smalltalk.send((smalltalk.HashedCollection || HashedCollection),"_new",[]);
  478. smalltalk.send(smalltalk.send(smalltalk.send(self,"_methodDictionary",[]),"_values",[]),"_do_",[(function(m){
  479. return smalltalk.send(smalltalk.send(methodsByCategory,"_at_ifAbsentPut_",[smalltalk.send(m,"_category",[]),(function(){
  480. return smalltalk.send((smalltalk.Array || Array),"_new",[]);
  481. })]),"_add_",[m]);
  482. })]);
  483. smalltalk.send(smalltalk.send(self,"_protocols",[]),"_do_",[(function(category){
  484. return smalltalk.send(aBlock,"_value_value_",[category,smalltalk.send(methodsByCategory,"_at_",[category])]);
  485. })]);
  486. return self},
  487. args: ["aBlock"],
  488. source: "protocolsDo: aBlock\x0a\x09\x22Execute aBlock for each method category with\x0a\x09its collection of methods in the sort order of category name.\x22\x0a\x0a\x09| methodsByCategory |\x0a\x09methodsByCategory := HashedCollection new.\x0a\x09self methodDictionary values do: [:m |\x0a\x09\x09(methodsByCategory at: m category ifAbsentPut: [Array new])\x0a \x09\x09\x09add: m]. \x0a\x09self protocols do: [:category |\x0a\x09\x09aBlock value: category value: (methodsByCategory at: category)]",
  489. messageSends: ["new", "do:", "add:", "at:ifAbsentPut:", "category", "values", "methodDictionary", "value:value:", "at:", "protocols"],
  490. referencedClasses: ["HashedCollection", "Array"]
  491. }),
  492. smalltalk.Behavior);
  493. smalltalk.addMethod(
  494. "_prototype",
  495. smalltalk.method({
  496. selector: "prototype",
  497. category: 'accessing',
  498. fn: function (){
  499. var self=this;
  500. return self.fn.prototype;
  501. ;
  502. return self},
  503. args: [],
  504. source: "prototype\x0a\x09<return self.fn.prototype>",
  505. messageSends: [],
  506. referencedClasses: []
  507. }),
  508. smalltalk.Behavior);
  509. smalltalk.addMethod(
  510. "_removeCompiledMethod_",
  511. smalltalk.method({
  512. selector: "removeCompiledMethod:",
  513. category: 'compiling',
  514. fn: function (aMethod){
  515. var self=this;
  516. var $1,$2;
  517. smalltalk.removeMethod(aMethod)
  518. smalltalk.init(self);
  519. ;
  520. ;
  521. $1=smalltalk.send((smalltalk.MethodRemoved || MethodRemoved),"_new",[]);
  522. smalltalk.send($1,"_theClass_",[self]);
  523. smalltalk.send($1,"_method_",[aMethod]);
  524. $2=smalltalk.send($1,"_yourself",[]);
  525. smalltalk.send(smalltalk.send((smalltalk.SystemAnnouncer || SystemAnnouncer),"_current",[]),"_announce_",[$2]);
  526. return self},
  527. args: ["aMethod"],
  528. source: "removeCompiledMethod: aMethod\x0a\x09<\x0a \x09smalltalk.removeMethod(aMethod)\x0a\x09\x09smalltalk.init(self);\x0a >.\x0a \x0a SystemAnnouncer current\x0a \x09\x09announce: (MethodRemoved new\x0a \x09theClass: self;\x0a method: aMethod;\x0a yourself)",
  529. messageSends: ["announce:", "theClass:", "new", "method:", "yourself", "current"],
  530. referencedClasses: ["MethodRemoved", "SystemAnnouncer"]
  531. }),
  532. smalltalk.Behavior);
  533. smalltalk.addMethod(
  534. "_selectors",
  535. smalltalk.method({
  536. selector: "selectors",
  537. category: 'accessing',
  538. fn: function (){
  539. var self=this;
  540. var $1;
  541. $1=smalltalk.send(smalltalk.send(self,"_methodDictionary",[]),"_keys",[]);
  542. return $1;
  543. },
  544. args: [],
  545. source: "selectors\x0a\x09^ self methodDictionary keys",
  546. messageSends: ["keys", "methodDictionary"],
  547. referencedClasses: []
  548. }),
  549. smalltalk.Behavior);
  550. smalltalk.addMethod(
  551. "_subclasses",
  552. smalltalk.method({
  553. selector: "subclasses",
  554. category: 'accessing',
  555. fn: function (){
  556. var self=this;
  557. return smalltalk.subclasses(self);
  558. ;
  559. return self},
  560. args: [],
  561. source: "subclasses\x0a\x09<return smalltalk.subclasses(self)>",
  562. messageSends: [],
  563. referencedClasses: []
  564. }),
  565. smalltalk.Behavior);
  566. smalltalk.addMethod(
  567. "_superclass",
  568. smalltalk.method({
  569. selector: "superclass",
  570. category: 'accessing',
  571. fn: function (){
  572. var self=this;
  573. return self.superclass || nil;
  574. ;
  575. return self},
  576. args: [],
  577. source: "superclass\x0a\x09<return self.superclass || nil>",
  578. messageSends: [],
  579. referencedClasses: []
  580. }),
  581. smalltalk.Behavior);
  582. smalltalk.addMethod(
  583. "_theMetaClass",
  584. smalltalk.method({
  585. selector: "theMetaClass",
  586. category: 'accessing',
  587. fn: function (){
  588. var self=this;
  589. var $1;
  590. $1=smalltalk.send(self,"_class",[]);
  591. return $1;
  592. },
  593. args: [],
  594. source: "theMetaClass\x0a\x09^ self class",
  595. messageSends: ["class"],
  596. referencedClasses: []
  597. }),
  598. smalltalk.Behavior);
  599. smalltalk.addMethod(
  600. "_theNonMetaClass",
  601. smalltalk.method({
  602. selector: "theNonMetaClass",
  603. category: 'accessing',
  604. fn: function (){
  605. var self=this;
  606. return self;
  607. },
  608. args: [],
  609. source: "theNonMetaClass\x0a\x09^ self",
  610. messageSends: [],
  611. referencedClasses: []
  612. }),
  613. smalltalk.Behavior);
  614. smalltalk.addMethod(
  615. "_withAllSubclasses",
  616. smalltalk.method({
  617. selector: "withAllSubclasses",
  618. category: 'accessing',
  619. fn: function (){
  620. var self=this;
  621. var $2,$3,$1;
  622. $2=smalltalk.send((smalltalk.Array || Array),"_with_",[self]);
  623. smalltalk.send($2,"_addAll_",[smalltalk.send(self,"_allSubclasses",[])]);
  624. $3=smalltalk.send($2,"_yourself",[]);
  625. $1=$3;
  626. return $1;
  627. },
  628. args: [],
  629. source: "withAllSubclasses\x0a\x09^(Array with: self) addAll: self allSubclasses; yourself",
  630. messageSends: ["addAll:", "allSubclasses", "with:", "yourself"],
  631. referencedClasses: ["Array"]
  632. }),
  633. smalltalk.Behavior);
  634. smalltalk.addClass('Class', smalltalk.Behavior, [], 'Kernel-Classes');
  635. smalltalk.Class.comment="Class is __the__ class object. \x0a\x0aInstances are the classes of the system.\x0aClass creation is done throught a `ClassBuilder`"
  636. smalltalk.addMethod(
  637. "_asJavascript",
  638. smalltalk.method({
  639. selector: "asJavascript",
  640. category: 'converting',
  641. fn: function (){
  642. var self=this;
  643. var $1;
  644. $1=smalltalk.send("smalltalk.","__comma",[smalltalk.send(self,"_name",[])]);
  645. return $1;
  646. },
  647. args: [],
  648. source: "asJavascript\x0a\x09^ 'smalltalk.', self name",
  649. messageSends: [",", "name"],
  650. referencedClasses: []
  651. }),
  652. smalltalk.Class);
  653. smalltalk.addMethod(
  654. "_category",
  655. smalltalk.method({
  656. selector: "category",
  657. category: 'accessing',
  658. fn: function (){
  659. var self=this;
  660. var $2,$1;
  661. $2=smalltalk.send(self,"_package",[]);
  662. if(($receiver = $2) == nil || $receiver == undefined){
  663. $1="Unclassified";
  664. } else {
  665. $1=smalltalk.send(smalltalk.send(self,"_package",[]),"_name",[]);
  666. };
  667. return $1;
  668. },
  669. args: [],
  670. source: "category\x0a\x09^self package ifNil: ['Unclassified'] ifNotNil: [self package name]",
  671. messageSends: ["ifNil:ifNotNil:", "name", "package"],
  672. referencedClasses: []
  673. }),
  674. smalltalk.Class);
  675. smalltalk.addMethod(
  676. "_definition",
  677. smalltalk.method({
  678. selector: "definition",
  679. category: 'accessing',
  680. fn: function (){
  681. var self=this;
  682. var $2,$3,$1;
  683. $1=smalltalk.send((smalltalk.String || String),"_streamContents_",[(function(stream){
  684. smalltalk.send(stream,"_nextPutAll_",[smalltalk.send(smalltalk.send(self,"_superclass",[]),"_asString",[])]);
  685. smalltalk.send(stream,"_nextPutAll_",[" subclass: #"]);
  686. smalltalk.send(stream,"_nextPutAll_",[smalltalk.send(self,"_name",[])]);
  687. smalltalk.send(stream,"_nextPutAll_",[smalltalk.send(smalltalk.send((smalltalk.String || String),"_lf",[]),"__comma",[smalltalk.send((smalltalk.String || String),"_tab",[])])]);
  688. $2=smalltalk.send(stream,"_nextPutAll_",["instanceVariableNames: '"]);
  689. $2;
  690. smalltalk.send(smalltalk.send(self,"_instanceVariableNames",[]),"_do_separatedBy_",[(function(each){
  691. return smalltalk.send(stream,"_nextPutAll_",[each]);
  692. }),(function(){
  693. return smalltalk.send(stream,"_nextPutAll_",[" "]);
  694. })]);
  695. smalltalk.send(stream,"_nextPutAll_",[smalltalk.send(smalltalk.send("'","__comma",[smalltalk.send((smalltalk.String || String),"_lf",[])]),"__comma",[smalltalk.send((smalltalk.String || String),"_tab",[])])]);
  696. smalltalk.send(stream,"_nextPutAll_",["package: '"]);
  697. smalltalk.send(stream,"_nextPutAll_",[smalltalk.send(self,"_category",[])]);
  698. $3=smalltalk.send(stream,"_nextPutAll_",["'"]);
  699. return $3;
  700. })]);
  701. return $1;
  702. },
  703. args: [],
  704. source: "definition\x0a\x09^ String streamContents: [ :stream |\x0a\x09\x09stream \x0a\x09 \x09nextPutAll: self superclass asString;\x0a\x09 \x09nextPutAll: ' subclass: #';\x0a\x09 \x09nextPutAll: self name;\x0a\x09 \x09nextPutAll: String lf, String tab;\x0a\x09 \x09nextPutAll: 'instanceVariableNames: '''.\x0a\x09\x09self instanceVariableNames \x0a \x09do: [ :each | stream nextPutAll: each ] \x0a\x09 \x09separatedBy: [ stream nextPutAll: ' ' ].\x0a\x09\x09stream\x0a\x09 \x09nextPutAll: '''', String lf, String tab;\x0a\x09 \x09nextPutAll: 'package: ''';\x0a\x09 \x09nextPutAll: self category;\x0a\x09 \x09nextPutAll: '''' ]",
  705. messageSends: ["streamContents:", "nextPutAll:", "asString", "superclass", "name", ",", "tab", "lf", "do:separatedBy:", "instanceVariableNames", "category"],
  706. referencedClasses: ["String"]
  707. }),
  708. smalltalk.Class);
  709. smalltalk.addMethod(
  710. "_isClass",
  711. smalltalk.method({
  712. selector: "isClass",
  713. category: 'testing',
  714. fn: function (){
  715. var self=this;
  716. return true;
  717. },
  718. args: [],
  719. source: "isClass\x0a\x09^true",
  720. messageSends: [],
  721. referencedClasses: []
  722. }),
  723. smalltalk.Class);
  724. smalltalk.addMethod(
  725. "_package",
  726. smalltalk.method({
  727. selector: "package",
  728. category: 'accessing',
  729. fn: function (){
  730. var self=this;
  731. return self.pkg;
  732. ;
  733. return self},
  734. args: [],
  735. source: "package\x0a\x09<return self.pkg>",
  736. messageSends: [],
  737. referencedClasses: []
  738. }),
  739. smalltalk.Class);
  740. smalltalk.addMethod(
  741. "_package_",
  742. smalltalk.method({
  743. selector: "package:",
  744. category: 'accessing',
  745. fn: function (aPackage){
  746. var self=this;
  747. self.pkg = aPackage;
  748. ;
  749. return self},
  750. args: ["aPackage"],
  751. source: "package: aPackage\x0a\x09<self.pkg = aPackage>",
  752. messageSends: [],
  753. referencedClasses: []
  754. }),
  755. smalltalk.Class);
  756. smalltalk.addMethod(
  757. "_printString",
  758. smalltalk.method({
  759. selector: "printString",
  760. category: 'printing',
  761. fn: function (){
  762. var self=this;
  763. var $1;
  764. $1=smalltalk.send(self,"_name",[]);
  765. return $1;
  766. },
  767. args: [],
  768. source: "printString\x0a\x09^self name",
  769. messageSends: ["name"],
  770. referencedClasses: []
  771. }),
  772. smalltalk.Class);
  773. smalltalk.addMethod(
  774. "_rename_",
  775. smalltalk.method({
  776. selector: "rename:",
  777. category: 'accessing',
  778. fn: function (aString){
  779. var self=this;
  780. smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder),"_new",[]),"_renameClass_to_",[self,aString]);
  781. return self},
  782. args: ["aString"],
  783. source: "rename: aString\x0a\x09ClassBuilder new renameClass: self to: aString",
  784. messageSends: ["renameClass:to:", "new"],
  785. referencedClasses: ["ClassBuilder"]
  786. }),
  787. smalltalk.Class);
  788. smalltalk.addMethod(
  789. "_subclass_instanceVariableNames_",
  790. smalltalk.method({
  791. selector: "subclass:instanceVariableNames:",
  792. category: 'class creation',
  793. fn: function (aString,anotherString){
  794. var self=this;
  795. var $1;
  796. $1=smalltalk.send(self,"_subclass_instanceVariableNames_package_",[aString,anotherString,nil]);
  797. return $1;
  798. },
  799. args: ["aString", "anotherString"],
  800. source: "subclass: aString instanceVariableNames: anotherString\x0a\x09\x22Kept for compatibility.\x22\x0a\x09^self subclass: aString instanceVariableNames: anotherString package: nil",
  801. messageSends: ["subclass:instanceVariableNames:package:"],
  802. referencedClasses: []
  803. }),
  804. smalltalk.Class);
  805. smalltalk.addMethod(
  806. "_subclass_instanceVariableNames_category_",
  807. smalltalk.method({
  808. selector: "subclass:instanceVariableNames:category:",
  809. category: 'class creation',
  810. fn: function (aString,aString2,aString3){
  811. var self=this;
  812. var $1;
  813. smalltalk.send(self,"_deprecatedAPI",[]);
  814. $1=smalltalk.send(self,"_subclass_instanceVariableNames_package_",[aString,aString2,aString3]);
  815. return $1;
  816. },
  817. args: ["aString", "aString2", "aString3"],
  818. source: "subclass: aString instanceVariableNames: aString2 category: aString3\x0a\x09\x22Kept for compatibility.\x22\x0a\x09self deprecatedAPI.\x0a\x09^self subclass: aString instanceVariableNames: aString2 package: aString3",
  819. messageSends: ["deprecatedAPI", "subclass:instanceVariableNames:package:"],
  820. referencedClasses: []
  821. }),
  822. smalltalk.Class);
  823. smalltalk.addMethod(
  824. "_subclass_instanceVariableNames_classVariableNames_poolDictionaries_category_",
  825. smalltalk.method({
  826. selector: "subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:",
  827. category: 'class creation',
  828. fn: function (aString,aString2,classVars,pools,aString3){
  829. var self=this;
  830. var $1;
  831. $1=smalltalk.send(self,"_subclass_instanceVariableNames_package_",[aString,aString2,aString3]);
  832. return $1;
  833. },
  834. args: ["aString", "aString2", "classVars", "pools", "aString3"],
  835. source: "subclass: aString instanceVariableNames: aString2 classVariableNames: classVars poolDictionaries: pools category: aString3\x0a\x09\x22Just ignore class variables and pools. Added for compatibility.\x22\x0a\x09^self subclass: aString instanceVariableNames: aString2 package: aString3",
  836. messageSends: ["subclass:instanceVariableNames:package:"],
  837. referencedClasses: []
  838. }),
  839. smalltalk.Class);
  840. smalltalk.addMethod(
  841. "_subclass_instanceVariableNames_package_",
  842. smalltalk.method({
  843. selector: "subclass:instanceVariableNames:package:",
  844. category: 'class creation',
  845. fn: function (aString,aString2,aString3){
  846. var self=this;
  847. var $1;
  848. $1=smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder),"_new",[]),"_superclass_subclass_instanceVariableNames_package_",[self,smalltalk.send(aString,"_asString",[]),aString2,aString3]);
  849. return $1;
  850. },
  851. args: ["aString", "aString2", "aString3"],
  852. source: "subclass: aString instanceVariableNames: aString2 package: aString3\x0a\x09^ClassBuilder new\x0a\x09 superclass: self subclass: aString asString instanceVariableNames: aString2 package: aString3",
  853. messageSends: ["superclass:subclass:instanceVariableNames:package:", "asString", "new"],
  854. referencedClasses: ["ClassBuilder"]
  855. }),
  856. smalltalk.Class);
  857. smalltalk.addClass('Metaclass', smalltalk.Behavior, [], 'Kernel-Classes');
  858. smalltalk.Metaclass.comment="Metaclass is the root of the class hierarchy.\x0a\x0aMetaclass instances are metaclasses, one for each real class. \x0aMetaclass instances have a single instance, which they hold onto, which is the class that they are the metaclass of."
  859. smalltalk.addMethod(
  860. "_asJavascript",
  861. smalltalk.method({
  862. selector: "asJavascript",
  863. category: 'converting',
  864. fn: function (){
  865. var self=this;
  866. var $1;
  867. $1=smalltalk.send(smalltalk.send("smalltalk.","__comma",[smalltalk.send(smalltalk.send(self,"_instanceClass",[]),"_name",[])]),"__comma",[".klass"]);
  868. return $1;
  869. },
  870. args: [],
  871. source: "asJavascript\x0a\x09^ 'smalltalk.', self instanceClass name, '.klass'",
  872. messageSends: [",", "name", "instanceClass"],
  873. referencedClasses: []
  874. }),
  875. smalltalk.Metaclass);
  876. smalltalk.addMethod(
  877. "_definition",
  878. smalltalk.method({
  879. selector: "definition",
  880. category: 'accessing',
  881. fn: function (){
  882. var self=this;
  883. var $2,$1;
  884. $1=smalltalk.send((smalltalk.String || String),"_streamContents_",[(function(stream){
  885. smalltalk.send(stream,"_nextPutAll_",[smalltalk.send(self,"_asString",[])]);
  886. smalltalk.send(stream,"_nextPutAll_",[" class "]);
  887. $2=smalltalk.send(stream,"_nextPutAll_",["instanceVariableNames: '"]);
  888. $2;
  889. smalltalk.send(smalltalk.send(self,"_instanceVariableNames",[]),"_do_separatedBy_",[(function(each){
  890. return smalltalk.send(stream,"_nextPutAll_",[each]);
  891. }),(function(){
  892. return smalltalk.send(stream,"_nextPutAll_",[" "]);
  893. })]);
  894. return smalltalk.send(stream,"_nextPutAll_",["'"]);
  895. })]);
  896. return $1;
  897. },
  898. args: [],
  899. source: "definition\x0a\x09^ String streamContents: [ :stream |\x0a\x09\x09stream \x0a\x09 \x09 \x09nextPutAll: self asString;\x0a\x09 \x09nextPutAll: ' class ';\x0a\x09 \x09nextPutAll: 'instanceVariableNames: '''.\x0a\x09\x09self instanceVariableNames\x0a\x09 \x09do: [ :each | stream nextPutAll: each ]\x0a\x09 \x09separatedBy: [ stream nextPutAll: ' ' ].\x0a\x09\x09stream nextPutAll: '''' ]",
  900. messageSends: ["streamContents:", "nextPutAll:", "asString", "do:separatedBy:", "instanceVariableNames"],
  901. referencedClasses: ["String"]
  902. }),
  903. smalltalk.Metaclass);
  904. smalltalk.addMethod(
  905. "_instanceClass",
  906. smalltalk.method({
  907. selector: "instanceClass",
  908. category: 'accessing',
  909. fn: function (){
  910. var self=this;
  911. return self.instanceClass;
  912. ;
  913. return self},
  914. args: [],
  915. source: "instanceClass\x0a\x09<return self.instanceClass>",
  916. messageSends: [],
  917. referencedClasses: []
  918. }),
  919. smalltalk.Metaclass);
  920. smalltalk.addMethod(
  921. "_instanceVariableNames_",
  922. smalltalk.method({
  923. selector: "instanceVariableNames:",
  924. category: 'accessing',
  925. fn: function (aCollection){
  926. var self=this;
  927. smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder),"_new",[]),"_class_instanceVariableNames_",[self,aCollection]);
  928. return self},
  929. args: ["aCollection"],
  930. source: "instanceVariableNames: aCollection\x0a\x09ClassBuilder new\x0a\x09 class: self instanceVariableNames: aCollection",
  931. messageSends: ["class:instanceVariableNames:", "new"],
  932. referencedClasses: ["ClassBuilder"]
  933. }),
  934. smalltalk.Metaclass);
  935. smalltalk.addMethod(
  936. "_isMetaclass",
  937. smalltalk.method({
  938. selector: "isMetaclass",
  939. category: 'testing',
  940. fn: function (){
  941. var self=this;
  942. return true;
  943. },
  944. args: [],
  945. source: "isMetaclass\x0a\x09^true",
  946. messageSends: [],
  947. referencedClasses: []
  948. }),
  949. smalltalk.Metaclass);
  950. smalltalk.addMethod(
  951. "_printString",
  952. smalltalk.method({
  953. selector: "printString",
  954. category: 'printing',
  955. fn: function (){
  956. var self=this;
  957. var $1;
  958. $1=smalltalk.send(smalltalk.send(smalltalk.send(self,"_instanceClass",[]),"_name",[]),"__comma",[" class"]);
  959. return $1;
  960. },
  961. args: [],
  962. source: "printString\x0a\x09^self instanceClass name, ' class'",
  963. messageSends: [",", "name", "instanceClass"],
  964. referencedClasses: []
  965. }),
  966. smalltalk.Metaclass);
  967. smalltalk.addMethod(
  968. "_theMetaClass",
  969. smalltalk.method({
  970. selector: "theMetaClass",
  971. category: 'accessing',
  972. fn: function (){
  973. var self=this;
  974. return self;
  975. },
  976. args: [],
  977. source: "theMetaClass\x0a\x09^ self",
  978. messageSends: [],
  979. referencedClasses: []
  980. }),
  981. smalltalk.Metaclass);
  982. smalltalk.addMethod(
  983. "_theNonMetaClass",
  984. smalltalk.method({
  985. selector: "theNonMetaClass",
  986. category: 'accessing',
  987. fn: function (){
  988. var self=this;
  989. var $1;
  990. $1=smalltalk.send(self,"_instanceClass",[]);
  991. return $1;
  992. },
  993. args: [],
  994. source: "theNonMetaClass\x0a\x09^ self instanceClass",
  995. messageSends: ["instanceClass"],
  996. referencedClasses: []
  997. }),
  998. smalltalk.Metaclass);
  999. smalltalk.addClass('ClassBuilder', smalltalk.Object, [], 'Kernel-Classes');
  1000. smalltalk.ClassBuilder.comment="ClassBuilder is responsible for compiling new classes or modifying existing classes in the system.\x0a\x0aRather than using ClassBuilder directly to compile a class, use `Class >> subclass:instanceVariableNames:package:`."
  1001. smalltalk.addMethod(
  1002. "_addSubclassOf_named_instanceVariableNames_",
  1003. smalltalk.method({
  1004. selector: "addSubclassOf:named:instanceVariableNames:",
  1005. category: 'private',
  1006. fn: function (aClass,aString,aCollection){
  1007. var self=this;
  1008. smalltalk.addClass(aString, aClass, aCollection);
  1009. return smalltalk[aString];
  1010. ;
  1011. return self},
  1012. args: ["aClass", "aString", "aCollection"],
  1013. source: "addSubclassOf: aClass named: aString instanceVariableNames: aCollection\x0a\x09<smalltalk.addClass(aString, aClass, aCollection);\x0a\x09 return smalltalk[aString]>",
  1014. messageSends: [],
  1015. referencedClasses: []
  1016. }),
  1017. smalltalk.ClassBuilder);
  1018. smalltalk.addMethod(
  1019. "_addSubclassOf_named_instanceVariableNames_package_",
  1020. smalltalk.method({
  1021. selector: "addSubclassOf:named:instanceVariableNames:package:",
  1022. category: 'private',
  1023. fn: function (aClass,aString,aCollection,packageName){
  1024. var self=this;
  1025. smalltalk.addClass(aString, aClass, aCollection, packageName);
  1026. return smalltalk[aString];
  1027. ;
  1028. return self},
  1029. args: ["aClass", "aString", "aCollection", "packageName"],
  1030. source: "addSubclassOf: aClass named: aString instanceVariableNames: aCollection package: packageName\x0a\x09<smalltalk.addClass(aString, aClass, aCollection, packageName);\x0a\x09 return smalltalk[aString]>",
  1031. messageSends: [],
  1032. referencedClasses: []
  1033. }),
  1034. smalltalk.ClassBuilder);
  1035. smalltalk.addMethod(
  1036. "_class_instanceVariableNames_",
  1037. smalltalk.method({
  1038. selector: "class:instanceVariableNames:",
  1039. category: 'class creation',
  1040. fn: function (aClass,aString){
  1041. var self=this;
  1042. var $1,$2,$3;
  1043. $1=smalltalk.send(aClass,"_isMetaclass",[]);
  1044. if(! smalltalk.assert($1)){
  1045. smalltalk.send(self,"_error_",[smalltalk.send(smalltalk.send(aClass,"_name",[]),"__comma",[" is not a metaclass"])]);
  1046. };
  1047. smalltalk.send(aClass,"_basicAt_put_",["iVarNames",smalltalk.send(self,"_instanceVariableNamesFor_",[aString])]);
  1048. $2=smalltalk.send((smalltalk.ClassDefinitionChanged || ClassDefinitionChanged),"_new",[]);
  1049. smalltalk.send($2,"_theClass_",[aClass]);
  1050. $3=smalltalk.send($2,"_yourself",[]);
  1051. smalltalk.send(smalltalk.send((smalltalk.SystemAnnouncer || SystemAnnouncer),"_current",[]),"_announce_",[$3]);
  1052. smalltalk.send(self,"_setupClass_",[aClass]);
  1053. return self},
  1054. args: ["aClass", "aString"],
  1055. source: "class: aClass instanceVariableNames: aString\x0a\x09aClass isMetaclass ifFalse: [self error: aClass name, ' is not a metaclass'].\x0a\x09aClass basicAt: 'iVarNames' put: (self instanceVariableNamesFor: aString).\x0a \x0a SystemAnnouncer current\x0a \x09announce: (ClassDefinitionChanged new\x0a \x09theClass: aClass;\x0a yourself).\x0a \x0a\x09self setupClass: aClass",
  1056. messageSends: ["ifFalse:", "error:", ",", "name", "isMetaclass", "basicAt:put:", "instanceVariableNamesFor:", "announce:", "theClass:", "new", "yourself", "current", "setupClass:"],
  1057. referencedClasses: ["ClassDefinitionChanged", "SystemAnnouncer"]
  1058. }),
  1059. smalltalk.ClassBuilder);
  1060. smalltalk.addMethod(
  1061. "_copyClass_named_",
  1062. smalltalk.method({
  1063. selector: "copyClass:named:",
  1064. category: 'private',
  1065. fn: function (aClass,aString){
  1066. var self=this;
  1067. var newClass;
  1068. newClass=smalltalk.send(self,"_addSubclassOf_named_instanceVariableNames_package_",[smalltalk.send(aClass,"_superclass",[]),aString,smalltalk.send(aClass,"_instanceVariableNames",[]),smalltalk.send(smalltalk.send(aClass,"_package",[]),"_name",[])]);
  1069. smalltalk.send(self,"_setupClass_",[newClass]);
  1070. smalltalk.send(smalltalk.send(smalltalk.send(aClass,"_methodDictionary",[]),"_values",[]),"_do_",[(function(each){
  1071. return smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler),"_new",[]),"_install_forClass_category_",[smalltalk.send(each,"_source",[]),newClass,smalltalk.send(each,"_category",[])]);
  1072. })]);
  1073. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass,"_class",[]),"_methodDictionary",[]),"_values",[]),"_do_",[(function(each){
  1074. return smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler),"_new",[]),"_install_forClass_category_",[smalltalk.send(each,"_source",[]),smalltalk.send(newClass,"_class",[]),smalltalk.send(each,"_category",[])]);
  1075. })]);
  1076. smalltalk.send(self,"_setupClass_",[newClass]);
  1077. return newClass;
  1078. },
  1079. args: ["aClass", "aString"],
  1080. source: "copyClass: aClass named: aString\x0a\x09| newClass |\x0a\x0a\x09newClass := self \x0a\x09\x09addSubclassOf: aClass superclass\x0a\x09\x09named: aString \x0a\x09\x09instanceVariableNames: aClass instanceVariableNames \x0a\x09\x09package: aClass package name.\x0a\x0a\x09self setupClass: newClass.\x0a\x0a\x09aClass methodDictionary values do: [:each |\x0a\x09\x09Compiler new install: each source forClass: newClass category: each category].\x0a\x0a\x09aClass class methodDictionary values do: [:each |\x0a\x09\x09Compiler new install: each source forClass: newClass class category: each category].\x0a\x0a\x09self setupClass: newClass.\x0a\x09^newClass",
  1081. messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "superclass", "instanceVariableNames", "name", "package", "setupClass:", "do:", "install:forClass:category:", "source", "category", "new", "values", "methodDictionary", "class"],
  1082. referencedClasses: ["Compiler"]
  1083. }),
  1084. smalltalk.ClassBuilder);
  1085. smalltalk.addMethod(
  1086. "_instanceVariableNamesFor_",
  1087. smalltalk.method({
  1088. selector: "instanceVariableNamesFor:",
  1089. category: 'private',
  1090. fn: function (aString){
  1091. var self=this;
  1092. var $1;
  1093. $1=smalltalk.send(smalltalk.send(aString,"_tokenize_",[" "]),"_reject_",[(function(each){
  1094. return smalltalk.send(each,"_isEmpty",[]);
  1095. })]);
  1096. return $1;
  1097. },
  1098. args: ["aString"],
  1099. source: "instanceVariableNamesFor: aString\x0a\x09^(aString tokenize: ' ') reject: [:each | each isEmpty]",
  1100. messageSends: ["reject:", "isEmpty", "tokenize:"],
  1101. referencedClasses: []
  1102. }),
  1103. smalltalk.ClassBuilder);
  1104. smalltalk.addMethod(
  1105. "_renameClass_to_",
  1106. smalltalk.method({
  1107. selector: "renameClass:to:",
  1108. category: 'class creation',
  1109. fn: function (aClass,aString){
  1110. var self=this;
  1111. var $1,$2;
  1112. smalltalk[aString] = aClass;
  1113. delete smalltalk[aClass.className];
  1114. aClass.className = aString;
  1115. ;
  1116. ;
  1117. $1=smalltalk.send((smalltalk.ClassRenamed || ClassRenamed),"_new",[]);
  1118. smalltalk.send($1,"_theClass_",[aClass]);
  1119. $2=smalltalk.send($1,"_yourself",[]);
  1120. smalltalk.send(smalltalk.send((smalltalk.SystemAnnouncer || SystemAnnouncer),"_current",[]),"_announce_",[$2]);
  1121. return self},
  1122. args: ["aClass", "aString"],
  1123. source: "renameClass: aClass to: aString\x0a\x09<\x0a\x09\x09smalltalk[aString] = aClass;\x0a\x09\x09delete smalltalk[aClass.className];\x0a\x09\x09aClass.className = aString;\x0a\x09>.\x0a \x0a SystemAnnouncer current\x0a \x09announce: (ClassRenamed new\x0a \x09theClass: aClass;\x0a yourself)\x0a \x09",
  1124. messageSends: ["announce:", "theClass:", "new", "yourself", "current"],
  1125. referencedClasses: ["ClassRenamed", "SystemAnnouncer"]
  1126. }),
  1127. smalltalk.ClassBuilder);
  1128. smalltalk.addMethod(
  1129. "_setupClass_",
  1130. smalltalk.method({
  1131. selector: "setupClass:",
  1132. category: 'private',
  1133. fn: function (aClass){
  1134. var self=this;
  1135. smalltalk.init(aClass);;
  1136. ;
  1137. return self},
  1138. args: ["aClass"],
  1139. source: "setupClass: aClass\x0a\x09<smalltalk.init(aClass);>",
  1140. messageSends: [],
  1141. referencedClasses: []
  1142. }),
  1143. smalltalk.ClassBuilder);
  1144. smalltalk.addMethod(
  1145. "_superclass_subclass_",
  1146. smalltalk.method({
  1147. selector: "superclass:subclass:",
  1148. category: 'class creation',
  1149. fn: function (aClass,aString){
  1150. var self=this;
  1151. var $1;
  1152. $1=smalltalk.send(self,"_superclass_subclass_instanceVariableNames_package_",[aClass,aString,"",nil]);
  1153. return $1;
  1154. },
  1155. args: ["aClass", "aString"],
  1156. source: "superclass: aClass subclass: aString\x0a\x09^self superclass: aClass subclass: aString instanceVariableNames: '' package: nil",
  1157. messageSends: ["superclass:subclass:instanceVariableNames:package:"],
  1158. referencedClasses: []
  1159. }),
  1160. smalltalk.ClassBuilder);
  1161. smalltalk.addMethod(
  1162. "_superclass_subclass_instanceVariableNames_package_",
  1163. smalltalk.method({
  1164. selector: "superclass:subclass:instanceVariableNames:package:",
  1165. category: 'class creation',
  1166. fn: function (aClass,aString,aString2,aString3){
  1167. var self=this;
  1168. var $1,$2,$3;
  1169. var newClass;
  1170. if(($receiver = aString3) == nil || $receiver == undefined){
  1171. $1="unclassified";
  1172. } else {
  1173. $1=aString3;
  1174. };
  1175. newClass=smalltalk.send(self,"_addSubclassOf_named_instanceVariableNames_package_",[aClass,aString,smalltalk.send(self,"_instanceVariableNamesFor_",[aString2]),$1]);
  1176. smalltalk.send(self,"_setupClass_",[newClass]);
  1177. $2=smalltalk.send((smalltalk.ClassAdded || ClassAdded),"_new",[]);
  1178. smalltalk.send($2,"_theClass_",[newClass]);
  1179. $3=smalltalk.send($2,"_yourself",[]);
  1180. smalltalk.send(smalltalk.send((smalltalk.SystemAnnouncer || SystemAnnouncer),"_current",[]),"_announce_",[$3]);
  1181. return newClass;
  1182. },
  1183. args: ["aClass", "aString", "aString2", "aString3"],
  1184. source: "superclass: aClass subclass: aString instanceVariableNames: aString2 package: aString3\x0a\x09| newClass |\x0a\x09\x0a newClass := self addSubclassOf: aClass\x0a\x09\x09named: aString instanceVariableNames: (self instanceVariableNamesFor: aString2)\x0a\x09\x09package: (aString3 ifNil: ['unclassified']).\x0a\x09self setupClass: newClass.\x0a \x0a SystemAnnouncer current \x0a \x09announce: (ClassAdded new\x0a \x09theClass: newClass;\x0a yourself).\x0a \x0a\x09^newClass",
  1185. messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "instanceVariableNamesFor:", "ifNil:", "setupClass:", "announce:", "theClass:", "new", "yourself", "current"],
  1186. referencedClasses: ["ClassAdded", "SystemAnnouncer"]
  1187. }),
  1188. smalltalk.ClassBuilder);
  1189. smalltalk.addClass('ClassCategoryReader', smalltalk.Object, ['class', 'category'], 'Kernel-Classes');
  1190. smalltalk.ClassCategoryReader.comment="ClassCategoryReader represents a mechanism for retrieving class descriptions stored on a file."
  1191. smalltalk.addMethod(
  1192. "_class_category_",
  1193. smalltalk.method({
  1194. selector: "class:category:",
  1195. category: 'accessing',
  1196. fn: function (aClass,aString){
  1197. var self=this;
  1198. self["@class"]=aClass;
  1199. self["@category"]=aString;
  1200. return self},
  1201. args: ["aClass", "aString"],
  1202. source: "class: aClass category: aString\x0a\x09class := aClass.\x0a\x09category := aString",
  1203. messageSends: [],
  1204. referencedClasses: []
  1205. }),
  1206. smalltalk.ClassCategoryReader);
  1207. smalltalk.addMethod(
  1208. "_compileMethod_",
  1209. smalltalk.method({
  1210. selector: "compileMethod:",
  1211. category: 'private',
  1212. fn: function (aString){
  1213. var self=this;
  1214. smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler),"_new",[]),"_install_forClass_category_",[aString,self["@class"],self["@category"]]);
  1215. return self},
  1216. args: ["aString"],
  1217. source: "compileMethod: aString\x0a\x09Compiler new install: aString forClass: class category: category",
  1218. messageSends: ["install:forClass:category:", "new"],
  1219. referencedClasses: ["Compiler"]
  1220. }),
  1221. smalltalk.ClassCategoryReader);
  1222. smalltalk.addMethod(
  1223. "_initialize",
  1224. smalltalk.method({
  1225. selector: "initialize",
  1226. category: 'initialization',
  1227. fn: function (){
  1228. var self=this;
  1229. smalltalk.send(self,"_initialize",[],smalltalk.Object);
  1230. return self},
  1231. args: [],
  1232. source: "initialize\x0a\x09super initialize.",
  1233. messageSends: ["initialize"],
  1234. referencedClasses: []
  1235. }),
  1236. smalltalk.ClassCategoryReader);
  1237. smalltalk.addMethod(
  1238. "_scanFrom_",
  1239. smalltalk.method({
  1240. selector: "scanFrom:",
  1241. category: 'fileIn',
  1242. fn: function (aChunkParser){
  1243. var self=this;
  1244. var chunk;
  1245. smalltalk.send((function(){
  1246. chunk=smalltalk.send(aChunkParser,"_nextChunk",[]);
  1247. chunk;
  1248. return smalltalk.send(chunk,"_isEmpty",[]);
  1249. }),"_whileFalse_",[(function(){
  1250. return smalltalk.send(self,"_compileMethod_",[chunk]);
  1251. })]);
  1252. smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler),"_new",[]),"_setupClass_",[self["@class"]]);
  1253. return self},
  1254. args: ["aChunkParser"],
  1255. source: "scanFrom: aChunkParser\x0a\x09| chunk |\x0a\x09[chunk := aChunkParser nextChunk.\x0a\x09chunk isEmpty] whileFalse: [\x0a\x09 self compileMethod: chunk].\x0a\x09Compiler new setupClass: class",
  1256. messageSends: ["whileFalse:", "compileMethod:", "nextChunk", "isEmpty", "setupClass:", "new"],
  1257. referencedClasses: ["Compiler"]
  1258. }),
  1259. smalltalk.ClassCategoryReader);
  1260. smalltalk.addClass('ClassCommentReader', smalltalk.Object, ['class'], 'Kernel-Classes');
  1261. smalltalk.ClassCommentReader.comment="ClassCommentReader represents a mechanism for retrieving class descriptions stored on a file.\x0aSee `ClassCategoryReader` too."
  1262. smalltalk.addMethod(
  1263. "_class_",
  1264. smalltalk.method({
  1265. selector: "class:",
  1266. category: 'accessing',
  1267. fn: function (aClass){
  1268. var self=this;
  1269. self["@class"]=aClass;
  1270. return self},
  1271. args: ["aClass"],
  1272. source: "class: aClass\x0a\x09class := aClass",
  1273. messageSends: [],
  1274. referencedClasses: []
  1275. }),
  1276. smalltalk.ClassCommentReader);
  1277. smalltalk.addMethod(
  1278. "_initialize",
  1279. smalltalk.method({
  1280. selector: "initialize",
  1281. category: 'initialization',
  1282. fn: function (){
  1283. var self=this;
  1284. smalltalk.send(self,"_initialize",[],smalltalk.Object);
  1285. return self},
  1286. args: [],
  1287. source: "initialize\x0a\x09super initialize.",
  1288. messageSends: ["initialize"],
  1289. referencedClasses: []
  1290. }),
  1291. smalltalk.ClassCommentReader);
  1292. smalltalk.addMethod(
  1293. "_scanFrom_",
  1294. smalltalk.method({
  1295. selector: "scanFrom:",
  1296. category: 'fileIn',
  1297. fn: function (aChunkParser){
  1298. var self=this;
  1299. var $1;
  1300. var chunk;
  1301. chunk=smalltalk.send(aChunkParser,"_nextChunk",[]);
  1302. $1=smalltalk.send(chunk,"_isEmpty",[]);
  1303. if(! smalltalk.assert($1)){
  1304. smalltalk.send(self,"_setComment_",[chunk]);
  1305. };
  1306. return self},
  1307. args: ["aChunkParser"],
  1308. source: "scanFrom: aChunkParser\x0a\x09| chunk |\x0a\x09chunk := aChunkParser nextChunk.\x0a\x09chunk isEmpty ifFalse: [\x0a\x09 self setComment: chunk].",
  1309. messageSends: ["nextChunk", "ifFalse:", "setComment:", "isEmpty"],
  1310. referencedClasses: []
  1311. }),
  1312. smalltalk.ClassCommentReader);
  1313. smalltalk.addMethod(
  1314. "_setComment_",
  1315. smalltalk.method({
  1316. selector: "setComment:",
  1317. category: 'private',
  1318. fn: function (aString){
  1319. var self=this;
  1320. smalltalk.send(self["@class"],"_comment_",[aString]);
  1321. return self},
  1322. args: ["aString"],
  1323. source: "setComment: aString\x0a class comment: aString",
  1324. messageSends: ["comment:"],
  1325. referencedClasses: []
  1326. }),
  1327. smalltalk.ClassCommentReader);
  1328. smalltalk.addClass('ClassSorterNode', smalltalk.Object, ['theClass', 'level', 'nodes'], 'Kernel-Classes');
  1329. smalltalk.addMethod(
  1330. "_getNodesFrom_",
  1331. smalltalk.method({
  1332. selector: "getNodesFrom:",
  1333. category: 'accessing',
  1334. fn: function (aCollection){
  1335. var self=this;
  1336. var $1;
  1337. var children;
  1338. var others;
  1339. children=[];
  1340. others=[];
  1341. smalltalk.send(aCollection,"_do_",[(function(each){
  1342. $1=smalltalk.send(smalltalk.send(each,"_superclass",[]),"__eq",[smalltalk.send(self,"_theClass",[])]);
  1343. if(smalltalk.assert($1)){
  1344. return smalltalk.send(children,"_add_",[each]);
  1345. } else {
  1346. return smalltalk.send(others,"_add_",[each]);
  1347. };
  1348. })]);
  1349. self["@nodes"]=smalltalk.send(children,"_collect_",[(function(each){
  1350. return smalltalk.send((smalltalk.ClassSorterNode || ClassSorterNode),"_on_classes_level_",[each,others,smalltalk.send(smalltalk.send(self,"_level",[]),"__plus",[(1)])]);
  1351. })]);
  1352. return self},
  1353. args: ["aCollection"],
  1354. source: "getNodesFrom: aCollection\x0a\x09| children others |\x0a\x09children := #().\x0a\x09others := #().\x0a\x09aCollection do: [:each |\x0a\x09\x09(each superclass = self theClass)\x0a\x09\x09\x09ifTrue: [children add: each]\x0a\x09\x09\x09ifFalse: [others add: each]].\x0a\x09nodes:= children collect: [:each |\x0a\x09\x09ClassSorterNode on: each classes: others level: self level + 1]",
  1355. messageSends: ["do:", "ifTrue:ifFalse:", "add:", "=", "theClass", "superclass", "collect:", "on:classes:level:", "+", "level"],
  1356. referencedClasses: ["ClassSorterNode"]
  1357. }),
  1358. smalltalk.ClassSorterNode);
  1359. smalltalk.addMethod(
  1360. "_level",
  1361. smalltalk.method({
  1362. selector: "level",
  1363. category: 'accessing',
  1364. fn: function (){
  1365. var self=this;
  1366. return self["@level"];
  1367. },
  1368. args: [],
  1369. source: "level\x0a\x09^level",
  1370. messageSends: [],
  1371. referencedClasses: []
  1372. }),
  1373. smalltalk.ClassSorterNode);
  1374. smalltalk.addMethod(
  1375. "_level_",
  1376. smalltalk.method({
  1377. selector: "level:",
  1378. category: 'accessing',
  1379. fn: function (anInteger){
  1380. var self=this;
  1381. self["@level"]=anInteger;
  1382. return self},
  1383. args: ["anInteger"],
  1384. source: "level: anInteger\x0a\x09level := anInteger",
  1385. messageSends: [],
  1386. referencedClasses: []
  1387. }),
  1388. smalltalk.ClassSorterNode);
  1389. smalltalk.addMethod(
  1390. "_nodes",
  1391. smalltalk.method({
  1392. selector: "nodes",
  1393. category: 'accessing',
  1394. fn: function (){
  1395. var self=this;
  1396. return self["@nodes"];
  1397. },
  1398. args: [],
  1399. source: "nodes\x0a\x09^nodes",
  1400. messageSends: [],
  1401. referencedClasses: []
  1402. }),
  1403. smalltalk.ClassSorterNode);
  1404. smalltalk.addMethod(
  1405. "_theClass",
  1406. smalltalk.method({
  1407. selector: "theClass",
  1408. category: 'accessing',
  1409. fn: function (){
  1410. var self=this;
  1411. return self["@theClass"];
  1412. },
  1413. args: [],
  1414. source: "theClass\x0a\x09^theClass",
  1415. messageSends: [],
  1416. referencedClasses: []
  1417. }),
  1418. smalltalk.ClassSorterNode);
  1419. smalltalk.addMethod(
  1420. "_theClass_",
  1421. smalltalk.method({
  1422. selector: "theClass:",
  1423. category: 'accessing',
  1424. fn: function (aClass){
  1425. var self=this;
  1426. self["@theClass"]=aClass;
  1427. return self},
  1428. args: ["aClass"],
  1429. source: "theClass: aClass\x0a\x09theClass := aClass",
  1430. messageSends: [],
  1431. referencedClasses: []
  1432. }),
  1433. smalltalk.ClassSorterNode);
  1434. smalltalk.addMethod(
  1435. "_traverseClassesWith_",
  1436. smalltalk.method({
  1437. selector: "traverseClassesWith:",
  1438. category: 'visiting',
  1439. fn: function (aCollection){
  1440. var self=this;
  1441. smalltalk.send(aCollection,"_add_",[smalltalk.send(self,"_theClass",[])]);
  1442. smalltalk.send(smalltalk.send(smalltalk.send(self,"_nodes",[]),"_sorted_",[(function(a,b){
  1443. return smalltalk.send(smalltalk.send(smalltalk.send(a,"_theClass",[]),"_name",[]),"__lt_eq",[smalltalk.send(smalltalk.send(b,"_theClass",[]),"_name",[])]);
  1444. })]),"_do_",[(function(aNode){
  1445. return smalltalk.send(aNode,"_traverseClassesWith_",[aCollection]);
  1446. })]);
  1447. return self},
  1448. args: ["aCollection"],
  1449. source: "traverseClassesWith: aCollection\x0a\x09\x22sort classes alphabetically Issue #143\x22\x0a\x0a\x09aCollection add: self theClass.\x0a\x09(self nodes sorted: [:a :b | a theClass name <= b theClass name ]) do: [:aNode |\x0a\x09\x09aNode traverseClassesWith: aCollection ].",
  1450. messageSends: ["add:", "theClass", "do:", "traverseClassesWith:", "sorted:", "<=", "name", "nodes"],
  1451. referencedClasses: []
  1452. }),
  1453. smalltalk.ClassSorterNode);
  1454. smalltalk.addMethod(
  1455. "_on_classes_level_",
  1456. smalltalk.method({
  1457. selector: "on:classes:level:",
  1458. category: 'instance creation',
  1459. fn: function (aClass,aCollection,anInteger){
  1460. var self=this;
  1461. var $2,$3,$1;
  1462. $2=smalltalk.send(self,"_new",[]);
  1463. smalltalk.send($2,"_theClass_",[aClass]);
  1464. smalltalk.send($2,"_level_",[anInteger]);
  1465. smalltalk.send($2,"_getNodesFrom_",[aCollection]);
  1466. $3=smalltalk.send($2,"_yourself",[]);
  1467. $1=$3;
  1468. return $1;
  1469. },
  1470. args: ["aClass", "aCollection", "anInteger"],
  1471. source: "on: aClass classes: aCollection level: anInteger\x0a\x09^self new\x0a\x09\x09theClass: aClass;\x0a\x09\x09level: anInteger;\x0a\x09\x09getNodesFrom: aCollection;\x0a\x09\x09yourself",
  1472. messageSends: ["theClass:", "new", "level:", "getNodesFrom:", "yourself"],
  1473. referencedClasses: []
  1474. }),
  1475. smalltalk.ClassSorterNode.klass);