1
0

Kernel-Classes.deploy.js 59 KB

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