12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172 |
- smalltalk.addPackage('Kernel-Classes', {});
- smalltalk.addClass('Behavior', smalltalk.Object, [], 'Kernel-Classes');
- smalltalk.addMethod(
- "_addCompiledMethod_",
- smalltalk.method({
- selector: "addCompiledMethod:",
- fn: function (aMethod){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1,$2;
- smalltalk.addMethod(aMethod.selector._asSelector(), aMethod, self);
- ;
- $1=_st((smalltalk.MethodAdded || MethodAdded))._new();
- _st($1)._theClass_(self);
- _st($1)._method_(aMethod);
- $2=_st($1)._yourself();
- _st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($2);
- return self}, self, "addCompiledMethod:", [aMethod], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_allInstanceVariableNames",
- smalltalk.method({
- selector: "allInstanceVariableNames",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1;
- var result;
- result=_st(_st(self)._instanceVariableNames())._copy();
- $1=_st(self)._superclass();
- if(($receiver = $1) == nil || $receiver == undefined){
- $1;
- } else {
- _st(result)._addAll_(_st(_st(self)._superclass())._allInstanceVariableNames());
- };
- return result;
- }, self, "allInstanceVariableNames", [], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_allSubclasses",
- smalltalk.method({
- selector: "allSubclasses",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { var result;
- result=_st(self)._subclasses();
- _st(_st(self)._subclasses())._do_((function(each){
- return _st(result)._addAll_(_st(each)._allSubclasses());
- }));
- return result;
- }, self, "allSubclasses", [], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_allSuperclasses",
- smalltalk.method({
- selector: "allSuperclasses",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1,$3,$4,$2;
- $1=_st(self)._superclass();
- if(($receiver = $1) == nil || $receiver == undefined){
- return [];
- } else {
- $1;
- };
- $3=_st((smalltalk.OrderedCollection || OrderedCollection))._with_(_st(self)._superclass());
- _st($3)._addAll_(_st(_st(self)._superclass())._allSuperclasses());
- $4=_st($3)._yourself();
- $2=$4;
- return $2;
- }, self, "allSuperclasses", [], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_basicNew",
- smalltalk.method({
- selector: "basicNew",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { return new self.fn();
- ;
- return self}, self, "basicNew", [], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_canUnderstand_",
- smalltalk.method({
- selector: "canUnderstand:",
- fn: function (aSelector){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1;
- $1=_st(_st(_st(_st(self)._methodDictionary())._keys())._includes_(_st(aSelector)._asString()))._or_((function(){
- return _st(_st(_st(self)._superclass())._notNil())._and_((function(){
- return _st(_st(self)._superclass())._canUnderstand_(aSelector);
- }));
- }));
- return $1;
- }, self, "canUnderstand:", [aSelector], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_comment",
- smalltalk.method({
- selector: "comment",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $2,$1;
- $2=_st(self)._basicAt_("comment");
- if(($receiver = $2) == nil || $receiver == undefined){
- $1="";
- } else {
- $1=$2;
- };
- return $1;
- }, self, "comment", [], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_comment_",
- smalltalk.method({
- selector: "comment:",
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1,$2;
- _st(self)._basicAt_put_("comment",aString);
- $1=_st((smalltalk.ClassCommentChanged || ClassCommentChanged))._new();
- _st($1)._theClass_(self);
- $2=_st($1)._yourself();
- _st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($2);
- return self}, self, "comment:", [aString], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_commentStamp",
- smalltalk.method({
- selector: "commentStamp",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $2,$3,$1;
- $2=_st((smalltalk.ClassCommentReader || ClassCommentReader))._new();
- _st($2)._class_(self);
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, self, "commentStamp", [], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_commentStamp_prior_",
- smalltalk.method({
- selector: "commentStamp:prior:",
- fn: function (aStamp,prior){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1;
- $1=_st(self)._commentStamp();
- return $1;
- }, self, "commentStamp:prior:", [aStamp,prior], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_compile_",
- smalltalk.method({
- selector: "compile:",
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx) { _st(self)._compile_category_(aString,"");
- return self}, self, "compile:", [aString], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_compile_category_",
- smalltalk.method({
- selector: "compile:category:",
- fn: function (aString,anotherString){
- var self=this;
- return smalltalk.withContext(function($ctx) { _st(_st((smalltalk.Compiler || Compiler))._new())._install_forClass_category_(aString,self,anotherString);
- return self}, self, "compile:category:", [aString,anotherString], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_definition",
- smalltalk.method({
- selector: "definition",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { return "";
- }, self, "definition", [], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_inheritsFrom_",
- smalltalk.method({
- selector: "inheritsFrom:",
- fn: function (aClass){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1;
- $1=_st(_st(aClass)._allSubclasses())._includes_(self);
- return $1;
- }, self, "inheritsFrom:", [aClass], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_instanceVariableNames",
- smalltalk.method({
- selector: "instanceVariableNames",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { return self.iVarNames;
- ;
- return self}, self, "instanceVariableNames", [], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_methodAt_",
- smalltalk.method({
- selector: "methodAt:",
- fn: function (aSymbol){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1;
- $1=_st(_st(self)._methodDictionary())._at_(_st(aSymbol)._asString());
- return $1;
- }, self, "methodAt:", [aSymbol], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_methodDictionary",
- smalltalk.method({
- selector: "methodDictionary",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { var dict = smalltalk.HashedCollection._new();
- var methods = self.methods;
- for(var i in methods) {
- if(methods[i].selector) {
- dict._at_put_(methods[i].selector, methods[i]);
- }
- };
- return dict;
- ;
- return self}, self, "methodDictionary", [], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_methods",
- smalltalk.method({
- selector: "methods",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1;
- $1=_st(_st(self)._methodDictionary())._values();
- return $1;
- }, self, "methods", [], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_methodsFor_",
- smalltalk.method({
- selector: "methodsFor:",
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $2,$3,$1;
- $2=_st((smalltalk.ClassCategoryReader || ClassCategoryReader))._new();
- _st($2)._class_category_(self,aString);
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, self, "methodsFor:", [aString], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_methodsFor_stamp_",
- smalltalk.method({
- selector: "methodsFor:stamp:",
- fn: function (aString,aStamp){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1;
- $1=_st(self)._methodsFor_(aString);
- return $1;
- }, self, "methodsFor:stamp:", [aString,aStamp], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_methodsInProtocol_",
- smalltalk.method({
- selector: "methodsInProtocol:",
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1;
- $1=_st(_st(_st(self)._methodDictionary())._values())._select_((function(each){
- return _st(_st(each)._protocol()).__eq(aString);
- }));
- return $1;
- }, self, "methodsInProtocol:", [aString], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_name",
- smalltalk.method({
- selector: "name",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { return self.className || nil;
- ;
- return self}, self, "name", [], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_new",
- smalltalk.method({
- selector: "new",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1;
- $1=_st(_st(self)._basicNew())._initialize();
- return $1;
- }, self, "new", [], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_organization",
- smalltalk.method({
- selector: "organization",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1;
- $1=_st(self)._basicAt_("organization");
- return $1;
- }, self, "organization", [], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_protocols",
- smalltalk.method({
- selector: "protocols",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1;
- $1=_st(_st(_st(self)._organization())._elements())._sorted();
- return $1;
- }, self, "protocols", [], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_protocolsDo_",
- smalltalk.method({
- selector: "protocolsDo:",
- fn: function (aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx) { var methodsByCategory;
- methodsByCategory=_st((smalltalk.HashedCollection || HashedCollection))._new();
- _st(_st(_st(self)._methodDictionary())._values())._do_((function(m){
- return _st(_st(methodsByCategory)._at_ifAbsentPut_(_st(m)._category(),(function(){
- return _st((smalltalk.Array || Array))._new();
- })))._add_(m);
- }));
- _st(_st(self)._protocols())._do_((function(category){
- return _st(aBlock)._value_value_(category,_st(methodsByCategory)._at_(category));
- }));
- return self}, self, "protocolsDo:", [aBlock], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_prototype",
- smalltalk.method({
- selector: "prototype",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { return self.fn.prototype;
- ;
- return self}, self, "prototype", [], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_removeCompiledMethod_",
- smalltalk.method({
- selector: "removeCompiledMethod:",
- fn: function (aMethod){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1,$2;
- smalltalk.removeMethod(aMethod)
- smalltalk.init(self);
- ;
- ;
- $1=_st((smalltalk.MethodRemoved || MethodRemoved))._new();
- _st($1)._theClass_(self);
- _st($1)._method_(aMethod);
- $2=_st($1)._yourself();
- _st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($2);
- return self}, self, "removeCompiledMethod:", [aMethod], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_selectors",
- smalltalk.method({
- selector: "selectors",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1;
- $1=_st(_st(self)._methodDictionary())._keys();
- return $1;
- }, self, "selectors", [], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_subclasses",
- smalltalk.method({
- selector: "subclasses",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { return smalltalk.subclasses(self);
- ;
- return self}, self, "subclasses", [], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_superclass",
- smalltalk.method({
- selector: "superclass",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { return self.superclass || nil;
- ;
- return self}, self, "superclass", [], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_theMetaClass",
- smalltalk.method({
- selector: "theMetaClass",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1;
- $1=_st(self)._class();
- return $1;
- }, self, "theMetaClass", [], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_theNonMetaClass",
- smalltalk.method({
- selector: "theNonMetaClass",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { return self;
- }, self, "theNonMetaClass", [], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addMethod(
- "_withAllSubclasses",
- smalltalk.method({
- selector: "withAllSubclasses",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $2,$3,$1;
- $2=_st((smalltalk.Array || Array))._with_(self);
- _st($2)._addAll_(_st(self)._allSubclasses());
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, self, "withAllSubclasses", [], smalltalk.Behavior)}
- }),
- smalltalk.Behavior);
- smalltalk.addClass('Class', smalltalk.Behavior, [], 'Kernel-Classes');
- smalltalk.addMethod(
- "_asJavascript",
- smalltalk.method({
- selector: "asJavascript",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1;
- $1=_st("smalltalk.").__comma(_st(self)._name());
- return $1;
- }, self, "asJavascript", [], smalltalk.Class)}
- }),
- smalltalk.Class);
- smalltalk.addMethod(
- "_category",
- smalltalk.method({
- selector: "category",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $2,$1;
- $2=_st(self)._package();
- if(($receiver = $2) == nil || $receiver == undefined){
- $1="Unclassified";
- } else {
- $1=_st(_st(self)._package())._name();
- };
- return $1;
- }, self, "category", [], smalltalk.Class)}
- }),
- smalltalk.Class);
- smalltalk.addMethod(
- "_definition",
- smalltalk.method({
- selector: "definition",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $2,$3,$1;
- $1=_st((smalltalk.String || String))._streamContents_((function(stream){
- _st(stream)._nextPutAll_(_st(_st(self)._superclass())._asString());
- _st(stream)._nextPutAll_(" subclass: #");
- _st(stream)._nextPutAll_(_st(self)._name());
- _st(stream)._nextPutAll_(_st(_st((smalltalk.String || String))._lf()).__comma(_st((smalltalk.String || String))._tab()));
- $2=_st(stream)._nextPutAll_("instanceVariableNames: '");
- $2;
- _st(_st(self)._instanceVariableNames())._do_separatedBy_((function(each){
- return _st(stream)._nextPutAll_(each);
- }),(function(){
- return _st(stream)._nextPutAll_(" ");
- }));
- _st(stream)._nextPutAll_(_st(_st("'").__comma(_st((smalltalk.String || String))._lf())).__comma(_st((smalltalk.String || String))._tab()));
- _st(stream)._nextPutAll_("package: '");
- _st(stream)._nextPutAll_(_st(self)._category());
- $3=_st(stream)._nextPutAll_("'");
- return $3;
- }));
- return $1;
- }, self, "definition", [], smalltalk.Class)}
- }),
- smalltalk.Class);
- smalltalk.addMethod(
- "_isClass",
- smalltalk.method({
- selector: "isClass",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { return true;
- }, self, "isClass", [], smalltalk.Class)}
- }),
- smalltalk.Class);
- smalltalk.addMethod(
- "_package",
- smalltalk.method({
- selector: "package",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { return self.pkg;
- ;
- return self}, self, "package", [], smalltalk.Class)}
- }),
- smalltalk.Class);
- smalltalk.addMethod(
- "_package_",
- smalltalk.method({
- selector: "package:",
- fn: function (aPackage){
- var self=this;
- return smalltalk.withContext(function($ctx) { self.pkg = aPackage;
- ;
- return self}, self, "package:", [aPackage], smalltalk.Class)}
- }),
- smalltalk.Class);
- smalltalk.addMethod(
- "_printString",
- smalltalk.method({
- selector: "printString",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1;
- $1=_st(self)._name();
- return $1;
- }, self, "printString", [], smalltalk.Class)}
- }),
- smalltalk.Class);
- smalltalk.addMethod(
- "_rename_",
- smalltalk.method({
- selector: "rename:",
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx) { _st(_st((smalltalk.ClassBuilder || ClassBuilder))._new())._renameClass_to_(self,aString);
- return self}, self, "rename:", [aString], smalltalk.Class)}
- }),
- smalltalk.Class);
- smalltalk.addMethod(
- "_subclass_instanceVariableNames_",
- smalltalk.method({
- selector: "subclass:instanceVariableNames:",
- fn: function (aString,anotherString){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1;
- $1=_st(self)._subclass_instanceVariableNames_package_(aString,anotherString,nil);
- return $1;
- }, self, "subclass:instanceVariableNames:", [aString,anotherString], smalltalk.Class)}
- }),
- smalltalk.Class);
- smalltalk.addMethod(
- "_subclass_instanceVariableNames_category_",
- smalltalk.method({
- selector: "subclass:instanceVariableNames:category:",
- fn: function (aString,aString2,aString3){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1;
- _st(self)._deprecatedAPI();
- $1=_st(self)._subclass_instanceVariableNames_package_(aString,aString2,aString3);
- return $1;
- }, self, "subclass:instanceVariableNames:category:", [aString,aString2,aString3], smalltalk.Class)}
- }),
- smalltalk.Class);
- smalltalk.addMethod(
- "_subclass_instanceVariableNames_classVariableNames_poolDictionaries_category_",
- smalltalk.method({
- selector: "subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:",
- fn: function (aString,aString2,classVars,pools,aString3){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1;
- $1=_st(self)._subclass_instanceVariableNames_package_(aString,aString2,aString3);
- return $1;
- }, self, "subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:", [aString,aString2,classVars,pools,aString3], smalltalk.Class)}
- }),
- smalltalk.Class);
- smalltalk.addMethod(
- "_subclass_instanceVariableNames_package_",
- smalltalk.method({
- selector: "subclass:instanceVariableNames:package:",
- fn: function (aString,aString2,aString3){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1;
- $1=_st(_st((smalltalk.ClassBuilder || ClassBuilder))._new())._superclass_subclass_instanceVariableNames_package_(self,_st(aString)._asString(),aString2,aString3);
- return $1;
- }, self, "subclass:instanceVariableNames:package:", [aString,aString2,aString3], smalltalk.Class)}
- }),
- smalltalk.Class);
- smalltalk.addClass('Metaclass', smalltalk.Behavior, [], 'Kernel-Classes');
- smalltalk.addMethod(
- "_asJavascript",
- smalltalk.method({
- selector: "asJavascript",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1;
- $1=_st(_st("smalltalk.").__comma(_st(_st(self)._instanceClass())._name())).__comma(".klass");
- return $1;
- }, self, "asJavascript", [], smalltalk.Metaclass)}
- }),
- smalltalk.Metaclass);
- smalltalk.addMethod(
- "_definition",
- smalltalk.method({
- selector: "definition",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $2,$1;
- $1=_st((smalltalk.String || String))._streamContents_((function(stream){
- _st(stream)._nextPutAll_(_st(self)._asString());
- _st(stream)._nextPutAll_(" class ");
- $2=_st(stream)._nextPutAll_("instanceVariableNames: '");
- $2;
- _st(_st(self)._instanceVariableNames())._do_separatedBy_((function(each){
- return _st(stream)._nextPutAll_(each);
- }),(function(){
- return _st(stream)._nextPutAll_(" ");
- }));
- return _st(stream)._nextPutAll_("'");
- }));
- return $1;
- }, self, "definition", [], smalltalk.Metaclass)}
- }),
- smalltalk.Metaclass);
- smalltalk.addMethod(
- "_instanceClass",
- smalltalk.method({
- selector: "instanceClass",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { return self.instanceClass;
- ;
- return self}, self, "instanceClass", [], smalltalk.Metaclass)}
- }),
- smalltalk.Metaclass);
- smalltalk.addMethod(
- "_instanceVariableNames_",
- smalltalk.method({
- selector: "instanceVariableNames:",
- fn: function (aCollection){
- var self=this;
- return smalltalk.withContext(function($ctx) { _st(_st((smalltalk.ClassBuilder || ClassBuilder))._new())._class_instanceVariableNames_(self,aCollection);
- return self}, self, "instanceVariableNames:", [aCollection], smalltalk.Metaclass)}
- }),
- smalltalk.Metaclass);
- smalltalk.addMethod(
- "_isMetaclass",
- smalltalk.method({
- selector: "isMetaclass",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { return true;
- }, self, "isMetaclass", [], smalltalk.Metaclass)}
- }),
- smalltalk.Metaclass);
- smalltalk.addMethod(
- "_printString",
- smalltalk.method({
- selector: "printString",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1;
- $1=_st(_st(_st(self)._instanceClass())._name()).__comma(" class");
- return $1;
- }, self, "printString", [], smalltalk.Metaclass)}
- }),
- smalltalk.Metaclass);
- smalltalk.addMethod(
- "_theMetaClass",
- smalltalk.method({
- selector: "theMetaClass",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { return self;
- }, self, "theMetaClass", [], smalltalk.Metaclass)}
- }),
- smalltalk.Metaclass);
- smalltalk.addMethod(
- "_theNonMetaClass",
- smalltalk.method({
- selector: "theNonMetaClass",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1;
- $1=_st(self)._instanceClass();
- return $1;
- }, self, "theNonMetaClass", [], smalltalk.Metaclass)}
- }),
- smalltalk.Metaclass);
- smalltalk.addClass('ClassBuilder', smalltalk.Object, [], 'Kernel-Classes');
- smalltalk.addMethod(
- "_addSubclassOf_named_instanceVariableNames_",
- smalltalk.method({
- selector: "addSubclassOf:named:instanceVariableNames:",
- fn: function (aClass,aString,aCollection){
- var self=this;
- return smalltalk.withContext(function($ctx) { smalltalk.addClass(aString, aClass, aCollection);
- return smalltalk[aString];
- ;
- return self}, self, "addSubclassOf:named:instanceVariableNames:", [aClass,aString,aCollection], smalltalk.ClassBuilder)}
- }),
- smalltalk.ClassBuilder);
- smalltalk.addMethod(
- "_addSubclassOf_named_instanceVariableNames_package_",
- smalltalk.method({
- selector: "addSubclassOf:named:instanceVariableNames:package:",
- fn: function (aClass,aString,aCollection,packageName){
- var self=this;
- return smalltalk.withContext(function($ctx) { smalltalk.addClass(aString, aClass, aCollection, packageName);
- return smalltalk[aString];
- ;
- return self}, self, "addSubclassOf:named:instanceVariableNames:package:", [aClass,aString,aCollection,packageName], smalltalk.ClassBuilder)}
- }),
- smalltalk.ClassBuilder);
- smalltalk.addMethod(
- "_class_instanceVariableNames_",
- smalltalk.method({
- selector: "class:instanceVariableNames:",
- fn: function (aClass,aString){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1,$2,$3;
- $1=_st(aClass)._isMetaclass();
- if(! smalltalk.assert($1)){
- _st(self)._error_(_st(_st(aClass)._name()).__comma(" is not a metaclass"));
- };
- _st(aClass)._basicAt_put_("iVarNames",_st(self)._instanceVariableNamesFor_(aString));
- $2=_st((smalltalk.ClassDefinitionChanged || ClassDefinitionChanged))._new();
- _st($2)._theClass_(aClass);
- $3=_st($2)._yourself();
- _st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($3);
- _st(self)._setupClass_(aClass);
- return self}, self, "class:instanceVariableNames:", [aClass,aString], smalltalk.ClassBuilder)}
- }),
- smalltalk.ClassBuilder);
- smalltalk.addMethod(
- "_copyClass_named_",
- smalltalk.method({
- selector: "copyClass:named:",
- fn: function (aClass,aString){
- var self=this;
- return smalltalk.withContext(function($ctx) { var newClass;
- newClass=_st(self)._addSubclassOf_named_instanceVariableNames_package_(_st(aClass)._superclass(),aString,_st(aClass)._instanceVariableNames(),_st(_st(aClass)._package())._name());
- _st(self)._setupClass_(newClass);
- _st(_st(_st(aClass)._methodDictionary())._values())._do_((function(each){
- return _st(_st((smalltalk.Compiler || Compiler))._new())._install_forClass_category_(_st(each)._source(),newClass,_st(each)._category());
- }));
- _st(_st(_st(_st(aClass)._class())._methodDictionary())._values())._do_((function(each){
- return _st(_st((smalltalk.Compiler || Compiler))._new())._install_forClass_category_(_st(each)._source(),_st(newClass)._class(),_st(each)._category());
- }));
- _st(self)._setupClass_(newClass);
- return newClass;
- }, self, "copyClass:named:", [aClass,aString], smalltalk.ClassBuilder)}
- }),
- smalltalk.ClassBuilder);
- smalltalk.addMethod(
- "_instanceVariableNamesFor_",
- smalltalk.method({
- selector: "instanceVariableNamesFor:",
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1;
- $1=_st(_st(aString)._tokenize_(" "))._reject_((function(each){
- return _st(each)._isEmpty();
- }));
- return $1;
- }, self, "instanceVariableNamesFor:", [aString], smalltalk.ClassBuilder)}
- }),
- smalltalk.ClassBuilder);
- smalltalk.addMethod(
- "_renameClass_to_",
- smalltalk.method({
- selector: "renameClass:to:",
- fn: function (aClass,aString){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1,$2;
- smalltalk[aString] = aClass;
- delete smalltalk[aClass.className];
- aClass.className = aString;
- ;
- ;
- $1=_st((smalltalk.ClassRenamed || ClassRenamed))._new();
- _st($1)._theClass_(aClass);
- $2=_st($1)._yourself();
- _st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($2);
- return self}, self, "renameClass:to:", [aClass,aString], smalltalk.ClassBuilder)}
- }),
- smalltalk.ClassBuilder);
- smalltalk.addMethod(
- "_setupClass_",
- smalltalk.method({
- selector: "setupClass:",
- fn: function (aClass){
- var self=this;
- return smalltalk.withContext(function($ctx) { smalltalk.init(aClass);;
- ;
- return self}, self, "setupClass:", [aClass], smalltalk.ClassBuilder)}
- }),
- smalltalk.ClassBuilder);
- smalltalk.addMethod(
- "_superclass_subclass_",
- smalltalk.method({
- selector: "superclass:subclass:",
- fn: function (aClass,aString){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1;
- $1=_st(self)._superclass_subclass_instanceVariableNames_package_(aClass,aString,"",nil);
- return $1;
- }, self, "superclass:subclass:", [aClass,aString], smalltalk.ClassBuilder)}
- }),
- smalltalk.ClassBuilder);
- smalltalk.addMethod(
- "_superclass_subclass_instanceVariableNames_package_",
- smalltalk.method({
- selector: "superclass:subclass:instanceVariableNames:package:",
- fn: function (aClass,aString,aString2,aString3){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1,$2,$3;
- var newClass;
- if(($receiver = aString3) == nil || $receiver == undefined){
- $1="unclassified";
- } else {
- $1=aString3;
- };
- newClass=_st(self)._addSubclassOf_named_instanceVariableNames_package_(aClass,aString,_st(self)._instanceVariableNamesFor_(aString2),$1);
- _st(self)._setupClass_(newClass);
- $2=_st((smalltalk.ClassAdded || ClassAdded))._new();
- _st($2)._theClass_(newClass);
- $3=_st($2)._yourself();
- _st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($3);
- return newClass;
- }, self, "superclass:subclass:instanceVariableNames:package:", [aClass,aString,aString2,aString3], smalltalk.ClassBuilder)}
- }),
- smalltalk.ClassBuilder);
- smalltalk.addClass('ClassCategoryReader', smalltalk.Object, ['class', 'category', 'chunkParser'], 'Kernel-Classes');
- smalltalk.addMethod(
- "_class_category_",
- smalltalk.method({
- selector: "class:category:",
- fn: function (aClass,aString){
- var self=this;
- return smalltalk.withContext(function($ctx) { self["@class"]=aClass;
- self["@category"]=aString;
- return self}, self, "class:category:", [aClass,aString], smalltalk.ClassCategoryReader)}
- }),
- smalltalk.ClassCategoryReader);
- smalltalk.addMethod(
- "_compileMethod_",
- smalltalk.method({
- selector: "compileMethod:",
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx) { _st(_st((smalltalk.Compiler || Compiler))._new())._install_forClass_category_(aString,self["@class"],self["@category"]);
- return self}, self, "compileMethod:", [aString], smalltalk.ClassCategoryReader)}
- }),
- smalltalk.ClassCategoryReader);
- smalltalk.addMethod(
- "_initialize",
- smalltalk.method({
- selector: "initialize",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
- self["@chunkParser"]=_st((smalltalk.ChunkParser || ChunkParser))._new();
- return self}, self, "initialize", [], smalltalk.ClassCategoryReader)}
- }),
- smalltalk.ClassCategoryReader);
- smalltalk.addMethod(
- "_scanFrom_",
- smalltalk.method({
- selector: "scanFrom:",
- fn: function (aChunkParser){
- var self=this;
- return smalltalk.withContext(function($ctx) { var chunk;
- _st((function(){
- chunk=_st(aChunkParser)._nextChunk();
- chunk;
- return _st(chunk)._isEmpty();
- }))._whileFalse_((function(){
- return _st(self)._compileMethod_(chunk);
- }));
- _st(_st((smalltalk.Compiler || Compiler))._new())._setupClass_(self["@class"]);
- return self}, self, "scanFrom:", [aChunkParser], smalltalk.ClassCategoryReader)}
- }),
- smalltalk.ClassCategoryReader);
- smalltalk.addClass('ClassCommentReader', smalltalk.Object, ['class', 'chunkParser'], 'Kernel-Classes');
- smalltalk.addMethod(
- "_class_",
- smalltalk.method({
- selector: "class:",
- fn: function (aClass){
- var self=this;
- return smalltalk.withContext(function($ctx) { self["@class"]=aClass;
- return self}, self, "class:", [aClass], smalltalk.ClassCommentReader)}
- }),
- smalltalk.ClassCommentReader);
- smalltalk.addMethod(
- "_initialize",
- smalltalk.method({
- selector: "initialize",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
- self["@chunkParser"]=_st((smalltalk.ChunkParser || ChunkParser))._new();
- return self}, self, "initialize", [], smalltalk.ClassCommentReader)}
- }),
- smalltalk.ClassCommentReader);
- smalltalk.addMethod(
- "_scanFrom_",
- smalltalk.method({
- selector: "scanFrom:",
- fn: function (aChunkParser){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1;
- var chunk;
- chunk=_st(aChunkParser)._nextChunk();
- $1=_st(chunk)._isEmpty();
- if(! smalltalk.assert($1)){
- _st(self)._setComment_(chunk);
- };
- return self}, self, "scanFrom:", [aChunkParser], smalltalk.ClassCommentReader)}
- }),
- smalltalk.ClassCommentReader);
- smalltalk.addMethod(
- "_setComment_",
- smalltalk.method({
- selector: "setComment:",
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx) { _st(self["@class"])._comment_(aString);
- return self}, self, "setComment:", [aString], smalltalk.ClassCommentReader)}
- }),
- smalltalk.ClassCommentReader);
- smalltalk.addClass('ClassSorterNode', smalltalk.Object, ['theClass', 'level', 'nodes'], 'Kernel-Classes');
- smalltalk.addMethod(
- "_getNodesFrom_",
- smalltalk.method({
- selector: "getNodesFrom:",
- fn: function (aCollection){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $1;
- var children;
- var others;
- children=[];
- others=[];
- _st(aCollection)._do_((function(each){
- $1=_st(_st(each)._superclass()).__eq(_st(self)._theClass());
- if(smalltalk.assert($1)){
- return _st(children)._add_(each);
- } else {
- return _st(others)._add_(each);
- };
- }));
- self["@nodes"]=_st(children)._collect_((function(each){
- return _st((smalltalk.ClassSorterNode || ClassSorterNode))._on_classes_level_(each,others,_st(_st(self)._level()).__plus((1)));
- }));
- return self}, self, "getNodesFrom:", [aCollection], smalltalk.ClassSorterNode)}
- }),
- smalltalk.ClassSorterNode);
- smalltalk.addMethod(
- "_level",
- smalltalk.method({
- selector: "level",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { return self["@level"];
- }, self, "level", [], smalltalk.ClassSorterNode)}
- }),
- smalltalk.ClassSorterNode);
- smalltalk.addMethod(
- "_level_",
- smalltalk.method({
- selector: "level:",
- fn: function (anInteger){
- var self=this;
- return smalltalk.withContext(function($ctx) { self["@level"]=anInteger;
- return self}, self, "level:", [anInteger], smalltalk.ClassSorterNode)}
- }),
- smalltalk.ClassSorterNode);
- smalltalk.addMethod(
- "_nodes",
- smalltalk.method({
- selector: "nodes",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { return self["@nodes"];
- }, self, "nodes", [], smalltalk.ClassSorterNode)}
- }),
- smalltalk.ClassSorterNode);
- smalltalk.addMethod(
- "_theClass",
- smalltalk.method({
- selector: "theClass",
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx) { return self["@theClass"];
- }, self, "theClass", [], smalltalk.ClassSorterNode)}
- }),
- smalltalk.ClassSorterNode);
- smalltalk.addMethod(
- "_theClass_",
- smalltalk.method({
- selector: "theClass:",
- fn: function (aClass){
- var self=this;
- return smalltalk.withContext(function($ctx) { self["@theClass"]=aClass;
- return self}, self, "theClass:", [aClass], smalltalk.ClassSorterNode)}
- }),
- smalltalk.ClassSorterNode);
- smalltalk.addMethod(
- "_traverseClassesWith_",
- smalltalk.method({
- selector: "traverseClassesWith:",
- fn: function (aCollection){
- var self=this;
- return smalltalk.withContext(function($ctx) { _st(aCollection)._add_(_st(self)._theClass());
- _st(_st(_st(self)._nodes())._sorted_((function(a,b){
- return _st(_st(_st(a)._theClass())._name()).__lt_eq(_st(_st(b)._theClass())._name());
- })))._do_((function(aNode){
- return _st(aNode)._traverseClassesWith_(aCollection);
- }));
- return self}, self, "traverseClassesWith:", [aCollection], smalltalk.ClassSorterNode)}
- }),
- smalltalk.ClassSorterNode);
- smalltalk.addMethod(
- "_on_classes_level_",
- smalltalk.method({
- selector: "on:classes:level:",
- fn: function (aClass,aCollection,anInteger){
- var self=this;
- return smalltalk.withContext(function($ctx) { var $2,$3,$1;
- $2=_st(self)._new();
- _st($2)._theClass_(aClass);
- _st($2)._level_(anInteger);
- _st($2)._getNodesFrom_(aCollection);
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, self, "on:classes:level:", [aClass,aCollection,anInteger], smalltalk.ClassSorterNode.klass)}
- }),
- smalltalk.ClassSorterNode.klass);
|