Kernel-Classes.deploy.js 59 KB

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