Kernel-Classes.deploy.js 59 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640
  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,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;
  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. $1=theClass;
  968. if(($receiver = $1) == nil || $receiver == undefined){
  969. $1;
  970. } else {
  971. _st(theClass)._package_(self._createPackageNamed_(packageName));
  972. $2=_st(_st(theClass)._superclass()).__eq_eq(aClass);
  973. if(! smalltalk.assert($2)){
  974. $3=self._migrateClassNamed_superclass_instanceVariableNames_package_(className,aClass,aCollection,packageName);
  975. return $3;
  976. };
  977. };
  978. $4=self._basicAddSubclassOf_named_instanceVariableNames_package_(aClass,className,aCollection,packageName);
  979. return $4;
  980. }, function($ctx1) {$ctx1.fill(self,"addSubclassOf:named:instanceVariableNames:package:",{aClass:aClass,className:className,aCollection:aCollection,packageName:packageName,theClass:theClass},smalltalk.ClassBuilder)})},
  981. messageSends: ["at:", "current", "ifNotNil:", "package:", "createPackageNamed:", "ifFalse:", "migrateClassNamed:superclass:instanceVariableNames:package:", "==", "superclass", "basicAddSubclassOf:named:instanceVariableNames:package:"]}),
  982. smalltalk.ClassBuilder);
  983. smalltalk.addMethod(
  984. smalltalk.method({
  985. selector: "basicAddSubclassOf:named:instanceVariableNames:package:",
  986. fn: function (aClass,aString,aCollection,packageName){
  987. var self=this;
  988. return smalltalk.withContext(function($ctx1) {
  989. smalltalk.addClass(aString, aClass, aCollection, packageName);
  990. return smalltalk[aString]
  991. ;
  992. return self}, function($ctx1) {$ctx1.fill(self,"basicAddSubclassOf:named:instanceVariableNames:package:",{aClass:aClass,aString:aString,aCollection:aCollection,packageName:packageName},smalltalk.ClassBuilder)})},
  993. messageSends: []}),
  994. smalltalk.ClassBuilder);
  995. smalltalk.addMethod(
  996. smalltalk.method({
  997. selector: "basicClass:instanceVariableNames:",
  998. fn: function (aClass,aString){
  999. var self=this;
  1000. return smalltalk.withContext(function($ctx1) {
  1001. self._basicClass_instanceVariables_(aClass,self._instanceVariableNamesFor_(aString));
  1002. return self}, function($ctx1) {$ctx1.fill(self,"basicClass:instanceVariableNames:",{aClass:aClass,aString:aString},smalltalk.ClassBuilder)})},
  1003. messageSends: ["basicClass:instanceVariables:", "instanceVariableNamesFor:"]}),
  1004. smalltalk.ClassBuilder);
  1005. smalltalk.addMethod(
  1006. smalltalk.method({
  1007. selector: "basicClass:instanceVariables:",
  1008. fn: function (aClass,aCollection){
  1009. var self=this;
  1010. return smalltalk.withContext(function($ctx1) {
  1011. var $1;
  1012. $1=_st(aClass)._isMetaclass();
  1013. if(! smalltalk.assert($1)){
  1014. self._error_(_st(_st(aClass)._name()).__comma(" is not a metaclass"));
  1015. };
  1016. _st(aClass)._basicAt_put_("iVarNames",aCollection);
  1017. return self}, function($ctx1) {$ctx1.fill(self,"basicClass:instanceVariables:",{aClass:aClass,aCollection:aCollection},smalltalk.ClassBuilder)})},
  1018. messageSends: ["ifFalse:", "error:", ",", "name", "isMetaclass", "basicAt:put:"]}),
  1019. smalltalk.ClassBuilder);
  1020. smalltalk.addMethod(
  1021. smalltalk.method({
  1022. selector: "basicRemoveClass:",
  1023. fn: function (aClass){
  1024. var self=this;
  1025. return smalltalk.withContext(function($ctx1) {
  1026. smalltalk.removeClass(aClass);
  1027. return self}, function($ctx1) {$ctx1.fill(self,"basicRemoveClass:",{aClass:aClass},smalltalk.ClassBuilder)})},
  1028. messageSends: []}),
  1029. smalltalk.ClassBuilder);
  1030. smalltalk.addMethod(
  1031. smalltalk.method({
  1032. selector: "basicRenameClass:to:",
  1033. fn: function (aClass,aString){
  1034. var self=this;
  1035. return smalltalk.withContext(function($ctx1) {
  1036. smalltalk[aString] = aClass;
  1037. delete smalltalk[aClass.className];
  1038. aClass.className = aString;
  1039. ;
  1040. return self}, function($ctx1) {$ctx1.fill(self,"basicRenameClass:to:",{aClass:aClass,aString:aString},smalltalk.ClassBuilder)})},
  1041. messageSends: []}),
  1042. smalltalk.ClassBuilder);
  1043. smalltalk.addMethod(
  1044. smalltalk.method({
  1045. selector: "basicSwapClassNames:with:",
  1046. fn: function (aClass,anotherClass){
  1047. var self=this;
  1048. return smalltalk.withContext(function($ctx1) {
  1049. var tmp = aClass.className;
  1050. aClass.className = anotherClass.className;
  1051. anotherClass.className = tmp;
  1052. ;
  1053. return self}, function($ctx1) {$ctx1.fill(self,"basicSwapClassNames:with:",{aClass:aClass,anotherClass:anotherClass},smalltalk.ClassBuilder)})},
  1054. messageSends: []}),
  1055. smalltalk.ClassBuilder);
  1056. smalltalk.addMethod(
  1057. smalltalk.method({
  1058. selector: "class:instanceVariableNames:",
  1059. fn: function (aClass,ivarNames){
  1060. var self=this;
  1061. function $ClassDefinitionChanged(){return smalltalk.ClassDefinitionChanged||(typeof ClassDefinitionChanged=="undefined"?nil:ClassDefinitionChanged)}
  1062. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  1063. return smalltalk.withContext(function($ctx1) {
  1064. var $1,$2;
  1065. self._basicClass_instanceVariableNames_(aClass,ivarNames);
  1066. self._setupClass_(aClass);
  1067. $1=_st($ClassDefinitionChanged())._new();
  1068. _st($1)._theClass_(aClass);
  1069. $2=_st($1)._yourself();
  1070. _st(_st($SystemAnnouncer())._current())._announce_($2);
  1071. return self}, function($ctx1) {$ctx1.fill(self,"class:instanceVariableNames:",{aClass:aClass,ivarNames:ivarNames},smalltalk.ClassBuilder)})},
  1072. messageSends: ["basicClass:instanceVariableNames:", "setupClass:", "announce:", "theClass:", "new", "yourself", "current"]}),
  1073. smalltalk.ClassBuilder);
  1074. smalltalk.addMethod(
  1075. smalltalk.method({
  1076. selector: "copyClass:named:",
  1077. fn: function (aClass,className){
  1078. var self=this;
  1079. var newClass;
  1080. function $ClassAdded(){return smalltalk.ClassAdded||(typeof ClassAdded=="undefined"?nil:ClassAdded)}
  1081. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  1082. return smalltalk.withContext(function($ctx1) {
  1083. var $1,$2,$3;
  1084. newClass=self._addSubclassOf_named_instanceVariableNames_package_(_st(aClass)._superclass(),className,_st(aClass)._instanceVariableNames(),_st(_st(aClass)._package())._name());
  1085. self._copyClass_to_(aClass,newClass);
  1086. $1=_st($ClassAdded())._new();
  1087. _st($1)._theClass_(newClass);
  1088. $2=_st($1)._yourself();
  1089. _st(_st($SystemAnnouncer())._current())._announce_($2);
  1090. $3=newClass;
  1091. return $3;
  1092. }, function($ctx1) {$ctx1.fill(self,"copyClass:named:",{aClass:aClass,className:className,newClass:newClass},smalltalk.ClassBuilder)})},
  1093. messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "superclass", "instanceVariableNames", "name", "package", "copyClass:to:", "announce:", "theClass:", "new", "yourself", "current"]}),
  1094. smalltalk.ClassBuilder);
  1095. smalltalk.addMethod(
  1096. smalltalk.method({
  1097. selector: "copyClass:to:",
  1098. fn: function (aClass,anotherClass){
  1099. var self=this;
  1100. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  1101. return smalltalk.withContext(function($ctx1) {
  1102. _st(anotherClass)._comment_(_st(aClass)._comment());
  1103. _st(_st(_st(aClass)._methodDictionary())._values())._do_((function(each){
  1104. return smalltalk.withContext(function($ctx2) {
  1105. return _st(_st($Compiler())._new())._install_forClass_category_(_st(each)._source(),anotherClass,_st(each)._category());
  1106. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1107. self._basicClass_instanceVariables_(_st(anotherClass)._class(),_st(_st(aClass)._class())._instanceVariableNames());
  1108. _st(_st(_st(_st(aClass)._class())._methodDictionary())._values())._do_((function(each){
  1109. return smalltalk.withContext(function($ctx2) {
  1110. return _st(_st($Compiler())._new())._install_forClass_category_(_st(each)._source(),_st(anotherClass)._class(),_st(each)._category());
  1111. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1112. self._setupClass_(anotherClass);
  1113. return self}, function($ctx1) {$ctx1.fill(self,"copyClass:to:",{aClass:aClass,anotherClass:anotherClass},smalltalk.ClassBuilder)})},
  1114. messageSends: ["comment:", "comment", "do:", "install:forClass:category:", "source", "category", "new", "values", "methodDictionary", "basicClass:instanceVariables:", "class", "instanceVariableNames", "setupClass:"]}),
  1115. smalltalk.ClassBuilder);
  1116. smalltalk.addMethod(
  1117. smalltalk.method({
  1118. selector: "createPackageNamed:",
  1119. fn: function (aString){
  1120. var self=this;
  1121. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1122. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  1123. return smalltalk.withContext(function($ctx1) {
  1124. var $1;
  1125. $1=_st($Package())._named_ifAbsent_(aString,(function(){
  1126. return smalltalk.withContext(function($ctx2) {
  1127. return _st(_st($Smalltalk())._current())._createPackage_(aString);
  1128. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1129. return $1;
  1130. }, function($ctx1) {$ctx1.fill(self,"createPackageNamed:",{aString:aString},smalltalk.ClassBuilder)})},
  1131. messageSends: ["named:ifAbsent:", "createPackage:", "current"]}),
  1132. smalltalk.ClassBuilder);
  1133. smalltalk.addMethod(
  1134. smalltalk.method({
  1135. selector: "installMethod:forClass:category:",
  1136. fn: function (aCompiledMethod,aBehavior,aString){
  1137. var self=this;
  1138. return smalltalk.withContext(function($ctx1) {
  1139. var $1;
  1140. _st(aCompiledMethod)._category_(aString);
  1141. _st(aBehavior)._addCompiledMethod_(aCompiledMethod);
  1142. self._setupClass_(aBehavior);
  1143. $1=aCompiledMethod;
  1144. return $1;
  1145. }, function($ctx1) {$ctx1.fill(self,"installMethod:forClass:category:",{aCompiledMethod:aCompiledMethod,aBehavior:aBehavior,aString:aString},smalltalk.ClassBuilder)})},
  1146. messageSends: ["category:", "addCompiledMethod:", "setupClass:"]}),
  1147. smalltalk.ClassBuilder);
  1148. smalltalk.addMethod(
  1149. smalltalk.method({
  1150. selector: "instanceVariableNamesFor:",
  1151. fn: function (aString){
  1152. var self=this;
  1153. return smalltalk.withContext(function($ctx1) {
  1154. var $1;
  1155. $1=_st(_st(aString)._tokenize_(" "))._reject_((function(each){
  1156. return smalltalk.withContext(function($ctx2) {
  1157. return _st(each)._isEmpty();
  1158. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1159. return $1;
  1160. }, function($ctx1) {$ctx1.fill(self,"instanceVariableNamesFor:",{aString:aString},smalltalk.ClassBuilder)})},
  1161. messageSends: ["reject:", "isEmpty", "tokenize:"]}),
  1162. smalltalk.ClassBuilder);
  1163. smalltalk.addMethod(
  1164. smalltalk.method({
  1165. selector: "migrateClass:superclass:",
  1166. fn: function (aClass,anotherClass){
  1167. var self=this;
  1168. return smalltalk.withContext(function($ctx1) {
  1169. var $1;
  1170. $1=self._migrateClassNamed_superclass_instanceVariableNames_package_(_st(aClass)._name(),anotherClass,_st(aClass)._instanceVariableNames(),_st(_st(aClass)._package())._name());
  1171. return $1;
  1172. }, function($ctx1) {$ctx1.fill(self,"migrateClass:superclass:",{aClass:aClass,anotherClass:anotherClass},smalltalk.ClassBuilder)})},
  1173. messageSends: ["migrateClassNamed:superclass:instanceVariableNames:package:", "name", "instanceVariableNames", "package"]}),
  1174. smalltalk.ClassBuilder);
  1175. smalltalk.addMethod(
  1176. smalltalk.method({
  1177. selector: "migrateClassNamed:superclass:instanceVariableNames:package:",
  1178. fn: function (className,aClass,aCollection,packageName){
  1179. var self=this;
  1180. var oldClass,newClass,tmp;
  1181. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1182. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  1183. function $ClassMigrated(){return smalltalk.ClassMigrated||(typeof ClassMigrated=="undefined"?nil:ClassMigrated)}
  1184. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  1185. return smalltalk.withContext(function($ctx1) {
  1186. var $1,$2,$3,$4,$5,$6,$7;
  1187. tmp="new*".__comma(className);
  1188. oldClass=_st(_st($Smalltalk())._current())._at_(className);
  1189. newClass=self._addSubclassOf_named_instanceVariableNames_package_(aClass,tmp,aCollection,packageName);
  1190. self._basicSwapClassNames_with_(oldClass,newClass);
  1191. _st((function(){
  1192. return smalltalk.withContext(function($ctx2) {
  1193. return self._copyClass_to_(oldClass,newClass);
  1194. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($Error(),(function(exception){
  1195. return smalltalk.withContext(function($ctx2) {
  1196. $1=self;
  1197. _st($1)._basicSwapClassNames_with_(oldClass,newClass);
  1198. $2=_st($1)._basicRemoveClass_(newClass);
  1199. $2;
  1200. return _st(exception)._signal();
  1201. }, function($ctx2) {$ctx2.fillBlock({exception:exception},$ctx1)})}));
  1202. $3=self;
  1203. _st($3)._rawRenameClass_to_(oldClass,tmp);
  1204. $4=_st($3)._rawRenameClass_to_(newClass,className);
  1205. _st(_st(oldClass)._subclasses())._do_displayingProgress_((function(each){
  1206. return smalltalk.withContext(function($ctx2) {
  1207. return self._migrateClass_superclass_(each,newClass);
  1208. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),_st("Recompiling ".__comma(_st(newClass)._name())).__comma("..."));
  1209. self._basicRemoveClass_(oldClass);
  1210. $5=_st($ClassMigrated())._new();
  1211. _st($5)._theClass_(newClass);
  1212. _st($5)._oldClass_(oldClass);
  1213. $6=_st($5)._yourself();
  1214. _st(_st($SystemAnnouncer())._current())._announce_($6);
  1215. $7=newClass;
  1216. return $7;
  1217. }, 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)})},
  1218. 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"]}),
  1219. smalltalk.ClassBuilder);
  1220. smalltalk.addMethod(
  1221. smalltalk.method({
  1222. selector: "rawRenameClass:to:",
  1223. fn: function (aClass,aString){
  1224. var self=this;
  1225. return smalltalk.withContext(function($ctx1) {
  1226. smalltalk[aString] = aClass;
  1227. ;
  1228. return self}, function($ctx1) {$ctx1.fill(self,"rawRenameClass:to:",{aClass:aClass,aString:aString},smalltalk.ClassBuilder)})},
  1229. messageSends: []}),
  1230. smalltalk.ClassBuilder);
  1231. smalltalk.addMethod(
  1232. smalltalk.method({
  1233. selector: "renameClass:to:",
  1234. fn: function (aClass,className){
  1235. var self=this;
  1236. function $ClassRenamed(){return smalltalk.ClassRenamed||(typeof ClassRenamed=="undefined"?nil:ClassRenamed)}
  1237. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  1238. return smalltalk.withContext(function($ctx1) {
  1239. var $1,$2;
  1240. self._basicRenameClass_to_(aClass,className);
  1241. _st(aClass)._recompile();
  1242. $1=_st($ClassRenamed())._new();
  1243. _st($1)._theClass_(aClass);
  1244. $2=_st($1)._yourself();
  1245. _st(_st($SystemAnnouncer())._current())._announce_($2);
  1246. return self}, function($ctx1) {$ctx1.fill(self,"renameClass:to:",{aClass:aClass,className:className},smalltalk.ClassBuilder)})},
  1247. messageSends: ["basicRenameClass:to:", "recompile", "announce:", "theClass:", "new", "yourself", "current"]}),
  1248. smalltalk.ClassBuilder);
  1249. smalltalk.addMethod(
  1250. smalltalk.method({
  1251. selector: "setupClass:",
  1252. fn: function (aClass){
  1253. var self=this;
  1254. return smalltalk.withContext(function($ctx1) {
  1255. smalltalk.init(aClass);;
  1256. return self}, function($ctx1) {$ctx1.fill(self,"setupClass:",{aClass:aClass},smalltalk.ClassBuilder)})},
  1257. messageSends: []}),
  1258. smalltalk.ClassBuilder);
  1259. smalltalk.addMethod(
  1260. smalltalk.method({
  1261. selector: "superclass:subclass:",
  1262. fn: function (aClass,className){
  1263. var self=this;
  1264. return smalltalk.withContext(function($ctx1) {
  1265. var $1;
  1266. $1=self._superclass_subclass_instanceVariableNames_package_(aClass,className,"",nil);
  1267. return $1;
  1268. }, function($ctx1) {$ctx1.fill(self,"superclass:subclass:",{aClass:aClass,className:className},smalltalk.ClassBuilder)})},
  1269. messageSends: ["superclass:subclass:instanceVariableNames:package:"]}),
  1270. smalltalk.ClassBuilder);
  1271. smalltalk.addMethod(
  1272. smalltalk.method({
  1273. selector: "superclass:subclass:instanceVariableNames:package:",
  1274. fn: function (aClass,className,ivarNames,packageName){
  1275. var self=this;
  1276. var newClass;
  1277. function $ClassAdded(){return smalltalk.ClassAdded||(typeof ClassAdded=="undefined"?nil:ClassAdded)}
  1278. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  1279. return smalltalk.withContext(function($ctx1) {
  1280. var $1,$2,$3,$4,$6,$5,$7,$8,$9;
  1281. $1=self;
  1282. $2=aClass;
  1283. $3=className;
  1284. $4=self._instanceVariableNamesFor_(ivarNames);
  1285. $6=packageName;
  1286. if(($receiver = $6) == nil || $receiver == undefined){
  1287. $5="unclassified";
  1288. } else {
  1289. $5=$6;
  1290. };
  1291. newClass=_st($1)._addSubclassOf_named_instanceVariableNames_package_($2,$3,$4,$5);
  1292. self._setupClass_(newClass);
  1293. $7=_st($ClassAdded())._new();
  1294. _st($7)._theClass_(newClass);
  1295. $8=_st($7)._yourself();
  1296. _st(_st($SystemAnnouncer())._current())._announce_($8);
  1297. $9=newClass;
  1298. return $9;
  1299. }, function($ctx1) {$ctx1.fill(self,"superclass:subclass:instanceVariableNames:package:",{aClass:aClass,className:className,ivarNames:ivarNames,packageName:packageName,newClass:newClass},smalltalk.ClassBuilder)})},
  1300. messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "instanceVariableNamesFor:", "ifNil:", "setupClass:", "announce:", "theClass:", "new", "yourself", "current"]}),
  1301. smalltalk.ClassBuilder);
  1302. smalltalk.addClass('ClassCategoryReader', smalltalk.Object, ['class', 'category'], 'Kernel-Classes');
  1303. smalltalk.addMethod(
  1304. smalltalk.method({
  1305. selector: "class:category:",
  1306. fn: function (aClass,aString){
  1307. var self=this;
  1308. return smalltalk.withContext(function($ctx1) {
  1309. self["@class"]=aClass;
  1310. self["@category"]=aString;
  1311. return self}, function($ctx1) {$ctx1.fill(self,"class:category:",{aClass:aClass,aString:aString},smalltalk.ClassCategoryReader)})},
  1312. messageSends: []}),
  1313. smalltalk.ClassCategoryReader);
  1314. smalltalk.addMethod(
  1315. smalltalk.method({
  1316. selector: "compileMethod:",
  1317. fn: function (aString){
  1318. var self=this;
  1319. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  1320. return smalltalk.withContext(function($ctx1) {
  1321. _st(_st($Compiler())._new())._install_forClass_category_(aString,self["@class"],self["@category"]);
  1322. return self}, function($ctx1) {$ctx1.fill(self,"compileMethod:",{aString:aString},smalltalk.ClassCategoryReader)})},
  1323. messageSends: ["install:forClass:category:", "new"]}),
  1324. smalltalk.ClassCategoryReader);
  1325. smalltalk.addMethod(
  1326. smalltalk.method({
  1327. selector: "initialize",
  1328. fn: function (){
  1329. var self=this;
  1330. return smalltalk.withContext(function($ctx1) {
  1331. smalltalk.ClassCategoryReader.superclass.fn.prototype._initialize.apply(_st(self), []);
  1332. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ClassCategoryReader)})},
  1333. messageSends: ["initialize"]}),
  1334. smalltalk.ClassCategoryReader);
  1335. smalltalk.addMethod(
  1336. smalltalk.method({
  1337. selector: "scanFrom:",
  1338. fn: function (aChunkParser){
  1339. var self=this;
  1340. var chunk;
  1341. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  1342. return smalltalk.withContext(function($ctx1) {
  1343. _st((function(){
  1344. return smalltalk.withContext(function($ctx2) {
  1345. chunk=_st(aChunkParser)._nextChunk();
  1346. chunk;
  1347. return _st(chunk)._isEmpty();
  1348. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  1349. return smalltalk.withContext(function($ctx2) {
  1350. return self._compileMethod_(chunk);
  1351. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1352. _st(_st($ClassBuilder())._new())._setupClass_(self["@class"]);
  1353. return self}, function($ctx1) {$ctx1.fill(self,"scanFrom:",{aChunkParser:aChunkParser,chunk:chunk},smalltalk.ClassCategoryReader)})},
  1354. messageSends: ["whileFalse:", "compileMethod:", "nextChunk", "isEmpty", "setupClass:", "new"]}),
  1355. smalltalk.ClassCategoryReader);
  1356. smalltalk.addClass('ClassCommentReader', smalltalk.Object, ['class'], 'Kernel-Classes');
  1357. smalltalk.addMethod(
  1358. smalltalk.method({
  1359. selector: "class:",
  1360. fn: function (aClass){
  1361. var self=this;
  1362. return smalltalk.withContext(function($ctx1) {
  1363. self["@class"]=aClass;
  1364. return self}, function($ctx1) {$ctx1.fill(self,"class:",{aClass:aClass},smalltalk.ClassCommentReader)})},
  1365. messageSends: []}),
  1366. smalltalk.ClassCommentReader);
  1367. smalltalk.addMethod(
  1368. smalltalk.method({
  1369. selector: "initialize",
  1370. fn: function (){
  1371. var self=this;
  1372. return smalltalk.withContext(function($ctx1) {
  1373. smalltalk.ClassCommentReader.superclass.fn.prototype._initialize.apply(_st(self), []);
  1374. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ClassCommentReader)})},
  1375. messageSends: ["initialize"]}),
  1376. smalltalk.ClassCommentReader);
  1377. smalltalk.addMethod(
  1378. smalltalk.method({
  1379. selector: "scanFrom:",
  1380. fn: function (aChunkParser){
  1381. var self=this;
  1382. var chunk;
  1383. return smalltalk.withContext(function($ctx1) {
  1384. var $1;
  1385. chunk=_st(aChunkParser)._nextChunk();
  1386. $1=_st(chunk)._isEmpty();
  1387. if(! smalltalk.assert($1)){
  1388. self._setComment_(chunk);
  1389. };
  1390. return self}, function($ctx1) {$ctx1.fill(self,"scanFrom:",{aChunkParser:aChunkParser,chunk:chunk},smalltalk.ClassCommentReader)})},
  1391. messageSends: ["nextChunk", "ifFalse:", "setComment:", "isEmpty"]}),
  1392. smalltalk.ClassCommentReader);
  1393. smalltalk.addMethod(
  1394. smalltalk.method({
  1395. selector: "setComment:",
  1396. fn: function (aString){
  1397. var self=this;
  1398. return smalltalk.withContext(function($ctx1) {
  1399. _st(self["@class"])._comment_(aString);
  1400. return self}, function($ctx1) {$ctx1.fill(self,"setComment:",{aString:aString},smalltalk.ClassCommentReader)})},
  1401. messageSends: ["comment:"]}),
  1402. smalltalk.ClassCommentReader);
  1403. smalltalk.addClass('ClassSorterNode', smalltalk.Object, ['theClass', 'level', 'nodes'], 'Kernel-Classes');
  1404. smalltalk.addMethod(
  1405. smalltalk.method({
  1406. selector: "getNodesFrom:",
  1407. fn: function (aCollection){
  1408. var self=this;
  1409. var children,others;
  1410. function $ClassSorterNode(){return smalltalk.ClassSorterNode||(typeof ClassSorterNode=="undefined"?nil:ClassSorterNode)}
  1411. return smalltalk.withContext(function($ctx1) {
  1412. var $1;
  1413. children=[];
  1414. others=[];
  1415. _st(aCollection)._do_((function(each){
  1416. return smalltalk.withContext(function($ctx2) {
  1417. $1=_st(_st(each)._superclass()).__eq(self._theClass());
  1418. if(smalltalk.assert($1)){
  1419. return _st(children)._add_(each);
  1420. } else {
  1421. return _st(others)._add_(each);
  1422. };
  1423. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1424. self["@nodes"]=_st(children)._collect_((function(each){
  1425. return smalltalk.withContext(function($ctx2) {
  1426. return _st($ClassSorterNode())._on_classes_level_(each,others,_st(self._level()).__plus((1)));
  1427. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1428. return self}, function($ctx1) {$ctx1.fill(self,"getNodesFrom:",{aCollection:aCollection,children:children,others:others},smalltalk.ClassSorterNode)})},
  1429. messageSends: ["do:", "ifTrue:ifFalse:", "add:", "=", "theClass", "superclass", "collect:", "on:classes:level:", "+", "level"]}),
  1430. smalltalk.ClassSorterNode);
  1431. smalltalk.addMethod(
  1432. smalltalk.method({
  1433. selector: "level",
  1434. fn: function (){
  1435. var self=this;
  1436. return smalltalk.withContext(function($ctx1) {
  1437. var $1;
  1438. $1=self["@level"];
  1439. return $1;
  1440. }, function($ctx1) {$ctx1.fill(self,"level",{},smalltalk.ClassSorterNode)})},
  1441. messageSends: []}),
  1442. smalltalk.ClassSorterNode);
  1443. smalltalk.addMethod(
  1444. smalltalk.method({
  1445. selector: "level:",
  1446. fn: function (anInteger){
  1447. var self=this;
  1448. return smalltalk.withContext(function($ctx1) {
  1449. self["@level"]=anInteger;
  1450. return self}, function($ctx1) {$ctx1.fill(self,"level:",{anInteger:anInteger},smalltalk.ClassSorterNode)})},
  1451. messageSends: []}),
  1452. smalltalk.ClassSorterNode);
  1453. smalltalk.addMethod(
  1454. smalltalk.method({
  1455. selector: "nodes",
  1456. fn: function (){
  1457. var self=this;
  1458. return smalltalk.withContext(function($ctx1) {
  1459. var $1;
  1460. $1=self["@nodes"];
  1461. return $1;
  1462. }, function($ctx1) {$ctx1.fill(self,"nodes",{},smalltalk.ClassSorterNode)})},
  1463. messageSends: []}),
  1464. smalltalk.ClassSorterNode);
  1465. smalltalk.addMethod(
  1466. smalltalk.method({
  1467. selector: "theClass",
  1468. fn: function (){
  1469. var self=this;
  1470. return smalltalk.withContext(function($ctx1) {
  1471. var $1;
  1472. $1=self["@theClass"];
  1473. return $1;
  1474. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.ClassSorterNode)})},
  1475. messageSends: []}),
  1476. smalltalk.ClassSorterNode);
  1477. smalltalk.addMethod(
  1478. smalltalk.method({
  1479. selector: "theClass:",
  1480. fn: function (aClass){
  1481. var self=this;
  1482. return smalltalk.withContext(function($ctx1) {
  1483. self["@theClass"]=aClass;
  1484. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.ClassSorterNode)})},
  1485. messageSends: []}),
  1486. smalltalk.ClassSorterNode);
  1487. smalltalk.addMethod(
  1488. smalltalk.method({
  1489. selector: "traverseClassesWith:",
  1490. fn: function (aCollection){
  1491. var self=this;
  1492. return smalltalk.withContext(function($ctx1) {
  1493. _st(aCollection)._add_(self._theClass());
  1494. _st(_st(self._nodes())._sorted_((function(a,b){
  1495. return smalltalk.withContext(function($ctx2) {
  1496. return _st(_st(_st(a)._theClass())._name()).__lt_eq(_st(_st(b)._theClass())._name());
  1497. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(aNode){
  1498. return smalltalk.withContext(function($ctx2) {
  1499. return _st(aNode)._traverseClassesWith_(aCollection);
  1500. }, function($ctx2) {$ctx2.fillBlock({aNode:aNode},$ctx1)})}));
  1501. return self}, function($ctx1) {$ctx1.fill(self,"traverseClassesWith:",{aCollection:aCollection},smalltalk.ClassSorterNode)})},
  1502. messageSends: ["add:", "theClass", "do:", "traverseClassesWith:", "sorted:", "<=", "name", "nodes"]}),
  1503. smalltalk.ClassSorterNode);
  1504. smalltalk.addMethod(
  1505. smalltalk.method({
  1506. selector: "on:classes:level:",
  1507. fn: function (aClass,aCollection,anInteger){
  1508. var self=this;
  1509. return smalltalk.withContext(function($ctx1) {
  1510. var $2,$3,$1;
  1511. $2=self._new();
  1512. _st($2)._theClass_(aClass);
  1513. _st($2)._level_(anInteger);
  1514. _st($2)._getNodesFrom_(aCollection);
  1515. $3=_st($2)._yourself();
  1516. $1=$3;
  1517. return $1;
  1518. }, function($ctx1) {$ctx1.fill(self,"on:classes:level:",{aClass:aClass,aCollection:aCollection,anInteger:anInteger},smalltalk.ClassSorterNode.klass)})},
  1519. messageSends: ["theClass:", "new", "level:", "getNodesFrom:", "yourself"]}),
  1520. smalltalk.ClassSorterNode.klass);
  1521. });