1
0

Kernel-Classes.deploy.js 57 KB

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