Kernel-Classes.deploy.js 62 KB

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