Kernel-Classes.deploy.js 56 KB

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