Kernel-Classes.deploy.js 60 KB

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