Kernel-Classes.deploy.js 55 KB

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