2
0

Kernel-Classes.deploy.js 60 KB

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