Kernel-Classes.deploy.js 57 KB

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