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