2
0

Kernel-Classes.js 85 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126
  1. smalltalk.addPackage('Kernel-Classes');
  2. smalltalk.addClass('Behavior', smalltalk.Object, [], 'Kernel-Classes');
  3. smalltalk.Behavior.comment="I am the superclass of all class objects.\x0a\x0aI define the protocol for creating instances of a class with `#basicNew` and `#new` (see `boot.js` for class constructors details).\x0a\x0aMy instances know about the subclass/superclass relationships between classes, contain the description that instances are created from,\x0aand hold the method dictionary that's associated with each class.\x0a\x0aI also provides methods for compiling methods, examining the method dictionary, and iterating over the class hierarchy."
  4. smalltalk.addMethod(
  5. smalltalk.method({
  6. selector: ">>",
  7. category: 'accessing',
  8. fn: function (aString){
  9. var self=this;
  10. return smalltalk.withContext(function($ctx1) {
  11. var $1;
  12. $1=_st(self)._methodAt_(aString);
  13. return $1;
  14. }, function($ctx1) {$ctx1.fill(self,">>",{aString:aString},smalltalk.Behavior)})},
  15. args: ["aString"],
  16. source: ">> aString\x0a\x09^ self methodAt: aString",
  17. messageSends: ["methodAt:"],
  18. referencedClasses: []
  19. }),
  20. smalltalk.Behavior);
  21. smalltalk.addMethod(
  22. smalltalk.method({
  23. selector: "addCompiledMethod:",
  24. category: 'compiling',
  25. fn: function (aMethod){
  26. var self=this;
  27. var oldMethod,announcement;
  28. function $MethodAdded(){return smalltalk.MethodAdded||(typeof MethodAdded=="undefined"?nil:MethodAdded)}
  29. function $MethodModified(){return smalltalk.MethodModified||(typeof MethodModified=="undefined"?nil:MethodModified)}
  30. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  31. return smalltalk.withContext(function($ctx1) {
  32. var $1,$2,$3,$4,$5,$6;
  33. oldMethod=_st(_st(self)._methodDictionary())._at_ifAbsent_(_st(aMethod)._selector(),(function(){
  34. return smalltalk.withContext(function($ctx2) {
  35. return nil;
  36. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  37. $1=_st(_st(self)._protocols())._includes_(_st(aMethod)._protocol());
  38. if(! smalltalk.assert($1)){
  39. _st(_st(self)._organization())._addElement_(_st(aMethod)._protocol());
  40. };
  41. _st(self)._basicAddCompiledMethod_(aMethod);
  42. $2=oldMethod;
  43. if(($receiver = $2) == nil || $receiver == undefined){
  44. $3=_st($MethodAdded())._new();
  45. _st($3)._method_(aMethod);
  46. $4=_st($3)._yourself();
  47. announcement=$4;
  48. } else {
  49. $5=_st($MethodModified())._new();
  50. _st($5)._oldMethod_(oldMethod);
  51. _st($5)._method_(aMethod);
  52. $6=_st($5)._yourself();
  53. announcement=$6;
  54. };
  55. _st(_st($SystemAnnouncer())._current())._announce_(announcement);
  56. return self}, function($ctx1) {$ctx1.fill(self,"addCompiledMethod:",{aMethod:aMethod,oldMethod:oldMethod,announcement:announcement},smalltalk.Behavior)})},
  57. args: ["aMethod"],
  58. source: "addCompiledMethod: aMethod\x0a\x09| oldMethod announcement |\x0a\x09\x0a\x09oldMethod := self methodDictionary\x0a\x09\x09at: aMethod selector\x0a\x09\x09ifAbsent: [ nil ].\x0a\x09\x0a\x09(self protocols includes: aMethod protocol)\x0a\x09\x09ifFalse: [ self organization addElement: aMethod protocol ].\x0a\x0a\x09self basicAddCompiledMethod: aMethod.\x0a\x09\x0a\x09announcement := oldMethod\x0a\x09\x09ifNil: [\x0a\x09\x09\x09MethodAdded new\x0a\x09\x09\x09\x09\x09method: aMethod;\x0a\x09\x09\x09\x09\x09yourself ]\x0a\x09\x09ifNotNil: [\x0a\x09\x09\x09MethodModified new\x0a\x09\x09\x09\x09\x09oldMethod: oldMethod;\x0a\x09\x09\x09\x09\x09method: aMethod;\x0a\x09\x09\x09\x09\x09yourself ].\x0a\x09\x09\x09\x09\x09\x0a\x09\x09\x09\x09\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09\x09\x09announce: announcement",
  59. messageSends: ["at:ifAbsent:", "selector", "methodDictionary", "ifFalse:", "addElement:", "protocol", "organization", "includes:", "protocols", "basicAddCompiledMethod:", "ifNil:ifNotNil:", "method:", "new", "yourself", "oldMethod:", "announce:", "current"],
  60. referencedClasses: ["MethodAdded", "MethodModified", "SystemAnnouncer"]
  61. }),
  62. smalltalk.Behavior);
  63. smalltalk.addMethod(
  64. smalltalk.method({
  65. selector: "allInstanceVariableNames",
  66. category: 'accessing',
  67. fn: function (){
  68. var self=this;
  69. var result;
  70. return smalltalk.withContext(function($ctx1) {
  71. var $1,$2;
  72. result=_st(_st(self)._instanceVariableNames())._copy();
  73. $1=_st(self)._superclass();
  74. if(($receiver = $1) == nil || $receiver == undefined){
  75. $1;
  76. } else {
  77. _st(result)._addAll_(_st(_st(self)._superclass())._allInstanceVariableNames());
  78. };
  79. $2=result;
  80. return $2;
  81. }, function($ctx1) {$ctx1.fill(self,"allInstanceVariableNames",{result:result},smalltalk.Behavior)})},
  82. args: [],
  83. source: "allInstanceVariableNames\x0a\x09| result |\x0a\x09result := self instanceVariableNames copy.\x0a\x09self superclass ifNotNil: [\x0a\x09\x09result addAll: self superclass allInstanceVariableNames].\x0a\x09^result",
  84. messageSends: ["copy", "instanceVariableNames", "ifNotNil:", "addAll:", "allInstanceVariableNames", "superclass"],
  85. referencedClasses: []
  86. }),
  87. smalltalk.Behavior);
  88. smalltalk.addMethod(
  89. smalltalk.method({
  90. selector: "allSelectors",
  91. category: 'accessing',
  92. fn: function (){
  93. var self=this;
  94. return smalltalk.withContext(function($ctx1) {
  95. var $2,$3,$1;
  96. $1=_st(_st(self)._allSuperclasses())._inject_into_(_st(self)._selectors(),(function(soFar,aBehavior){
  97. return smalltalk.withContext(function($ctx2) {
  98. $2=soFar;
  99. _st($2)._addAll_(_st(aBehavior)._selectors());
  100. $3=_st($2)._yourself();
  101. return $3;
  102. }, function($ctx2) {$ctx2.fillBlock({soFar:soFar,aBehavior:aBehavior},$ctx1)})}));
  103. return $1;
  104. }, function($ctx1) {$ctx1.fill(self,"allSelectors",{},smalltalk.Behavior)})},
  105. args: [],
  106. source: "allSelectors\x0a\x09^self allSuperclasses\x0a\x09\x09inject: self selectors\x0a\x09\x09into: [ :soFar :aBehavior | soFar addAll: aBehavior selectors; yourself ]",
  107. messageSends: ["inject:into:", "selectors", "addAll:", "yourself", "allSuperclasses"],
  108. referencedClasses: []
  109. }),
  110. smalltalk.Behavior);
  111. smalltalk.addMethod(
  112. smalltalk.method({
  113. selector: "allSubclasses",
  114. category: 'accessing',
  115. fn: function (){
  116. var self=this;
  117. var result;
  118. return smalltalk.withContext(function($ctx1) {
  119. var $1;
  120. result=_st(self)._subclasses();
  121. _st(_st(self)._subclasses())._do_((function(each){
  122. return smalltalk.withContext(function($ctx2) {
  123. return _st(result)._addAll_(_st(each)._allSubclasses());
  124. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  125. $1=result;
  126. return $1;
  127. }, function($ctx1) {$ctx1.fill(self,"allSubclasses",{result:result},smalltalk.Behavior)})},
  128. args: [],
  129. source: "allSubclasses\x0a\x09| result |\x0a\x09result := self subclasses.\x0a\x09self subclasses do: [:each |\x0a\x09\x09result addAll: each allSubclasses].\x0a\x09^result",
  130. messageSends: ["subclasses", "do:", "addAll:", "allSubclasses"],
  131. referencedClasses: []
  132. }),
  133. smalltalk.Behavior);
  134. smalltalk.addMethod(
  135. smalltalk.method({
  136. selector: "allSubclassesDo:",
  137. category: 'enumerating',
  138. fn: function (aBlock){
  139. var self=this;
  140. return smalltalk.withContext(function($ctx1) {
  141. _st(_st(self)._subclasses())._do_((function(each){
  142. return smalltalk.withContext(function($ctx2) {
  143. _st(aBlock)._value_(each);
  144. return _st(each)._allSubclassesDo_(aBlock);
  145. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  146. return self}, function($ctx1) {$ctx1.fill(self,"allSubclassesDo:",{aBlock:aBlock},smalltalk.Behavior)})},
  147. args: ["aBlock"],
  148. source: "allSubclassesDo: aBlock\x0a\x09\x22Evaluate the argument, aBlock, for each of the receiver's subclasses.\x22\x0a\x0a\x09self subclasses do: [ :each |\x0a \x09aBlock value: each.\x0a each allSubclassesDo: aBlock ].",
  149. messageSends: ["do:", "value:", "allSubclassesDo:", "subclasses"],
  150. referencedClasses: []
  151. }),
  152. smalltalk.Behavior);
  153. smalltalk.addMethod(
  154. smalltalk.method({
  155. selector: "allSuperclasses",
  156. category: 'accessing',
  157. fn: function (){
  158. var self=this;
  159. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  160. return smalltalk.withContext(function($ctx1) {
  161. var $1,$2,$4,$5,$3;
  162. $1=_st(self)._superclass();
  163. if(($receiver = $1) == nil || $receiver == undefined){
  164. $2=[];
  165. return $2;
  166. } else {
  167. $1;
  168. };
  169. $4=_st($OrderedCollection())._with_(_st(self)._superclass());
  170. _st($4)._addAll_(_st(_st(self)._superclass())._allSuperclasses());
  171. $5=_st($4)._yourself();
  172. $3=$5;
  173. return $3;
  174. }, function($ctx1) {$ctx1.fill(self,"allSuperclasses",{},smalltalk.Behavior)})},
  175. args: [],
  176. source: "allSuperclasses\x0a\x09\x0a\x09self superclass ifNil: [ ^ #() ].\x0a\x09\x0a\x09^ (OrderedCollection with: self superclass)\x0a\x09\x09addAll: self superclass allSuperclasses;\x0a\x09\x09yourself",
  177. messageSends: ["ifNil:", "superclass", "addAll:", "allSuperclasses", "with:", "yourself"],
  178. referencedClasses: ["OrderedCollection"]
  179. }),
  180. smalltalk.Behavior);
  181. smalltalk.addMethod(
  182. smalltalk.method({
  183. selector: "basicAddCompiledMethod:",
  184. category: 'private',
  185. fn: function (aMethod){
  186. var self=this;
  187. return smalltalk.withContext(function($ctx1) {
  188. smalltalk.addMethod(aMethod, self);
  189. return self}, function($ctx1) {$ctx1.fill(self,"basicAddCompiledMethod:",{aMethod:aMethod},smalltalk.Behavior)})},
  190. args: ["aMethod"],
  191. source: "basicAddCompiledMethod: aMethod\x0a\x09<smalltalk.addMethod(aMethod, self)>",
  192. messageSends: [],
  193. referencedClasses: []
  194. }),
  195. smalltalk.Behavior);
  196. smalltalk.addMethod(
  197. smalltalk.method({
  198. selector: "basicNew",
  199. category: 'instance creation',
  200. fn: function (){
  201. var self=this;
  202. return smalltalk.withContext(function($ctx1) {
  203. return new self.fn();
  204. return self}, function($ctx1) {$ctx1.fill(self,"basicNew",{},smalltalk.Behavior)})},
  205. args: [],
  206. source: "basicNew\x0a\x09<return new self.fn()>",
  207. messageSends: [],
  208. referencedClasses: []
  209. }),
  210. smalltalk.Behavior);
  211. smalltalk.addMethod(
  212. smalltalk.method({
  213. selector: "basicRemoveCompiledMethod:",
  214. category: 'private',
  215. fn: function (aMethod){
  216. var self=this;
  217. return smalltalk.withContext(function($ctx1) {
  218. smalltalk.removeMethod(aMethod)
  219. smalltalk.init(self);
  220. ;
  221. return self}, function($ctx1) {$ctx1.fill(self,"basicRemoveCompiledMethod:",{aMethod:aMethod},smalltalk.Behavior)})},
  222. args: ["aMethod"],
  223. source: "basicRemoveCompiledMethod: aMethod\x0a\x09<\x0a\x09\x09smalltalk.removeMethod(aMethod)\x0a\x09\x09smalltalk.init(self);\x0a\x09>",
  224. messageSends: [],
  225. referencedClasses: []
  226. }),
  227. smalltalk.Behavior);
  228. smalltalk.addMethod(
  229. smalltalk.method({
  230. selector: "canUnderstand:",
  231. category: 'testing',
  232. fn: function (aSelector){
  233. var self=this;
  234. return smalltalk.withContext(function($ctx1) {
  235. var $1;
  236. $1=_st(_st(_st(_st(self)._methodDictionary())._keys())._includes_(_st(aSelector)._asString()))._or_((function(){
  237. return smalltalk.withContext(function($ctx2) {
  238. return _st(_st(_st(self)._superclass())._notNil())._and_((function(){
  239. return smalltalk.withContext(function($ctx3) {
  240. return _st(_st(self)._superclass())._canUnderstand_(aSelector);
  241. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  242. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  243. return $1;
  244. }, function($ctx1) {$ctx1.fill(self,"canUnderstand:",{aSelector:aSelector},smalltalk.Behavior)})},
  245. args: ["aSelector"],
  246. source: "canUnderstand: aSelector\x0a\x09^(self methodDictionary keys includes: aSelector asString) or: [\x0a\x09\x09self superclass notNil and: [self superclass canUnderstand: aSelector]]",
  247. messageSends: ["or:", "and:", "canUnderstand:", "superclass", "notNil", "includes:", "asString", "keys", "methodDictionary"],
  248. referencedClasses: []
  249. }),
  250. smalltalk.Behavior);
  251. smalltalk.addMethod(
  252. smalltalk.method({
  253. selector: "comment",
  254. category: 'accessing',
  255. fn: function (){
  256. var self=this;
  257. return smalltalk.withContext(function($ctx1) {
  258. var $2,$1;
  259. $2=_st(self)._basicAt_("comment");
  260. if(($receiver = $2) == nil || $receiver == undefined){
  261. $1="";
  262. } else {
  263. $1=$2;
  264. };
  265. return $1;
  266. }, function($ctx1) {$ctx1.fill(self,"comment",{},smalltalk.Behavior)})},
  267. args: [],
  268. source: "comment\x0a\x09^(self basicAt: 'comment') ifNil: ['']",
  269. messageSends: ["ifNil:", "basicAt:"],
  270. referencedClasses: []
  271. }),
  272. smalltalk.Behavior);
  273. smalltalk.addMethod(
  274. smalltalk.method({
  275. selector: "comment:",
  276. category: 'accessing',
  277. fn: function (aString){
  278. var self=this;
  279. function $ClassCommentChanged(){return smalltalk.ClassCommentChanged||(typeof ClassCommentChanged=="undefined"?nil:ClassCommentChanged)}
  280. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  281. return smalltalk.withContext(function($ctx1) {
  282. var $1,$2;
  283. _st(self)._basicAt_put_("comment",aString);
  284. $1=_st($ClassCommentChanged())._new();
  285. _st($1)._theClass_(self);
  286. $2=_st($1)._yourself();
  287. _st(_st($SystemAnnouncer())._current())._announce_($2);
  288. return self}, function($ctx1) {$ctx1.fill(self,"comment:",{aString:aString},smalltalk.Behavior)})},
  289. args: ["aString"],
  290. source: "comment: aString\x0a\x09self basicAt: 'comment' put: aString.\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (ClassCommentChanged new\x0a\x09\x09\x09theClass: self;\x0a\x09\x09\x09yourself)",
  291. messageSends: ["basicAt:put:", "announce:", "theClass:", "new", "yourself", "current"],
  292. referencedClasses: ["ClassCommentChanged", "SystemAnnouncer"]
  293. }),
  294. smalltalk.Behavior);
  295. smalltalk.addMethod(
  296. smalltalk.method({
  297. selector: "commentStamp",
  298. category: 'accessing',
  299. fn: function (){
  300. var self=this;
  301. function $ClassCommentReader(){return smalltalk.ClassCommentReader||(typeof ClassCommentReader=="undefined"?nil:ClassCommentReader)}
  302. return smalltalk.withContext(function($ctx1) {
  303. var $2,$3,$1;
  304. $2=_st($ClassCommentReader())._new();
  305. _st($2)._class_(self);
  306. $3=_st($2)._yourself();
  307. $1=$3;
  308. return $1;
  309. }, function($ctx1) {$ctx1.fill(self,"commentStamp",{},smalltalk.Behavior)})},
  310. args: [],
  311. source: "commentStamp\x0a\x09^ClassCommentReader new\x0a\x09class: self;\x0a\x09yourself",
  312. messageSends: ["class:", "new", "yourself"],
  313. referencedClasses: ["ClassCommentReader"]
  314. }),
  315. smalltalk.Behavior);
  316. smalltalk.addMethod(
  317. smalltalk.method({
  318. selector: "commentStamp:prior:",
  319. category: 'accessing',
  320. fn: function (aStamp,prior){
  321. var self=this;
  322. return smalltalk.withContext(function($ctx1) {
  323. var $1;
  324. $1=_st(self)._commentStamp();
  325. return $1;
  326. }, function($ctx1) {$ctx1.fill(self,"commentStamp:prior:",{aStamp:aStamp,prior:prior},smalltalk.Behavior)})},
  327. args: ["aStamp", "prior"],
  328. source: "commentStamp: aStamp prior: prior\x0a\x09\x09^self commentStamp",
  329. messageSends: ["commentStamp"],
  330. referencedClasses: []
  331. }),
  332. smalltalk.Behavior);
  333. smalltalk.addMethod(
  334. smalltalk.method({
  335. selector: "compile:",
  336. category: 'compiling',
  337. fn: function (aString){
  338. var self=this;
  339. return smalltalk.withContext(function($ctx1) {
  340. var $1;
  341. $1=_st(self)._compile_category_(aString,"");
  342. return $1;
  343. }, function($ctx1) {$ctx1.fill(self,"compile:",{aString:aString},smalltalk.Behavior)})},
  344. args: ["aString"],
  345. source: "compile: aString\x0a\x09^ self compile: aString category: ''",
  346. messageSends: ["compile:category:"],
  347. referencedClasses: []
  348. }),
  349. smalltalk.Behavior);
  350. smalltalk.addMethod(
  351. smalltalk.method({
  352. selector: "compile:category:",
  353. category: 'compiling',
  354. fn: function (aString,anotherString){
  355. var self=this;
  356. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  357. return smalltalk.withContext(function($ctx1) {
  358. var $1;
  359. $1=_st(_st($Compiler())._new())._install_forClass_category_(aString,self,anotherString);
  360. return $1;
  361. }, function($ctx1) {$ctx1.fill(self,"compile:category:",{aString:aString,anotherString:anotherString},smalltalk.Behavior)})},
  362. args: ["aString", "anotherString"],
  363. source: "compile: aString category: anotherString\x0a\x09^ Compiler new\x0a\x09\x09install: aString\x0a\x09\x09forClass: self\x0a\x09\x09category: anotherString",
  364. messageSends: ["install:forClass:category:", "new"],
  365. referencedClasses: ["Compiler"]
  366. }),
  367. smalltalk.Behavior);
  368. smalltalk.addMethod(
  369. smalltalk.method({
  370. selector: "definition",
  371. category: 'accessing',
  372. fn: function (){
  373. var self=this;
  374. return smalltalk.withContext(function($ctx1) {
  375. return "";
  376. }, function($ctx1) {$ctx1.fill(self,"definition",{},smalltalk.Behavior)})},
  377. args: [],
  378. source: "definition\x0a\x09^ ''",
  379. messageSends: [],
  380. referencedClasses: []
  381. }),
  382. smalltalk.Behavior);
  383. smalltalk.addMethod(
  384. smalltalk.method({
  385. selector: "includesBehavior:",
  386. category: 'testing',
  387. fn: function (aClass){
  388. var self=this;
  389. return smalltalk.withContext(function($ctx1) {
  390. var $1;
  391. $1=_st(_st(self).__eq_eq(aClass))._or_((function(){
  392. return smalltalk.withContext(function($ctx2) {
  393. return _st(self)._inheritsFrom_(aClass);
  394. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  395. return $1;
  396. }, function($ctx1) {$ctx1.fill(self,"includesBehavior:",{aClass:aClass},smalltalk.Behavior)})},
  397. args: ["aClass"],
  398. source: "includesBehavior: aClass\x0a\x09^ self == aClass or: [\x0a\x09\x09\x09self inheritsFrom: aClass ]",
  399. messageSends: ["or:", "inheritsFrom:", "=="],
  400. referencedClasses: []
  401. }),
  402. smalltalk.Behavior);
  403. smalltalk.addMethod(
  404. smalltalk.method({
  405. selector: "includesSelector:",
  406. category: 'testing',
  407. fn: function (aString){
  408. var self=this;
  409. return smalltalk.withContext(function($ctx1) {
  410. var $1;
  411. $1=_st(_st(self)._methodDictionary())._includesKey_(aString);
  412. return $1;
  413. }, function($ctx1) {$ctx1.fill(self,"includesSelector:",{aString:aString},smalltalk.Behavior)})},
  414. args: ["aString"],
  415. source: "includesSelector: aString\x0a\x09^ self methodDictionary includesKey: aString",
  416. messageSends: ["includesKey:", "methodDictionary"],
  417. referencedClasses: []
  418. }),
  419. smalltalk.Behavior);
  420. smalltalk.addMethod(
  421. smalltalk.method({
  422. selector: "inheritsFrom:",
  423. category: 'testing',
  424. fn: function (aClass){
  425. var self=this;
  426. return smalltalk.withContext(function($ctx1) {
  427. var $1,$2;
  428. $1=_st(self)._superclass();
  429. if(($receiver = $1) == nil || $receiver == undefined){
  430. return false;
  431. } else {
  432. $1;
  433. };
  434. $2=_st(_st(aClass).__eq_eq(_st(self)._superclass()))._or_((function(){
  435. return smalltalk.withContext(function($ctx2) {
  436. return _st(_st(self)._superclass())._inheritsFrom_(aClass);
  437. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  438. return $2;
  439. }, function($ctx1) {$ctx1.fill(self,"inheritsFrom:",{aClass:aClass},smalltalk.Behavior)})},
  440. args: ["aClass"],
  441. source: "inheritsFrom: aClass\x0a\x09self superclass ifNil: [ ^ false ].\x0a\x0a\x09^ aClass == self superclass or: [ \x0a\x09\x09self superclass inheritsFrom: aClass ]",
  442. messageSends: ["ifNil:", "superclass", "or:", "inheritsFrom:", "=="],
  443. referencedClasses: []
  444. }),
  445. smalltalk.Behavior);
  446. smalltalk.addMethod(
  447. smalltalk.method({
  448. selector: "instanceVariableNames",
  449. category: 'accessing',
  450. fn: function (){
  451. var self=this;
  452. return smalltalk.withContext(function($ctx1) {
  453. return self.iVarNames;
  454. return self}, function($ctx1) {$ctx1.fill(self,"instanceVariableNames",{},smalltalk.Behavior)})},
  455. args: [],
  456. source: "instanceVariableNames\x0a\x09<return self.iVarNames>",
  457. messageSends: [],
  458. referencedClasses: []
  459. }),
  460. smalltalk.Behavior);
  461. smalltalk.addMethod(
  462. smalltalk.method({
  463. selector: "isBehavior",
  464. category: 'testing',
  465. fn: function (){
  466. var self=this;
  467. return smalltalk.withContext(function($ctx1) {
  468. return true;
  469. }, function($ctx1) {$ctx1.fill(self,"isBehavior",{},smalltalk.Behavior)})},
  470. args: [],
  471. source: "isBehavior\x0a\x09^ true",
  472. messageSends: [],
  473. referencedClasses: []
  474. }),
  475. smalltalk.Behavior);
  476. smalltalk.addMethod(
  477. smalltalk.method({
  478. selector: "lookupSelector:",
  479. category: 'accessing',
  480. fn: function (selector){
  481. var self=this;
  482. var lookupClass;
  483. return smalltalk.withContext(function($ctx1) {
  484. var $1,$2;
  485. var $early={};
  486. try {
  487. lookupClass=self;
  488. _st((function(){
  489. return smalltalk.withContext(function($ctx2) {
  490. return _st(lookupClass).__eq(nil);
  491. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  492. return smalltalk.withContext(function($ctx2) {
  493. $1=_st(lookupClass)._includesSelector_(selector);
  494. if(smalltalk.assert($1)){
  495. $2=_st(lookupClass)._methodAt_(selector);
  496. throw $early=[$2];
  497. };
  498. lookupClass=_st(lookupClass)._superclass();
  499. return lookupClass;
  500. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  501. return nil;
  502. }
  503. catch(e) {if(e===$early)return e[0]; throw e}
  504. }, function($ctx1) {$ctx1.fill(self,"lookupSelector:",{selector:selector,lookupClass:lookupClass},smalltalk.Behavior)})},
  505. args: ["selector"],
  506. source: "lookupSelector: selector\x0a\x09\x22Look up the given selector in my methodDictionary.\x0a\x09Return the corresponding method if found.\x0a\x09Otherwise chase the superclass chain and try again.\x0a\x09Return nil if no method is found.\x22\x0a\x09\x0a\x09| lookupClass |\x0a\x09\x0a\x09lookupClass := self.\x0a\x09[ lookupClass = nil ] whileFalse: [\x0a\x09\x09(lookupClass includesSelector: selector)\x0a\x09\x09\x09\x09ifTrue: [ ^ lookupClass methodAt: selector ].\x0a\x09\x09\x09lookupClass := lookupClass superclass ].\x0a\x09^ nil",
  507. messageSends: ["whileFalse:", "ifTrue:", "methodAt:", "includesSelector:", "superclass", "="],
  508. referencedClasses: []
  509. }),
  510. smalltalk.Behavior);
  511. smalltalk.addMethod(
  512. smalltalk.method({
  513. selector: "methodAt:",
  514. category: 'accessing',
  515. fn: function (aString){
  516. var self=this;
  517. return smalltalk.withContext(function($ctx1) {
  518. var $1;
  519. $1=_st(_st(self)._methodDictionary())._at_(aString);
  520. return $1;
  521. }, function($ctx1) {$ctx1.fill(self,"methodAt:",{aString:aString},smalltalk.Behavior)})},
  522. args: ["aString"],
  523. source: "methodAt: aString\x0a\x09^ self methodDictionary at: aString",
  524. messageSends: ["at:", "methodDictionary"],
  525. referencedClasses: []
  526. }),
  527. smalltalk.Behavior);
  528. smalltalk.addMethod(
  529. smalltalk.method({
  530. selector: "methodDictionary",
  531. category: 'accessing',
  532. fn: function (){
  533. var self=this;
  534. return smalltalk.withContext(function($ctx1) {
  535. var dict = smalltalk.HashedCollection._new();
  536. var methods = self.methods;
  537. for(var i in methods) {
  538. if(methods[i].selector) {
  539. dict._at_put_(methods[i].selector, methods[i]);
  540. }
  541. };
  542. return dict;
  543. return self}, function($ctx1) {$ctx1.fill(self,"methodDictionary",{},smalltalk.Behavior)})},
  544. args: [],
  545. source: "methodDictionary\x0a\x09<var dict = smalltalk.HashedCollection._new();\x0a\x09var methods = self.methods;\x0a\x09for(var i in methods) {\x0a\x09\x09if(methods[i].selector) {\x0a\x09\x09\x09dict._at_put_(methods[i].selector, methods[i]);\x0a\x09\x09}\x0a\x09};\x0a\x09return dict>",
  546. messageSends: [],
  547. referencedClasses: []
  548. }),
  549. smalltalk.Behavior);
  550. smalltalk.addMethod(
  551. smalltalk.method({
  552. selector: "methods",
  553. category: 'accessing',
  554. fn: function (){
  555. var self=this;
  556. return smalltalk.withContext(function($ctx1) {
  557. var $1;
  558. $1=_st(_st(self)._methodDictionary())._values();
  559. return $1;
  560. }, function($ctx1) {$ctx1.fill(self,"methods",{},smalltalk.Behavior)})},
  561. args: [],
  562. source: "methods\x0a\x09^ self methodDictionary values",
  563. messageSends: ["values", "methodDictionary"],
  564. referencedClasses: []
  565. }),
  566. smalltalk.Behavior);
  567. smalltalk.addMethod(
  568. smalltalk.method({
  569. selector: "methodsFor:",
  570. category: 'accessing',
  571. fn: function (aString){
  572. var self=this;
  573. function $ClassCategoryReader(){return smalltalk.ClassCategoryReader||(typeof ClassCategoryReader=="undefined"?nil:ClassCategoryReader)}
  574. return smalltalk.withContext(function($ctx1) {
  575. var $2,$3,$1;
  576. $2=_st($ClassCategoryReader())._new();
  577. _st($2)._class_category_(self,aString);
  578. $3=_st($2)._yourself();
  579. $1=$3;
  580. return $1;
  581. }, function($ctx1) {$ctx1.fill(self,"methodsFor:",{aString:aString},smalltalk.Behavior)})},
  582. args: ["aString"],
  583. source: "methodsFor: aString\x0a\x09^ClassCategoryReader new\x0a\x09\x09class: self category: aString;\x0a\x09\x09yourself",
  584. messageSends: ["class:category:", "new", "yourself"],
  585. referencedClasses: ["ClassCategoryReader"]
  586. }),
  587. smalltalk.Behavior);
  588. smalltalk.addMethod(
  589. smalltalk.method({
  590. selector: "methodsFor:stamp:",
  591. category: 'accessing',
  592. fn: function (aString,aStamp){
  593. var self=this;
  594. return smalltalk.withContext(function($ctx1) {
  595. var $1;
  596. $1=_st(self)._methodsFor_(aString);
  597. return $1;
  598. }, function($ctx1) {$ctx1.fill(self,"methodsFor:stamp:",{aString:aString,aStamp:aStamp},smalltalk.Behavior)})},
  599. args: ["aString", "aStamp"],
  600. source: "methodsFor: aString stamp: aStamp\x0a\x09\x22Added for compatibility, right now ignores stamp.\x22\x0a\x09^self methodsFor: aString",
  601. messageSends: ["methodsFor:"],
  602. referencedClasses: []
  603. }),
  604. smalltalk.Behavior);
  605. smalltalk.addMethod(
  606. smalltalk.method({
  607. selector: "methodsInProtocol:",
  608. category: 'accessing',
  609. fn: function (aString){
  610. var self=this;
  611. return smalltalk.withContext(function($ctx1) {
  612. var $1;
  613. $1=_st(_st(_st(self)._methodDictionary())._values())._select_((function(each){
  614. return smalltalk.withContext(function($ctx2) {
  615. return _st(_st(each)._protocol()).__eq(aString);
  616. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  617. return $1;
  618. }, function($ctx1) {$ctx1.fill(self,"methodsInProtocol:",{aString:aString},smalltalk.Behavior)})},
  619. args: ["aString"],
  620. source: "methodsInProtocol: aString\x0a\x09^ self methodDictionary values select: [ :each | each protocol = aString ]",
  621. messageSends: ["select:", "=", "protocol", "values", "methodDictionary"],
  622. referencedClasses: []
  623. }),
  624. smalltalk.Behavior);
  625. smalltalk.addMethod(
  626. smalltalk.method({
  627. selector: "name",
  628. category: 'accessing',
  629. fn: function (){
  630. var self=this;
  631. return smalltalk.withContext(function($ctx1) {
  632. return self.className || nil;
  633. return self}, function($ctx1) {$ctx1.fill(self,"name",{},smalltalk.Behavior)})},
  634. args: [],
  635. source: "name\x0a\x09<return self.className || nil>",
  636. messageSends: [],
  637. referencedClasses: []
  638. }),
  639. smalltalk.Behavior);
  640. smalltalk.addMethod(
  641. smalltalk.method({
  642. selector: "new",
  643. category: 'instance creation',
  644. fn: function (){
  645. var self=this;
  646. return smalltalk.withContext(function($ctx1) {
  647. var $1;
  648. $1=_st(_st(self)._basicNew())._initialize();
  649. return $1;
  650. }, function($ctx1) {$ctx1.fill(self,"new",{},smalltalk.Behavior)})},
  651. args: [],
  652. source: "new\x0a\x09^self basicNew initialize",
  653. messageSends: ["initialize", "basicNew"],
  654. referencedClasses: []
  655. }),
  656. smalltalk.Behavior);
  657. smalltalk.addMethod(
  658. smalltalk.method({
  659. selector: "organization",
  660. category: 'accessing',
  661. fn: function (){
  662. var self=this;
  663. return smalltalk.withContext(function($ctx1) {
  664. var $1;
  665. $1=_st(self)._basicAt_("organization");
  666. return $1;
  667. }, function($ctx1) {$ctx1.fill(self,"organization",{},smalltalk.Behavior)})},
  668. args: [],
  669. source: "organization\x0a\x09^ self basicAt: 'organization'",
  670. messageSends: ["basicAt:"],
  671. referencedClasses: []
  672. }),
  673. smalltalk.Behavior);
  674. smalltalk.addMethod(
  675. smalltalk.method({
  676. selector: "protocols",
  677. category: 'accessing',
  678. fn: function (){
  679. var self=this;
  680. return smalltalk.withContext(function($ctx1) {
  681. var $1;
  682. $1=_st(_st(_st(self)._organization())._elements())._sorted();
  683. return $1;
  684. }, function($ctx1) {$ctx1.fill(self,"protocols",{},smalltalk.Behavior)})},
  685. args: [],
  686. source: "protocols\x0a\x09^ self organization elements sorted",
  687. messageSends: ["sorted", "elements", "organization"],
  688. referencedClasses: []
  689. }),
  690. smalltalk.Behavior);
  691. smalltalk.addMethod(
  692. smalltalk.method({
  693. selector: "protocolsDo:",
  694. category: 'enumerating',
  695. fn: function (aBlock){
  696. var self=this;
  697. var methodsByCategory;
  698. function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  699. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  700. return smalltalk.withContext(function($ctx1) {
  701. methodsByCategory=_st($HashedCollection())._new();
  702. _st(_st(_st(self)._methodDictionary())._values())._do_((function(m){
  703. return smalltalk.withContext(function($ctx2) {
  704. return _st(_st(methodsByCategory)._at_ifAbsentPut_(_st(m)._category(),(function(){
  705. return smalltalk.withContext(function($ctx3) {
  706. return _st($Array())._new();
  707. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})})))._add_(m);
  708. }, function($ctx2) {$ctx2.fillBlock({m:m},$ctx1)})}));
  709. _st(_st(self)._protocols())._do_((function(category){
  710. return smalltalk.withContext(function($ctx2) {
  711. return _st(aBlock)._value_value_(category,_st(methodsByCategory)._at_(category));
  712. }, function($ctx2) {$ctx2.fillBlock({category:category},$ctx1)})}));
  713. return self}, function($ctx1) {$ctx1.fill(self,"protocolsDo:",{aBlock:aBlock,methodsByCategory:methodsByCategory},smalltalk.Behavior)})},
  714. args: ["aBlock"],
  715. source: "protocolsDo: aBlock\x0a\x09\x22Execute aBlock for each method category with\x0a\x09its collection of methods in the sort order of category name.\x22\x0a\x0a\x09| methodsByCategory |\x0a\x09methodsByCategory := HashedCollection new.\x0a\x09self methodDictionary values do: [:m |\x0a\x09\x09(methodsByCategory at: m category ifAbsentPut: [Array new])\x0a\x09\x09\x09add: m].\x0a\x09self protocols do: [:category |\x0a\x09\x09aBlock value: category value: (methodsByCategory at: category)]",
  716. messageSends: ["new", "do:", "add:", "at:ifAbsentPut:", "category", "values", "methodDictionary", "value:value:", "at:", "protocols"],
  717. referencedClasses: ["HashedCollection", "Array"]
  718. }),
  719. smalltalk.Behavior);
  720. smalltalk.addMethod(
  721. smalltalk.method({
  722. selector: "prototype",
  723. category: 'accessing',
  724. fn: function (){
  725. var self=this;
  726. return smalltalk.withContext(function($ctx1) {
  727. return self.fn.prototype;
  728. return self}, function($ctx1) {$ctx1.fill(self,"prototype",{},smalltalk.Behavior)})},
  729. args: [],
  730. source: "prototype\x0a\x09<return self.fn.prototype>",
  731. messageSends: [],
  732. referencedClasses: []
  733. }),
  734. smalltalk.Behavior);
  735. smalltalk.addMethod(
  736. smalltalk.method({
  737. selector: "removeCompiledMethod:",
  738. category: 'compiling',
  739. fn: function (aMethod){
  740. var self=this;
  741. function $MethodRemoved(){return smalltalk.MethodRemoved||(typeof MethodRemoved=="undefined"?nil:MethodRemoved)}
  742. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  743. return smalltalk.withContext(function($ctx1) {
  744. var $1,$2;
  745. _st(self)._basicRemoveCompiledMethod_(aMethod);
  746. _st(_st(self)._methods())._detect_ifNone_((function(each){
  747. return smalltalk.withContext(function($ctx2) {
  748. return _st(_st(each)._protocol()).__eq(_st(aMethod)._protocol());
  749. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  750. return smalltalk.withContext(function($ctx2) {
  751. return _st(_st(self)._organization())._removeElement_(_st(aMethod)._protocol());
  752. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  753. $1=_st($MethodRemoved())._new();
  754. _st($1)._method_(aMethod);
  755. $2=_st($1)._yourself();
  756. _st(_st($SystemAnnouncer())._current())._announce_($2);
  757. return self}, function($ctx1) {$ctx1.fill(self,"removeCompiledMethod:",{aMethod:aMethod},smalltalk.Behavior)})},
  758. args: ["aMethod"],
  759. source: "removeCompiledMethod: aMethod\x0a\x09self basicRemoveCompiledMethod: aMethod.\x0a\x09\x0a\x09self methods\x0a\x09\x09detect: [ :each | each protocol = aMethod protocol ]\x0a\x09\x09ifNone: [ self organization removeElement: aMethod protocol ].\x0a\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (MethodRemoved new\x0a\x09\x09\x09method: aMethod;\x0a\x09\x09\x09yourself)",
  760. messageSends: ["basicRemoveCompiledMethod:", "detect:ifNone:", "=", "protocol", "removeElement:", "organization", "methods", "announce:", "method:", "new", "yourself", "current"],
  761. referencedClasses: ["MethodRemoved", "SystemAnnouncer"]
  762. }),
  763. smalltalk.Behavior);
  764. smalltalk.addMethod(
  765. smalltalk.method({
  766. selector: "selectors",
  767. category: 'accessing',
  768. fn: function (){
  769. var self=this;
  770. return smalltalk.withContext(function($ctx1) {
  771. var $1;
  772. $1=_st(_st(self)._methodDictionary())._keys();
  773. return $1;
  774. }, function($ctx1) {$ctx1.fill(self,"selectors",{},smalltalk.Behavior)})},
  775. args: [],
  776. source: "selectors\x0a\x09^ self methodDictionary keys",
  777. messageSends: ["keys", "methodDictionary"],
  778. referencedClasses: []
  779. }),
  780. smalltalk.Behavior);
  781. smalltalk.addMethod(
  782. smalltalk.method({
  783. selector: "subclasses",
  784. category: 'accessing',
  785. fn: function (){
  786. var self=this;
  787. return smalltalk.withContext(function($ctx1) {
  788. return smalltalk.subclasses(self);
  789. return self}, function($ctx1) {$ctx1.fill(self,"subclasses",{},smalltalk.Behavior)})},
  790. args: [],
  791. source: "subclasses\x0a\x09<return smalltalk.subclasses(self)>",
  792. messageSends: [],
  793. referencedClasses: []
  794. }),
  795. smalltalk.Behavior);
  796. smalltalk.addMethod(
  797. smalltalk.method({
  798. selector: "superclass",
  799. category: 'accessing',
  800. fn: function (){
  801. var self=this;
  802. return smalltalk.withContext(function($ctx1) {
  803. return self.superclass || nil;
  804. return self}, function($ctx1) {$ctx1.fill(self,"superclass",{},smalltalk.Behavior)})},
  805. args: [],
  806. source: "superclass\x0a\x09<return self.superclass || nil>",
  807. messageSends: [],
  808. referencedClasses: []
  809. }),
  810. smalltalk.Behavior);
  811. smalltalk.addMethod(
  812. smalltalk.method({
  813. selector: "theMetaClass",
  814. category: 'accessing',
  815. fn: function (){
  816. var self=this;
  817. return smalltalk.withContext(function($ctx1) {
  818. var $1;
  819. $1=_st(self)._class();
  820. return $1;
  821. }, function($ctx1) {$ctx1.fill(self,"theMetaClass",{},smalltalk.Behavior)})},
  822. args: [],
  823. source: "theMetaClass\x0a\x09^ self class",
  824. messageSends: ["class"],
  825. referencedClasses: []
  826. }),
  827. smalltalk.Behavior);
  828. smalltalk.addMethod(
  829. smalltalk.method({
  830. selector: "theNonMetaClass",
  831. category: 'accessing',
  832. fn: function (){
  833. var self=this;
  834. return smalltalk.withContext(function($ctx1) {
  835. var $1;
  836. $1=self;
  837. return $1;
  838. }, function($ctx1) {$ctx1.fill(self,"theNonMetaClass",{},smalltalk.Behavior)})},
  839. args: [],
  840. source: "theNonMetaClass\x0a\x09^ self",
  841. messageSends: [],
  842. referencedClasses: []
  843. }),
  844. smalltalk.Behavior);
  845. smalltalk.addMethod(
  846. smalltalk.method({
  847. selector: "withAllSubclasses",
  848. category: 'accessing',
  849. fn: function (){
  850. var self=this;
  851. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  852. return smalltalk.withContext(function($ctx1) {
  853. var $2,$3,$1;
  854. $2=_st($Array())._with_(self);
  855. _st($2)._addAll_(_st(self)._allSubclasses());
  856. $3=_st($2)._yourself();
  857. $1=$3;
  858. return $1;
  859. }, function($ctx1) {$ctx1.fill(self,"withAllSubclasses",{},smalltalk.Behavior)})},
  860. args: [],
  861. source: "withAllSubclasses\x0a\x09^(Array with: self) addAll: self allSubclasses; yourself",
  862. messageSends: ["addAll:", "allSubclasses", "with:", "yourself"],
  863. referencedClasses: ["Array"]
  864. }),
  865. smalltalk.Behavior);
  866. smalltalk.addClass('Class', smalltalk.Behavior, [], 'Kernel-Classes');
  867. smalltalk.Class.comment="I am __the__ class object.\x0a\x0aMy instances are the classes of the system.\x0aClass creation is done throught a `ClassBuilder` instance."
  868. smalltalk.addMethod(
  869. smalltalk.method({
  870. selector: "asJavascript",
  871. category: 'converting',
  872. fn: function (){
  873. var self=this;
  874. return smalltalk.withContext(function($ctx1) {
  875. var $1;
  876. $1=_st("smalltalk.").__comma(_st(self)._name());
  877. return $1;
  878. }, function($ctx1) {$ctx1.fill(self,"asJavascript",{},smalltalk.Class)})},
  879. args: [],
  880. source: "asJavascript\x0a\x09^ 'smalltalk.', self name",
  881. messageSends: [",", "name"],
  882. referencedClasses: []
  883. }),
  884. smalltalk.Class);
  885. smalltalk.addMethod(
  886. smalltalk.method({
  887. selector: "category",
  888. category: 'accessing',
  889. fn: function (){
  890. var self=this;
  891. return smalltalk.withContext(function($ctx1) {
  892. var $2,$1;
  893. $2=_st(self)._package();
  894. if(($receiver = $2) == nil || $receiver == undefined){
  895. $1="Unclassified";
  896. } else {
  897. $1=_st(_st(self)._package())._name();
  898. };
  899. return $1;
  900. }, function($ctx1) {$ctx1.fill(self,"category",{},smalltalk.Class)})},
  901. args: [],
  902. source: "category\x0a\x09^self package ifNil: ['Unclassified'] ifNotNil: [self package name]",
  903. messageSends: ["ifNil:ifNotNil:", "name", "package"],
  904. referencedClasses: []
  905. }),
  906. smalltalk.Class);
  907. smalltalk.addMethod(
  908. smalltalk.method({
  909. selector: "definition",
  910. category: 'accessing',
  911. fn: function (){
  912. var self=this;
  913. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  914. return smalltalk.withContext(function($ctx1) {
  915. var $2,$3,$4,$5,$1;
  916. $1=_st($String())._streamContents_((function(stream){
  917. return smalltalk.withContext(function($ctx2) {
  918. $2=stream;
  919. _st($2)._nextPutAll_(_st(_st(self)._superclass())._asString());
  920. _st($2)._nextPutAll_(" subclass: #");
  921. _st($2)._nextPutAll_(_st(self)._name());
  922. _st($2)._nextPutAll_(_st(_st($String())._lf()).__comma(_st($String())._tab()));
  923. $3=_st($2)._nextPutAll_("instanceVariableNames: '");
  924. $3;
  925. _st(_st(self)._instanceVariableNames())._do_separatedBy_((function(each){
  926. return smalltalk.withContext(function($ctx3) {
  927. return _st(stream)._nextPutAll_(each);
  928. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}),(function(){
  929. return smalltalk.withContext(function($ctx3) {
  930. return _st(stream)._nextPutAll_(" ");
  931. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  932. $4=stream;
  933. _st($4)._nextPutAll_(_st(_st("'").__comma(_st($String())._lf())).__comma(_st($String())._tab()));
  934. _st($4)._nextPutAll_("package: '");
  935. _st($4)._nextPutAll_(_st(self)._category());
  936. $5=_st($4)._nextPutAll_("'");
  937. return $5;
  938. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
  939. return $1;
  940. }, function($ctx1) {$ctx1.fill(self,"definition",{},smalltalk.Class)})},
  941. args: [],
  942. source: "definition\x0a\x09^ String streamContents: [ :stream |\x0a\x09\x09stream\x0a\x09\x09\x09nextPutAll: self superclass asString;\x0a\x09\x09\x09nextPutAll: ' subclass: #';\x0a\x09\x09\x09nextPutAll: self name;\x0a\x09\x09\x09nextPutAll: String lf, String tab;\x0a\x09\x09\x09nextPutAll: 'instanceVariableNames: '''.\x0a\x09\x09self instanceVariableNames\x0a\x09\x09\x09do: [ :each | stream nextPutAll: each ]\x0a\x09\x09\x09separatedBy: [ stream nextPutAll: ' ' ].\x0a\x09\x09stream\x0a\x09\x09\x09nextPutAll: '''', String lf, String tab;\x0a\x09\x09\x09nextPutAll: 'package: ''';\x0a\x09\x09\x09nextPutAll: self category;\x0a\x09\x09\x09nextPutAll: '''' ]",
  943. messageSends: ["streamContents:", "nextPutAll:", "asString", "superclass", "name", ",", "tab", "lf", "do:separatedBy:", "instanceVariableNames", "category"],
  944. referencedClasses: ["String"]
  945. }),
  946. smalltalk.Class);
  947. smalltalk.addMethod(
  948. smalltalk.method({
  949. selector: "isClass",
  950. category: 'testing',
  951. fn: function (){
  952. var self=this;
  953. return smalltalk.withContext(function($ctx1) {
  954. return true;
  955. }, function($ctx1) {$ctx1.fill(self,"isClass",{},smalltalk.Class)})},
  956. args: [],
  957. source: "isClass\x0a\x09^true",
  958. messageSends: [],
  959. referencedClasses: []
  960. }),
  961. smalltalk.Class);
  962. smalltalk.addMethod(
  963. smalltalk.method({
  964. selector: "package",
  965. category: 'accessing',
  966. fn: function (){
  967. var self=this;
  968. return smalltalk.withContext(function($ctx1) {
  969. var $1;
  970. $1=_st(self)._basicAt_("pkg");
  971. return $1;
  972. }, function($ctx1) {$ctx1.fill(self,"package",{},smalltalk.Class)})},
  973. args: [],
  974. source: "package\x0a\x09^ self basicAt: 'pkg'",
  975. messageSends: ["basicAt:"],
  976. referencedClasses: []
  977. }),
  978. smalltalk.Class);
  979. smalltalk.addMethod(
  980. smalltalk.method({
  981. selector: "package:",
  982. category: 'accessing',
  983. fn: function (aPackage){
  984. var self=this;
  985. var oldPackage;
  986. function $ClassMoved(){return smalltalk.ClassMoved||(typeof ClassMoved=="undefined"?nil:ClassMoved)}
  987. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  988. return smalltalk.withContext(function($ctx1) {
  989. var $1,$2,$3,$4;
  990. $1=_st(_st(self)._package()).__eq(aPackage);
  991. if(smalltalk.assert($1)){
  992. $2=self;
  993. return $2;
  994. };
  995. oldPackage=_st(self)._package();
  996. _st(self)._basicAt_put_("pkg",aPackage);
  997. _st(_st(oldPackage)._organization())._removeElement_(self);
  998. _st(_st(aPackage)._organization())._addElement_(self);
  999. $3=_st($ClassMoved())._new();
  1000. _st($3)._theClass_(self);
  1001. _st($3)._oldPackage_(oldPackage);
  1002. $4=_st($3)._yourself();
  1003. _st(_st($SystemAnnouncer())._current())._announce_($4);
  1004. return self}, function($ctx1) {$ctx1.fill(self,"package:",{aPackage:aPackage,oldPackage:oldPackage},smalltalk.Class)})},
  1005. args: ["aPackage"],
  1006. source: "package: aPackage\x0a\x09| oldPackage |\x0a\x09\x0a\x09self package = aPackage ifTrue: [ ^ self ].\x0a\x09\x0a\x09oldPackage := self package.\x0a\x09\x0a\x09self basicAt: 'pkg' put: aPackage.\x0a\x09oldPackage organization removeElement: self.\x0a\x09aPackage organization addElement: self.\x0a\x0a\x09SystemAnnouncer current announce: (ClassMoved new\x0a\x09\x09theClass: self;\x0a\x09\x09oldPackage: oldPackage;\x0a\x09\x09yourself)",
  1007. messageSends: ["ifTrue:", "=", "package", "basicAt:put:", "removeElement:", "organization", "addElement:", "announce:", "theClass:", "new", "oldPackage:", "yourself", "current"],
  1008. referencedClasses: ["ClassMoved", "SystemAnnouncer"]
  1009. }),
  1010. smalltalk.Class);
  1011. smalltalk.addMethod(
  1012. smalltalk.method({
  1013. selector: "printOn:",
  1014. category: 'printing',
  1015. fn: function (aStream){
  1016. var self=this;
  1017. return smalltalk.withContext(function($ctx1) {
  1018. _st(aStream)._nextPutAll_(_st(self)._name());
  1019. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Class)})},
  1020. args: ["aStream"],
  1021. source: "printOn: aStream\x0a\x09aStream nextPutAll: self name",
  1022. messageSends: ["nextPutAll:", "name"],
  1023. referencedClasses: []
  1024. }),
  1025. smalltalk.Class);
  1026. smalltalk.addMethod(
  1027. smalltalk.method({
  1028. selector: "rename:",
  1029. category: 'accessing',
  1030. fn: function (aString){
  1031. var self=this;
  1032. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  1033. return smalltalk.withContext(function($ctx1) {
  1034. _st(_st($ClassBuilder())._new())._renameClass_to_(self,aString);
  1035. return self}, function($ctx1) {$ctx1.fill(self,"rename:",{aString:aString},smalltalk.Class)})},
  1036. args: ["aString"],
  1037. source: "rename: aString\x0a\x09ClassBuilder new renameClass: self to: aString",
  1038. messageSends: ["renameClass:to:", "new"],
  1039. referencedClasses: ["ClassBuilder"]
  1040. }),
  1041. smalltalk.Class);
  1042. smalltalk.addMethod(
  1043. smalltalk.method({
  1044. selector: "subclass:instanceVariableNames:",
  1045. category: 'class creation',
  1046. fn: function (aString,anotherString){
  1047. var self=this;
  1048. return smalltalk.withContext(function($ctx1) {
  1049. var $1;
  1050. $1=_st(self)._subclass_instanceVariableNames_package_(aString,anotherString,nil);
  1051. return $1;
  1052. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:",{aString:aString,anotherString:anotherString},smalltalk.Class)})},
  1053. args: ["aString", "anotherString"],
  1054. source: "subclass: aString instanceVariableNames: anotherString\x0a\x09\x22Kept for compatibility.\x22\x0a\x09^self subclass: aString instanceVariableNames: anotherString package: nil",
  1055. messageSends: ["subclass:instanceVariableNames:package:"],
  1056. referencedClasses: []
  1057. }),
  1058. smalltalk.Class);
  1059. smalltalk.addMethod(
  1060. smalltalk.method({
  1061. selector: "subclass:instanceVariableNames:category:",
  1062. category: 'class creation',
  1063. fn: function (aString,aString2,aString3){
  1064. var self=this;
  1065. return smalltalk.withContext(function($ctx1) {
  1066. var $1;
  1067. _st(self)._deprecatedAPI();
  1068. $1=_st(self)._subclass_instanceVariableNames_package_(aString,aString2,aString3);
  1069. return $1;
  1070. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:category:",{aString:aString,aString2:aString2,aString3:aString3},smalltalk.Class)})},
  1071. args: ["aString", "aString2", "aString3"],
  1072. source: "subclass: aString instanceVariableNames: aString2 category: aString3\x0a\x09\x22Kept for compatibility.\x22\x0a\x09self deprecatedAPI.\x0a\x09^self subclass: aString instanceVariableNames: aString2 package: aString3",
  1073. messageSends: ["deprecatedAPI", "subclass:instanceVariableNames:package:"],
  1074. referencedClasses: []
  1075. }),
  1076. smalltalk.Class);
  1077. smalltalk.addMethod(
  1078. smalltalk.method({
  1079. selector: "subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:",
  1080. category: 'class creation',
  1081. fn: function (aString,aString2,classVars,pools,aString3){
  1082. var self=this;
  1083. return smalltalk.withContext(function($ctx1) {
  1084. var $1;
  1085. $1=_st(self)._subclass_instanceVariableNames_package_(aString,aString2,aString3);
  1086. return $1;
  1087. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:",{aString:aString,aString2:aString2,classVars:classVars,pools:pools,aString3:aString3},smalltalk.Class)})},
  1088. args: ["aString", "aString2", "classVars", "pools", "aString3"],
  1089. source: "subclass: aString instanceVariableNames: aString2 classVariableNames: classVars poolDictionaries: pools category: aString3\x0a\x09\x22Just ignore class variables and pools. Added for compatibility.\x22\x0a\x09^self subclass: aString instanceVariableNames: aString2 package: aString3",
  1090. messageSends: ["subclass:instanceVariableNames:package:"],
  1091. referencedClasses: []
  1092. }),
  1093. smalltalk.Class);
  1094. smalltalk.addMethod(
  1095. smalltalk.method({
  1096. selector: "subclass:instanceVariableNames:package:",
  1097. category: 'class creation',
  1098. fn: function (aString,aString2,aString3){
  1099. var self=this;
  1100. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  1101. return smalltalk.withContext(function($ctx1) {
  1102. var $1;
  1103. $1=_st(_st($ClassBuilder())._new())._superclass_subclass_instanceVariableNames_package_(self,_st(aString)._asString(),aString2,aString3);
  1104. return $1;
  1105. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:package:",{aString:aString,aString2:aString2,aString3:aString3},smalltalk.Class)})},
  1106. args: ["aString", "aString2", "aString3"],
  1107. source: "subclass: aString instanceVariableNames: aString2 package: aString3\x0a\x09^ClassBuilder new\x0a\x09\x09superclass: self subclass: aString asString instanceVariableNames: aString2 package: aString3",
  1108. messageSends: ["superclass:subclass:instanceVariableNames:package:", "asString", "new"],
  1109. referencedClasses: ["ClassBuilder"]
  1110. }),
  1111. smalltalk.Class);
  1112. smalltalk.addClass('Metaclass', smalltalk.Behavior, [], 'Kernel-Classes');
  1113. smalltalk.Metaclass.comment="I am the root of the class hierarchy.\x0a\x0aMy instances are metaclasses, one for each real class, and have a single instance, which they hold onto: the class that they are the metaclass of."
  1114. smalltalk.addMethod(
  1115. smalltalk.method({
  1116. selector: "asJavascript",
  1117. category: 'converting',
  1118. fn: function (){
  1119. var self=this;
  1120. return smalltalk.withContext(function($ctx1) {
  1121. var $1;
  1122. $1=_st(_st("smalltalk.").__comma(_st(_st(self)._instanceClass())._name())).__comma(".klass");
  1123. return $1;
  1124. }, function($ctx1) {$ctx1.fill(self,"asJavascript",{},smalltalk.Metaclass)})},
  1125. args: [],
  1126. source: "asJavascript\x0a\x09^ 'smalltalk.', self instanceClass name, '.klass'",
  1127. messageSends: [",", "name", "instanceClass"],
  1128. referencedClasses: []
  1129. }),
  1130. smalltalk.Metaclass);
  1131. smalltalk.addMethod(
  1132. smalltalk.method({
  1133. selector: "definition",
  1134. category: 'accessing',
  1135. fn: function (){
  1136. var self=this;
  1137. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1138. return smalltalk.withContext(function($ctx1) {
  1139. var $2,$3,$1;
  1140. $1=_st($String())._streamContents_((function(stream){
  1141. return smalltalk.withContext(function($ctx2) {
  1142. $2=stream;
  1143. _st($2)._nextPutAll_(_st(self)._asString());
  1144. $3=_st($2)._nextPutAll_(" instanceVariableNames: '");
  1145. $3;
  1146. _st(_st(self)._instanceVariableNames())._do_separatedBy_((function(each){
  1147. return smalltalk.withContext(function($ctx3) {
  1148. return _st(stream)._nextPutAll_(each);
  1149. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}),(function(){
  1150. return smalltalk.withContext(function($ctx3) {
  1151. return _st(stream)._nextPutAll_(" ");
  1152. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1153. return _st(stream)._nextPutAll_("'");
  1154. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
  1155. return $1;
  1156. }, function($ctx1) {$ctx1.fill(self,"definition",{},smalltalk.Metaclass)})},
  1157. args: [],
  1158. source: "definition\x0a\x09^ String streamContents: [ :stream |\x0a\x09\x09stream\x0a\x09\x09\x09nextPutAll: self asString;\x0a\x09\x09\x09nextPutAll: ' instanceVariableNames: '''.\x0a\x09\x09self instanceVariableNames\x0a\x09\x09\x09do: [ :each | stream nextPutAll: each ]\x0a\x09\x09\x09separatedBy: [ stream nextPutAll: ' ' ].\x0a\x09\x09stream nextPutAll: '''' ]",
  1159. messageSends: ["streamContents:", "nextPutAll:", "asString", "do:separatedBy:", "instanceVariableNames"],
  1160. referencedClasses: ["String"]
  1161. }),
  1162. smalltalk.Metaclass);
  1163. smalltalk.addMethod(
  1164. smalltalk.method({
  1165. selector: "instanceClass",
  1166. category: 'accessing',
  1167. fn: function (){
  1168. var self=this;
  1169. return smalltalk.withContext(function($ctx1) {
  1170. return self.instanceClass;
  1171. return self}, function($ctx1) {$ctx1.fill(self,"instanceClass",{},smalltalk.Metaclass)})},
  1172. args: [],
  1173. source: "instanceClass\x0a\x09<return self.instanceClass>",
  1174. messageSends: [],
  1175. referencedClasses: []
  1176. }),
  1177. smalltalk.Metaclass);
  1178. smalltalk.addMethod(
  1179. smalltalk.method({
  1180. selector: "instanceVariableNames:",
  1181. category: 'accessing',
  1182. fn: function (aCollection){
  1183. var self=this;
  1184. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  1185. return smalltalk.withContext(function($ctx1) {
  1186. _st(_st($ClassBuilder())._new())._class_instanceVariableNames_(self,aCollection);
  1187. return self}, function($ctx1) {$ctx1.fill(self,"instanceVariableNames:",{aCollection:aCollection},smalltalk.Metaclass)})},
  1188. args: ["aCollection"],
  1189. source: "instanceVariableNames: aCollection\x0a\x09ClassBuilder new\x0a\x09\x09class: self instanceVariableNames: aCollection",
  1190. messageSends: ["class:instanceVariableNames:", "new"],
  1191. referencedClasses: ["ClassBuilder"]
  1192. }),
  1193. smalltalk.Metaclass);
  1194. smalltalk.addMethod(
  1195. smalltalk.method({
  1196. selector: "isMetaclass",
  1197. category: 'testing',
  1198. fn: function (){
  1199. var self=this;
  1200. return smalltalk.withContext(function($ctx1) {
  1201. return true;
  1202. }, function($ctx1) {$ctx1.fill(self,"isMetaclass",{},smalltalk.Metaclass)})},
  1203. args: [],
  1204. source: "isMetaclass\x0a\x09^true",
  1205. messageSends: [],
  1206. referencedClasses: []
  1207. }),
  1208. smalltalk.Metaclass);
  1209. smalltalk.addMethod(
  1210. smalltalk.method({
  1211. selector: "printOn:",
  1212. category: 'printing',
  1213. fn: function (aStream){
  1214. var self=this;
  1215. return smalltalk.withContext(function($ctx1) {
  1216. var $1,$2;
  1217. $1=aStream;
  1218. _st($1)._nextPutAll_(_st(_st(self)._instanceClass())._name());
  1219. $2=_st($1)._nextPutAll_(" class");
  1220. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Metaclass)})},
  1221. args: ["aStream"],
  1222. source: "printOn: aStream\x0a\x09aStream\x0a\x09\x09nextPutAll: self instanceClass name;\x0a\x09\x09nextPutAll: ' class'",
  1223. messageSends: ["nextPutAll:", "name", "instanceClass"],
  1224. referencedClasses: []
  1225. }),
  1226. smalltalk.Metaclass);
  1227. smalltalk.addMethod(
  1228. smalltalk.method({
  1229. selector: "theMetaClass",
  1230. category: 'accessing',
  1231. fn: function (){
  1232. var self=this;
  1233. return smalltalk.withContext(function($ctx1) {
  1234. var $1;
  1235. $1=self;
  1236. return $1;
  1237. }, function($ctx1) {$ctx1.fill(self,"theMetaClass",{},smalltalk.Metaclass)})},
  1238. args: [],
  1239. source: "theMetaClass\x0a\x09^ self",
  1240. messageSends: [],
  1241. referencedClasses: []
  1242. }),
  1243. smalltalk.Metaclass);
  1244. smalltalk.addMethod(
  1245. smalltalk.method({
  1246. selector: "theNonMetaClass",
  1247. category: 'accessing',
  1248. fn: function (){
  1249. var self=this;
  1250. return smalltalk.withContext(function($ctx1) {
  1251. var $1;
  1252. $1=_st(self)._instanceClass();
  1253. return $1;
  1254. }, function($ctx1) {$ctx1.fill(self,"theNonMetaClass",{},smalltalk.Metaclass)})},
  1255. args: [],
  1256. source: "theNonMetaClass\x0a\x09^ self instanceClass",
  1257. messageSends: ["instanceClass"],
  1258. referencedClasses: []
  1259. }),
  1260. smalltalk.Metaclass);
  1261. smalltalk.addClass('ClassBuilder', smalltalk.Object, [], 'Kernel-Classes');
  1262. smalltalk.ClassBuilder.comment="I am responsible for compiling new classes or modifying existing classes in the system.\x0a\x0aRather than using me directly to compile a class, use `Class >> subclass:instanceVariableNames:package:`."
  1263. smalltalk.addMethod(
  1264. smalltalk.method({
  1265. selector: "addSubclassOf:named:instanceVariableNames:package:",
  1266. category: 'class definition',
  1267. fn: function (aClass,className,aCollection,packageName){
  1268. var self=this;
  1269. var theClass;
  1270. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1271. return smalltalk.withContext(function($ctx1) {
  1272. var $1,$2,$3,$4;
  1273. theClass=_st(_st($Smalltalk())._current())._at_(className);
  1274. $1=theClass;
  1275. if(($receiver = $1) == nil || $receiver == undefined){
  1276. $1;
  1277. } else {
  1278. _st(theClass)._package_(_st(self)._createPackageNamed_(packageName));
  1279. $2=_st(_st(theClass)._superclass()).__eq_eq(aClass);
  1280. if(! smalltalk.assert($2)){
  1281. $3=_st(self)._migrateClassNamed_superclass_instanceVariableNames_package_(className,aClass,aCollection,packageName);
  1282. return $3;
  1283. };
  1284. };
  1285. $4=_st(self)._basicAddSubclassOf_named_instanceVariableNames_package_(aClass,className,aCollection,packageName);
  1286. return $4;
  1287. }, function($ctx1) {$ctx1.fill(self,"addSubclassOf:named:instanceVariableNames:package:",{aClass:aClass,className:className,aCollection:aCollection,packageName:packageName,theClass:theClass},smalltalk.ClassBuilder)})},
  1288. args: ["aClass", "className", "aCollection", "packageName"],
  1289. source: "addSubclassOf: aClass named: className instanceVariableNames: aCollection package: packageName\x0a\x09| theClass |\x0a\x09\x0a\x09theClass := Smalltalk current at: className.\x0a\x09\x0a\x09theClass ifNotNil: [\x0a\x09\x09theClass package: (self createPackageNamed: packageName).\x0a\x09\x09theClass superclass == aClass ifFalse: [\x0a\x09\x09\x09^ self\x0a\x09\x09\x09\x09migrateClassNamed: className\x0a\x09\x09\x09\x09superclass: aClass\x0a\x09\x09\x09\x09instanceVariableNames: aCollection\x0a\x09\x09\x09\x09package: packageName ] ].\x0a\x09\x09\x0a\x09\x09^ self\x0a\x09\x09\x09basicAddSubclassOf: aClass\x0a\x09\x09\x09named: className\x0a\x09\x09\x09instanceVariableNames: aCollection\x0a\x09\x09\x09package: packageName",
  1290. messageSends: ["at:", "current", "ifNotNil:", "package:", "createPackageNamed:", "ifFalse:", "migrateClassNamed:superclass:instanceVariableNames:package:", "==", "superclass", "basicAddSubclassOf:named:instanceVariableNames:package:"],
  1291. referencedClasses: ["Smalltalk"]
  1292. }),
  1293. smalltalk.ClassBuilder);
  1294. smalltalk.addMethod(
  1295. smalltalk.method({
  1296. selector: "basicAddSubclassOf:named:instanceVariableNames:package:",
  1297. category: 'private',
  1298. fn: function (aClass,aString,aCollection,packageName){
  1299. var self=this;
  1300. return smalltalk.withContext(function($ctx1) {
  1301. smalltalk.addClass(aString, aClass, aCollection, packageName);
  1302. return smalltalk[aString]
  1303. ;
  1304. return self}, function($ctx1) {$ctx1.fill(self,"basicAddSubclassOf:named:instanceVariableNames:package:",{aClass:aClass,aString:aString,aCollection:aCollection,packageName:packageName},smalltalk.ClassBuilder)})},
  1305. args: ["aClass", "aString", "aCollection", "packageName"],
  1306. source: "basicAddSubclassOf: aClass named: aString instanceVariableNames: aCollection package: packageName\x0a\x09<\x0a\x09\x09smalltalk.addClass(aString, aClass, aCollection, packageName);\x0a\x09\x09return smalltalk[aString]\x0a\x09>",
  1307. messageSends: [],
  1308. referencedClasses: []
  1309. }),
  1310. smalltalk.ClassBuilder);
  1311. smalltalk.addMethod(
  1312. smalltalk.method({
  1313. selector: "basicClass:instanceVariableNames:",
  1314. category: 'private',
  1315. fn: function (aClass,aString){
  1316. var self=this;
  1317. return smalltalk.withContext(function($ctx1) {
  1318. _st(self)._basicClass_instanceVariables_(aClass,_st(self)._instanceVariableNamesFor_(aString));
  1319. return self}, function($ctx1) {$ctx1.fill(self,"basicClass:instanceVariableNames:",{aClass:aClass,aString:aString},smalltalk.ClassBuilder)})},
  1320. args: ["aClass", "aString"],
  1321. source: "basicClass: aClass instanceVariableNames: aString\x0a\x09self basicClass: aClass instanceVariables: (self instanceVariableNamesFor: aString)",
  1322. messageSends: ["basicClass:instanceVariables:", "instanceVariableNamesFor:"],
  1323. referencedClasses: []
  1324. }),
  1325. smalltalk.ClassBuilder);
  1326. smalltalk.addMethod(
  1327. smalltalk.method({
  1328. selector: "basicClass:instanceVariables:",
  1329. category: 'private',
  1330. fn: function (aClass,aCollection){
  1331. var self=this;
  1332. return smalltalk.withContext(function($ctx1) {
  1333. var $1;
  1334. $1=_st(aClass)._isMetaclass();
  1335. if(! smalltalk.assert($1)){
  1336. _st(self)._error_(_st(_st(aClass)._name()).__comma(" is not a metaclass"));
  1337. };
  1338. _st(aClass)._basicAt_put_("iVarNames",aCollection);
  1339. return self}, function($ctx1) {$ctx1.fill(self,"basicClass:instanceVariables:",{aClass:aClass,aCollection:aCollection},smalltalk.ClassBuilder)})},
  1340. args: ["aClass", "aCollection"],
  1341. source: "basicClass: aClass instanceVariables: aCollection\x0a\x0a\x09aClass isMetaclass ifFalse: [self error: aClass name, ' is not a metaclass'].\x0a\x09aClass basicAt: 'iVarNames' put: aCollection",
  1342. messageSends: ["ifFalse:", "error:", ",", "name", "isMetaclass", "basicAt:put:"],
  1343. referencedClasses: []
  1344. }),
  1345. smalltalk.ClassBuilder);
  1346. smalltalk.addMethod(
  1347. smalltalk.method({
  1348. selector: "basicRemoveClass:",
  1349. category: 'private',
  1350. fn: function (aClass){
  1351. var self=this;
  1352. return smalltalk.withContext(function($ctx1) {
  1353. smalltalk.removeClass(aClass);
  1354. return self}, function($ctx1) {$ctx1.fill(self,"basicRemoveClass:",{aClass:aClass},smalltalk.ClassBuilder)})},
  1355. args: ["aClass"],
  1356. source: "basicRemoveClass: aClass\x0a\x09<smalltalk.removeClass(aClass)>",
  1357. messageSends: [],
  1358. referencedClasses: []
  1359. }),
  1360. smalltalk.ClassBuilder);
  1361. smalltalk.addMethod(
  1362. smalltalk.method({
  1363. selector: "basicRenameClass:to:",
  1364. category: 'private',
  1365. fn: function (aClass,aString){
  1366. var self=this;
  1367. return smalltalk.withContext(function($ctx1) {
  1368. smalltalk[aString] = aClass;
  1369. delete smalltalk[aClass.className];
  1370. aClass.className = aString;
  1371. ;
  1372. return self}, function($ctx1) {$ctx1.fill(self,"basicRenameClass:to:",{aClass:aClass,aString:aString},smalltalk.ClassBuilder)})},
  1373. args: ["aClass", "aString"],
  1374. source: "basicRenameClass: aClass to: aString\x0a\x09<\x0a\x09\x09smalltalk[aString] = aClass;\x0a\x09\x09delete smalltalk[aClass.className];\x0a\x09\x09aClass.className = aString;\x0a\x09>",
  1375. messageSends: [],
  1376. referencedClasses: []
  1377. }),
  1378. smalltalk.ClassBuilder);
  1379. smalltalk.addMethod(
  1380. smalltalk.method({
  1381. selector: "basicSwapClassNames:with:",
  1382. category: 'private',
  1383. fn: function (aClass,anotherClass){
  1384. var self=this;
  1385. return smalltalk.withContext(function($ctx1) {
  1386. var tmp = aClass.className;
  1387. aClass.className = anotherClass.className;
  1388. anotherClass.className = tmp;
  1389. ;
  1390. return self}, function($ctx1) {$ctx1.fill(self,"basicSwapClassNames:with:",{aClass:aClass,anotherClass:anotherClass},smalltalk.ClassBuilder)})},
  1391. args: ["aClass", "anotherClass"],
  1392. source: "basicSwapClassNames: aClass with: anotherClass\x0a\x09<\x0a\x09\x09var tmp = aClass.className;\x0a\x09\x09aClass.className = anotherClass.className;\x0a\x09\x09anotherClass.className = tmp;\x0a\x09>",
  1393. messageSends: [],
  1394. referencedClasses: []
  1395. }),
  1396. smalltalk.ClassBuilder);
  1397. smalltalk.addMethod(
  1398. smalltalk.method({
  1399. selector: "class:instanceVariableNames:",
  1400. category: 'class definition',
  1401. fn: function (aClass,ivarNames){
  1402. var self=this;
  1403. function $ClassDefinitionChanged(){return smalltalk.ClassDefinitionChanged||(typeof ClassDefinitionChanged=="undefined"?nil:ClassDefinitionChanged)}
  1404. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  1405. return smalltalk.withContext(function($ctx1) {
  1406. var $1,$2;
  1407. _st(self)._basicClass_instanceVariableNames_(aClass,ivarNames);
  1408. _st(self)._setupClass_(aClass);
  1409. $1=_st($ClassDefinitionChanged())._new();
  1410. _st($1)._theClass_(aClass);
  1411. $2=_st($1)._yourself();
  1412. _st(_st($SystemAnnouncer())._current())._announce_($2);
  1413. return self}, function($ctx1) {$ctx1.fill(self,"class:instanceVariableNames:",{aClass:aClass,ivarNames:ivarNames},smalltalk.ClassBuilder)})},
  1414. args: ["aClass", "ivarNames"],
  1415. source: "class: aClass instanceVariableNames: ivarNames\x0a\x09self basicClass: aClass instanceVariableNames: ivarNames.\x0a\x09self setupClass: aClass.\x0a\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (ClassDefinitionChanged new\x0a\x09\x09\x09theClass: aClass;\x0a\x09\x09\x09yourself)",
  1416. messageSends: ["basicClass:instanceVariableNames:", "setupClass:", "announce:", "theClass:", "new", "yourself", "current"],
  1417. referencedClasses: ["ClassDefinitionChanged", "SystemAnnouncer"]
  1418. }),
  1419. smalltalk.ClassBuilder);
  1420. smalltalk.addMethod(
  1421. smalltalk.method({
  1422. selector: "copyClass:named:",
  1423. category: 'copying',
  1424. fn: function (aClass,className){
  1425. var self=this;
  1426. var newClass;
  1427. function $ClassAdded(){return smalltalk.ClassAdded||(typeof ClassAdded=="undefined"?nil:ClassAdded)}
  1428. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  1429. return smalltalk.withContext(function($ctx1) {
  1430. var $1,$2,$3;
  1431. newClass=_st(self)._addSubclassOf_named_instanceVariableNames_package_(_st(aClass)._superclass(),className,_st(aClass)._instanceVariableNames(),_st(_st(aClass)._package())._name());
  1432. _st(self)._copyClass_to_(aClass,newClass);
  1433. $1=_st($ClassAdded())._new();
  1434. _st($1)._theClass_(newClass);
  1435. $2=_st($1)._yourself();
  1436. _st(_st($SystemAnnouncer())._current())._announce_($2);
  1437. $3=newClass;
  1438. return $3;
  1439. }, function($ctx1) {$ctx1.fill(self,"copyClass:named:",{aClass:aClass,className:className,newClass:newClass},smalltalk.ClassBuilder)})},
  1440. args: ["aClass", "className"],
  1441. source: "copyClass: aClass named: className\x0a\x09| newClass |\x0a\x0a\x09newClass := self\x0a\x09\x09addSubclassOf: aClass superclass\x0a\x09\x09named: className\x0a\x09\x09instanceVariableNames: aClass instanceVariableNames\x0a\x09\x09package: aClass package name.\x0a\x0a\x09self copyClass: aClass to: newClass.\x0a\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (ClassAdded new\x0a\x09\x09\x09theClass: newClass;\x0a\x09\x09\x09yourself).\x0a\x09\x0a\x09^newClass",
  1442. messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "superclass", "instanceVariableNames", "name", "package", "copyClass:to:", "announce:", "theClass:", "new", "yourself", "current"],
  1443. referencedClasses: ["ClassAdded", "SystemAnnouncer"]
  1444. }),
  1445. smalltalk.ClassBuilder);
  1446. smalltalk.addMethod(
  1447. smalltalk.method({
  1448. selector: "copyClass:to:",
  1449. category: 'copying',
  1450. fn: function (aClass,anotherClass){
  1451. var self=this;
  1452. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  1453. return smalltalk.withContext(function($ctx1) {
  1454. _st(anotherClass)._comment_(_st(aClass)._comment());
  1455. _st(_st(_st(aClass)._methodDictionary())._values())._do_((function(each){
  1456. return smalltalk.withContext(function($ctx2) {
  1457. return _st(_st($Compiler())._new())._install_forClass_category_(_st(each)._source(),anotherClass,_st(each)._category());
  1458. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1459. _st(self)._basicClass_instanceVariables_(_st(anotherClass)._class(),_st(_st(aClass)._class())._instanceVariableNames());
  1460. _st(_st(_st(_st(aClass)._class())._methodDictionary())._values())._do_((function(each){
  1461. return smalltalk.withContext(function($ctx2) {
  1462. return _st(_st($Compiler())._new())._install_forClass_category_(_st(each)._source(),_st(anotherClass)._class(),_st(each)._category());
  1463. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1464. _st(self)._setupClass_(anotherClass);
  1465. return self}, function($ctx1) {$ctx1.fill(self,"copyClass:to:",{aClass:aClass,anotherClass:anotherClass},smalltalk.ClassBuilder)})},
  1466. args: ["aClass", "anotherClass"],
  1467. source: "copyClass: aClass to: anotherClass\x0a\x0a\x09anotherClass comment: aClass comment.\x0a\x0a\x09aClass methodDictionary values do: [ :each |\x0a\x09\x09Compiler new install: each source forClass: anotherClass category: each category ].\x0a\x0a\x09self basicClass: anotherClass class instanceVariables: aClass class instanceVariableNames.\x0a\x0a\x09aClass class methodDictionary values do: [ :each |\x0a\x09\x09Compiler new install: each source forClass: anotherClass class category: each category ].\x0a\x0a\x09self setupClass: anotherClass",
  1468. messageSends: ["comment:", "comment", "do:", "install:forClass:category:", "source", "category", "new", "values", "methodDictionary", "basicClass:instanceVariables:", "class", "instanceVariableNames", "setupClass:"],
  1469. referencedClasses: ["Compiler"]
  1470. }),
  1471. smalltalk.ClassBuilder);
  1472. smalltalk.addMethod(
  1473. smalltalk.method({
  1474. selector: "createPackageNamed:",
  1475. category: 'private',
  1476. fn: function (aString){
  1477. var self=this;
  1478. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1479. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  1480. return smalltalk.withContext(function($ctx1) {
  1481. var $1;
  1482. $1=_st($Package())._named_ifAbsent_(aString,(function(){
  1483. return smalltalk.withContext(function($ctx2) {
  1484. return _st(_st($Smalltalk())._current())._createPackage_(aString);
  1485. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1486. return $1;
  1487. }, function($ctx1) {$ctx1.fill(self,"createPackageNamed:",{aString:aString},smalltalk.ClassBuilder)})},
  1488. args: ["aString"],
  1489. source: "createPackageNamed: aString\x0a\x09^ Package named: aString ifAbsent: [\x0a\x09\x09Smalltalk current createPackage: aString ]",
  1490. messageSends: ["named:ifAbsent:", "createPackage:", "current"],
  1491. referencedClasses: ["Smalltalk", "Package"]
  1492. }),
  1493. smalltalk.ClassBuilder);
  1494. smalltalk.addMethod(
  1495. smalltalk.method({
  1496. selector: "installMethod:forClass:category:",
  1497. category: 'method definition',
  1498. fn: function (aCompiledMethod,aBehavior,aString){
  1499. var self=this;
  1500. return smalltalk.withContext(function($ctx1) {
  1501. var $1;
  1502. _st(aCompiledMethod)._category_(aString);
  1503. _st(aBehavior)._addCompiledMethod_(aCompiledMethod);
  1504. _st(self)._setupClass_(aBehavior);
  1505. $1=aCompiledMethod;
  1506. return $1;
  1507. }, function($ctx1) {$ctx1.fill(self,"installMethod:forClass:category:",{aCompiledMethod:aCompiledMethod,aBehavior:aBehavior,aString:aString},smalltalk.ClassBuilder)})},
  1508. args: ["aCompiledMethod", "aBehavior", "aString"],
  1509. source: "installMethod: aCompiledMethod forClass: aBehavior category: aString\x0a\x09aCompiledMethod category: aString.\x0a\x09aBehavior addCompiledMethod: aCompiledMethod.\x0a\x09self setupClass: aBehavior.\x0a\x09^aCompiledMethod",
  1510. messageSends: ["category:", "addCompiledMethod:", "setupClass:"],
  1511. referencedClasses: []
  1512. }),
  1513. smalltalk.ClassBuilder);
  1514. smalltalk.addMethod(
  1515. smalltalk.method({
  1516. selector: "instanceVariableNamesFor:",
  1517. category: 'accessing',
  1518. fn: function (aString){
  1519. var self=this;
  1520. return smalltalk.withContext(function($ctx1) {
  1521. var $1;
  1522. $1=_st(_st(aString)._tokenize_(" "))._reject_((function(each){
  1523. return smalltalk.withContext(function($ctx2) {
  1524. return _st(each)._isEmpty();
  1525. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1526. return $1;
  1527. }, function($ctx1) {$ctx1.fill(self,"instanceVariableNamesFor:",{aString:aString},smalltalk.ClassBuilder)})},
  1528. args: ["aString"],
  1529. source: "instanceVariableNamesFor: aString\x0a\x09^(aString tokenize: ' ') reject: [ :each | each isEmpty ]",
  1530. messageSends: ["reject:", "isEmpty", "tokenize:"],
  1531. referencedClasses: []
  1532. }),
  1533. smalltalk.ClassBuilder);
  1534. smalltalk.addMethod(
  1535. smalltalk.method({
  1536. selector: "migrateClass:superclass:",
  1537. category: 'class migration',
  1538. fn: function (aClass,anotherClass){
  1539. var self=this;
  1540. return smalltalk.withContext(function($ctx1) {
  1541. var $1;
  1542. $1=_st(self)._migrateClassNamed_superclass_instanceVariableNames_package_(_st(aClass)._name(),anotherClass,_st(aClass)._instanceVariableNames(),_st(_st(aClass)._package())._name());
  1543. return $1;
  1544. }, function($ctx1) {$ctx1.fill(self,"migrateClass:superclass:",{aClass:aClass,anotherClass:anotherClass},smalltalk.ClassBuilder)})},
  1545. args: ["aClass", "anotherClass"],
  1546. source: "migrateClass: aClass superclass: anotherClass\x0a\x09^ self\x0a\x09\x09migrateClassNamed: aClass name\x0a\x09\x09superclass: anotherClass\x0a\x09\x09instanceVariableNames: aClass instanceVariableNames\x0a\x09\x09package: aClass package name",
  1547. messageSends: ["migrateClassNamed:superclass:instanceVariableNames:package:", "name", "instanceVariableNames", "package"],
  1548. referencedClasses: []
  1549. }),
  1550. smalltalk.ClassBuilder);
  1551. smalltalk.addMethod(
  1552. smalltalk.method({
  1553. selector: "migrateClassNamed:superclass:instanceVariableNames:package:",
  1554. category: 'class migration',
  1555. fn: function (className,aClass,aCollection,packageName){
  1556. var self=this;
  1557. var oldClass,newClass,tmp;
  1558. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1559. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  1560. function $ClassMigrated(){return smalltalk.ClassMigrated||(typeof ClassMigrated=="undefined"?nil:ClassMigrated)}
  1561. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  1562. return smalltalk.withContext(function($ctx1) {
  1563. var $1,$2,$3,$4,$5,$6,$7;
  1564. tmp=_st("new*").__comma(className);
  1565. oldClass=_st(_st($Smalltalk())._current())._at_(className);
  1566. newClass=_st(self)._addSubclassOf_named_instanceVariableNames_package_(aClass,tmp,aCollection,packageName);
  1567. _st(self)._basicSwapClassNames_with_(oldClass,newClass);
  1568. _st((function(){
  1569. return smalltalk.withContext(function($ctx2) {
  1570. return _st(self)._copyClass_to_(oldClass,newClass);
  1571. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($Error(),(function(exception){
  1572. return smalltalk.withContext(function($ctx2) {
  1573. $1=self;
  1574. _st($1)._basicSwapClassNames_with_(oldClass,newClass);
  1575. $2=_st($1)._basicRemoveClass_(newClass);
  1576. $2;
  1577. return _st(exception)._signal();
  1578. }, function($ctx2) {$ctx2.fillBlock({exception:exception},$ctx1)})}));
  1579. $3=self;
  1580. _st($3)._rawRenameClass_to_(oldClass,tmp);
  1581. $4=_st($3)._rawRenameClass_to_(newClass,className);
  1582. _st(_st(oldClass)._subclasses())._do_displayingProgress_((function(each){
  1583. return smalltalk.withContext(function($ctx2) {
  1584. return _st(self)._migrateClass_superclass_(each,newClass);
  1585. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),_st(_st("Recompiling ").__comma(_st(newClass)._name())).__comma("..."));
  1586. _st(self)._basicRemoveClass_(oldClass);
  1587. $5=_st($ClassMigrated())._new();
  1588. _st($5)._theClass_(newClass);
  1589. _st($5)._oldClass_(oldClass);
  1590. $6=_st($5)._yourself();
  1591. _st(_st($SystemAnnouncer())._current())._announce_($6);
  1592. $7=newClass;
  1593. return $7;
  1594. }, 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)})},
  1595. args: ["className", "aClass", "aCollection", "packageName"],
  1596. source: "migrateClassNamed: className superclass: aClass instanceVariableNames: aCollection package: packageName\x0a\x09| oldClass newClass tmp |\x0a\x09\x0a\x09tmp := 'new*', className.\x0a\x09oldClass := Smalltalk current at: className.\x0a\x09\x0a\x09newClass := self\x0a\x09\x09addSubclassOf: aClass\x0a\x09\x09named: tmp\x0a\x09\x09instanceVariableNames: aCollection\x0a\x09\x09package: packageName.\x0a\x0a\x09self basicSwapClassNames: oldClass with: newClass.\x0a\x0a\x09[ self copyClass: oldClass to: newClass ]\x0a\x09\x09on: Error\x0a\x09\x09do: [ :exception |\x0a\x09\x09\x09self\x0a\x09\x09\x09\x09basicSwapClassNames: oldClass with: newClass;\x0a\x09\x09\x09\x09basicRemoveClass: newClass.\x0a\x09\x09\x09exception signal ].\x0a\x0a\x09self\x0a\x09\x09rawRenameClass: oldClass to: tmp;\x0a\x09\x09rawRenameClass: newClass to: className.\x0a\x0a\x09oldClass subclasses \x0a\x09\x09do: [ :each | self migrateClass: each superclass: newClass ]\x0a\x09\x09displayingProgress: 'Recompiling ', newClass name, '...'.\x0a\x0a\x09self basicRemoveClass: oldClass.\x0a\x09\x0a\x09SystemAnnouncer current announce: (ClassMigrated new\x0a\x09\x09theClass: newClass;\x0a\x09\x09oldClass: oldClass;\x0a\x09\x09yourself).\x0a\x09\x0a\x09^newClass",
  1597. 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"],
  1598. referencedClasses: ["Smalltalk", "Error", "ClassMigrated", "SystemAnnouncer"]
  1599. }),
  1600. smalltalk.ClassBuilder);
  1601. smalltalk.addMethod(
  1602. smalltalk.method({
  1603. selector: "rawRenameClass:to:",
  1604. category: 'private',
  1605. fn: function (aClass,aString){
  1606. var self=this;
  1607. return smalltalk.withContext(function($ctx1) {
  1608. smalltalk[aString] = aClass;
  1609. ;
  1610. return self}, function($ctx1) {$ctx1.fill(self,"rawRenameClass:to:",{aClass:aClass,aString:aString},smalltalk.ClassBuilder)})},
  1611. args: ["aClass", "aString"],
  1612. source: "rawRenameClass: aClass to: aString\x0a\x09<\x0a\x09\x09smalltalk[aString] = aClass;\x0a\x09>",
  1613. messageSends: [],
  1614. referencedClasses: []
  1615. }),
  1616. smalltalk.ClassBuilder);
  1617. smalltalk.addMethod(
  1618. smalltalk.method({
  1619. selector: "renameClass:to:",
  1620. category: 'class migration',
  1621. fn: function (aClass,className){
  1622. var self=this;
  1623. function $ClassRenamed(){return smalltalk.ClassRenamed||(typeof ClassRenamed=="undefined"?nil:ClassRenamed)}
  1624. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  1625. return smalltalk.withContext(function($ctx1) {
  1626. var $1,$2;
  1627. _st(self)._basicRenameClass_to_(aClass,className);
  1628. $1=_st($ClassRenamed())._new();
  1629. _st($1)._theClass_(aClass);
  1630. $2=_st($1)._yourself();
  1631. _st(_st($SystemAnnouncer())._current())._announce_($2);
  1632. return self}, function($ctx1) {$ctx1.fill(self,"renameClass:to:",{aClass:aClass,className:className},smalltalk.ClassBuilder)})},
  1633. args: ["aClass", "className"],
  1634. source: "renameClass: aClass to: className\x0a\x09self basicRenameClass: aClass to: className.\x0a\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (ClassRenamed new\x0a\x09\x09\x09theClass: aClass;\x0a\x09\x09\x09yourself)",
  1635. messageSends: ["basicRenameClass:to:", "announce:", "theClass:", "new", "yourself", "current"],
  1636. referencedClasses: ["ClassRenamed", "SystemAnnouncer"]
  1637. }),
  1638. smalltalk.ClassBuilder);
  1639. smalltalk.addMethod(
  1640. smalltalk.method({
  1641. selector: "setupClass:",
  1642. category: 'public',
  1643. fn: function (aClass){
  1644. var self=this;
  1645. return smalltalk.withContext(function($ctx1) {
  1646. smalltalk.init(aClass);;
  1647. return self}, function($ctx1) {$ctx1.fill(self,"setupClass:",{aClass:aClass},smalltalk.ClassBuilder)})},
  1648. args: ["aClass"],
  1649. source: "setupClass: aClass\x0a\x09<smalltalk.init(aClass);>",
  1650. messageSends: [],
  1651. referencedClasses: []
  1652. }),
  1653. smalltalk.ClassBuilder);
  1654. smalltalk.addMethod(
  1655. smalltalk.method({
  1656. selector: "superclass:subclass:",
  1657. category: 'class definition',
  1658. fn: function (aClass,className){
  1659. var self=this;
  1660. return smalltalk.withContext(function($ctx1) {
  1661. var $1;
  1662. $1=_st(self)._superclass_subclass_instanceVariableNames_package_(aClass,className,"",nil);
  1663. return $1;
  1664. }, function($ctx1) {$ctx1.fill(self,"superclass:subclass:",{aClass:aClass,className:className},smalltalk.ClassBuilder)})},
  1665. args: ["aClass", "className"],
  1666. source: "superclass: aClass subclass: className\x0a\x09^self superclass: aClass subclass: className instanceVariableNames: '' package: nil",
  1667. messageSends: ["superclass:subclass:instanceVariableNames:package:"],
  1668. referencedClasses: []
  1669. }),
  1670. smalltalk.ClassBuilder);
  1671. smalltalk.addMethod(
  1672. smalltalk.method({
  1673. selector: "superclass:subclass:instanceVariableNames:package:",
  1674. category: 'class definition',
  1675. fn: function (aClass,className,ivarNames,packageName){
  1676. var self=this;
  1677. var newClass;
  1678. function $ClassAdded(){return smalltalk.ClassAdded||(typeof ClassAdded=="undefined"?nil:ClassAdded)}
  1679. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  1680. return smalltalk.withContext(function($ctx1) {
  1681. var $1,$2,$3,$4,$6,$5,$7,$8,$9;
  1682. $1=self;
  1683. $2=aClass;
  1684. $3=className;
  1685. $4=_st(self)._instanceVariableNamesFor_(ivarNames);
  1686. $6=packageName;
  1687. if(($receiver = $6) == nil || $receiver == undefined){
  1688. $5="unclassified";
  1689. } else {
  1690. $5=$6;
  1691. };
  1692. newClass=_st($1)._addSubclassOf_named_instanceVariableNames_package_($2,$3,$4,$5);
  1693. _st(self)._setupClass_(newClass);
  1694. $7=_st($ClassAdded())._new();
  1695. _st($7)._theClass_(newClass);
  1696. $8=_st($7)._yourself();
  1697. _st(_st($SystemAnnouncer())._current())._announce_($8);
  1698. $9=newClass;
  1699. return $9;
  1700. }, function($ctx1) {$ctx1.fill(self,"superclass:subclass:instanceVariableNames:package:",{aClass:aClass,className:className,ivarNames:ivarNames,packageName:packageName,newClass:newClass},smalltalk.ClassBuilder)})},
  1701. args: ["aClass", "className", "ivarNames", "packageName"],
  1702. source: "superclass: aClass subclass: className instanceVariableNames: ivarNames package: packageName\x0a\x09| newClass |\x0a\x09\x0a\x09newClass := self addSubclassOf: aClass\x0a\x09\x09named: className instanceVariableNames: (self instanceVariableNamesFor: ivarNames)\x0a\x09\x09package: (packageName ifNil: ['unclassified']).\x0a\x09self setupClass: newClass.\x0a\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (ClassAdded new\x0a\x09\x09\x09theClass: newClass;\x0a\x09\x09\x09yourself).\x0a\x09\x0a\x09^newClass",
  1703. messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "instanceVariableNamesFor:", "ifNil:", "setupClass:", "announce:", "theClass:", "new", "yourself", "current"],
  1704. referencedClasses: ["ClassAdded", "SystemAnnouncer"]
  1705. }),
  1706. smalltalk.ClassBuilder);
  1707. smalltalk.addClass('ClassCategoryReader', smalltalk.Object, ['class', 'category'], 'Kernel-Classes');
  1708. smalltalk.ClassCategoryReader.comment="I provide a mechanism for retrieving class descriptions stored on a file in the Smalltalk chunk format."
  1709. smalltalk.addMethod(
  1710. smalltalk.method({
  1711. selector: "class:category:",
  1712. category: 'accessing',
  1713. fn: function (aClass,aString){
  1714. var self=this;
  1715. return smalltalk.withContext(function($ctx1) {
  1716. self["@class"]=aClass;
  1717. self["@category"]=aString;
  1718. return self}, function($ctx1) {$ctx1.fill(self,"class:category:",{aClass:aClass,aString:aString},smalltalk.ClassCategoryReader)})},
  1719. args: ["aClass", "aString"],
  1720. source: "class: aClass category: aString\x0a\x09class := aClass.\x0a\x09category := aString",
  1721. messageSends: [],
  1722. referencedClasses: []
  1723. }),
  1724. smalltalk.ClassCategoryReader);
  1725. smalltalk.addMethod(
  1726. smalltalk.method({
  1727. selector: "compileMethod:",
  1728. category: 'private',
  1729. fn: function (aString){
  1730. var self=this;
  1731. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  1732. return smalltalk.withContext(function($ctx1) {
  1733. _st(_st($Compiler())._new())._install_forClass_category_(aString,self["@class"],self["@category"]);
  1734. return self}, function($ctx1) {$ctx1.fill(self,"compileMethod:",{aString:aString},smalltalk.ClassCategoryReader)})},
  1735. args: ["aString"],
  1736. source: "compileMethod: aString\x0a\x09Compiler new install: aString forClass: class category: category",
  1737. messageSends: ["install:forClass:category:", "new"],
  1738. referencedClasses: ["Compiler"]
  1739. }),
  1740. smalltalk.ClassCategoryReader);
  1741. smalltalk.addMethod(
  1742. smalltalk.method({
  1743. selector: "initialize",
  1744. category: 'initialization',
  1745. fn: function (){
  1746. var self=this;
  1747. return smalltalk.withContext(function($ctx1) {
  1748. smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  1749. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ClassCategoryReader)})},
  1750. args: [],
  1751. source: "initialize\x0a\x09super initialize.",
  1752. messageSends: ["initialize"],
  1753. referencedClasses: []
  1754. }),
  1755. smalltalk.ClassCategoryReader);
  1756. smalltalk.addMethod(
  1757. smalltalk.method({
  1758. selector: "scanFrom:",
  1759. category: 'fileIn',
  1760. fn: function (aChunkParser){
  1761. var self=this;
  1762. var chunk;
  1763. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  1764. return smalltalk.withContext(function($ctx1) {
  1765. _st((function(){
  1766. return smalltalk.withContext(function($ctx2) {
  1767. chunk=_st(aChunkParser)._nextChunk();
  1768. chunk;
  1769. return _st(chunk)._isEmpty();
  1770. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  1771. return smalltalk.withContext(function($ctx2) {
  1772. return _st(self)._compileMethod_(chunk);
  1773. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1774. _st(_st($ClassBuilder())._new())._setupClass_(self["@class"]);
  1775. return self}, function($ctx1) {$ctx1.fill(self,"scanFrom:",{aChunkParser:aChunkParser,chunk:chunk},smalltalk.ClassCategoryReader)})},
  1776. args: ["aChunkParser"],
  1777. source: "scanFrom: aChunkParser\x0a\x09| chunk |\x0a\x09[chunk := aChunkParser nextChunk.\x0a\x09chunk isEmpty] whileFalse: [\x0a\x09\x09self compileMethod: chunk].\x0a\x09ClassBuilder new setupClass: class",
  1778. messageSends: ["whileFalse:", "compileMethod:", "nextChunk", "isEmpty", "setupClass:", "new"],
  1779. referencedClasses: ["ClassBuilder"]
  1780. }),
  1781. smalltalk.ClassCategoryReader);
  1782. smalltalk.addClass('ClassCommentReader', smalltalk.Object, ['class'], 'Kernel-Classes');
  1783. smalltalk.ClassCommentReader.comment="I provide a mechanism for retrieving class comments stored on a file.\x0a\x0aSee also `ClassCategoryReader`."
  1784. smalltalk.addMethod(
  1785. smalltalk.method({
  1786. selector: "class:",
  1787. category: 'accessing',
  1788. fn: function (aClass){
  1789. var self=this;
  1790. return smalltalk.withContext(function($ctx1) {
  1791. self["@class"]=aClass;
  1792. return self}, function($ctx1) {$ctx1.fill(self,"class:",{aClass:aClass},smalltalk.ClassCommentReader)})},
  1793. args: ["aClass"],
  1794. source: "class: aClass\x0a\x09class := aClass",
  1795. messageSends: [],
  1796. referencedClasses: []
  1797. }),
  1798. smalltalk.ClassCommentReader);
  1799. smalltalk.addMethod(
  1800. smalltalk.method({
  1801. selector: "initialize",
  1802. category: 'initialization',
  1803. fn: function (){
  1804. var self=this;
  1805. return smalltalk.withContext(function($ctx1) {
  1806. smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  1807. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ClassCommentReader)})},
  1808. args: [],
  1809. source: "initialize\x0a\x09super initialize.",
  1810. messageSends: ["initialize"],
  1811. referencedClasses: []
  1812. }),
  1813. smalltalk.ClassCommentReader);
  1814. smalltalk.addMethod(
  1815. smalltalk.method({
  1816. selector: "scanFrom:",
  1817. category: 'fileIn',
  1818. fn: function (aChunkParser){
  1819. var self=this;
  1820. var chunk;
  1821. return smalltalk.withContext(function($ctx1) {
  1822. var $1;
  1823. chunk=_st(aChunkParser)._nextChunk();
  1824. $1=_st(chunk)._isEmpty();
  1825. if(! smalltalk.assert($1)){
  1826. _st(self)._setComment_(chunk);
  1827. };
  1828. return self}, function($ctx1) {$ctx1.fill(self,"scanFrom:",{aChunkParser:aChunkParser,chunk:chunk},smalltalk.ClassCommentReader)})},
  1829. args: ["aChunkParser"],
  1830. source: "scanFrom: aChunkParser\x0a\x09| chunk |\x0a\x09chunk := aChunkParser nextChunk.\x0a\x09chunk isEmpty ifFalse: [\x0a\x09\x09self setComment: chunk].",
  1831. messageSends: ["nextChunk", "ifFalse:", "setComment:", "isEmpty"],
  1832. referencedClasses: []
  1833. }),
  1834. smalltalk.ClassCommentReader);
  1835. smalltalk.addMethod(
  1836. smalltalk.method({
  1837. selector: "setComment:",
  1838. category: 'private',
  1839. fn: function (aString){
  1840. var self=this;
  1841. return smalltalk.withContext(function($ctx1) {
  1842. _st(self["@class"])._comment_(aString);
  1843. return self}, function($ctx1) {$ctx1.fill(self,"setComment:",{aString:aString},smalltalk.ClassCommentReader)})},
  1844. args: ["aString"],
  1845. source: "setComment: aString\x0a\x09class comment: aString",
  1846. messageSends: ["comment:"],
  1847. referencedClasses: []
  1848. }),
  1849. smalltalk.ClassCommentReader);
  1850. smalltalk.addClass('ClassSorterNode', smalltalk.Object, ['theClass', 'level', 'nodes'], 'Kernel-Classes');
  1851. smalltalk.ClassSorterNode.comment="I provide an algorithm for sorting classes alphabetically.\x0a\x0aSee [Issue #143](https://github.com/amber-smalltalk/amber/issues/143) on GitHub."
  1852. smalltalk.addMethod(
  1853. smalltalk.method({
  1854. selector: "getNodesFrom:",
  1855. category: 'accessing',
  1856. fn: function (aCollection){
  1857. var self=this;
  1858. var children,others;
  1859. function $ClassSorterNode(){return smalltalk.ClassSorterNode||(typeof ClassSorterNode=="undefined"?nil:ClassSorterNode)}
  1860. return smalltalk.withContext(function($ctx1) {
  1861. var $1;
  1862. children=[];
  1863. others=[];
  1864. _st(aCollection)._do_((function(each){
  1865. return smalltalk.withContext(function($ctx2) {
  1866. $1=_st(_st(each)._superclass()).__eq(_st(self)._theClass());
  1867. if(smalltalk.assert($1)){
  1868. return _st(children)._add_(each);
  1869. } else {
  1870. return _st(others)._add_(each);
  1871. };
  1872. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1873. self["@nodes"]=_st(children)._collect_((function(each){
  1874. return smalltalk.withContext(function($ctx2) {
  1875. return _st($ClassSorterNode())._on_classes_level_(each,others,_st(_st(self)._level()).__plus((1)));
  1876. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1877. return self}, function($ctx1) {$ctx1.fill(self,"getNodesFrom:",{aCollection:aCollection,children:children,others:others},smalltalk.ClassSorterNode)})},
  1878. args: ["aCollection"],
  1879. source: "getNodesFrom: aCollection\x0a\x09| children others |\x0a\x09children := #().\x0a\x09others := #().\x0a\x09aCollection do: [:each |\x0a\x09\x09(each superclass = self theClass)\x0a\x09\x09\x09ifTrue: [children add: each]\x0a\x09\x09\x09ifFalse: [others add: each]].\x0a\x09nodes:= children collect: [:each |\x0a\x09\x09ClassSorterNode on: each classes: others level: self level + 1]",
  1880. messageSends: ["do:", "ifTrue:ifFalse:", "add:", "=", "theClass", "superclass", "collect:", "on:classes:level:", "+", "level"],
  1881. referencedClasses: ["ClassSorterNode"]
  1882. }),
  1883. smalltalk.ClassSorterNode);
  1884. smalltalk.addMethod(
  1885. smalltalk.method({
  1886. selector: "level",
  1887. category: 'accessing',
  1888. fn: function (){
  1889. var self=this;
  1890. return smalltalk.withContext(function($ctx1) {
  1891. var $1;
  1892. $1=self["@level"];
  1893. return $1;
  1894. }, function($ctx1) {$ctx1.fill(self,"level",{},smalltalk.ClassSorterNode)})},
  1895. args: [],
  1896. source: "level\x0a\x09^level",
  1897. messageSends: [],
  1898. referencedClasses: []
  1899. }),
  1900. smalltalk.ClassSorterNode);
  1901. smalltalk.addMethod(
  1902. smalltalk.method({
  1903. selector: "level:",
  1904. category: 'accessing',
  1905. fn: function (anInteger){
  1906. var self=this;
  1907. return smalltalk.withContext(function($ctx1) {
  1908. self["@level"]=anInteger;
  1909. return self}, function($ctx1) {$ctx1.fill(self,"level:",{anInteger:anInteger},smalltalk.ClassSorterNode)})},
  1910. args: ["anInteger"],
  1911. source: "level: anInteger\x0a\x09level := anInteger",
  1912. messageSends: [],
  1913. referencedClasses: []
  1914. }),
  1915. smalltalk.ClassSorterNode);
  1916. smalltalk.addMethod(
  1917. smalltalk.method({
  1918. selector: "nodes",
  1919. category: 'accessing',
  1920. fn: function (){
  1921. var self=this;
  1922. return smalltalk.withContext(function($ctx1) {
  1923. var $1;
  1924. $1=self["@nodes"];
  1925. return $1;
  1926. }, function($ctx1) {$ctx1.fill(self,"nodes",{},smalltalk.ClassSorterNode)})},
  1927. args: [],
  1928. source: "nodes\x0a\x09^nodes",
  1929. messageSends: [],
  1930. referencedClasses: []
  1931. }),
  1932. smalltalk.ClassSorterNode);
  1933. smalltalk.addMethod(
  1934. smalltalk.method({
  1935. selector: "theClass",
  1936. category: 'accessing',
  1937. fn: function (){
  1938. var self=this;
  1939. return smalltalk.withContext(function($ctx1) {
  1940. var $1;
  1941. $1=self["@theClass"];
  1942. return $1;
  1943. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.ClassSorterNode)})},
  1944. args: [],
  1945. source: "theClass\x0a\x09^theClass",
  1946. messageSends: [],
  1947. referencedClasses: []
  1948. }),
  1949. smalltalk.ClassSorterNode);
  1950. smalltalk.addMethod(
  1951. smalltalk.method({
  1952. selector: "theClass:",
  1953. category: 'accessing',
  1954. fn: function (aClass){
  1955. var self=this;
  1956. return smalltalk.withContext(function($ctx1) {
  1957. self["@theClass"]=aClass;
  1958. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.ClassSorterNode)})},
  1959. args: ["aClass"],
  1960. source: "theClass: aClass\x0a\x09theClass := aClass",
  1961. messageSends: [],
  1962. referencedClasses: []
  1963. }),
  1964. smalltalk.ClassSorterNode);
  1965. smalltalk.addMethod(
  1966. smalltalk.method({
  1967. selector: "traverseClassesWith:",
  1968. category: 'visiting',
  1969. fn: function (aCollection){
  1970. var self=this;
  1971. return smalltalk.withContext(function($ctx1) {
  1972. _st(aCollection)._add_(_st(self)._theClass());
  1973. _st(_st(_st(self)._nodes())._sorted_((function(a,b){
  1974. return smalltalk.withContext(function($ctx2) {
  1975. return _st(_st(_st(a)._theClass())._name()).__lt_eq(_st(_st(b)._theClass())._name());
  1976. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(aNode){
  1977. return smalltalk.withContext(function($ctx2) {
  1978. return _st(aNode)._traverseClassesWith_(aCollection);
  1979. }, function($ctx2) {$ctx2.fillBlock({aNode:aNode},$ctx1)})}));
  1980. return self}, function($ctx1) {$ctx1.fill(self,"traverseClassesWith:",{aCollection:aCollection},smalltalk.ClassSorterNode)})},
  1981. args: ["aCollection"],
  1982. source: "traverseClassesWith: aCollection\x0a\x09\x22sort classes alphabetically Issue #143\x22\x0a\x0a\x09aCollection add: self theClass.\x0a\x09(self nodes sorted: [:a :b | a theClass name <= b theClass name ]) do: [:aNode |\x0a\x09\x09aNode traverseClassesWith: aCollection ].",
  1983. messageSends: ["add:", "theClass", "do:", "traverseClassesWith:", "sorted:", "<=", "name", "nodes"],
  1984. referencedClasses: []
  1985. }),
  1986. smalltalk.ClassSorterNode);
  1987. smalltalk.addMethod(
  1988. smalltalk.method({
  1989. selector: "on:classes:level:",
  1990. category: 'instance creation',
  1991. fn: function (aClass,aCollection,anInteger){
  1992. var self=this;
  1993. return smalltalk.withContext(function($ctx1) {
  1994. var $2,$3,$1;
  1995. $2=_st(self)._new();
  1996. _st($2)._theClass_(aClass);
  1997. _st($2)._level_(anInteger);
  1998. _st($2)._getNodesFrom_(aCollection);
  1999. $3=_st($2)._yourself();
  2000. $1=$3;
  2001. return $1;
  2002. }, function($ctx1) {$ctx1.fill(self,"on:classes:level:",{aClass:aClass,aCollection:aCollection,anInteger:anInteger},smalltalk.ClassSorterNode.klass)})},
  2003. args: ["aClass", "aCollection", "anInteger"],
  2004. source: "on: aClass classes: aCollection level: anInteger\x0a\x09^self new\x0a\x09\x09theClass: aClass;\x0a\x09\x09level: anInteger;\x0a\x09\x09getNodesFrom: aCollection;\x0a\x09\x09yourself",
  2005. messageSends: ["theClass:", "new", "level:", "getNodesFrom:", "yourself"],
  2006. referencedClasses: []
  2007. }),
  2008. smalltalk.ClassSorterNode.klass);