Kernel-Classes.deploy.js 37 KB

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