Kernel-Classes.deploy.js 59 KB

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