Kernel-Classes.deploy.js 58 KB

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