Kernel-Classes.deploy.js 56 KB

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