Kernel-Classes.deploy.js 45 KB

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