Kernel-Classes.deploy.js 59 KB

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