Kernel-Classes.js 73 KB

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