Kernel-Classes.deploy.js 59 KB

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