Kernel-Classes.deploy.js 55 KB

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