Kernel-Classes.deploy.js 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172
  1. smalltalk.addPackage('Kernel-Classes', {});
  2. smalltalk.addClass('Behavior', smalltalk.Object, [], 'Kernel-Classes');
  3. smalltalk.addMethod(
  4. "_addCompiledMethod_",
  5. smalltalk.method({
  6. selector: "addCompiledMethod:",
  7. fn: function (aMethod){
  8. var self=this;
  9. return smalltalk.withContext(function($ctx) { var $1,$2;
  10. smalltalk.addMethod(aMethod.selector._asSelector(), aMethod, self);
  11. ;
  12. $1=_st((smalltalk.MethodAdded || MethodAdded))._new();
  13. _st($1)._theClass_(self);
  14. _st($1)._method_(aMethod);
  15. $2=_st($1)._yourself();
  16. _st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($2);
  17. return self}, self, "addCompiledMethod:", [aMethod], smalltalk.Behavior)}
  18. }),
  19. smalltalk.Behavior);
  20. smalltalk.addMethod(
  21. "_allInstanceVariableNames",
  22. smalltalk.method({
  23. selector: "allInstanceVariableNames",
  24. fn: function (){
  25. var self=this;
  26. return smalltalk.withContext(function($ctx) { var $1;
  27. var result;
  28. result=_st(_st(self)._instanceVariableNames())._copy();
  29. $1=_st(self)._superclass();
  30. if(($receiver = $1) == nil || $receiver == undefined){
  31. $1;
  32. } else {
  33. _st(result)._addAll_(_st(_st(self)._superclass())._allInstanceVariableNames());
  34. };
  35. return result;
  36. }, self, "allInstanceVariableNames", [], smalltalk.Behavior)}
  37. }),
  38. smalltalk.Behavior);
  39. smalltalk.addMethod(
  40. "_allSubclasses",
  41. smalltalk.method({
  42. selector: "allSubclasses",
  43. fn: function (){
  44. var self=this;
  45. return smalltalk.withContext(function($ctx) { var result;
  46. result=_st(self)._subclasses();
  47. _st(_st(self)._subclasses())._do_((function(each){
  48. return _st(result)._addAll_(_st(each)._allSubclasses());
  49. }));
  50. return result;
  51. }, self, "allSubclasses", [], smalltalk.Behavior)}
  52. }),
  53. smalltalk.Behavior);
  54. smalltalk.addMethod(
  55. "_allSuperclasses",
  56. smalltalk.method({
  57. selector: "allSuperclasses",
  58. fn: function (){
  59. var self=this;
  60. return smalltalk.withContext(function($ctx) { var $1,$3,$4,$2;
  61. $1=_st(self)._superclass();
  62. if(($receiver = $1) == nil || $receiver == undefined){
  63. return [];
  64. } else {
  65. $1;
  66. };
  67. $3=_st((smalltalk.OrderedCollection || OrderedCollection))._with_(_st(self)._superclass());
  68. _st($3)._addAll_(_st(_st(self)._superclass())._allSuperclasses());
  69. $4=_st($3)._yourself();
  70. $2=$4;
  71. return $2;
  72. }, self, "allSuperclasses", [], smalltalk.Behavior)}
  73. }),
  74. smalltalk.Behavior);
  75. smalltalk.addMethod(
  76. "_basicNew",
  77. smalltalk.method({
  78. selector: "basicNew",
  79. fn: function (){
  80. var self=this;
  81. return smalltalk.withContext(function($ctx) { return new self.fn();
  82. ;
  83. return self}, self, "basicNew", [], smalltalk.Behavior)}
  84. }),
  85. smalltalk.Behavior);
  86. smalltalk.addMethod(
  87. "_canUnderstand_",
  88. smalltalk.method({
  89. selector: "canUnderstand:",
  90. fn: function (aSelector){
  91. var self=this;
  92. return smalltalk.withContext(function($ctx) { var $1;
  93. $1=_st(_st(_st(_st(self)._methodDictionary())._keys())._includes_(_st(aSelector)._asString()))._or_((function(){
  94. return _st(_st(_st(self)._superclass())._notNil())._and_((function(){
  95. return _st(_st(self)._superclass())._canUnderstand_(aSelector);
  96. }));
  97. }));
  98. return $1;
  99. }, self, "canUnderstand:", [aSelector], smalltalk.Behavior)}
  100. }),
  101. smalltalk.Behavior);
  102. smalltalk.addMethod(
  103. "_comment",
  104. smalltalk.method({
  105. selector: "comment",
  106. fn: function (){
  107. var self=this;
  108. return smalltalk.withContext(function($ctx) { var $2,$1;
  109. $2=_st(self)._basicAt_("comment");
  110. if(($receiver = $2) == nil || $receiver == undefined){
  111. $1="";
  112. } else {
  113. $1=$2;
  114. };
  115. return $1;
  116. }, self, "comment", [], smalltalk.Behavior)}
  117. }),
  118. smalltalk.Behavior);
  119. smalltalk.addMethod(
  120. "_comment_",
  121. smalltalk.method({
  122. selector: "comment:",
  123. fn: function (aString){
  124. var self=this;
  125. return smalltalk.withContext(function($ctx) { var $1,$2;
  126. _st(self)._basicAt_put_("comment",aString);
  127. $1=_st((smalltalk.ClassCommentChanged || ClassCommentChanged))._new();
  128. _st($1)._theClass_(self);
  129. $2=_st($1)._yourself();
  130. _st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($2);
  131. return self}, self, "comment:", [aString], smalltalk.Behavior)}
  132. }),
  133. smalltalk.Behavior);
  134. smalltalk.addMethod(
  135. "_commentStamp",
  136. smalltalk.method({
  137. selector: "commentStamp",
  138. fn: function (){
  139. var self=this;
  140. return smalltalk.withContext(function($ctx) { var $2,$3,$1;
  141. $2=_st((smalltalk.ClassCommentReader || ClassCommentReader))._new();
  142. _st($2)._class_(self);
  143. $3=_st($2)._yourself();
  144. $1=$3;
  145. return $1;
  146. }, self, "commentStamp", [], smalltalk.Behavior)}
  147. }),
  148. smalltalk.Behavior);
  149. smalltalk.addMethod(
  150. "_commentStamp_prior_",
  151. smalltalk.method({
  152. selector: "commentStamp:prior:",
  153. fn: function (aStamp,prior){
  154. var self=this;
  155. return smalltalk.withContext(function($ctx) { var $1;
  156. $1=_st(self)._commentStamp();
  157. return $1;
  158. }, self, "commentStamp:prior:", [aStamp,prior], smalltalk.Behavior)}
  159. }),
  160. smalltalk.Behavior);
  161. smalltalk.addMethod(
  162. "_compile_",
  163. smalltalk.method({
  164. selector: "compile:",
  165. fn: function (aString){
  166. var self=this;
  167. return smalltalk.withContext(function($ctx) { _st(self)._compile_category_(aString,"");
  168. return self}, self, "compile:", [aString], smalltalk.Behavior)}
  169. }),
  170. smalltalk.Behavior);
  171. smalltalk.addMethod(
  172. "_compile_category_",
  173. smalltalk.method({
  174. selector: "compile:category:",
  175. fn: function (aString,anotherString){
  176. var self=this;
  177. return smalltalk.withContext(function($ctx) { _st(_st((smalltalk.Compiler || Compiler))._new())._install_forClass_category_(aString,self,anotherString);
  178. return self}, self, "compile:category:", [aString,anotherString], smalltalk.Behavior)}
  179. }),
  180. smalltalk.Behavior);
  181. smalltalk.addMethod(
  182. "_definition",
  183. smalltalk.method({
  184. selector: "definition",
  185. fn: function (){
  186. var self=this;
  187. return smalltalk.withContext(function($ctx) { return "";
  188. }, self, "definition", [], smalltalk.Behavior)}
  189. }),
  190. smalltalk.Behavior);
  191. smalltalk.addMethod(
  192. "_inheritsFrom_",
  193. smalltalk.method({
  194. selector: "inheritsFrom:",
  195. fn: function (aClass){
  196. var self=this;
  197. return smalltalk.withContext(function($ctx) { var $1;
  198. $1=_st(_st(aClass)._allSubclasses())._includes_(self);
  199. return $1;
  200. }, self, "inheritsFrom:", [aClass], smalltalk.Behavior)}
  201. }),
  202. smalltalk.Behavior);
  203. smalltalk.addMethod(
  204. "_instanceVariableNames",
  205. smalltalk.method({
  206. selector: "instanceVariableNames",
  207. fn: function (){
  208. var self=this;
  209. return smalltalk.withContext(function($ctx) { return self.iVarNames;
  210. ;
  211. return self}, self, "instanceVariableNames", [], smalltalk.Behavior)}
  212. }),
  213. smalltalk.Behavior);
  214. smalltalk.addMethod(
  215. "_methodAt_",
  216. smalltalk.method({
  217. selector: "methodAt:",
  218. fn: function (aSymbol){
  219. var self=this;
  220. return smalltalk.withContext(function($ctx) { var $1;
  221. $1=_st(_st(self)._methodDictionary())._at_(_st(aSymbol)._asString());
  222. return $1;
  223. }, self, "methodAt:", [aSymbol], smalltalk.Behavior)}
  224. }),
  225. smalltalk.Behavior);
  226. smalltalk.addMethod(
  227. "_methodDictionary",
  228. smalltalk.method({
  229. selector: "methodDictionary",
  230. fn: function (){
  231. var self=this;
  232. return smalltalk.withContext(function($ctx) { var dict = smalltalk.HashedCollection._new();
  233. var methods = self.methods;
  234. for(var i in methods) {
  235. if(methods[i].selector) {
  236. dict._at_put_(methods[i].selector, methods[i]);
  237. }
  238. };
  239. return dict;
  240. ;
  241. return self}, self, "methodDictionary", [], smalltalk.Behavior)}
  242. }),
  243. smalltalk.Behavior);
  244. smalltalk.addMethod(
  245. "_methods",
  246. smalltalk.method({
  247. selector: "methods",
  248. fn: function (){
  249. var self=this;
  250. return smalltalk.withContext(function($ctx) { var $1;
  251. $1=_st(_st(self)._methodDictionary())._values();
  252. return $1;
  253. }, self, "methods", [], smalltalk.Behavior)}
  254. }),
  255. smalltalk.Behavior);
  256. smalltalk.addMethod(
  257. "_methodsFor_",
  258. smalltalk.method({
  259. selector: "methodsFor:",
  260. fn: function (aString){
  261. var self=this;
  262. return smalltalk.withContext(function($ctx) { var $2,$3,$1;
  263. $2=_st((smalltalk.ClassCategoryReader || ClassCategoryReader))._new();
  264. _st($2)._class_category_(self,aString);
  265. $3=_st($2)._yourself();
  266. $1=$3;
  267. return $1;
  268. }, self, "methodsFor:", [aString], smalltalk.Behavior)}
  269. }),
  270. smalltalk.Behavior);
  271. smalltalk.addMethod(
  272. "_methodsFor_stamp_",
  273. smalltalk.method({
  274. selector: "methodsFor:stamp:",
  275. fn: function (aString,aStamp){
  276. var self=this;
  277. return smalltalk.withContext(function($ctx) { var $1;
  278. $1=_st(self)._methodsFor_(aString);
  279. return $1;
  280. }, self, "methodsFor:stamp:", [aString,aStamp], smalltalk.Behavior)}
  281. }),
  282. smalltalk.Behavior);
  283. smalltalk.addMethod(
  284. "_methodsInProtocol_",
  285. smalltalk.method({
  286. selector: "methodsInProtocol:",
  287. fn: function (aString){
  288. var self=this;
  289. return smalltalk.withContext(function($ctx) { var $1;
  290. $1=_st(_st(_st(self)._methodDictionary())._values())._select_((function(each){
  291. return _st(_st(each)._protocol()).__eq(aString);
  292. }));
  293. return $1;
  294. }, self, "methodsInProtocol:", [aString], smalltalk.Behavior)}
  295. }),
  296. smalltalk.Behavior);
  297. smalltalk.addMethod(
  298. "_name",
  299. smalltalk.method({
  300. selector: "name",
  301. fn: function (){
  302. var self=this;
  303. return smalltalk.withContext(function($ctx) { return self.className || nil;
  304. ;
  305. return self}, self, "name", [], smalltalk.Behavior)}
  306. }),
  307. smalltalk.Behavior);
  308. smalltalk.addMethod(
  309. "_new",
  310. smalltalk.method({
  311. selector: "new",
  312. fn: function (){
  313. var self=this;
  314. return smalltalk.withContext(function($ctx) { var $1;
  315. $1=_st(_st(self)._basicNew())._initialize();
  316. return $1;
  317. }, self, "new", [], smalltalk.Behavior)}
  318. }),
  319. smalltalk.Behavior);
  320. smalltalk.addMethod(
  321. "_organization",
  322. smalltalk.method({
  323. selector: "organization",
  324. fn: function (){
  325. var self=this;
  326. return smalltalk.withContext(function($ctx) { var $1;
  327. $1=_st(self)._basicAt_("organization");
  328. return $1;
  329. }, self, "organization", [], smalltalk.Behavior)}
  330. }),
  331. smalltalk.Behavior);
  332. smalltalk.addMethod(
  333. "_protocols",
  334. smalltalk.method({
  335. selector: "protocols",
  336. fn: function (){
  337. var self=this;
  338. return smalltalk.withContext(function($ctx) { var $1;
  339. $1=_st(_st(_st(self)._organization())._elements())._sorted();
  340. return $1;
  341. }, self, "protocols", [], smalltalk.Behavior)}
  342. }),
  343. smalltalk.Behavior);
  344. smalltalk.addMethod(
  345. "_protocolsDo_",
  346. smalltalk.method({
  347. selector: "protocolsDo:",
  348. fn: function (aBlock){
  349. var self=this;
  350. return smalltalk.withContext(function($ctx) { var methodsByCategory;
  351. methodsByCategory=_st((smalltalk.HashedCollection || HashedCollection))._new();
  352. _st(_st(_st(self)._methodDictionary())._values())._do_((function(m){
  353. return _st(_st(methodsByCategory)._at_ifAbsentPut_(_st(m)._category(),(function(){
  354. return _st((smalltalk.Array || Array))._new();
  355. })))._add_(m);
  356. }));
  357. _st(_st(self)._protocols())._do_((function(category){
  358. return _st(aBlock)._value_value_(category,_st(methodsByCategory)._at_(category));
  359. }));
  360. return self}, self, "protocolsDo:", [aBlock], smalltalk.Behavior)}
  361. }),
  362. smalltalk.Behavior);
  363. smalltalk.addMethod(
  364. "_prototype",
  365. smalltalk.method({
  366. selector: "prototype",
  367. fn: function (){
  368. var self=this;
  369. return smalltalk.withContext(function($ctx) { return self.fn.prototype;
  370. ;
  371. return self}, self, "prototype", [], smalltalk.Behavior)}
  372. }),
  373. smalltalk.Behavior);
  374. smalltalk.addMethod(
  375. "_removeCompiledMethod_",
  376. smalltalk.method({
  377. selector: "removeCompiledMethod:",
  378. fn: function (aMethod){
  379. var self=this;
  380. return smalltalk.withContext(function($ctx) { var $1,$2;
  381. smalltalk.removeMethod(aMethod)
  382. smalltalk.init(self);
  383. ;
  384. ;
  385. $1=_st((smalltalk.MethodRemoved || MethodRemoved))._new();
  386. _st($1)._theClass_(self);
  387. _st($1)._method_(aMethod);
  388. $2=_st($1)._yourself();
  389. _st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($2);
  390. return self}, self, "removeCompiledMethod:", [aMethod], smalltalk.Behavior)}
  391. }),
  392. smalltalk.Behavior);
  393. smalltalk.addMethod(
  394. "_selectors",
  395. smalltalk.method({
  396. selector: "selectors",
  397. fn: function (){
  398. var self=this;
  399. return smalltalk.withContext(function($ctx) { var $1;
  400. $1=_st(_st(self)._methodDictionary())._keys();
  401. return $1;
  402. }, self, "selectors", [], smalltalk.Behavior)}
  403. }),
  404. smalltalk.Behavior);
  405. smalltalk.addMethod(
  406. "_subclasses",
  407. smalltalk.method({
  408. selector: "subclasses",
  409. fn: function (){
  410. var self=this;
  411. return smalltalk.withContext(function($ctx) { return smalltalk.subclasses(self);
  412. ;
  413. return self}, self, "subclasses", [], smalltalk.Behavior)}
  414. }),
  415. smalltalk.Behavior);
  416. smalltalk.addMethod(
  417. "_superclass",
  418. smalltalk.method({
  419. selector: "superclass",
  420. fn: function (){
  421. var self=this;
  422. return smalltalk.withContext(function($ctx) { return self.superclass || nil;
  423. ;
  424. return self}, self, "superclass", [], smalltalk.Behavior)}
  425. }),
  426. smalltalk.Behavior);
  427. smalltalk.addMethod(
  428. "_theMetaClass",
  429. smalltalk.method({
  430. selector: "theMetaClass",
  431. fn: function (){
  432. var self=this;
  433. return smalltalk.withContext(function($ctx) { var $1;
  434. $1=_st(self)._class();
  435. return $1;
  436. }, self, "theMetaClass", [], smalltalk.Behavior)}
  437. }),
  438. smalltalk.Behavior);
  439. smalltalk.addMethod(
  440. "_theNonMetaClass",
  441. smalltalk.method({
  442. selector: "theNonMetaClass",
  443. fn: function (){
  444. var self=this;
  445. return smalltalk.withContext(function($ctx) { return self;
  446. }, self, "theNonMetaClass", [], smalltalk.Behavior)}
  447. }),
  448. smalltalk.Behavior);
  449. smalltalk.addMethod(
  450. "_withAllSubclasses",
  451. smalltalk.method({
  452. selector: "withAllSubclasses",
  453. fn: function (){
  454. var self=this;
  455. return smalltalk.withContext(function($ctx) { var $2,$3,$1;
  456. $2=_st((smalltalk.Array || Array))._with_(self);
  457. _st($2)._addAll_(_st(self)._allSubclasses());
  458. $3=_st($2)._yourself();
  459. $1=$3;
  460. return $1;
  461. }, self, "withAllSubclasses", [], smalltalk.Behavior)}
  462. }),
  463. smalltalk.Behavior);
  464. smalltalk.addClass('Class', smalltalk.Behavior, [], 'Kernel-Classes');
  465. smalltalk.addMethod(
  466. "_asJavascript",
  467. smalltalk.method({
  468. selector: "asJavascript",
  469. fn: function (){
  470. var self=this;
  471. return smalltalk.withContext(function($ctx) { var $1;
  472. $1=_st("smalltalk.").__comma(_st(self)._name());
  473. return $1;
  474. }, self, "asJavascript", [], smalltalk.Class)}
  475. }),
  476. smalltalk.Class);
  477. smalltalk.addMethod(
  478. "_category",
  479. smalltalk.method({
  480. selector: "category",
  481. fn: function (){
  482. var self=this;
  483. return smalltalk.withContext(function($ctx) { var $2,$1;
  484. $2=_st(self)._package();
  485. if(($receiver = $2) == nil || $receiver == undefined){
  486. $1="Unclassified";
  487. } else {
  488. $1=_st(_st(self)._package())._name();
  489. };
  490. return $1;
  491. }, self, "category", [], smalltalk.Class)}
  492. }),
  493. smalltalk.Class);
  494. smalltalk.addMethod(
  495. "_definition",
  496. smalltalk.method({
  497. selector: "definition",
  498. fn: function (){
  499. var self=this;
  500. return smalltalk.withContext(function($ctx) { var $2,$3,$1;
  501. $1=_st((smalltalk.String || String))._streamContents_((function(stream){
  502. _st(stream)._nextPutAll_(_st(_st(self)._superclass())._asString());
  503. _st(stream)._nextPutAll_(" subclass: #");
  504. _st(stream)._nextPutAll_(_st(self)._name());
  505. _st(stream)._nextPutAll_(_st(_st((smalltalk.String || String))._lf()).__comma(_st((smalltalk.String || String))._tab()));
  506. $2=_st(stream)._nextPutAll_("instanceVariableNames: '");
  507. $2;
  508. _st(_st(self)._instanceVariableNames())._do_separatedBy_((function(each){
  509. return _st(stream)._nextPutAll_(each);
  510. }),(function(){
  511. return _st(stream)._nextPutAll_(" ");
  512. }));
  513. _st(stream)._nextPutAll_(_st(_st("'").__comma(_st((smalltalk.String || String))._lf())).__comma(_st((smalltalk.String || String))._tab()));
  514. _st(stream)._nextPutAll_("package: '");
  515. _st(stream)._nextPutAll_(_st(self)._category());
  516. $3=_st(stream)._nextPutAll_("'");
  517. return $3;
  518. }));
  519. return $1;
  520. }, self, "definition", [], smalltalk.Class)}
  521. }),
  522. smalltalk.Class);
  523. smalltalk.addMethod(
  524. "_isClass",
  525. smalltalk.method({
  526. selector: "isClass",
  527. fn: function (){
  528. var self=this;
  529. return smalltalk.withContext(function($ctx) { return true;
  530. }, self, "isClass", [], smalltalk.Class)}
  531. }),
  532. smalltalk.Class);
  533. smalltalk.addMethod(
  534. "_package",
  535. smalltalk.method({
  536. selector: "package",
  537. fn: function (){
  538. var self=this;
  539. return smalltalk.withContext(function($ctx) { return self.pkg;
  540. ;
  541. return self}, self, "package", [], smalltalk.Class)}
  542. }),
  543. smalltalk.Class);
  544. smalltalk.addMethod(
  545. "_package_",
  546. smalltalk.method({
  547. selector: "package:",
  548. fn: function (aPackage){
  549. var self=this;
  550. return smalltalk.withContext(function($ctx) { self.pkg = aPackage;
  551. ;
  552. return self}, self, "package:", [aPackage], smalltalk.Class)}
  553. }),
  554. smalltalk.Class);
  555. smalltalk.addMethod(
  556. "_printString",
  557. smalltalk.method({
  558. selector: "printString",
  559. fn: function (){
  560. var self=this;
  561. return smalltalk.withContext(function($ctx) { var $1;
  562. $1=_st(self)._name();
  563. return $1;
  564. }, self, "printString", [], smalltalk.Class)}
  565. }),
  566. smalltalk.Class);
  567. smalltalk.addMethod(
  568. "_rename_",
  569. smalltalk.method({
  570. selector: "rename:",
  571. fn: function (aString){
  572. var self=this;
  573. return smalltalk.withContext(function($ctx) { _st(_st((smalltalk.ClassBuilder || ClassBuilder))._new())._renameClass_to_(self,aString);
  574. return self}, self, "rename:", [aString], smalltalk.Class)}
  575. }),
  576. smalltalk.Class);
  577. smalltalk.addMethod(
  578. "_subclass_instanceVariableNames_",
  579. smalltalk.method({
  580. selector: "subclass:instanceVariableNames:",
  581. fn: function (aString,anotherString){
  582. var self=this;
  583. return smalltalk.withContext(function($ctx) { var $1;
  584. $1=_st(self)._subclass_instanceVariableNames_package_(aString,anotherString,nil);
  585. return $1;
  586. }, self, "subclass:instanceVariableNames:", [aString,anotherString], smalltalk.Class)}
  587. }),
  588. smalltalk.Class);
  589. smalltalk.addMethod(
  590. "_subclass_instanceVariableNames_category_",
  591. smalltalk.method({
  592. selector: "subclass:instanceVariableNames:category:",
  593. fn: function (aString,aString2,aString3){
  594. var self=this;
  595. return smalltalk.withContext(function($ctx) { var $1;
  596. _st(self)._deprecatedAPI();
  597. $1=_st(self)._subclass_instanceVariableNames_package_(aString,aString2,aString3);
  598. return $1;
  599. }, self, "subclass:instanceVariableNames:category:", [aString,aString2,aString3], smalltalk.Class)}
  600. }),
  601. smalltalk.Class);
  602. smalltalk.addMethod(
  603. "_subclass_instanceVariableNames_classVariableNames_poolDictionaries_category_",
  604. smalltalk.method({
  605. selector: "subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:",
  606. fn: function (aString,aString2,classVars,pools,aString3){
  607. var self=this;
  608. return smalltalk.withContext(function($ctx) { var $1;
  609. $1=_st(self)._subclass_instanceVariableNames_package_(aString,aString2,aString3);
  610. return $1;
  611. }, self, "subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:", [aString,aString2,classVars,pools,aString3], smalltalk.Class)}
  612. }),
  613. smalltalk.Class);
  614. smalltalk.addMethod(
  615. "_subclass_instanceVariableNames_package_",
  616. smalltalk.method({
  617. selector: "subclass:instanceVariableNames:package:",
  618. fn: function (aString,aString2,aString3){
  619. var self=this;
  620. return smalltalk.withContext(function($ctx) { var $1;
  621. $1=_st(_st((smalltalk.ClassBuilder || ClassBuilder))._new())._superclass_subclass_instanceVariableNames_package_(self,_st(aString)._asString(),aString2,aString3);
  622. return $1;
  623. }, self, "subclass:instanceVariableNames:package:", [aString,aString2,aString3], smalltalk.Class)}
  624. }),
  625. smalltalk.Class);
  626. smalltalk.addClass('Metaclass', smalltalk.Behavior, [], 'Kernel-Classes');
  627. smalltalk.addMethod(
  628. "_asJavascript",
  629. smalltalk.method({
  630. selector: "asJavascript",
  631. fn: function (){
  632. var self=this;
  633. return smalltalk.withContext(function($ctx) { var $1;
  634. $1=_st(_st("smalltalk.").__comma(_st(_st(self)._instanceClass())._name())).__comma(".klass");
  635. return $1;
  636. }, self, "asJavascript", [], smalltalk.Metaclass)}
  637. }),
  638. smalltalk.Metaclass);
  639. smalltalk.addMethod(
  640. "_definition",
  641. smalltalk.method({
  642. selector: "definition",
  643. fn: function (){
  644. var self=this;
  645. return smalltalk.withContext(function($ctx) { var $2,$1;
  646. $1=_st((smalltalk.String || String))._streamContents_((function(stream){
  647. _st(stream)._nextPutAll_(_st(self)._asString());
  648. _st(stream)._nextPutAll_(" class ");
  649. $2=_st(stream)._nextPutAll_("instanceVariableNames: '");
  650. $2;
  651. _st(_st(self)._instanceVariableNames())._do_separatedBy_((function(each){
  652. return _st(stream)._nextPutAll_(each);
  653. }),(function(){
  654. return _st(stream)._nextPutAll_(" ");
  655. }));
  656. return _st(stream)._nextPutAll_("'");
  657. }));
  658. return $1;
  659. }, self, "definition", [], smalltalk.Metaclass)}
  660. }),
  661. smalltalk.Metaclass);
  662. smalltalk.addMethod(
  663. "_instanceClass",
  664. smalltalk.method({
  665. selector: "instanceClass",
  666. fn: function (){
  667. var self=this;
  668. return smalltalk.withContext(function($ctx) { return self.instanceClass;
  669. ;
  670. return self}, self, "instanceClass", [], smalltalk.Metaclass)}
  671. }),
  672. smalltalk.Metaclass);
  673. smalltalk.addMethod(
  674. "_instanceVariableNames_",
  675. smalltalk.method({
  676. selector: "instanceVariableNames:",
  677. fn: function (aCollection){
  678. var self=this;
  679. return smalltalk.withContext(function($ctx) { _st(_st((smalltalk.ClassBuilder || ClassBuilder))._new())._class_instanceVariableNames_(self,aCollection);
  680. return self}, self, "instanceVariableNames:", [aCollection], smalltalk.Metaclass)}
  681. }),
  682. smalltalk.Metaclass);
  683. smalltalk.addMethod(
  684. "_isMetaclass",
  685. smalltalk.method({
  686. selector: "isMetaclass",
  687. fn: function (){
  688. var self=this;
  689. return smalltalk.withContext(function($ctx) { return true;
  690. }, self, "isMetaclass", [], smalltalk.Metaclass)}
  691. }),
  692. smalltalk.Metaclass);
  693. smalltalk.addMethod(
  694. "_printString",
  695. smalltalk.method({
  696. selector: "printString",
  697. fn: function (){
  698. var self=this;
  699. return smalltalk.withContext(function($ctx) { var $1;
  700. $1=_st(_st(_st(self)._instanceClass())._name()).__comma(" class");
  701. return $1;
  702. }, self, "printString", [], smalltalk.Metaclass)}
  703. }),
  704. smalltalk.Metaclass);
  705. smalltalk.addMethod(
  706. "_theMetaClass",
  707. smalltalk.method({
  708. selector: "theMetaClass",
  709. fn: function (){
  710. var self=this;
  711. return smalltalk.withContext(function($ctx) { return self;
  712. }, self, "theMetaClass", [], smalltalk.Metaclass)}
  713. }),
  714. smalltalk.Metaclass);
  715. smalltalk.addMethod(
  716. "_theNonMetaClass",
  717. smalltalk.method({
  718. selector: "theNonMetaClass",
  719. fn: function (){
  720. var self=this;
  721. return smalltalk.withContext(function($ctx) { var $1;
  722. $1=_st(self)._instanceClass();
  723. return $1;
  724. }, self, "theNonMetaClass", [], smalltalk.Metaclass)}
  725. }),
  726. smalltalk.Metaclass);
  727. smalltalk.addClass('ClassBuilder', smalltalk.Object, [], 'Kernel-Classes');
  728. smalltalk.addMethod(
  729. "_addSubclassOf_named_instanceVariableNames_",
  730. smalltalk.method({
  731. selector: "addSubclassOf:named:instanceVariableNames:",
  732. fn: function (aClass,aString,aCollection){
  733. var self=this;
  734. return smalltalk.withContext(function($ctx) { smalltalk.addClass(aString, aClass, aCollection);
  735. return smalltalk[aString];
  736. ;
  737. return self}, self, "addSubclassOf:named:instanceVariableNames:", [aClass,aString,aCollection], smalltalk.ClassBuilder)}
  738. }),
  739. smalltalk.ClassBuilder);
  740. smalltalk.addMethod(
  741. "_addSubclassOf_named_instanceVariableNames_package_",
  742. smalltalk.method({
  743. selector: "addSubclassOf:named:instanceVariableNames:package:",
  744. fn: function (aClass,aString,aCollection,packageName){
  745. var self=this;
  746. return smalltalk.withContext(function($ctx) { smalltalk.addClass(aString, aClass, aCollection, packageName);
  747. return smalltalk[aString];
  748. ;
  749. return self}, self, "addSubclassOf:named:instanceVariableNames:package:", [aClass,aString,aCollection,packageName], smalltalk.ClassBuilder)}
  750. }),
  751. smalltalk.ClassBuilder);
  752. smalltalk.addMethod(
  753. "_class_instanceVariableNames_",
  754. smalltalk.method({
  755. selector: "class:instanceVariableNames:",
  756. fn: function (aClass,aString){
  757. var self=this;
  758. return smalltalk.withContext(function($ctx) { var $1,$2,$3;
  759. $1=_st(aClass)._isMetaclass();
  760. if(! smalltalk.assert($1)){
  761. _st(self)._error_(_st(_st(aClass)._name()).__comma(" is not a metaclass"));
  762. };
  763. _st(aClass)._basicAt_put_("iVarNames",_st(self)._instanceVariableNamesFor_(aString));
  764. $2=_st((smalltalk.ClassDefinitionChanged || ClassDefinitionChanged))._new();
  765. _st($2)._theClass_(aClass);
  766. $3=_st($2)._yourself();
  767. _st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($3);
  768. _st(self)._setupClass_(aClass);
  769. return self}, self, "class:instanceVariableNames:", [aClass,aString], smalltalk.ClassBuilder)}
  770. }),
  771. smalltalk.ClassBuilder);
  772. smalltalk.addMethod(
  773. "_copyClass_named_",
  774. smalltalk.method({
  775. selector: "copyClass:named:",
  776. fn: function (aClass,aString){
  777. var self=this;
  778. return smalltalk.withContext(function($ctx) { var newClass;
  779. newClass=_st(self)._addSubclassOf_named_instanceVariableNames_package_(_st(aClass)._superclass(),aString,_st(aClass)._instanceVariableNames(),_st(_st(aClass)._package())._name());
  780. _st(self)._setupClass_(newClass);
  781. _st(_st(_st(aClass)._methodDictionary())._values())._do_((function(each){
  782. return _st(_st((smalltalk.Compiler || Compiler))._new())._install_forClass_category_(_st(each)._source(),newClass,_st(each)._category());
  783. }));
  784. _st(_st(_st(_st(aClass)._class())._methodDictionary())._values())._do_((function(each){
  785. return _st(_st((smalltalk.Compiler || Compiler))._new())._install_forClass_category_(_st(each)._source(),_st(newClass)._class(),_st(each)._category());
  786. }));
  787. _st(self)._setupClass_(newClass);
  788. return newClass;
  789. }, self, "copyClass:named:", [aClass,aString], smalltalk.ClassBuilder)}
  790. }),
  791. smalltalk.ClassBuilder);
  792. smalltalk.addMethod(
  793. "_instanceVariableNamesFor_",
  794. smalltalk.method({
  795. selector: "instanceVariableNamesFor:",
  796. fn: function (aString){
  797. var self=this;
  798. return smalltalk.withContext(function($ctx) { var $1;
  799. $1=_st(_st(aString)._tokenize_(" "))._reject_((function(each){
  800. return _st(each)._isEmpty();
  801. }));
  802. return $1;
  803. }, self, "instanceVariableNamesFor:", [aString], smalltalk.ClassBuilder)}
  804. }),
  805. smalltalk.ClassBuilder);
  806. smalltalk.addMethod(
  807. "_renameClass_to_",
  808. smalltalk.method({
  809. selector: "renameClass:to:",
  810. fn: function (aClass,aString){
  811. var self=this;
  812. return smalltalk.withContext(function($ctx) { var $1,$2;
  813. smalltalk[aString] = aClass;
  814. delete smalltalk[aClass.className];
  815. aClass.className = aString;
  816. ;
  817. ;
  818. $1=_st((smalltalk.ClassRenamed || ClassRenamed))._new();
  819. _st($1)._theClass_(aClass);
  820. $2=_st($1)._yourself();
  821. _st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($2);
  822. return self}, self, "renameClass:to:", [aClass,aString], smalltalk.ClassBuilder)}
  823. }),
  824. smalltalk.ClassBuilder);
  825. smalltalk.addMethod(
  826. "_setupClass_",
  827. smalltalk.method({
  828. selector: "setupClass:",
  829. fn: function (aClass){
  830. var self=this;
  831. return smalltalk.withContext(function($ctx) { smalltalk.init(aClass);;
  832. ;
  833. return self}, self, "setupClass:", [aClass], smalltalk.ClassBuilder)}
  834. }),
  835. smalltalk.ClassBuilder);
  836. smalltalk.addMethod(
  837. "_superclass_subclass_",
  838. smalltalk.method({
  839. selector: "superclass:subclass:",
  840. fn: function (aClass,aString){
  841. var self=this;
  842. return smalltalk.withContext(function($ctx) { var $1;
  843. $1=_st(self)._superclass_subclass_instanceVariableNames_package_(aClass,aString,"",nil);
  844. return $1;
  845. }, self, "superclass:subclass:", [aClass,aString], smalltalk.ClassBuilder)}
  846. }),
  847. smalltalk.ClassBuilder);
  848. smalltalk.addMethod(
  849. "_superclass_subclass_instanceVariableNames_package_",
  850. smalltalk.method({
  851. selector: "superclass:subclass:instanceVariableNames:package:",
  852. fn: function (aClass,aString,aString2,aString3){
  853. var self=this;
  854. return smalltalk.withContext(function($ctx) { var $1,$2,$3;
  855. var newClass;
  856. if(($receiver = aString3) == nil || $receiver == undefined){
  857. $1="unclassified";
  858. } else {
  859. $1=aString3;
  860. };
  861. newClass=_st(self)._addSubclassOf_named_instanceVariableNames_package_(aClass,aString,_st(self)._instanceVariableNamesFor_(aString2),$1);
  862. _st(self)._setupClass_(newClass);
  863. $2=_st((smalltalk.ClassAdded || ClassAdded))._new();
  864. _st($2)._theClass_(newClass);
  865. $3=_st($2)._yourself();
  866. _st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($3);
  867. return newClass;
  868. }, self, "superclass:subclass:instanceVariableNames:package:", [aClass,aString,aString2,aString3], smalltalk.ClassBuilder)}
  869. }),
  870. smalltalk.ClassBuilder);
  871. smalltalk.addClass('ClassCategoryReader', smalltalk.Object, ['class', 'category', 'chunkParser'], 'Kernel-Classes');
  872. smalltalk.addMethod(
  873. "_class_category_",
  874. smalltalk.method({
  875. selector: "class:category:",
  876. fn: function (aClass,aString){
  877. var self=this;
  878. return smalltalk.withContext(function($ctx) { self["@class"]=aClass;
  879. self["@category"]=aString;
  880. return self}, self, "class:category:", [aClass,aString], smalltalk.ClassCategoryReader)}
  881. }),
  882. smalltalk.ClassCategoryReader);
  883. smalltalk.addMethod(
  884. "_compileMethod_",
  885. smalltalk.method({
  886. selector: "compileMethod:",
  887. fn: function (aString){
  888. var self=this;
  889. return smalltalk.withContext(function($ctx) { _st(_st((smalltalk.Compiler || Compiler))._new())._install_forClass_category_(aString,self["@class"],self["@category"]);
  890. return self}, self, "compileMethod:", [aString], smalltalk.ClassCategoryReader)}
  891. }),
  892. smalltalk.ClassCategoryReader);
  893. smalltalk.addMethod(
  894. "_initialize",
  895. smalltalk.method({
  896. selector: "initialize",
  897. fn: function (){
  898. var self=this;
  899. return smalltalk.withContext(function($ctx) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  900. self["@chunkParser"]=_st((smalltalk.ChunkParser || ChunkParser))._new();
  901. return self}, self, "initialize", [], smalltalk.ClassCategoryReader)}
  902. }),
  903. smalltalk.ClassCategoryReader);
  904. smalltalk.addMethod(
  905. "_scanFrom_",
  906. smalltalk.method({
  907. selector: "scanFrom:",
  908. fn: function (aChunkParser){
  909. var self=this;
  910. return smalltalk.withContext(function($ctx) { var chunk;
  911. _st((function(){
  912. chunk=_st(aChunkParser)._nextChunk();
  913. chunk;
  914. return _st(chunk)._isEmpty();
  915. }))._whileFalse_((function(){
  916. return _st(self)._compileMethod_(chunk);
  917. }));
  918. _st(_st((smalltalk.Compiler || Compiler))._new())._setupClass_(self["@class"]);
  919. return self}, self, "scanFrom:", [aChunkParser], smalltalk.ClassCategoryReader)}
  920. }),
  921. smalltalk.ClassCategoryReader);
  922. smalltalk.addClass('ClassCommentReader', smalltalk.Object, ['class', 'chunkParser'], 'Kernel-Classes');
  923. smalltalk.addMethod(
  924. "_class_",
  925. smalltalk.method({
  926. selector: "class:",
  927. fn: function (aClass){
  928. var self=this;
  929. return smalltalk.withContext(function($ctx) { self["@class"]=aClass;
  930. return self}, self, "class:", [aClass], smalltalk.ClassCommentReader)}
  931. }),
  932. smalltalk.ClassCommentReader);
  933. smalltalk.addMethod(
  934. "_initialize",
  935. smalltalk.method({
  936. selector: "initialize",
  937. fn: function (){
  938. var self=this;
  939. return smalltalk.withContext(function($ctx) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  940. self["@chunkParser"]=_st((smalltalk.ChunkParser || ChunkParser))._new();
  941. return self}, self, "initialize", [], smalltalk.ClassCommentReader)}
  942. }),
  943. smalltalk.ClassCommentReader);
  944. smalltalk.addMethod(
  945. "_scanFrom_",
  946. smalltalk.method({
  947. selector: "scanFrom:",
  948. fn: function (aChunkParser){
  949. var self=this;
  950. return smalltalk.withContext(function($ctx) { var $1;
  951. var chunk;
  952. chunk=_st(aChunkParser)._nextChunk();
  953. $1=_st(chunk)._isEmpty();
  954. if(! smalltalk.assert($1)){
  955. _st(self)._setComment_(chunk);
  956. };
  957. return self}, self, "scanFrom:", [aChunkParser], smalltalk.ClassCommentReader)}
  958. }),
  959. smalltalk.ClassCommentReader);
  960. smalltalk.addMethod(
  961. "_setComment_",
  962. smalltalk.method({
  963. selector: "setComment:",
  964. fn: function (aString){
  965. var self=this;
  966. return smalltalk.withContext(function($ctx) { _st(self["@class"])._comment_(aString);
  967. return self}, self, "setComment:", [aString], smalltalk.ClassCommentReader)}
  968. }),
  969. smalltalk.ClassCommentReader);
  970. smalltalk.addClass('ClassSorterNode', smalltalk.Object, ['theClass', 'level', 'nodes'], 'Kernel-Classes');
  971. smalltalk.addMethod(
  972. "_getNodesFrom_",
  973. smalltalk.method({
  974. selector: "getNodesFrom:",
  975. fn: function (aCollection){
  976. var self=this;
  977. return smalltalk.withContext(function($ctx) { var $1;
  978. var children;
  979. var others;
  980. children=[];
  981. others=[];
  982. _st(aCollection)._do_((function(each){
  983. $1=_st(_st(each)._superclass()).__eq(_st(self)._theClass());
  984. if(smalltalk.assert($1)){
  985. return _st(children)._add_(each);
  986. } else {
  987. return _st(others)._add_(each);
  988. };
  989. }));
  990. self["@nodes"]=_st(children)._collect_((function(each){
  991. return _st((smalltalk.ClassSorterNode || ClassSorterNode))._on_classes_level_(each,others,_st(_st(self)._level()).__plus((1)));
  992. }));
  993. return self}, self, "getNodesFrom:", [aCollection], smalltalk.ClassSorterNode)}
  994. }),
  995. smalltalk.ClassSorterNode);
  996. smalltalk.addMethod(
  997. "_level",
  998. smalltalk.method({
  999. selector: "level",
  1000. fn: function (){
  1001. var self=this;
  1002. return smalltalk.withContext(function($ctx) { return self["@level"];
  1003. }, self, "level", [], smalltalk.ClassSorterNode)}
  1004. }),
  1005. smalltalk.ClassSorterNode);
  1006. smalltalk.addMethod(
  1007. "_level_",
  1008. smalltalk.method({
  1009. selector: "level:",
  1010. fn: function (anInteger){
  1011. var self=this;
  1012. return smalltalk.withContext(function($ctx) { self["@level"]=anInteger;
  1013. return self}, self, "level:", [anInteger], smalltalk.ClassSorterNode)}
  1014. }),
  1015. smalltalk.ClassSorterNode);
  1016. smalltalk.addMethod(
  1017. "_nodes",
  1018. smalltalk.method({
  1019. selector: "nodes",
  1020. fn: function (){
  1021. var self=this;
  1022. return smalltalk.withContext(function($ctx) { return self["@nodes"];
  1023. }, self, "nodes", [], smalltalk.ClassSorterNode)}
  1024. }),
  1025. smalltalk.ClassSorterNode);
  1026. smalltalk.addMethod(
  1027. "_theClass",
  1028. smalltalk.method({
  1029. selector: "theClass",
  1030. fn: function (){
  1031. var self=this;
  1032. return smalltalk.withContext(function($ctx) { return self["@theClass"];
  1033. }, self, "theClass", [], smalltalk.ClassSorterNode)}
  1034. }),
  1035. smalltalk.ClassSorterNode);
  1036. smalltalk.addMethod(
  1037. "_theClass_",
  1038. smalltalk.method({
  1039. selector: "theClass:",
  1040. fn: function (aClass){
  1041. var self=this;
  1042. return smalltalk.withContext(function($ctx) { self["@theClass"]=aClass;
  1043. return self}, self, "theClass:", [aClass], smalltalk.ClassSorterNode)}
  1044. }),
  1045. smalltalk.ClassSorterNode);
  1046. smalltalk.addMethod(
  1047. "_traverseClassesWith_",
  1048. smalltalk.method({
  1049. selector: "traverseClassesWith:",
  1050. fn: function (aCollection){
  1051. var self=this;
  1052. return smalltalk.withContext(function($ctx) { _st(aCollection)._add_(_st(self)._theClass());
  1053. _st(_st(_st(self)._nodes())._sorted_((function(a,b){
  1054. return _st(_st(_st(a)._theClass())._name()).__lt_eq(_st(_st(b)._theClass())._name());
  1055. })))._do_((function(aNode){
  1056. return _st(aNode)._traverseClassesWith_(aCollection);
  1057. }));
  1058. return self}, self, "traverseClassesWith:", [aCollection], smalltalk.ClassSorterNode)}
  1059. }),
  1060. smalltalk.ClassSorterNode);
  1061. smalltalk.addMethod(
  1062. "_on_classes_level_",
  1063. smalltalk.method({
  1064. selector: "on:classes:level:",
  1065. fn: function (aClass,aCollection,anInteger){
  1066. var self=this;
  1067. return smalltalk.withContext(function($ctx) { var $2,$3,$1;
  1068. $2=_st(self)._new();
  1069. _st($2)._theClass_(aClass);
  1070. _st($2)._level_(anInteger);
  1071. _st($2)._getNodesFrom_(aCollection);
  1072. $3=_st($2)._yourself();
  1073. $1=$3;
  1074. return $1;
  1075. }, self, "on:classes:level:", [aClass,aCollection,anInteger], smalltalk.ClassSorterNode.klass)}
  1076. }),
  1077. smalltalk.ClassSorterNode.klass);