Kernel-Classes.deploy.js 54 KB

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