Kernel-Classes.deploy.js 57 KB

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