Kernel-Classes.deploy.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675
  1. smalltalk.addPackage('Kernel-Classes', {});
  2. smalltalk.addClass('Behavior', smalltalk.Object, [], 'Kernel-Classes');
  3. smalltalk.addMethod(
  4. '_new',
  5. smalltalk.method({
  6. selector: 'new',
  7. fn: function (){
  8. var self=this;
  9. return smalltalk.send(smalltalk.send(self, "_basicNew", []), "_initialize", []);
  10. return self;}
  11. }),
  12. smalltalk.Behavior);
  13. smalltalk.addMethod(
  14. '_basicNew',
  15. smalltalk.method({
  16. selector: 'basicNew',
  17. fn: function (){
  18. var self=this;
  19. return new self.fn();
  20. return self;}
  21. }),
  22. smalltalk.Behavior);
  23. smalltalk.addMethod(
  24. '_name',
  25. smalltalk.method({
  26. selector: 'name',
  27. fn: function (){
  28. var self=this;
  29. return self.className || nil;
  30. return self;}
  31. }),
  32. smalltalk.Behavior);
  33. smalltalk.addMethod(
  34. '_superclass',
  35. smalltalk.method({
  36. selector: 'superclass',
  37. fn: function (){
  38. var self=this;
  39. return self.superclass || nil;
  40. return self;}
  41. }),
  42. smalltalk.Behavior);
  43. smalltalk.addMethod(
  44. '_subclasses',
  45. smalltalk.method({
  46. selector: 'subclasses',
  47. fn: function (){
  48. var self=this;
  49. return smalltalk.subclasses(self);
  50. return self;}
  51. }),
  52. smalltalk.Behavior);
  53. smalltalk.addMethod(
  54. '_allSubclasses',
  55. smalltalk.method({
  56. selector: 'allSubclasses',
  57. fn: function (){
  58. var self=this;
  59. var result=nil;
  60. result=smalltalk.send(self, "_subclasses", []);
  61. smalltalk.send(smalltalk.send(self, "_subclasses", []), "_do_", [(function(each){return smalltalk.send(result, "_addAll_", [smalltalk.send(each, "_allSubclasses", [])]);})]);
  62. return result;
  63. return self;}
  64. }),
  65. smalltalk.Behavior);
  66. smalltalk.addMethod(
  67. '_withAllSubclasses',
  68. smalltalk.method({
  69. selector: 'withAllSubclasses',
  70. fn: function (){
  71. var self=this;
  72. return (function($rec){smalltalk.send($rec, "_addAll_", [smalltalk.send(self, "_allSubclasses", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Array || Array), "_with_", [self]));
  73. return self;}
  74. }),
  75. smalltalk.Behavior);
  76. smalltalk.addMethod(
  77. '_prototype',
  78. smalltalk.method({
  79. selector: 'prototype',
  80. fn: function (){
  81. var self=this;
  82. return self.fn.prototype;
  83. return self;}
  84. }),
  85. smalltalk.Behavior);
  86. smalltalk.addMethod(
  87. '_methodDictionary',
  88. smalltalk.method({
  89. selector: 'methodDictionary',
  90. fn: function (){
  91. var self=this;
  92. var dict = smalltalk.Dictionary._new();
  93. var methods = self.fn.prototype.methods;
  94. for(var i in methods) {
  95. if(methods[i].selector) {
  96. dict._at_put_(methods[i].selector, methods[i]);
  97. }
  98. };
  99. return dict;
  100. return self;}
  101. }),
  102. smalltalk.Behavior);
  103. smalltalk.addMethod(
  104. '_methodsFor_',
  105. smalltalk.method({
  106. selector: 'methodsFor:',
  107. fn: function (aString){
  108. var self=this;
  109. return (function($rec){smalltalk.send($rec, "_class_category_", [self, aString]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.ClassCategoryReader || ClassCategoryReader), "_new", []));
  110. return self;}
  111. }),
  112. smalltalk.Behavior);
  113. smalltalk.addMethod(
  114. '_addCompiledMethod_',
  115. smalltalk.method({
  116. selector: 'addCompiledMethod:',
  117. fn: function (aMethod){
  118. var self=this;
  119. smalltalk.addMethod(aMethod.selector._asSelector(), aMethod, self);
  120. return self;}
  121. }),
  122. smalltalk.Behavior);
  123. smalltalk.addMethod(
  124. '_instanceVariableNames',
  125. smalltalk.method({
  126. selector: 'instanceVariableNames',
  127. fn: function (){
  128. var self=this;
  129. return self.iVarNames;
  130. return self;}
  131. }),
  132. smalltalk.Behavior);
  133. smalltalk.addMethod(
  134. '_comment',
  135. smalltalk.method({
  136. selector: 'comment',
  137. fn: function (){
  138. var self=this;
  139. return (($receiver = smalltalk.send(self, "_basicAt_", ["comment"])) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
  140. return self;}
  141. }),
  142. smalltalk.Behavior);
  143. smalltalk.addMethod(
  144. '_comment_',
  145. smalltalk.method({
  146. selector: 'comment:',
  147. fn: function (aString){
  148. var self=this;
  149. smalltalk.send(self, "_basicAt_put_", ["comment", aString]);
  150. return self;}
  151. }),
  152. smalltalk.Behavior);
  153. smalltalk.addMethod(
  154. '_commentStamp',
  155. smalltalk.method({
  156. selector: 'commentStamp',
  157. fn: function (){
  158. var self=this;
  159. return (function($rec){smalltalk.send($rec, "_class_", [self]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.ClassCommentReader || ClassCommentReader), "_new", []));
  160. return self;}
  161. }),
  162. smalltalk.Behavior);
  163. smalltalk.addMethod(
  164. '_removeCompiledMethod_',
  165. smalltalk.method({
  166. selector: 'removeCompiledMethod:',
  167. fn: function (aMethod){
  168. var self=this;
  169. delete self.fn.prototype[aMethod.selector._asSelector()];
  170. delete self.fn.prototype.methods[aMethod.selector];
  171. smalltalk.init(self);;
  172. return self;}
  173. }),
  174. smalltalk.Behavior);
  175. smalltalk.addMethod(
  176. '_inheritsFrom_',
  177. smalltalk.method({
  178. selector: 'inheritsFrom:',
  179. fn: function (aClass){
  180. var self=this;
  181. return smalltalk.send(smalltalk.send(aClass, "_allSubclasses", []), "_includes_", [self]);
  182. return self;}
  183. }),
  184. smalltalk.Behavior);
  185. smalltalk.addMethod(
  186. '_protocols',
  187. smalltalk.method({
  188. selector: 'protocols',
  189. fn: function (){
  190. var self=this;
  191. var protocols=nil;
  192. protocols=smalltalk.send((smalltalk.Array || Array), "_new", []);
  193. 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", [])]);})]));})]);
  194. return smalltalk.send(protocols, "_sort", []);
  195. return self;}
  196. }),
  197. smalltalk.Behavior);
  198. smalltalk.addMethod(
  199. '_protocolsDo_',
  200. smalltalk.method({
  201. selector: 'protocolsDo:',
  202. fn: function (aBlock){
  203. var self=this;
  204. var methodsByCategory=nil;
  205. methodsByCategory=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []);
  206. 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]);})]);
  207. smalltalk.send(smalltalk.send(self, "_protocols", []), "_do_", [(function(category){return smalltalk.send(aBlock, "_value_value_", [category, smalltalk.send(methodsByCategory, "_at_", [category])]);})]);
  208. return self;}
  209. }),
  210. smalltalk.Behavior);
  211. smalltalk.addMethod(
  212. '_allInstanceVariableNames',
  213. smalltalk.method({
  214. selector: 'allInstanceVariableNames',
  215. fn: function (){
  216. var self=this;
  217. var result=nil;
  218. result=smalltalk.send(smalltalk.send(self, "_instanceVariableNames", []), "_copy", []);
  219. (($receiver = smalltalk.send(self, "_superclass", [])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(result, "_addAll_", [smalltalk.send(smalltalk.send(self, "_superclass", []), "_allInstanceVariableNames", [])]);})() : nil;
  220. return result;
  221. return self;}
  222. }),
  223. smalltalk.Behavior);
  224. smalltalk.addMethod(
  225. '_methodAt_',
  226. smalltalk.method({
  227. selector: 'methodAt:',
  228. fn: function (aString){
  229. var self=this;
  230. return smalltalk.methods(self)[aString];
  231. return self;}
  232. }),
  233. smalltalk.Behavior);
  234. smalltalk.addMethod(
  235. '_methodsFor_stamp_',
  236. smalltalk.method({
  237. selector: 'methodsFor:stamp:',
  238. fn: function (aString, aStamp){
  239. var self=this;
  240. return smalltalk.send(self, "_methodsFor_", [aString]);
  241. return self;}
  242. }),
  243. smalltalk.Behavior);
  244. smalltalk.addMethod(
  245. '_commentStamp_prior_',
  246. smalltalk.method({
  247. selector: 'commentStamp:prior:',
  248. fn: function (aStamp, prior){
  249. var self=this;
  250. return smalltalk.send(self, "_commentStamp", []);
  251. return self;}
  252. }),
  253. smalltalk.Behavior);
  254. smalltalk.addMethod(
  255. '_compile_',
  256. smalltalk.method({
  257. selector: 'compile:',
  258. fn: function (aString){
  259. var self=this;
  260. smalltalk.send(self, "_compile_category_", [aString, ""]);
  261. return self;}
  262. }),
  263. smalltalk.Behavior);
  264. smalltalk.addMethod(
  265. '_compile_category_',
  266. smalltalk.method({
  267. selector: 'compile:category:',
  268. fn: function (aString, anotherString){
  269. var self=this;
  270. var method=nil;
  271. method=smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_load_forClass_", [aString, self]);
  272. smalltalk.send(method, "_category_", [anotherString]);
  273. smalltalk.send(self, "_addCompiledMethod_", [method]);
  274. return self;}
  275. }),
  276. smalltalk.Behavior);
  277. smalltalk.addClass('Class', smalltalk.Behavior, [], 'Kernel-Classes');
  278. smalltalk.addMethod(
  279. '_category',
  280. smalltalk.method({
  281. selector: 'category',
  282. fn: function (){
  283. var self=this;
  284. return (($receiver = smalltalk.send(self, "_package", [])) == nil || $receiver == undefined) ? (function(){return "Unclassified";})() : (function(){return smalltalk.send(smalltalk.send(self, "_package", []), "_name", []);})();
  285. return self;}
  286. }),
  287. smalltalk.Class);
  288. smalltalk.addMethod(
  289. '_subclass_instanceVariableNames_',
  290. smalltalk.method({
  291. selector: 'subclass:instanceVariableNames:',
  292. fn: function (aString, anotherString){
  293. var self=this;
  294. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, anotherString, nil]);
  295. return self;}
  296. }),
  297. smalltalk.Class);
  298. smalltalk.addMethod(
  299. '_subclass_instanceVariableNames_category_',
  300. smalltalk.method({
  301. selector: 'subclass:instanceVariableNames:category:',
  302. fn: function (aString, aString2, aString3){
  303. var self=this;
  304. smalltalk.send(self, "_deprecatedAPI", []);
  305. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
  306. return self;}
  307. }),
  308. smalltalk.Class);
  309. smalltalk.addMethod(
  310. '_isClass',
  311. smalltalk.method({
  312. selector: 'isClass',
  313. fn: function (){
  314. var self=this;
  315. return true;
  316. return self;}
  317. }),
  318. smalltalk.Class);
  319. smalltalk.addMethod(
  320. '_printString',
  321. smalltalk.method({
  322. selector: 'printString',
  323. fn: function (){
  324. var self=this;
  325. return smalltalk.send(self, "_name", []);
  326. return self;}
  327. }),
  328. smalltalk.Class);
  329. smalltalk.addMethod(
  330. '_rename_',
  331. smalltalk.method({
  332. selector: 'rename:',
  333. fn: function (aString){
  334. var self=this;
  335. smalltalk[aString] = self;
  336. delete smalltalk[self.className];
  337. self.className = aString;
  338. ;
  339. return self;}
  340. }),
  341. smalltalk.Class);
  342. smalltalk.addMethod(
  343. '_subclass_instanceVariableNames_classVariableNames_poolDictionaries_category_',
  344. smalltalk.method({
  345. selector: 'subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:',
  346. fn: function (aString, aString2, classVars, pools, aString3){
  347. var self=this;
  348. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
  349. return self;}
  350. }),
  351. smalltalk.Class);
  352. smalltalk.addMethod(
  353. '_package',
  354. smalltalk.method({
  355. selector: 'package',
  356. fn: function (){
  357. var self=this;
  358. return self.pkg;
  359. return self;}
  360. }),
  361. smalltalk.Class);
  362. smalltalk.addMethod(
  363. '_package_',
  364. smalltalk.method({
  365. selector: 'package:',
  366. fn: function (aPackage){
  367. var self=this;
  368. self.pkg = aPackage;
  369. return self;}
  370. }),
  371. smalltalk.Class);
  372. smalltalk.addMethod(
  373. '_subclass_instanceVariableNames_package_',
  374. smalltalk.method({
  375. selector: 'subclass:instanceVariableNames:package:',
  376. fn: function (aString, aString2, aString3){
  377. var self=this;
  378. return smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_superclass_subclass_instanceVariableNames_package_", [self, aString, aString2, aString3]);
  379. return self;}
  380. }),
  381. smalltalk.Class);
  382. smalltalk.addClass('Metaclass', smalltalk.Behavior, [], 'Kernel-Classes');
  383. smalltalk.addMethod(
  384. '_instanceClass',
  385. smalltalk.method({
  386. selector: 'instanceClass',
  387. fn: function (){
  388. var self=this;
  389. return self.instanceClass;
  390. return self;}
  391. }),
  392. smalltalk.Metaclass);
  393. smalltalk.addMethod(
  394. '_instanceVariableNames_',
  395. smalltalk.method({
  396. selector: 'instanceVariableNames:',
  397. fn: function (aCollection){
  398. var self=this;
  399. smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_class_instanceVariableNames_", [self, aCollection]);
  400. return self;}
  401. }),
  402. smalltalk.Metaclass);
  403. smalltalk.addMethod(
  404. '_isMetaclass',
  405. smalltalk.method({
  406. selector: 'isMetaclass',
  407. fn: function (){
  408. var self=this;
  409. return true;
  410. return self;}
  411. }),
  412. smalltalk.Metaclass);
  413. smalltalk.addMethod(
  414. '_printString',
  415. smalltalk.method({
  416. selector: 'printString',
  417. fn: function (){
  418. var self=this;
  419. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_instanceClass", []), "_name", []), "__comma", [" class"]);
  420. return self;}
  421. }),
  422. smalltalk.Metaclass);
  423. smalltalk.addClass('ClassBuilder', smalltalk.Object, [], 'Kernel-Classes');
  424. smalltalk.addMethod(
  425. '_superclass_subclass_',
  426. smalltalk.method({
  427. selector: 'superclass:subclass:',
  428. fn: function (aClass, aString){
  429. var self=this;
  430. return smalltalk.send(self, "_superclass_subclass_instanceVariableNames_package_", [aClass, aString, "", nil]);
  431. return self;}
  432. }),
  433. smalltalk.ClassBuilder);
  434. smalltalk.addMethod(
  435. '_class_instanceVariableNames_',
  436. smalltalk.method({
  437. selector: 'class:instanceVariableNames:',
  438. fn: function (aClass, aString){
  439. var self=this;
  440. ((($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"])]);})]));
  441. smalltalk.send(aClass, "_basicAt_put_", ["iVarNames", smalltalk.send(self, "_instanceVariableNamesFor_", [aString])]);
  442. smalltalk.send(self, "_setupClass_", [aClass]);
  443. return self;}
  444. }),
  445. smalltalk.ClassBuilder);
  446. smalltalk.addMethod(
  447. '_instanceVariableNamesFor_',
  448. smalltalk.method({
  449. selector: 'instanceVariableNamesFor:',
  450. fn: function (aString){
  451. var self=this;
  452. return smalltalk.send(smalltalk.send(aString, "_tokenize_", [" "]), "_reject_", [(function(each){return smalltalk.send(each, "_isEmpty", []);})]);
  453. return self;}
  454. }),
  455. smalltalk.ClassBuilder);
  456. smalltalk.addMethod(
  457. '_addSubclassOf_named_instanceVariableNames_',
  458. smalltalk.method({
  459. selector: 'addSubclassOf:named:instanceVariableNames:',
  460. fn: function (aClass, aString, aCollection){
  461. var self=this;
  462. smalltalk.addClass(aString, aClass, aCollection);
  463. return smalltalk[aString];
  464. return self;}
  465. }),
  466. smalltalk.ClassBuilder);
  467. smalltalk.addMethod(
  468. '_setupClass_',
  469. smalltalk.method({
  470. selector: 'setupClass:',
  471. fn: function (aClass){
  472. var self=this;
  473. smalltalk.init(aClass);;
  474. return self;}
  475. }),
  476. smalltalk.ClassBuilder);
  477. smalltalk.addMethod(
  478. '_superclass_subclass_instanceVariableNames_package_',
  479. smalltalk.method({
  480. selector: 'superclass:subclass:instanceVariableNames:package:',
  481. fn: function (aClass, aString, aString2, aString3){
  482. var self=this;
  483. var newClass=nil;
  484. newClass=smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_package_", [aClass, aString, smalltalk.send(self, "_instanceVariableNamesFor_", [aString2]), (($receiver = aString3) == nil || $receiver == undefined) ? (function(){return "unclassified";})() : $receiver]);
  485. smalltalk.send(self, "_setupClass_", [newClass]);
  486. return newClass;
  487. return self;}
  488. }),
  489. smalltalk.ClassBuilder);
  490. smalltalk.addMethod(
  491. '_addSubclassOf_named_instanceVariableNames_package_',
  492. smalltalk.method({
  493. selector: 'addSubclassOf:named:instanceVariableNames:package:',
  494. fn: function (aClass, aString, aCollection, packageName){
  495. var self=this;
  496. smalltalk.addClass(aString, aClass, aCollection, packageName);
  497. return smalltalk[aString];
  498. return self;}
  499. }),
  500. smalltalk.ClassBuilder);
  501. smalltalk.addMethod(
  502. '_copyClass_named_',
  503. smalltalk.method({
  504. selector: 'copyClass:named:',
  505. fn: function (aClass, aString){
  506. var self=this;
  507. var newClass=nil;
  508. newClass=smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_package_", [smalltalk.send(aClass, "_superclass", []), aString, smalltalk.send(aClass, "_instanceVariableNames", []), smalltalk.send(smalltalk.send(aClass, "_package", []), "_name", [])]);
  509. smalltalk.send(self, "_setupClass_", [newClass]);
  510. 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", [])]);})]);
  511. 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", [])]);})]);
  512. smalltalk.send(self, "_setupClass_", [newClass]);
  513. return newClass;
  514. return self;}
  515. }),
  516. smalltalk.ClassBuilder);
  517. smalltalk.addClass('ClassCategoryReader', smalltalk.Object, ['class', 'category', 'chunkParser'], 'Kernel-Classes');
  518. smalltalk.addMethod(
  519. '_initialize',
  520. smalltalk.method({
  521. selector: 'initialize',
  522. fn: function (){
  523. var self=this;
  524. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  525. self['@chunkParser']=smalltalk.send((smalltalk.ChunkParser || ChunkParser), "_new", []);
  526. return self;}
  527. }),
  528. smalltalk.ClassCategoryReader);
  529. smalltalk.addMethod(
  530. '_class_category_',
  531. smalltalk.method({
  532. selector: 'class:category:',
  533. fn: function (aClass, aString){
  534. var self=this;
  535. self['@class']=aClass;
  536. self['@category']=aString;
  537. return self;}
  538. }),
  539. smalltalk.ClassCategoryReader);
  540. smalltalk.addMethod(
  541. '_scanFrom_',
  542. smalltalk.method({
  543. selector: 'scanFrom:',
  544. fn: function (aChunkParser){
  545. var self=this;
  546. var chunk=nil;
  547. (function(){while(!(function(){chunk=smalltalk.send(aChunkParser, "_nextChunk", []);return smalltalk.send(chunk, "_isEmpty", []);})()) {(function(){return smalltalk.send(self, "_compileMethod_", [chunk]);})()}})();
  548. return self;}
  549. }),
  550. smalltalk.ClassCategoryReader);
  551. smalltalk.addMethod(
  552. '_compileMethod_',
  553. smalltalk.method({
  554. selector: 'compileMethod:',
  555. fn: function (aString){
  556. var self=this;
  557. var method=nil;
  558. method=smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_load_forClass_", [aString, self['@class']]);
  559. smalltalk.send(method, "_category_", [self['@category']]);
  560. smalltalk.send(self['@class'], "_addCompiledMethod_", [method]);
  561. return self;}
  562. }),
  563. smalltalk.ClassCategoryReader);
  564. smalltalk.addClass('ClassCommentReader', smalltalk.Object, ['class', 'chunkParser'], 'Kernel-Classes');
  565. smalltalk.addMethod(
  566. '_class_',
  567. smalltalk.method({
  568. selector: 'class:',
  569. fn: function (aClass){
  570. var self=this;
  571. self['@class']=aClass;
  572. return self;}
  573. }),
  574. smalltalk.ClassCommentReader);
  575. smalltalk.addMethod(
  576. '_scanFrom_',
  577. smalltalk.method({
  578. selector: 'scanFrom:',
  579. fn: function (aChunkParser){
  580. var self=this;
  581. var chunk=nil;
  582. chunk=smalltalk.send(aChunkParser, "_nextChunk", []);
  583. ((($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]);})]));
  584. return self;}
  585. }),
  586. smalltalk.ClassCommentReader);
  587. smalltalk.addMethod(
  588. '_initialize',
  589. smalltalk.method({
  590. selector: 'initialize',
  591. fn: function (){
  592. var self=this;
  593. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  594. self['@chunkParser']=smalltalk.send((smalltalk.ChunkParser || ChunkParser), "_new", []);
  595. return self;}
  596. }),
  597. smalltalk.ClassCommentReader);
  598. smalltalk.addMethod(
  599. '_setComment_',
  600. smalltalk.method({
  601. selector: 'setComment:',
  602. fn: function (aString){
  603. var self=this;
  604. smalltalk.send(self['@class'], "_comment_", [aString]);
  605. return self;}
  606. }),
  607. smalltalk.ClassCommentReader);