Kernel-Classes.deploy.js 61 KB

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