2
0

Kernel-Classes.js 46 KB

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