Explorar o código

Make 'set parsed inst vars for metaclass' public.

Herby Vojčík %!s(int64=6) %!d(string=hai) anos
pai
achega
ca26024178
Modificáronse 3 ficheiros con 38 adicións e 34 borrados
  1. 4 0
      API-CHANGES.txt
  2. 29 29
      src/Kernel-Classes.js
  3. 5 5
      src/Kernel-Classes.st

+ 4 - 0
API-CHANGES.txt

@@ -1,9 +1,13 @@
 0.21.1:
 
++ ClassBuilder >>
+  + class:instanceVariables:
 + JSObjectProxy class >>
   + null
   + undefined
 
+- ClassBuilder >>
+  - basicClass:instanceVariableNames:
 
 0.21.0:
 

+ 29 - 29
src/Kernel-Classes.js

@@ -1338,30 +1338,6 @@ messageSends: []
 }),
 $globals.ClassBuilder);
 
-$core.addMethod(
-$core.method({
-selector: "basicClass:instanceVariableNames:",
-protocol: "private",
-fn: function (aClass,aString){
-var self=this,$self=this;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-$self._basicClass_instanceVariables_(aClass,$self._instanceVariableNamesFor_(aString));
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"basicClass:instanceVariableNames:",{aClass:aClass,aString:aString},$globals.ClassBuilder)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: ["aClass", "aString"],
-source: "basicClass: aClass instanceVariableNames: aString\x0a\x09self basicClass: aClass instanceVariables: (self instanceVariableNamesFor: aString)",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: ["basicClass:instanceVariables:", "instanceVariableNamesFor:"]
-}),
-$globals.ClassBuilder);
-
 $core.addMethod(
 $core.method({
 selector: "basicClass:instanceVariables:",
@@ -1480,8 +1456,32 @@ var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
+$self._class_instanceVariables_(aClass,$self._instanceVariableNamesFor_(ivarNames));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"class:instanceVariableNames:",{aClass:aClass,ivarNames:ivarNames},$globals.ClassBuilder)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aClass", "ivarNames"],
+source: "class: aClass instanceVariableNames: ivarNames\x0a\x09self class: aClass instanceVariables:  (self instanceVariableNamesFor: ivarNames)",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["class:instanceVariables:", "instanceVariableNamesFor:"]
+}),
+$globals.ClassBuilder);
+
+$core.addMethod(
+$core.method({
+selector: "class:instanceVariables:",
+protocol: "class definition",
+fn: function (aClass,aCollection){
+var self=this,$self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
 var $1,$3,$2;
-$self._basicClass_instanceVariableNames_(aClass,ivarNames);
+$self._basicClass_instanceVariables_(aClass,aCollection);
 $1=$recv($globals.SystemAnnouncer)._current();
 $3=$recv($globals.ClassDefinitionChanged)._new();
 $recv($3)._theClass_(aClass);
@@ -1489,15 +1489,15 @@ $2=$recv($3)._yourself();
 $recv($1)._announce_($2);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"class:instanceVariableNames:",{aClass:aClass,ivarNames:ivarNames},$globals.ClassBuilder)});
+}, function($ctx1) {$ctx1.fill(self,"class:instanceVariables:",{aClass:aClass,aCollection:aCollection},$globals.ClassBuilder)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
-args: ["aClass", "ivarNames"],
-source: "class: aClass instanceVariableNames: ivarNames\x0a\x09self basicClass: aClass instanceVariableNames: ivarNames.\x0a\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (ClassDefinitionChanged new\x0a\x09\x09\x09theClass: aClass;\x0a\x09\x09\x09yourself)",
+args: ["aClass", "aCollection"],
+source: "class: aClass instanceVariables: aCollection\x0a\x09self basicClass: aClass instanceVariables: aCollection.\x0a\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (ClassDefinitionChanged new\x0a\x09\x09\x09theClass: aClass;\x0a\x09\x09\x09yourself)",
 referencedClasses: ["SystemAnnouncer", "ClassDefinitionChanged"],
 //>>excludeEnd("ide");
-messageSends: ["basicClass:instanceVariableNames:", "announce:", "current", "theClass:", "new", "yourself"]
+messageSends: ["basicClass:instanceVariables:", "announce:", "current", "theClass:", "new", "yourself"]
 }),
 $globals.ClassBuilder);
 

+ 5 - 5
src/Kernel-Classes.st

@@ -326,7 +326,11 @@ addTraitNamed: traitName package: packageName
 !
 
 class: aClass instanceVariableNames: ivarNames
-	self basicClass: aClass instanceVariableNames: ivarNames.
+	self class: aClass instanceVariables:  (self instanceVariableNamesFor: ivarNames)
+!
+
+class: aClass instanceVariables: aCollection
+	self basicClass: aClass instanceVariables: aCollection.
 	
 	SystemAnnouncer current
 		announce: (ClassDefinitionChanged new
@@ -472,10 +476,6 @@ basicAddTraitNamed: aString package: anotherString
 	<inlineJS: 'return $core.addTrait(aString, anotherString)'>
 !
 
-basicClass: aClass instanceVariableNames: aString
-	self basicClass: aClass instanceVariables: (self instanceVariableNamesFor: aString)
-!
-
 basicClass: aClass instanceVariables: aCollection
 
 	aClass isMetaclass ifFalse: [ self error: aClass name, ' is not a metaclass' ].