2
0

Kernel-Classes.deploy.js 59 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624
  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=_st(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(_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(_st(self)._protocols())._includes_(_st(aMethod)._protocol());
  31. if(! smalltalk.assert($1)){
  32. _st(_st(self)._organization())._addElement_(_st(aMethod)._protocol());
  33. };
  34. _st(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(_st(self)._instanceVariableNames())._copy();
  61. $1=_st(self)._superclass();
  62. if(($receiver = $1) == nil || $receiver == undefined){
  63. $1;
  64. } else {
  65. _st(result)._addAll_(_st(_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(_st(self)._allSuperclasses())._inject_into_(_st(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=_st(self)._subclasses();
  99. _st(_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(_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=_st(self)._superclass();
  131. if(($receiver = $1) == nil || $receiver == undefined){
  132. $2=[];
  133. return $2;
  134. } else {
  135. $1;
  136. };
  137. $4=_st($OrderedCollection())._with_(_st(self)._superclass());
  138. _st($4)._addAll_(_st(_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(_st(self)._methodDictionary())._keys())._includes_(_st(aSelector)._asString()))._or_((function(){
  185. return smalltalk.withContext(function($ctx2) {
  186. return _st(_st(_st(self)._superclass())._notNil())._and_((function(){
  187. return smalltalk.withContext(function($ctx3) {
  188. return _st(_st(self)._superclass())._canUnderstand_(aSelector);
  189. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  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=_st(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. _st(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=_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. smalltalk.method({
  259. selector: "compile:",
  260. fn: function (aString){
  261. var self=this;
  262. return smalltalk.withContext(function($ctx1) {
  263. var $1;
  264. $1=_st(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(_st(self).__eq_eq(aClass))._or_((function(){
  300. return smalltalk.withContext(function($ctx2) {
  301. return _st(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(_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=_st(self)._superclass();
  327. if(($receiver = $1) == nil || $receiver == undefined){
  328. return false;
  329. } else {
  330. $1;
  331. };
  332. $2=_st(_st(aClass).__eq_eq(_st(self)._superclass()))._or_((function(){
  333. return smalltalk.withContext(function($ctx2) {
  334. return _st(_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(_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(_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=_st(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(_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(_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=_st(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(_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(_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({},$ctx1)})})))._add_(m);
  536. }, function($ctx2) {$ctx2.fillBlock({m:m},$ctx1)})}));
  537. _st(_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: "removeCompiledMethod:",
  557. fn: function (aMethod){
  558. var self=this;
  559. function $MethodRemoved(){return smalltalk.MethodRemoved||(typeof MethodRemoved=="undefined"?nil:MethodRemoved)}
  560. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  561. return smalltalk.withContext(function($ctx1) {
  562. var $1,$2;
  563. _st(self)._basicRemoveCompiledMethod_(aMethod);
  564. _st(_st(self)._methods())._detect_ifNone_((function(each){
  565. return smalltalk.withContext(function($ctx2) {
  566. return _st(_st(each)._protocol()).__eq(_st(aMethod)._protocol());
  567. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  568. return smalltalk.withContext(function($ctx2) {
  569. return _st(_st(self)._organization())._removeElement_(_st(aMethod)._protocol());
  570. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  571. $1=_st($MethodRemoved())._new();
  572. _st($1)._method_(aMethod);
  573. $2=_st($1)._yourself();
  574. _st(_st($SystemAnnouncer())._current())._announce_($2);
  575. return self}, function($ctx1) {$ctx1.fill(self,"removeCompiledMethod:",{aMethod:aMethod},smalltalk.Behavior)})},
  576. messageSends: ["basicRemoveCompiledMethod:", "detect:ifNone:", "=", "protocol", "removeElement:", "organization", "methods", "announce:", "method:", "new", "yourself", "current"]}),
  577. smalltalk.Behavior);
  578. smalltalk.addMethod(
  579. smalltalk.method({
  580. selector: "selectors",
  581. fn: function (){
  582. var self=this;
  583. return smalltalk.withContext(function($ctx1) {
  584. var $1;
  585. $1=_st(_st(self)._methodDictionary())._keys();
  586. return $1;
  587. }, function($ctx1) {$ctx1.fill(self,"selectors",{},smalltalk.Behavior)})},
  588. messageSends: ["keys", "methodDictionary"]}),
  589. smalltalk.Behavior);
  590. smalltalk.addMethod(
  591. smalltalk.method({
  592. selector: "subclasses",
  593. fn: function (){
  594. var self=this;
  595. return smalltalk.withContext(function($ctx1) {
  596. return smalltalk.subclasses(self);
  597. return self}, function($ctx1) {$ctx1.fill(self,"subclasses",{},smalltalk.Behavior)})},
  598. messageSends: []}),
  599. smalltalk.Behavior);
  600. smalltalk.addMethod(
  601. smalltalk.method({
  602. selector: "superclass",
  603. fn: function (){
  604. var self=this;
  605. return smalltalk.withContext(function($ctx1) {
  606. return self.superclass || nil;
  607. return self}, function($ctx1) {$ctx1.fill(self,"superclass",{},smalltalk.Behavior)})},
  608. messageSends: []}),
  609. smalltalk.Behavior);
  610. smalltalk.addMethod(
  611. smalltalk.method({
  612. selector: "theMetaClass",
  613. fn: function (){
  614. var self=this;
  615. return smalltalk.withContext(function($ctx1) {
  616. var $1;
  617. $1=_st(self)._class();
  618. return $1;
  619. }, function($ctx1) {$ctx1.fill(self,"theMetaClass",{},smalltalk.Behavior)})},
  620. messageSends: ["class"]}),
  621. smalltalk.Behavior);
  622. smalltalk.addMethod(
  623. smalltalk.method({
  624. selector: "theNonMetaClass",
  625. fn: function (){
  626. var self=this;
  627. return smalltalk.withContext(function($ctx1) {
  628. var $1;
  629. $1=self;
  630. return $1;
  631. }, function($ctx1) {$ctx1.fill(self,"theNonMetaClass",{},smalltalk.Behavior)})},
  632. messageSends: []}),
  633. smalltalk.Behavior);
  634. smalltalk.addMethod(
  635. smalltalk.method({
  636. selector: "withAllSubclasses",
  637. fn: function (){
  638. var self=this;
  639. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  640. return smalltalk.withContext(function($ctx1) {
  641. var $2,$3,$1;
  642. $2=_st($Array())._with_(self);
  643. _st($2)._addAll_(_st(self)._allSubclasses());
  644. $3=_st($2)._yourself();
  645. $1=$3;
  646. return $1;
  647. }, function($ctx1) {$ctx1.fill(self,"withAllSubclasses",{},smalltalk.Behavior)})},
  648. messageSends: ["addAll:", "allSubclasses", "with:", "yourself"]}),
  649. smalltalk.Behavior);
  650. smalltalk.addClass('Class', smalltalk.Behavior, [], 'Kernel-Classes');
  651. smalltalk.addMethod(
  652. smalltalk.method({
  653. selector: "asJavascript",
  654. fn: function (){
  655. var self=this;
  656. return smalltalk.withContext(function($ctx1) {
  657. var $1;
  658. $1=_st("smalltalk.").__comma(_st(self)._name());
  659. return $1;
  660. }, function($ctx1) {$ctx1.fill(self,"asJavascript",{},smalltalk.Class)})},
  661. messageSends: [",", "name"]}),
  662. smalltalk.Class);
  663. smalltalk.addMethod(
  664. smalltalk.method({
  665. selector: "category",
  666. fn: function (){
  667. var self=this;
  668. return smalltalk.withContext(function($ctx1) {
  669. var $2,$1;
  670. $2=_st(self)._package();
  671. if(($receiver = $2) == nil || $receiver == undefined){
  672. $1="Unclassified";
  673. } else {
  674. $1=_st(_st(self)._package())._name();
  675. };
  676. return $1;
  677. }, function($ctx1) {$ctx1.fill(self,"category",{},smalltalk.Class)})},
  678. messageSends: ["ifNil:ifNotNil:", "name", "package"]}),
  679. smalltalk.Class);
  680. smalltalk.addMethod(
  681. smalltalk.method({
  682. selector: "definition",
  683. fn: function (){
  684. var self=this;
  685. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  686. return smalltalk.withContext(function($ctx1) {
  687. var $2,$3,$4,$5,$1;
  688. $1=_st($String())._streamContents_((function(stream){
  689. return smalltalk.withContext(function($ctx2) {
  690. $2=stream;
  691. _st($2)._nextPutAll_(_st(_st(self)._superclass())._asString());
  692. _st($2)._nextPutAll_(" subclass: #");
  693. _st($2)._nextPutAll_(_st(self)._name());
  694. _st($2)._nextPutAll_(_st(_st($String())._lf()).__comma(_st($String())._tab()));
  695. $3=_st($2)._nextPutAll_("instanceVariableNames: '");
  696. $3;
  697. _st(_st(self)._instanceVariableNames())._do_separatedBy_((function(each){
  698. return smalltalk.withContext(function($ctx3) {
  699. return _st(stream)._nextPutAll_(each);
  700. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}),(function(){
  701. return smalltalk.withContext(function($ctx3) {
  702. return _st(stream)._nextPutAll_(" ");
  703. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  704. $4=stream;
  705. _st($4)._nextPutAll_(_st(_st("'").__comma(_st($String())._lf())).__comma(_st($String())._tab()));
  706. _st($4)._nextPutAll_("package: '");
  707. _st($4)._nextPutAll_(_st(self)._category());
  708. $5=_st($4)._nextPutAll_("'");
  709. return $5;
  710. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
  711. return $1;
  712. }, function($ctx1) {$ctx1.fill(self,"definition",{},smalltalk.Class)})},
  713. messageSends: ["streamContents:", "nextPutAll:", "asString", "superclass", "name", ",", "tab", "lf", "do:separatedBy:", "instanceVariableNames", "category"]}),
  714. smalltalk.Class);
  715. smalltalk.addMethod(
  716. smalltalk.method({
  717. selector: "isClass",
  718. fn: function (){
  719. var self=this;
  720. return smalltalk.withContext(function($ctx1) {
  721. return true;
  722. }, function($ctx1) {$ctx1.fill(self,"isClass",{},smalltalk.Class)})},
  723. messageSends: []}),
  724. smalltalk.Class);
  725. smalltalk.addMethod(
  726. smalltalk.method({
  727. selector: "package",
  728. fn: function (){
  729. var self=this;
  730. return smalltalk.withContext(function($ctx1) {
  731. var $1;
  732. $1=_st(self)._basicAt_("pkg");
  733. return $1;
  734. }, function($ctx1) {$ctx1.fill(self,"package",{},smalltalk.Class)})},
  735. messageSends: ["basicAt:"]}),
  736. smalltalk.Class);
  737. smalltalk.addMethod(
  738. smalltalk.method({
  739. selector: "package:",
  740. fn: function (aPackage){
  741. var self=this;
  742. var oldPackage;
  743. function $ClassMoved(){return smalltalk.ClassMoved||(typeof ClassMoved=="undefined"?nil:ClassMoved)}
  744. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  745. return smalltalk.withContext(function($ctx1) {
  746. var $1,$2,$3,$4;
  747. $1=_st(_st(self)._package()).__eq(aPackage);
  748. if(smalltalk.assert($1)){
  749. $2=self;
  750. return $2;
  751. };
  752. oldPackage=_st(self)._package();
  753. _st(self)._basicAt_put_("pkg",aPackage);
  754. _st(_st(oldPackage)._organization())._removeElement_(self);
  755. _st(_st(aPackage)._organization())._addElement_(self);
  756. $3=_st($ClassMoved())._new();
  757. _st($3)._theClass_(self);
  758. _st($3)._oldPackage_(oldPackage);
  759. $4=_st($3)._yourself();
  760. _st(_st($SystemAnnouncer())._current())._announce_($4);
  761. return self}, function($ctx1) {$ctx1.fill(self,"package:",{aPackage:aPackage,oldPackage:oldPackage},smalltalk.Class)})},
  762. messageSends: ["ifTrue:", "=", "package", "basicAt:put:", "removeElement:", "organization", "addElement:", "announce:", "theClass:", "new", "oldPackage:", "yourself", "current"]}),
  763. smalltalk.Class);
  764. smalltalk.addMethod(
  765. smalltalk.method({
  766. selector: "printOn:",
  767. fn: function (aStream){
  768. var self=this;
  769. return smalltalk.withContext(function($ctx1) {
  770. _st(aStream)._nextPutAll_(_st(self)._name());
  771. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Class)})},
  772. messageSends: ["nextPutAll:", "name"]}),
  773. smalltalk.Class);
  774. smalltalk.addMethod(
  775. smalltalk.method({
  776. selector: "rename:",
  777. fn: function (aString){
  778. var self=this;
  779. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  780. return smalltalk.withContext(function($ctx1) {
  781. _st(_st($ClassBuilder())._new())._renameClass_to_(self,aString);
  782. return self}, function($ctx1) {$ctx1.fill(self,"rename:",{aString:aString},smalltalk.Class)})},
  783. messageSends: ["renameClass:to:", "new"]}),
  784. smalltalk.Class);
  785. smalltalk.addMethod(
  786. smalltalk.method({
  787. selector: "subclass:instanceVariableNames:",
  788. fn: function (aString,anotherString){
  789. var self=this;
  790. return smalltalk.withContext(function($ctx1) {
  791. var $1;
  792. $1=_st(self)._subclass_instanceVariableNames_package_(aString,anotherString,nil);
  793. return $1;
  794. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:",{aString:aString,anotherString:anotherString},smalltalk.Class)})},
  795. messageSends: ["subclass:instanceVariableNames:package:"]}),
  796. smalltalk.Class);
  797. smalltalk.addMethod(
  798. smalltalk.method({
  799. selector: "subclass:instanceVariableNames:category:",
  800. fn: function (aString,aString2,aString3){
  801. var self=this;
  802. return smalltalk.withContext(function($ctx1) {
  803. var $1;
  804. _st(self)._deprecatedAPI();
  805. $1=_st(self)._subclass_instanceVariableNames_package_(aString,aString2,aString3);
  806. return $1;
  807. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:category:",{aString:aString,aString2:aString2,aString3:aString3},smalltalk.Class)})},
  808. messageSends: ["deprecatedAPI", "subclass:instanceVariableNames:package:"]}),
  809. smalltalk.Class);
  810. smalltalk.addMethod(
  811. smalltalk.method({
  812. selector: "subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:",
  813. fn: function (aString,aString2,classVars,pools,aString3){
  814. var self=this;
  815. return smalltalk.withContext(function($ctx1) {
  816. var $1;
  817. $1=_st(self)._subclass_instanceVariableNames_package_(aString,aString2,aString3);
  818. return $1;
  819. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:",{aString:aString,aString2:aString2,classVars:classVars,pools:pools,aString3:aString3},smalltalk.Class)})},
  820. messageSends: ["subclass:instanceVariableNames:package:"]}),
  821. smalltalk.Class);
  822. smalltalk.addMethod(
  823. smalltalk.method({
  824. selector: "subclass:instanceVariableNames:package:",
  825. fn: function (aString,aString2,aString3){
  826. var self=this;
  827. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  828. return smalltalk.withContext(function($ctx1) {
  829. var $1;
  830. $1=_st(_st($ClassBuilder())._new())._superclass_subclass_instanceVariableNames_package_(self,_st(aString)._asString(),aString2,aString3);
  831. return $1;
  832. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:package:",{aString:aString,aString2:aString2,aString3:aString3},smalltalk.Class)})},
  833. messageSends: ["superclass:subclass:instanceVariableNames:package:", "asString", "new"]}),
  834. smalltalk.Class);
  835. smalltalk.addClass('Metaclass', smalltalk.Behavior, [], 'Kernel-Classes');
  836. smalltalk.addMethod(
  837. smalltalk.method({
  838. selector: "asJavascript",
  839. fn: function (){
  840. var self=this;
  841. return smalltalk.withContext(function($ctx1) {
  842. var $1;
  843. $1=_st(_st("smalltalk.").__comma(_st(_st(self)._instanceClass())._name())).__comma(".klass");
  844. return $1;
  845. }, function($ctx1) {$ctx1.fill(self,"asJavascript",{},smalltalk.Metaclass)})},
  846. messageSends: [",", "name", "instanceClass"]}),
  847. smalltalk.Metaclass);
  848. smalltalk.addMethod(
  849. smalltalk.method({
  850. selector: "definition",
  851. fn: function (){
  852. var self=this;
  853. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  854. return smalltalk.withContext(function($ctx1) {
  855. var $2,$3,$1;
  856. $1=_st($String())._streamContents_((function(stream){
  857. return smalltalk.withContext(function($ctx2) {
  858. $2=stream;
  859. _st($2)._nextPutAll_(_st(self)._asString());
  860. $3=_st($2)._nextPutAll_(" instanceVariableNames: '");
  861. $3;
  862. _st(_st(self)._instanceVariableNames())._do_separatedBy_((function(each){
  863. return smalltalk.withContext(function($ctx3) {
  864. return _st(stream)._nextPutAll_(each);
  865. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}),(function(){
  866. return smalltalk.withContext(function($ctx3) {
  867. return _st(stream)._nextPutAll_(" ");
  868. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  869. return _st(stream)._nextPutAll_("'");
  870. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
  871. return $1;
  872. }, function($ctx1) {$ctx1.fill(self,"definition",{},smalltalk.Metaclass)})},
  873. messageSends: ["streamContents:", "nextPutAll:", "asString", "do:separatedBy:", "instanceVariableNames"]}),
  874. smalltalk.Metaclass);
  875. smalltalk.addMethod(
  876. smalltalk.method({
  877. selector: "instanceClass",
  878. fn: function (){
  879. var self=this;
  880. return smalltalk.withContext(function($ctx1) {
  881. return self.instanceClass;
  882. return self}, function($ctx1) {$ctx1.fill(self,"instanceClass",{},smalltalk.Metaclass)})},
  883. messageSends: []}),
  884. smalltalk.Metaclass);
  885. smalltalk.addMethod(
  886. smalltalk.method({
  887. selector: "instanceVariableNames:",
  888. fn: function (aCollection){
  889. var self=this;
  890. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  891. return smalltalk.withContext(function($ctx1) {
  892. _st(_st($ClassBuilder())._new())._class_instanceVariableNames_(self,aCollection);
  893. return self}, function($ctx1) {$ctx1.fill(self,"instanceVariableNames:",{aCollection:aCollection},smalltalk.Metaclass)})},
  894. messageSends: ["class:instanceVariableNames:", "new"]}),
  895. smalltalk.Metaclass);
  896. smalltalk.addMethod(
  897. smalltalk.method({
  898. selector: "isMetaclass",
  899. fn: function (){
  900. var self=this;
  901. return smalltalk.withContext(function($ctx1) {
  902. return true;
  903. }, function($ctx1) {$ctx1.fill(self,"isMetaclass",{},smalltalk.Metaclass)})},
  904. messageSends: []}),
  905. smalltalk.Metaclass);
  906. smalltalk.addMethod(
  907. smalltalk.method({
  908. selector: "printOn:",
  909. fn: function (aStream){
  910. var self=this;
  911. return smalltalk.withContext(function($ctx1) {
  912. var $1,$2;
  913. $1=aStream;
  914. _st($1)._nextPutAll_(_st(_st(self)._instanceClass())._name());
  915. $2=_st($1)._nextPutAll_(" class");
  916. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Metaclass)})},
  917. messageSends: ["nextPutAll:", "name", "instanceClass"]}),
  918. smalltalk.Metaclass);
  919. smalltalk.addMethod(
  920. smalltalk.method({
  921. selector: "theMetaClass",
  922. fn: function (){
  923. var self=this;
  924. return smalltalk.withContext(function($ctx1) {
  925. var $1;
  926. $1=self;
  927. return $1;
  928. }, function($ctx1) {$ctx1.fill(self,"theMetaClass",{},smalltalk.Metaclass)})},
  929. messageSends: []}),
  930. smalltalk.Metaclass);
  931. smalltalk.addMethod(
  932. smalltalk.method({
  933. selector: "theNonMetaClass",
  934. fn: function (){
  935. var self=this;
  936. return smalltalk.withContext(function($ctx1) {
  937. var $1;
  938. $1=_st(self)._instanceClass();
  939. return $1;
  940. }, function($ctx1) {$ctx1.fill(self,"theNonMetaClass",{},smalltalk.Metaclass)})},
  941. messageSends: ["instanceClass"]}),
  942. smalltalk.Metaclass);
  943. smalltalk.addClass('ClassBuilder', smalltalk.Object, [], 'Kernel-Classes');
  944. smalltalk.addMethod(
  945. smalltalk.method({
  946. selector: "addSubclassOf:named:instanceVariableNames:package:",
  947. fn: function (aClass,className,aCollection,packageName){
  948. var self=this;
  949. var theClass;
  950. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  951. return smalltalk.withContext(function($ctx1) {
  952. var $1,$2,$3,$4;
  953. theClass=_st(_st($Smalltalk())._current())._at_(className);
  954. $1=theClass;
  955. if(($receiver = $1) == nil || $receiver == undefined){
  956. $1;
  957. } else {
  958. _st(theClass)._package_(_st(self)._createPackageNamed_(packageName));
  959. $2=_st(_st(theClass)._superclass()).__eq_eq(aClass);
  960. if(! smalltalk.assert($2)){
  961. $3=_st(self)._migrateClassNamed_superclass_instanceVariableNames_package_(className,aClass,aCollection,packageName);
  962. return $3;
  963. };
  964. };
  965. $4=_st(self)._basicAddSubclassOf_named_instanceVariableNames_package_(aClass,className,aCollection,packageName);
  966. return $4;
  967. }, function($ctx1) {$ctx1.fill(self,"addSubclassOf:named:instanceVariableNames:package:",{aClass:aClass,className:className,aCollection:aCollection,packageName:packageName,theClass:theClass},smalltalk.ClassBuilder)})},
  968. messageSends: ["at:", "current", "ifNotNil:", "package:", "createPackageNamed:", "ifFalse:", "migrateClassNamed:superclass:instanceVariableNames:package:", "==", "superclass", "basicAddSubclassOf:named:instanceVariableNames:package:"]}),
  969. smalltalk.ClassBuilder);
  970. smalltalk.addMethod(
  971. smalltalk.method({
  972. selector: "basicAddSubclassOf:named:instanceVariableNames:package:",
  973. fn: function (aClass,aString,aCollection,packageName){
  974. var self=this;
  975. return smalltalk.withContext(function($ctx1) {
  976. smalltalk.addClass(aString, aClass, aCollection, packageName);
  977. return smalltalk[aString]
  978. ;
  979. return self}, function($ctx1) {$ctx1.fill(self,"basicAddSubclassOf:named:instanceVariableNames:package:",{aClass:aClass,aString:aString,aCollection:aCollection,packageName:packageName},smalltalk.ClassBuilder)})},
  980. messageSends: []}),
  981. smalltalk.ClassBuilder);
  982. smalltalk.addMethod(
  983. smalltalk.method({
  984. selector: "basicClass:instanceVariableNames:",
  985. fn: function (aClass,aString){
  986. var self=this;
  987. return smalltalk.withContext(function($ctx1) {
  988. _st(self)._basicClass_instanceVariables_(aClass,_st(self)._instanceVariableNamesFor_(aString));
  989. return self}, function($ctx1) {$ctx1.fill(self,"basicClass:instanceVariableNames:",{aClass:aClass,aString:aString},smalltalk.ClassBuilder)})},
  990. messageSends: ["basicClass:instanceVariables:", "instanceVariableNamesFor:"]}),
  991. smalltalk.ClassBuilder);
  992. smalltalk.addMethod(
  993. smalltalk.method({
  994. selector: "basicClass:instanceVariables:",
  995. fn: function (aClass,aCollection){
  996. var self=this;
  997. return smalltalk.withContext(function($ctx1) {
  998. var $1;
  999. $1=_st(aClass)._isMetaclass();
  1000. if(! smalltalk.assert($1)){
  1001. _st(self)._error_(_st(_st(aClass)._name()).__comma(" is not a metaclass"));
  1002. };
  1003. _st(aClass)._basicAt_put_("iVarNames",aCollection);
  1004. return self}, function($ctx1) {$ctx1.fill(self,"basicClass:instanceVariables:",{aClass:aClass,aCollection:aCollection},smalltalk.ClassBuilder)})},
  1005. messageSends: ["ifFalse:", "error:", ",", "name", "isMetaclass", "basicAt:put:"]}),
  1006. smalltalk.ClassBuilder);
  1007. smalltalk.addMethod(
  1008. smalltalk.method({
  1009. selector: "basicRemoveClass:",
  1010. fn: function (aClass){
  1011. var self=this;
  1012. return smalltalk.withContext(function($ctx1) {
  1013. smalltalk.removeClass(aClass);
  1014. return self}, function($ctx1) {$ctx1.fill(self,"basicRemoveClass:",{aClass:aClass},smalltalk.ClassBuilder)})},
  1015. messageSends: []}),
  1016. smalltalk.ClassBuilder);
  1017. smalltalk.addMethod(
  1018. smalltalk.method({
  1019. selector: "basicRenameClass:to:",
  1020. fn: function (aClass,aString){
  1021. var self=this;
  1022. return smalltalk.withContext(function($ctx1) {
  1023. smalltalk[aString] = aClass;
  1024. delete smalltalk[aClass.className];
  1025. aClass.className = aString;
  1026. ;
  1027. return self}, function($ctx1) {$ctx1.fill(self,"basicRenameClass:to:",{aClass:aClass,aString:aString},smalltalk.ClassBuilder)})},
  1028. messageSends: []}),
  1029. smalltalk.ClassBuilder);
  1030. smalltalk.addMethod(
  1031. smalltalk.method({
  1032. selector: "basicSwapClassNames:with:",
  1033. fn: function (aClass,anotherClass){
  1034. var self=this;
  1035. return smalltalk.withContext(function($ctx1) {
  1036. var tmp = aClass.className;
  1037. aClass.className = anotherClass.className;
  1038. anotherClass.className = tmp;
  1039. ;
  1040. return self}, function($ctx1) {$ctx1.fill(self,"basicSwapClassNames:with:",{aClass:aClass,anotherClass:anotherClass},smalltalk.ClassBuilder)})},
  1041. messageSends: []}),
  1042. smalltalk.ClassBuilder);
  1043. smalltalk.addMethod(
  1044. smalltalk.method({
  1045. selector: "class:instanceVariableNames:",
  1046. fn: function (aClass,ivarNames){
  1047. var self=this;
  1048. function $ClassDefinitionChanged(){return smalltalk.ClassDefinitionChanged||(typeof ClassDefinitionChanged=="undefined"?nil:ClassDefinitionChanged)}
  1049. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  1050. return smalltalk.withContext(function($ctx1) {
  1051. var $1,$2;
  1052. _st(self)._basicClass_instanceVariableNames_(aClass,ivarNames);
  1053. _st(self)._setupClass_(aClass);
  1054. $1=_st($ClassDefinitionChanged())._new();
  1055. _st($1)._theClass_(aClass);
  1056. $2=_st($1)._yourself();
  1057. _st(_st($SystemAnnouncer())._current())._announce_($2);
  1058. return self}, function($ctx1) {$ctx1.fill(self,"class:instanceVariableNames:",{aClass:aClass,ivarNames:ivarNames},smalltalk.ClassBuilder)})},
  1059. messageSends: ["basicClass:instanceVariableNames:", "setupClass:", "announce:", "theClass:", "new", "yourself", "current"]}),
  1060. smalltalk.ClassBuilder);
  1061. smalltalk.addMethod(
  1062. smalltalk.method({
  1063. selector: "copyClass:named:",
  1064. fn: function (aClass,className){
  1065. var self=this;
  1066. var newClass;
  1067. function $ClassAdded(){return smalltalk.ClassAdded||(typeof ClassAdded=="undefined"?nil:ClassAdded)}
  1068. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  1069. return smalltalk.withContext(function($ctx1) {
  1070. var $1,$2,$3;
  1071. newClass=_st(self)._addSubclassOf_named_instanceVariableNames_package_(_st(aClass)._superclass(),className,_st(aClass)._instanceVariableNames(),_st(_st(aClass)._package())._name());
  1072. _st(self)._copyClass_to_(aClass,newClass);
  1073. $1=_st($ClassAdded())._new();
  1074. _st($1)._theClass_(newClass);
  1075. $2=_st($1)._yourself();
  1076. _st(_st($SystemAnnouncer())._current())._announce_($2);
  1077. $3=newClass;
  1078. return $3;
  1079. }, function($ctx1) {$ctx1.fill(self,"copyClass:named:",{aClass:aClass,className:className,newClass:newClass},smalltalk.ClassBuilder)})},
  1080. messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "superclass", "instanceVariableNames", "name", "package", "copyClass:to:", "announce:", "theClass:", "new", "yourself", "current"]}),
  1081. smalltalk.ClassBuilder);
  1082. smalltalk.addMethod(
  1083. smalltalk.method({
  1084. selector: "copyClass:to:",
  1085. fn: function (aClass,anotherClass){
  1086. var self=this;
  1087. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  1088. return smalltalk.withContext(function($ctx1) {
  1089. _st(anotherClass)._comment_(_st(aClass)._comment());
  1090. _st(_st(_st(aClass)._methodDictionary())._values())._do_((function(each){
  1091. return smalltalk.withContext(function($ctx2) {
  1092. return _st(_st($Compiler())._new())._install_forClass_category_(_st(each)._source(),anotherClass,_st(each)._category());
  1093. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1094. _st(self)._basicClass_instanceVariables_(_st(anotherClass)._class(),_st(_st(aClass)._class())._instanceVariableNames());
  1095. _st(_st(_st(_st(aClass)._class())._methodDictionary())._values())._do_((function(each){
  1096. return smalltalk.withContext(function($ctx2) {
  1097. return _st(_st($Compiler())._new())._install_forClass_category_(_st(each)._source(),_st(anotherClass)._class(),_st(each)._category());
  1098. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1099. _st(self)._setupClass_(anotherClass);
  1100. return self}, function($ctx1) {$ctx1.fill(self,"copyClass:to:",{aClass:aClass,anotherClass:anotherClass},smalltalk.ClassBuilder)})},
  1101. messageSends: ["comment:", "comment", "do:", "install:forClass:category:", "source", "category", "new", "values", "methodDictionary", "basicClass:instanceVariables:", "class", "instanceVariableNames", "setupClass:"]}),
  1102. smalltalk.ClassBuilder);
  1103. smalltalk.addMethod(
  1104. smalltalk.method({
  1105. selector: "createPackageNamed:",
  1106. fn: function (aString){
  1107. var self=this;
  1108. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1109. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  1110. return smalltalk.withContext(function($ctx1) {
  1111. var $1;
  1112. $1=_st($Package())._named_ifAbsent_(aString,(function(){
  1113. return smalltalk.withContext(function($ctx2) {
  1114. return _st(_st($Smalltalk())._current())._createPackage_(aString);
  1115. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1116. return $1;
  1117. }, function($ctx1) {$ctx1.fill(self,"createPackageNamed:",{aString:aString},smalltalk.ClassBuilder)})},
  1118. messageSends: ["named:ifAbsent:", "createPackage:", "current"]}),
  1119. smalltalk.ClassBuilder);
  1120. smalltalk.addMethod(
  1121. smalltalk.method({
  1122. selector: "installMethod:forClass:category:",
  1123. fn: function (aCompiledMethod,aBehavior,aString){
  1124. var self=this;
  1125. return smalltalk.withContext(function($ctx1) {
  1126. var $1;
  1127. _st(aCompiledMethod)._category_(aString);
  1128. _st(aBehavior)._addCompiledMethod_(aCompiledMethod);
  1129. _st(self)._setupClass_(aBehavior);
  1130. $1=aCompiledMethod;
  1131. return $1;
  1132. }, function($ctx1) {$ctx1.fill(self,"installMethod:forClass:category:",{aCompiledMethod:aCompiledMethod,aBehavior:aBehavior,aString:aString},smalltalk.ClassBuilder)})},
  1133. messageSends: ["category:", "addCompiledMethod:", "setupClass:"]}),
  1134. smalltalk.ClassBuilder);
  1135. smalltalk.addMethod(
  1136. smalltalk.method({
  1137. selector: "instanceVariableNamesFor:",
  1138. fn: function (aString){
  1139. var self=this;
  1140. return smalltalk.withContext(function($ctx1) {
  1141. var $1;
  1142. $1=_st(_st(aString)._tokenize_(" "))._reject_((function(each){
  1143. return smalltalk.withContext(function($ctx2) {
  1144. return _st(each)._isEmpty();
  1145. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1146. return $1;
  1147. }, function($ctx1) {$ctx1.fill(self,"instanceVariableNamesFor:",{aString:aString},smalltalk.ClassBuilder)})},
  1148. messageSends: ["reject:", "isEmpty", "tokenize:"]}),
  1149. smalltalk.ClassBuilder);
  1150. smalltalk.addMethod(
  1151. smalltalk.method({
  1152. selector: "migrateClass:superclass:",
  1153. fn: function (aClass,anotherClass){
  1154. var self=this;
  1155. return smalltalk.withContext(function($ctx1) {
  1156. var $1;
  1157. $1=_st(self)._migrateClassNamed_superclass_instanceVariableNames_package_(_st(aClass)._name(),anotherClass,_st(aClass)._instanceVariableNames(),_st(_st(aClass)._package())._name());
  1158. return $1;
  1159. }, function($ctx1) {$ctx1.fill(self,"migrateClass:superclass:",{aClass:aClass,anotherClass:anotherClass},smalltalk.ClassBuilder)})},
  1160. messageSends: ["migrateClassNamed:superclass:instanceVariableNames:package:", "name", "instanceVariableNames", "package"]}),
  1161. smalltalk.ClassBuilder);
  1162. smalltalk.addMethod(
  1163. smalltalk.method({
  1164. selector: "migrateClassNamed:superclass:instanceVariableNames:package:",
  1165. fn: function (className,aClass,aCollection,packageName){
  1166. var self=this;
  1167. var oldClass,newClass,tmp;
  1168. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1169. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  1170. function $ClassMigrated(){return smalltalk.ClassMigrated||(typeof ClassMigrated=="undefined"?nil:ClassMigrated)}
  1171. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  1172. return smalltalk.withContext(function($ctx1) {
  1173. var $1,$2,$3,$4,$5,$6,$7;
  1174. tmp=_st("new*").__comma(className);
  1175. oldClass=_st(_st($Smalltalk())._current())._at_(className);
  1176. newClass=_st(self)._addSubclassOf_named_instanceVariableNames_package_(aClass,tmp,aCollection,packageName);
  1177. _st(self)._basicSwapClassNames_with_(oldClass,newClass);
  1178. _st((function(){
  1179. return smalltalk.withContext(function($ctx2) {
  1180. return _st(self)._copyClass_to_(oldClass,newClass);
  1181. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($Error(),(function(exception){
  1182. return smalltalk.withContext(function($ctx2) {
  1183. $1=self;
  1184. _st($1)._basicSwapClassNames_with_(oldClass,newClass);
  1185. $2=_st($1)._basicRemoveClass_(newClass);
  1186. $2;
  1187. return _st(exception)._signal();
  1188. }, function($ctx2) {$ctx2.fillBlock({exception:exception},$ctx1)})}));
  1189. $3=self;
  1190. _st($3)._rawRenameClass_to_(oldClass,tmp);
  1191. $4=_st($3)._rawRenameClass_to_(newClass,className);
  1192. _st(_st(oldClass)._subclasses())._do_displayingProgress_((function(each){
  1193. return smalltalk.withContext(function($ctx2) {
  1194. return _st(self)._migrateClass_superclass_(each,newClass);
  1195. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),_st(_st("Recompiling ").__comma(_st(newClass)._name())).__comma("..."));
  1196. _st(self)._basicRemoveClass_(oldClass);
  1197. $5=_st($ClassMigrated())._new();
  1198. _st($5)._theClass_(newClass);
  1199. _st($5)._oldClass_(oldClass);
  1200. $6=_st($5)._yourself();
  1201. _st(_st($SystemAnnouncer())._current())._announce_($6);
  1202. $7=newClass;
  1203. return $7;
  1204. }, 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)})},
  1205. 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"]}),
  1206. smalltalk.ClassBuilder);
  1207. smalltalk.addMethod(
  1208. smalltalk.method({
  1209. selector: "rawRenameClass:to:",
  1210. fn: function (aClass,aString){
  1211. var self=this;
  1212. return smalltalk.withContext(function($ctx1) {
  1213. smalltalk[aString] = aClass;
  1214. ;
  1215. return self}, function($ctx1) {$ctx1.fill(self,"rawRenameClass:to:",{aClass:aClass,aString:aString},smalltalk.ClassBuilder)})},
  1216. messageSends: []}),
  1217. smalltalk.ClassBuilder);
  1218. smalltalk.addMethod(
  1219. smalltalk.method({
  1220. selector: "renameClass:to:",
  1221. fn: function (aClass,className){
  1222. var self=this;
  1223. function $ClassRenamed(){return smalltalk.ClassRenamed||(typeof ClassRenamed=="undefined"?nil:ClassRenamed)}
  1224. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  1225. return smalltalk.withContext(function($ctx1) {
  1226. var $1,$2;
  1227. _st(self)._basicRenameClass_to_(aClass,className);
  1228. $1=_st($ClassRenamed())._new();
  1229. _st($1)._theClass_(aClass);
  1230. $2=_st($1)._yourself();
  1231. _st(_st($SystemAnnouncer())._current())._announce_($2);
  1232. return self}, function($ctx1) {$ctx1.fill(self,"renameClass:to:",{aClass:aClass,className:className},smalltalk.ClassBuilder)})},
  1233. messageSends: ["basicRenameClass:to:", "announce:", "theClass:", "new", "yourself", "current"]}),
  1234. smalltalk.ClassBuilder);
  1235. smalltalk.addMethod(
  1236. smalltalk.method({
  1237. selector: "setupClass:",
  1238. fn: function (aClass){
  1239. var self=this;
  1240. return smalltalk.withContext(function($ctx1) {
  1241. smalltalk.init(aClass);;
  1242. return self}, function($ctx1) {$ctx1.fill(self,"setupClass:",{aClass:aClass},smalltalk.ClassBuilder)})},
  1243. messageSends: []}),
  1244. smalltalk.ClassBuilder);
  1245. smalltalk.addMethod(
  1246. smalltalk.method({
  1247. selector: "superclass:subclass:",
  1248. fn: function (aClass,className){
  1249. var self=this;
  1250. return smalltalk.withContext(function($ctx1) {
  1251. var $1;
  1252. $1=_st(self)._superclass_subclass_instanceVariableNames_package_(aClass,className,"",nil);
  1253. return $1;
  1254. }, function($ctx1) {$ctx1.fill(self,"superclass:subclass:",{aClass:aClass,className:className},smalltalk.ClassBuilder)})},
  1255. messageSends: ["superclass:subclass:instanceVariableNames:package:"]}),
  1256. smalltalk.ClassBuilder);
  1257. smalltalk.addMethod(
  1258. smalltalk.method({
  1259. selector: "superclass:subclass:instanceVariableNames:package:",
  1260. fn: function (aClass,className,ivarNames,packageName){
  1261. var self=this;
  1262. var newClass;
  1263. function $ClassAdded(){return smalltalk.ClassAdded||(typeof ClassAdded=="undefined"?nil:ClassAdded)}
  1264. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  1265. return smalltalk.withContext(function($ctx1) {
  1266. var $1,$2,$3,$4,$6,$5,$7,$8,$9;
  1267. $1=self;
  1268. $2=aClass;
  1269. $3=className;
  1270. $4=_st(self)._instanceVariableNamesFor_(ivarNames);
  1271. $6=packageName;
  1272. if(($receiver = $6) == nil || $receiver == undefined){
  1273. $5="unclassified";
  1274. } else {
  1275. $5=$6;
  1276. };
  1277. newClass=_st($1)._addSubclassOf_named_instanceVariableNames_package_($2,$3,$4,$5);
  1278. _st(self)._setupClass_(newClass);
  1279. $7=_st($ClassAdded())._new();
  1280. _st($7)._theClass_(newClass);
  1281. $8=_st($7)._yourself();
  1282. _st(_st($SystemAnnouncer())._current())._announce_($8);
  1283. $9=newClass;
  1284. return $9;
  1285. }, function($ctx1) {$ctx1.fill(self,"superclass:subclass:instanceVariableNames:package:",{aClass:aClass,className:className,ivarNames:ivarNames,packageName:packageName,newClass:newClass},smalltalk.ClassBuilder)})},
  1286. messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "instanceVariableNamesFor:", "ifNil:", "setupClass:", "announce:", "theClass:", "new", "yourself", "current"]}),
  1287. smalltalk.ClassBuilder);
  1288. smalltalk.addClass('ClassCategoryReader', smalltalk.Object, ['class', 'category'], 'Kernel-Classes');
  1289. smalltalk.addMethod(
  1290. smalltalk.method({
  1291. selector: "class:category:",
  1292. fn: function (aClass,aString){
  1293. var self=this;
  1294. return smalltalk.withContext(function($ctx1) {
  1295. self["@class"]=aClass;
  1296. self["@category"]=aString;
  1297. return self}, function($ctx1) {$ctx1.fill(self,"class:category:",{aClass:aClass,aString:aString},smalltalk.ClassCategoryReader)})},
  1298. messageSends: []}),
  1299. smalltalk.ClassCategoryReader);
  1300. smalltalk.addMethod(
  1301. smalltalk.method({
  1302. selector: "compileMethod:",
  1303. fn: function (aString){
  1304. var self=this;
  1305. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  1306. return smalltalk.withContext(function($ctx1) {
  1307. _st(_st($Compiler())._new())._install_forClass_category_(aString,self["@class"],self["@category"]);
  1308. return self}, function($ctx1) {$ctx1.fill(self,"compileMethod:",{aString:aString},smalltalk.ClassCategoryReader)})},
  1309. messageSends: ["install:forClass:category:", "new"]}),
  1310. smalltalk.ClassCategoryReader);
  1311. smalltalk.addMethod(
  1312. smalltalk.method({
  1313. selector: "initialize",
  1314. fn: function (){
  1315. var self=this;
  1316. return smalltalk.withContext(function($ctx1) {
  1317. smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  1318. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ClassCategoryReader)})},
  1319. messageSends: ["initialize"]}),
  1320. smalltalk.ClassCategoryReader);
  1321. smalltalk.addMethod(
  1322. smalltalk.method({
  1323. selector: "scanFrom:",
  1324. fn: function (aChunkParser){
  1325. var self=this;
  1326. var chunk;
  1327. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  1328. return smalltalk.withContext(function($ctx1) {
  1329. _st((function(){
  1330. return smalltalk.withContext(function($ctx2) {
  1331. chunk=_st(aChunkParser)._nextChunk();
  1332. chunk;
  1333. return _st(chunk)._isEmpty();
  1334. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  1335. return smalltalk.withContext(function($ctx2) {
  1336. return _st(self)._compileMethod_(chunk);
  1337. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1338. _st(_st($ClassBuilder())._new())._setupClass_(self["@class"]);
  1339. return self}, function($ctx1) {$ctx1.fill(self,"scanFrom:",{aChunkParser:aChunkParser,chunk:chunk},smalltalk.ClassCategoryReader)})},
  1340. messageSends: ["whileFalse:", "compileMethod:", "nextChunk", "isEmpty", "setupClass:", "new"]}),
  1341. smalltalk.ClassCategoryReader);
  1342. smalltalk.addClass('ClassCommentReader', smalltalk.Object, ['class'], 'Kernel-Classes');
  1343. smalltalk.addMethod(
  1344. smalltalk.method({
  1345. selector: "class:",
  1346. fn: function (aClass){
  1347. var self=this;
  1348. return smalltalk.withContext(function($ctx1) {
  1349. self["@class"]=aClass;
  1350. return self}, function($ctx1) {$ctx1.fill(self,"class:",{aClass:aClass},smalltalk.ClassCommentReader)})},
  1351. messageSends: []}),
  1352. smalltalk.ClassCommentReader);
  1353. smalltalk.addMethod(
  1354. smalltalk.method({
  1355. selector: "initialize",
  1356. fn: function (){
  1357. var self=this;
  1358. return smalltalk.withContext(function($ctx1) {
  1359. smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  1360. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ClassCommentReader)})},
  1361. messageSends: ["initialize"]}),
  1362. smalltalk.ClassCommentReader);
  1363. smalltalk.addMethod(
  1364. smalltalk.method({
  1365. selector: "scanFrom:",
  1366. fn: function (aChunkParser){
  1367. var self=this;
  1368. var chunk;
  1369. return smalltalk.withContext(function($ctx1) {
  1370. var $1;
  1371. chunk=_st(aChunkParser)._nextChunk();
  1372. $1=_st(chunk)._isEmpty();
  1373. if(! smalltalk.assert($1)){
  1374. _st(self)._setComment_(chunk);
  1375. };
  1376. return self}, function($ctx1) {$ctx1.fill(self,"scanFrom:",{aChunkParser:aChunkParser,chunk:chunk},smalltalk.ClassCommentReader)})},
  1377. messageSends: ["nextChunk", "ifFalse:", "setComment:", "isEmpty"]}),
  1378. smalltalk.ClassCommentReader);
  1379. smalltalk.addMethod(
  1380. smalltalk.method({
  1381. selector: "setComment:",
  1382. fn: function (aString){
  1383. var self=this;
  1384. return smalltalk.withContext(function($ctx1) {
  1385. _st(self["@class"])._comment_(aString);
  1386. return self}, function($ctx1) {$ctx1.fill(self,"setComment:",{aString:aString},smalltalk.ClassCommentReader)})},
  1387. messageSends: ["comment:"]}),
  1388. smalltalk.ClassCommentReader);
  1389. smalltalk.addClass('ClassSorterNode', smalltalk.Object, ['theClass', 'level', 'nodes'], 'Kernel-Classes');
  1390. smalltalk.addMethod(
  1391. smalltalk.method({
  1392. selector: "getNodesFrom:",
  1393. fn: function (aCollection){
  1394. var self=this;
  1395. var children,others;
  1396. function $ClassSorterNode(){return smalltalk.ClassSorterNode||(typeof ClassSorterNode=="undefined"?nil:ClassSorterNode)}
  1397. return smalltalk.withContext(function($ctx1) {
  1398. var $1;
  1399. children=[];
  1400. others=[];
  1401. _st(aCollection)._do_((function(each){
  1402. return smalltalk.withContext(function($ctx2) {
  1403. $1=_st(_st(each)._superclass()).__eq(_st(self)._theClass());
  1404. if(smalltalk.assert($1)){
  1405. return _st(children)._add_(each);
  1406. } else {
  1407. return _st(others)._add_(each);
  1408. };
  1409. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1410. self["@nodes"]=_st(children)._collect_((function(each){
  1411. return smalltalk.withContext(function($ctx2) {
  1412. return _st($ClassSorterNode())._on_classes_level_(each,others,_st(_st(self)._level()).__plus((1)));
  1413. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1414. return self}, function($ctx1) {$ctx1.fill(self,"getNodesFrom:",{aCollection:aCollection,children:children,others:others},smalltalk.ClassSorterNode)})},
  1415. messageSends: ["do:", "ifTrue:ifFalse:", "add:", "=", "theClass", "superclass", "collect:", "on:classes:level:", "+", "level"]}),
  1416. smalltalk.ClassSorterNode);
  1417. smalltalk.addMethod(
  1418. smalltalk.method({
  1419. selector: "level",
  1420. fn: function (){
  1421. var self=this;
  1422. return smalltalk.withContext(function($ctx1) {
  1423. var $1;
  1424. $1=self["@level"];
  1425. return $1;
  1426. }, function($ctx1) {$ctx1.fill(self,"level",{},smalltalk.ClassSorterNode)})},
  1427. messageSends: []}),
  1428. smalltalk.ClassSorterNode);
  1429. smalltalk.addMethod(
  1430. smalltalk.method({
  1431. selector: "level:",
  1432. fn: function (anInteger){
  1433. var self=this;
  1434. return smalltalk.withContext(function($ctx1) {
  1435. self["@level"]=anInteger;
  1436. return self}, function($ctx1) {$ctx1.fill(self,"level:",{anInteger:anInteger},smalltalk.ClassSorterNode)})},
  1437. messageSends: []}),
  1438. smalltalk.ClassSorterNode);
  1439. smalltalk.addMethod(
  1440. smalltalk.method({
  1441. selector: "nodes",
  1442. fn: function (){
  1443. var self=this;
  1444. return smalltalk.withContext(function($ctx1) {
  1445. var $1;
  1446. $1=self["@nodes"];
  1447. return $1;
  1448. }, function($ctx1) {$ctx1.fill(self,"nodes",{},smalltalk.ClassSorterNode)})},
  1449. messageSends: []}),
  1450. smalltalk.ClassSorterNode);
  1451. smalltalk.addMethod(
  1452. smalltalk.method({
  1453. selector: "theClass",
  1454. fn: function (){
  1455. var self=this;
  1456. return smalltalk.withContext(function($ctx1) {
  1457. var $1;
  1458. $1=self["@theClass"];
  1459. return $1;
  1460. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.ClassSorterNode)})},
  1461. messageSends: []}),
  1462. smalltalk.ClassSorterNode);
  1463. smalltalk.addMethod(
  1464. smalltalk.method({
  1465. selector: "theClass:",
  1466. fn: function (aClass){
  1467. var self=this;
  1468. return smalltalk.withContext(function($ctx1) {
  1469. self["@theClass"]=aClass;
  1470. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.ClassSorterNode)})},
  1471. messageSends: []}),
  1472. smalltalk.ClassSorterNode);
  1473. smalltalk.addMethod(
  1474. smalltalk.method({
  1475. selector: "traverseClassesWith:",
  1476. fn: function (aCollection){
  1477. var self=this;
  1478. return smalltalk.withContext(function($ctx1) {
  1479. _st(aCollection)._add_(_st(self)._theClass());
  1480. _st(_st(_st(self)._nodes())._sorted_((function(a,b){
  1481. return smalltalk.withContext(function($ctx2) {
  1482. return _st(_st(_st(a)._theClass())._name()).__lt_eq(_st(_st(b)._theClass())._name());
  1483. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(aNode){
  1484. return smalltalk.withContext(function($ctx2) {
  1485. return _st(aNode)._traverseClassesWith_(aCollection);
  1486. }, function($ctx2) {$ctx2.fillBlock({aNode:aNode},$ctx1)})}));
  1487. return self}, function($ctx1) {$ctx1.fill(self,"traverseClassesWith:",{aCollection:aCollection},smalltalk.ClassSorterNode)})},
  1488. messageSends: ["add:", "theClass", "do:", "traverseClassesWith:", "sorted:", "<=", "name", "nodes"]}),
  1489. smalltalk.ClassSorterNode);
  1490. smalltalk.addMethod(
  1491. smalltalk.method({
  1492. selector: "on:classes:level:",
  1493. fn: function (aClass,aCollection,anInteger){
  1494. var self=this;
  1495. return smalltalk.withContext(function($ctx1) {
  1496. var $2,$3,$1;
  1497. $2=_st(self)._new();
  1498. _st($2)._theClass_(aClass);
  1499. _st($2)._level_(anInteger);
  1500. _st($2)._getNodesFrom_(aCollection);
  1501. $3=_st($2)._yourself();
  1502. $1=$3;
  1503. return $1;
  1504. }, function($ctx1) {$ctx1.fill(self,"on:classes:level:",{aClass:aClass,aCollection:aCollection,anInteger:anInteger},smalltalk.ClassSorterNode.klass)})},
  1505. messageSends: ["theClass:", "new", "level:", "getNodesFrom:", "yourself"]}),
  1506. smalltalk.ClassSorterNode.klass);