1
0

Kernel-Classes.deploy.js 56 KB

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