Browse Source

Add {allS,s}lotNames. Move to new APIs.

Exporter part not moved yet.
Herby Vojčík 4 years ago
parent
commit
b9f2080c19

+ 3 - 0
lang/API-CHANGES.txt

@@ -5,6 +5,7 @@
 * Behavior >> instanceVariableNames aimed at only that. No visible change atm.
 * Deprecate Object >> asJavaScript{Object,Source}.
   * Hard to do generically if slots are added later.
+* InstanceVar => SlotVar and related apis (addIVar: => addSlotVar:).
 
 + Behavior >>
   + slots
@@ -17,8 +18,10 @@
   + slots
 + TBehaviorProvider >>
   + allInstanceVariableNames
+  + allSlotNames
   + allSlots
   + instanceVariableNames
+  + slotNames
 + UndefinedObject >>
   + asJavaScriptSource
 

+ 47 - 47
lang/src/Compiler-Interpreter.js

@@ -4005,53 +4005,6 @@ return $self._error_("Unknown variable");
 }; }),
 $globals.ExternallyKnownVar);
 
-$core.addMethod(
-$core.method({
-selector: "inContext:",
-protocol: "*Compiler-Interpreter",
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: ["aContext"],
-source: "inContext: aContext\x0a\x09^ aContext receiver instVarNamed: self name",
-referencedClasses: [],
-//>>excludeEnd("ide");
-pragmas: [],
-messageSends: ["instVarNamed:", "receiver", "name"]
-}, function ($methodClass){ return function (aContext){
-var self=this,$self=this;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-return $recv($recv(aContext)._receiver())._instVarNamed_($self._name());
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"inContext:",{aContext:aContext})});
-//>>excludeEnd("ctx");
-}; }),
-$globals.InstanceVar);
-
-$core.addMethod(
-$core.method({
-selector: "inContext:put:",
-protocol: "*Compiler-Interpreter",
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: ["aContext", "anObject"],
-source: "inContext: aContext put: anObject\x0a\x09aContext receiver instVarNamed: self name put: anObject",
-referencedClasses: [],
-//>>excludeEnd("ide");
-pragmas: [],
-messageSends: ["instVarNamed:put:", "receiver", "name"]
-}, function ($methodClass){ return function (aContext,anObject){
-var self=this,$self=this;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-$recv($recv(aContext)._receiver())._instVarNamed_put_($self._name(),anObject);
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"inContext:put:",{aContext:aContext,anObject:anObject})});
-//>>excludeEnd("ctx");
-}; }),
-$globals.InstanceVar);
-
 $core.addMethod(
 $core.method({
 selector: "isSteppingNode",
@@ -4192,6 +4145,53 @@ return true;
 }; }),
 $globals.SendNode);
 
+$core.addMethod(
+$core.method({
+selector: "inContext:",
+protocol: "*Compiler-Interpreter",
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aContext"],
+source: "inContext: aContext\x0a\x09^ aContext receiver instVarNamed: self name",
+referencedClasses: [],
+//>>excludeEnd("ide");
+pragmas: [],
+messageSends: ["instVarNamed:", "receiver", "name"]
+}, function ($methodClass){ return function (aContext){
+var self=this,$self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+return $recv($recv(aContext)._receiver())._instVarNamed_($self._name());
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"inContext:",{aContext:aContext})});
+//>>excludeEnd("ctx");
+}; }),
+$globals.SlotVar);
+
+$core.addMethod(
+$core.method({
+selector: "inContext:put:",
+protocol: "*Compiler-Interpreter",
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aContext", "anObject"],
+source: "inContext: aContext put: anObject\x0a\x09aContext receiver instVarNamed: self name put: anObject",
+referencedClasses: [],
+//>>excludeEnd("ide");
+pragmas: [],
+messageSends: ["instVarNamed:put:", "receiver", "name"]
+}, function ($methodClass){ return function (aContext,anObject){
+var self=this,$self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv($recv(aContext)._receiver())._instVarNamed_put_($self._name(),anObject);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"inContext:put:",{aContext:aContext,anObject:anObject})});
+//>>excludeEnd("ctx");
+}; }),
+$globals.SlotVar);
+
 $core.addMethod(
 $core.method({
 selector: "inContext:",

+ 10 - 10
lang/src/Compiler-Interpreter.st

@@ -1069,16 +1069,6 @@ inContext: aContext
 	^ Platform globals at: self name ifAbsent: [ self error: 'Unknown variable' ]
 ! !
 
-!InstanceVar methodsFor: '*Compiler-Interpreter'!
-
-inContext: aContext
-	^ aContext receiver instVarNamed: self name
-!
-
-inContext: aContext put: anObject
-	aContext receiver instVarNamed: self name put: anObject
-! !
-
 !JSStatementNode methodsFor: '*Compiler-Interpreter'!
 
 isSteppingNode
@@ -1115,6 +1105,16 @@ isSteppingNode
 	^ true
 ! !
 
+!SlotVar methodsFor: '*Compiler-Interpreter'!
+
+inContext: aContext
+	^ aContext receiver instVarNamed: self name
+!
+
+inContext: aContext put: anObject
+	aContext receiver instVarNamed: self name put: anObject
+! !
+
 !SuperVar methodsFor: '*Compiler-Interpreter'!
 
 inContext: aContext

+ 109 - 109
lang/src/Compiler-Semantic.js

@@ -914,59 +914,59 @@ $globals.LexicalScope);
 
 
 $core.addClass("MethodLexicalScope", $globals.LexicalScope, "Compiler-Semantic");
-$core.setSlots($globals.MethodLexicalScope, ["iVars", "pseudoVars", "localReturn", "nonLocalReturns"]);
+$core.setSlots($globals.MethodLexicalScope, ["slotVars", "pseudoVars", "localReturn", "nonLocalReturns"]);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 $globals.MethodLexicalScope.comment="I represent a method scope.";
 //>>excludeEnd("ide");
 $core.addMethod(
 $core.method({
-selector: "addIVar:",
+selector: "addNonLocalReturn:",
 protocol: "adding",
 //>>excludeStart("ide", pragmas.excludeIdeData);
-args: ["aString"],
-source: "addIVar: aString\x0a\x09self iVars at: aString put: (InstanceVar on: aString).\x0a\x09(self iVars at: aString) scope: self",
-referencedClasses: ["InstanceVar"],
+args: ["aScope"],
+source: "addNonLocalReturn: aScope\x0a\x09self nonLocalReturns add: aScope",
+referencedClasses: [],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["at:put:", "iVars", "on:", "scope:", "at:"]
-}, function ($methodClass){ return function (aString){
+messageSends: ["add:", "nonLocalReturns"]
+}, function ($methodClass){ return function (aScope){
 var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-$recv([$self._iVars()
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-,$ctx1.sendIdx["iVars"]=1
-//>>excludeEnd("ctx");
-][0])._at_put_(aString,$recv($globals.InstanceVar)._on_(aString));
-$recv($recv($self._iVars())._at_(aString))._scope_(self);
+$recv($self._nonLocalReturns())._add_(aScope);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"addIVar:",{aString:aString})});
+}, function($ctx1) {$ctx1.fill(self,"addNonLocalReturn:",{aScope:aScope})});
 //>>excludeEnd("ctx");
 }; }),
 $globals.MethodLexicalScope);
 
 $core.addMethod(
 $core.method({
-selector: "addNonLocalReturn:",
+selector: "addSlotVar:",
 protocol: "adding",
 //>>excludeStart("ide", pragmas.excludeIdeData);
-args: ["aScope"],
-source: "addNonLocalReturn: aScope\x0a\x09self nonLocalReturns add: aScope",
-referencedClasses: [],
+args: ["aString"],
+source: "addSlotVar: aString\x0a\x09self slotVars at: aString put: (SlotVar on: aString).\x0a\x09(self slotVars at: aString) scope: self",
+referencedClasses: ["SlotVar"],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["add:", "nonLocalReturns"]
-}, function ($methodClass){ return function (aScope){
+messageSends: ["at:put:", "slotVars", "on:", "scope:", "at:"]
+}, function ($methodClass){ return function (aString){
 var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-$recv($self._nonLocalReturns())._add_(aScope);
+$recv([$self._slotVars()
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+,$ctx1.sendIdx["slotVars"]=1
+//>>excludeEnd("ctx");
+][0])._at_put_(aString,$recv($globals.SlotVar)._on_(aString));
+$recv($recv($self._slotVars())._at_(aString))._scope_(self);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"addNonLocalReturn:",{aScope:aScope})});
+}, function($ctx1) {$ctx1.fill(self,"addSlotVar:",{aString:aString})});
 //>>excludeEnd("ctx");
 }; }),
 $globals.MethodLexicalScope);
@@ -977,11 +977,11 @@ selector: "allVariableNames",
 protocol: "accessing",
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "allVariableNames\x0a\x09^ super allVariableNames, self iVars keys",
+source: "allVariableNames\x0a\x09^ super allVariableNames, self slotVars keys",
 referencedClasses: [],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: [",", "allVariableNames", "keys", "iVars"]
+messageSends: [",", "allVariableNames", "keys", "slotVars"]
 }, function ($methodClass){ return function (){
 var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -995,7 +995,7 @@ $ctx1.supercall = true,
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx1.supercall = false
 //>>excludeEnd("ctx");
-][0]).__comma($recv($self._iVars())._keys());
+][0]).__comma($recv($self._slotVars())._keys());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"allVariableNames",{})});
 //>>excludeEnd("ctx");
@@ -1008,11 +1008,11 @@ selector: "bindingFor:",
 protocol: "accessing",
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aString"],
-source: "bindingFor: aString\x0a\x09^ (super bindingFor: aString) ifNil: [\x0a\x09\x09self iVars at: aString ifAbsent: [ nil ]]",
+source: "bindingFor: aString\x0a\x09^ (super bindingFor: aString) ifNil: [\x0a\x09\x09self slotVars at: aString ifAbsent: [ nil ]]",
 referencedClasses: [],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["ifNil:", "bindingFor:", "at:ifAbsent:", "iVars"]
+messageSends: ["ifNil:", "bindingFor:", "at:ifAbsent:", "slotVars"]
 }, function ($methodClass){ return function (aString){
 var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -1029,7 +1029,7 @@ $ctx1.supercall = true,
 //>>excludeEnd("ctx");
 ][0];
 if($1 == null || $1.a$nil){
-return $recv($self._iVars())._at_ifAbsent_(aString,(function(){
+return $recv($self._slotVars())._at_ifAbsent_(aString,(function(){
 return nil;
 
 }));
@@ -1106,36 +1106,6 @@ return $recv($self._nonLocalReturns())._notEmpty();
 }; }),
 $globals.MethodLexicalScope);
 
-$core.addMethod(
-$core.method({
-selector: "iVars",
-protocol: "accessing",
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "iVars\x0a\x09^ iVars ifNil: [ iVars := Dictionary new ]",
-referencedClasses: ["Dictionary"],
-//>>excludeEnd("ide");
-pragmas: [],
-messageSends: ["ifNil:", "new"]
-}, function ($methodClass){ return function (){
-var self=this,$self=this;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-var $1;
-$1=$self.iVars;
-if($1 == null || $1.a$nil){
-$self.iVars=$recv($globals.Dictionary)._new();
-return $self.iVars;
-} else {
-return $1;
-}
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"iVars",{})});
-//>>excludeEnd("ctx");
-}; }),
-$globals.MethodLexicalScope);
-
 $core.addMethod(
 $core.method({
 selector: "isMethodScope",
@@ -1318,6 +1288,36 @@ return self;
 }; }),
 $globals.MethodLexicalScope);
 
+$core.addMethod(
+$core.method({
+selector: "slotVars",
+protocol: "accessing",
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "slotVars\x0a\x09^ slotVars ifNil: [ slotVars := Dictionary new ]",
+referencedClasses: ["Dictionary"],
+//>>excludeEnd("ide");
+pragmas: [],
+messageSends: ["ifNil:", "new"]
+}, function ($methodClass){ return function (){
+var self=this,$self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$self.slotVars;
+if($1 == null || $1.a$nil){
+$self.slotVars=$recv($globals.Dictionary)._new();
+return $self.slotVars;
+} else {
+return $1;
+}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"slotVars",{})});
+//>>excludeEnd("ctx");
+}; }),
+$globals.MethodLexicalScope);
+
 
 
 $core.addClass("ScopeVar", $globals.Object, "Compiler-Semantic");
@@ -1635,53 +1635,6 @@ $globals.ExternallyKnownVar.comment="I am a variable known externally (not in me
 //>>excludeEnd("ide");
 
 
-$core.addClass("InstanceVar", $globals.ScopeVar, "Compiler-Semantic");
-//>>excludeStart("ide", pragmas.excludeIdeData);
-$globals.InstanceVar.comment="I am an instance variable of a method or block.";
-//>>excludeEnd("ide");
-$core.addMethod(
-$core.method({
-selector: "alias",
-protocol: "testing",
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "alias\x0a\x09^ '$self.', self name",
-referencedClasses: [],
-//>>excludeEnd("ide");
-pragmas: [],
-messageSends: [",", "name"]
-}, function ($methodClass){ return function (){
-var self=this,$self=this;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-return "$self.".__comma($self._name());
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"alias",{})});
-//>>excludeEnd("ctx");
-}; }),
-$globals.InstanceVar);
-
-$core.addMethod(
-$core.method({
-selector: "isAssignable",
-protocol: "testing",
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "isAssignable\x0a\x09^ true",
-referencedClasses: [],
-//>>excludeEnd("ide");
-pragmas: [],
-messageSends: []
-}, function ($methodClass){ return function (){
-var self=this,$self=this;
-return true;
-
-}; }),
-$globals.InstanceVar);
-
-
-
 $core.addClass("PseudoVar", $globals.ScopeVar, "Compiler-Semantic");
 //>>excludeStart("ide", pragmas.excludeIdeData);
 $globals.PseudoVar.comment="I am an pseudo variable.\x0a\x0aThe five Smalltalk pseudo variables are: 'self', 'super', 'nil', 'true' and 'false'";
@@ -1916,6 +1869,53 @@ $globals.ThisContextVar);
 
 
 
+$core.addClass("SlotVar", $globals.ScopeVar, "Compiler-Semantic");
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.SlotVar.comment="I am a slot variable of a method's class.";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "alias",
+protocol: "testing",
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "alias\x0a\x09^ '$self.', self name",
+referencedClasses: [],
+//>>excludeEnd("ide");
+pragmas: [],
+messageSends: [",", "name"]
+}, function ($methodClass){ return function (){
+var self=this,$self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+return "$self.".__comma($self._name());
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"alias",{})});
+//>>excludeEnd("ctx");
+}; }),
+$globals.SlotVar);
+
+$core.addMethod(
+$core.method({
+selector: "isAssignable",
+protocol: "testing",
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "isAssignable\x0a\x09^ true",
+referencedClasses: [],
+//>>excludeEnd("ide");
+pragmas: [],
+messageSends: []
+}, function ($methodClass){ return function (){
+var self=this,$self=this;
+return true;
+
+}; }),
+$globals.SlotVar);
+
+
+
 $core.addClass("TempVar", $globals.ScopeVar, "Compiler-Semantic");
 //>>excludeStart("ide", pragmas.excludeIdeData);
 $globals.TempVar.comment="I am an temporary variable of a method or block.";
@@ -2584,11 +2584,11 @@ selector: "visitMethodNode:",
 protocol: "visiting",
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aNode"],
-source: "visitMethodNode: aNode\x0a\x09self pushScope: self newMethodScope.\x0a\x09aNode scope: currentScope.\x0a\x09currentScope node: aNode.\x0a\x0a\x09self theClass allInstanceVariableNames do: [ :each |\x0a\x09\x09currentScope addIVar: each ].\x0a\x09aNode arguments do: [ :each |\x0a\x09\x09self validateVariableScope: each.\x0a\x09\x09currentScope addArg: each ].\x0a\x0a\x09super visitMethodNode: aNode.\x0a\x0a\x09aNode\x0a\x09\x09classReferences: self classReferences;\x0a\x09\x09sendIndexes: self messageSends.\x0a\x09self popScope.\x0a\x09^ aNode",
+source: "visitMethodNode: aNode\x0a\x09self pushScope: self newMethodScope.\x0a\x09aNode scope: currentScope.\x0a\x09currentScope node: aNode.\x0a\x0a\x09self theClass allSlotNames do: [ :each |\x0a\x09\x09currentScope addSlotVar: each ].\x0a\x09aNode arguments do: [ :each |\x0a\x09\x09self validateVariableScope: each.\x0a\x09\x09currentScope addArg: each ].\x0a\x0a\x09super visitMethodNode: aNode.\x0a\x0a\x09aNode\x0a\x09\x09classReferences: self classReferences;\x0a\x09\x09sendIndexes: self messageSends.\x0a\x09self popScope.\x0a\x09^ aNode",
 referencedClasses: [],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["pushScope:", "newMethodScope", "scope:", "node:", "do:", "allInstanceVariableNames", "theClass", "addIVar:", "arguments", "validateVariableScope:", "addArg:", "visitMethodNode:", "classReferences:", "classReferences", "sendIndexes:", "messageSends", "popScope"]
+messageSends: ["pushScope:", "newMethodScope", "scope:", "node:", "do:", "allSlotNames", "theClass", "addSlotVar:", "arguments", "validateVariableScope:", "addArg:", "visitMethodNode:", "classReferences:", "classReferences", "sendIndexes:", "messageSends", "popScope"]
 }, function ($methodClass){ return function (aNode){
 var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -2597,11 +2597,11 @@ return $core.withContext(function($ctx1) {
 $self._pushScope_($self._newMethodScope());
 $recv(aNode)._scope_($self.currentScope);
 $recv($self.currentScope)._node_(aNode);
-[$recv($recv($self._theClass())._allInstanceVariableNames())._do_((function(each){
+[$recv($recv($self._theClass())._allSlotNames())._do_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-return $recv($self.currentScope)._addIVar_(each);
+return $recv($self.currentScope)._addSlotVar_(each);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
 //>>excludeEnd("ctx");

+ 30 - 30
lang/src/Compiler-Semantic.st

@@ -194,7 +194,7 @@ isMethodScope
 ! !
 
 LexicalScope subclass: #MethodLexicalScope
-	slots: {#iVars. #pseudoVars. #localReturn. #nonLocalReturns}
+	slots: {#slotVars. #pseudoVars. #localReturn. #nonLocalReturns}
 	package: 'Compiler-Semantic'!
 !MethodLexicalScope commentStamp!
 I represent a method scope.!
@@ -202,16 +202,12 @@ I represent a method scope.!
 !MethodLexicalScope methodsFor: 'accessing'!
 
 allVariableNames
-	^ super allVariableNames, self iVars keys
+	^ super allVariableNames, self slotVars keys
 !
 
 bindingFor: aString
 	^ (super bindingFor: aString) ifNil: [
-		self iVars at: aString ifAbsent: [ nil ]]
-!
-
-iVars
-	^ iVars ifNil: [ iVars := Dictionary new ]
+		self slotVars at: aString ifAbsent: [ nil ]]
 !
 
 localReturn
@@ -238,19 +234,23 @@ pseudoVars
 				scope: self methodScope;
 				yourself) ] ].
 	^ pseudoVars
+!
+
+slotVars
+	^ slotVars ifNil: [ slotVars := Dictionary new ]
 ! !
 
 !MethodLexicalScope methodsFor: 'adding'!
 
-addIVar: aString
-	self iVars at: aString put: (InstanceVar on: aString).
-	(self iVars at: aString) scope: self
-!
-
 addNonLocalReturn: aScope
 	self nonLocalReturns add: aScope
 !
 
+addSlotVar: aString
+	self slotVars at: aString put: (SlotVar on: aString).
+	(self slotVars at: aString) scope: self
+!
+
 removeNonLocalReturn: aScope
 	self nonLocalReturns remove: aScope ifAbsent: []
 ! !
@@ -375,22 +375,6 @@ ScopeVar subclass: #ExternallyKnownVar
 !ExternallyKnownVar commentStamp!
 I am a variable known externally (not in method scope).!
 
-ScopeVar subclass: #InstanceVar
-	slots: {}
-	package: 'Compiler-Semantic'!
-!InstanceVar commentStamp!
-I am an instance variable of a method or block.!
-
-!InstanceVar methodsFor: 'testing'!
-
-alias
-	^ '$self.', self name
-!
-
-isAssignable
-	^ true
-! !
-
 ScopeVar subclass: #PseudoVar
 	slots: {}
 	package: 'Compiler-Semantic'!
@@ -474,6 +458,22 @@ alias
 	^ '$core.getThisContext()'
 ! !
 
+ScopeVar subclass: #SlotVar
+	slots: {}
+	package: 'Compiler-Semantic'!
+!SlotVar commentStamp!
+I am a slot variable of a method's class.!
+
+!SlotVar methodsFor: 'testing'!
+
+alias
+	^ '$self.', self name
+!
+
+isAssignable
+	^ true
+! !
+
 ScopeVar subclass: #TempVar
 	slots: {}
 	package: 'Compiler-Semantic'!
@@ -649,8 +649,8 @@ visitMethodNode: aNode
 	aNode scope: currentScope.
 	currentScope node: aNode.
 
-	self theClass allInstanceVariableNames do: [ :each |
-		currentScope addIVar: each ].
+	self theClass allSlotNames do: [ :each |
+		currentScope addSlotVar: each ].
 	aNode arguments do: [ :each |
 		self validateVariableScope: each.
 		currentScope addArg: each ].

+ 33 - 33
lang/src/Compiler-Tests.js

@@ -3525,79 +3525,79 @@ $globals.ScopeVarTest);
 
 $core.addMethod(
 $core.method({
-selector: "testInstanceVar",
+selector: "testPseudoVar",
 protocol: "tests",
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "testInstanceVar\x0a\x09| binding |\x0a\x09binding := MethodLexicalScope new\x0a\x09\x09addIVar: 'bzzz';\x0a\x09\x09bindingFor: 'bzzz'.\x0a\x09self assert: binding isAssignable.\x0a\x09self deny: binding isIdempotent.\x0a\x09self assert: (binding alias includesSubString: 'bzzz').\x0a\x09self assert: (binding alias ~= 'bzzz')",
+source: "testPseudoVar\x0a\x09#('self' 'super' 'true' 'false' 'nil' 'thisContext') do: [ :each |\x0a\x09\x09| binding |\x0a\x09\x09binding := MethodLexicalScope new bindingFor: each.\x0a\x09\x09self deny: binding isAssignable.\x0a\x09\x09self assert: binding isIdempotent ]",
 referencedClasses: ["MethodLexicalScope"],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["addIVar:", "new", "bindingFor:", "assert:", "isAssignable", "deny:", "isIdempotent", "includesSubString:", "alias", "~="]
+messageSends: ["do:", "bindingFor:", "new", "deny:", "isAssignable", "assert:", "isIdempotent"]
 }, function ($methodClass){ return function (){
 var self=this,$self=this;
-var binding;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1;
-$1=$recv($globals.MethodLexicalScope)._new();
-$recv($1)._addIVar_("bzzz");
-binding=$recv($1)._bindingFor_("bzzz");
-[$self._assert_($recv(binding)._isAssignable())
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-,$ctx1.sendIdx["assert:"]=1
-//>>excludeEnd("ctx");
-][0];
-$self._deny_($recv(binding)._isIdempotent());
-[$self._assert_($recv([$recv(binding)._alias()
+["self", "super", "true", "false", "nil", "thisContext"]._do_((function(each){
+var binding;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-,$ctx1.sendIdx["alias"]=1
+return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-][0])._includesSubString_("bzzz"))
+binding=$recv($recv($globals.MethodLexicalScope)._new())._bindingFor_(each);
+$self._deny_($recv(binding)._isAssignable());
+return $self._assert_($recv(binding)._isIdempotent());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-,$ctx1.sendIdx["assert:"]=2
+}, function($ctx2) {$ctx2.fillBlock({each:each,binding:binding},$ctx1,1)});
 //>>excludeEnd("ctx");
-][0];
-$self._assert_($recv($recv(binding)._alias()).__tild_eq("bzzz"));
+}));
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"testInstanceVar",{binding:binding})});
+}, function($ctx1) {$ctx1.fill(self,"testPseudoVar",{})});
 //>>excludeEnd("ctx");
 }; }),
 $globals.ScopeVarTest);
 
 $core.addMethod(
 $core.method({
-selector: "testPseudoVar",
+selector: "testSlotVar",
 protocol: "tests",
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "testPseudoVar\x0a\x09#('self' 'super' 'true' 'false' 'nil' 'thisContext') do: [ :each |\x0a\x09\x09| binding |\x0a\x09\x09binding := MethodLexicalScope new bindingFor: each.\x0a\x09\x09self deny: binding isAssignable.\x0a\x09\x09self assert: binding isIdempotent ]",
+source: "testSlotVar\x0a\x09| binding |\x0a\x09binding := MethodLexicalScope new\x0a\x09\x09addSlotVar: 'bzzz';\x0a\x09\x09bindingFor: 'bzzz'.\x0a\x09self assert: binding isAssignable.\x0a\x09self deny: binding isIdempotent.\x0a\x09self assert: (binding alias includesSubString: 'bzzz').\x0a\x09self assert: (binding alias ~= 'bzzz')",
 referencedClasses: ["MethodLexicalScope"],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["do:", "bindingFor:", "new", "deny:", "isAssignable", "assert:", "isIdempotent"]
+messageSends: ["addSlotVar:", "new", "bindingFor:", "assert:", "isAssignable", "deny:", "isIdempotent", "includesSubString:", "alias", "~="]
 }, function ($methodClass){ return function (){
 var self=this,$self=this;
+var binding;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-["self", "super", "true", "false", "nil", "thisContext"]._do_((function(each){
-var binding;
+var $1;
+$1=$recv($globals.MethodLexicalScope)._new();
+$recv($1)._addSlotVar_("bzzz");
+binding=$recv($1)._bindingFor_("bzzz");
+[$self._assert_($recv(binding)._isAssignable())
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx2) {
+,$ctx1.sendIdx["assert:"]=1
 //>>excludeEnd("ctx");
-binding=$recv($recv($globals.MethodLexicalScope)._new())._bindingFor_(each);
-$self._deny_($recv(binding)._isAssignable());
-return $self._assert_($recv(binding)._isIdempotent());
+][0];
+$self._deny_($recv(binding)._isIdempotent());
+[$self._assert_($recv([$recv(binding)._alias()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx2) {$ctx2.fillBlock({each:each,binding:binding},$ctx1,1)});
+,$ctx1.sendIdx["alias"]=1
 //>>excludeEnd("ctx");
-}));
+][0])._includesSubString_("bzzz"))
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+,$ctx1.sendIdx["assert:"]=2
+//>>excludeEnd("ctx");
+][0];
+$self._assert_($recv($recv(binding)._alias()).__tild_eq("bzzz"));
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"testPseudoVar",{})});
+}, function($ctx1) {$ctx1.fill(self,"testSlotVar",{binding:binding})});
 //>>excludeEnd("ctx");
 }; }),
 $globals.ScopeVarTest);

+ 10 - 10
lang/src/Compiler-Tests.st

@@ -952,10 +952,18 @@ testExternallyUnknownVar
 		raise: UnknownVariableError
 !
 
-testInstanceVar
+testPseudoVar
+	#('self' 'super' 'true' 'false' 'nil' 'thisContext') do: [ :each |
+		| binding |
+		binding := MethodLexicalScope new bindingFor: each.
+		self deny: binding isAssignable.
+		self assert: binding isIdempotent ]
+!
+
+testSlotVar
 	| binding |
 	binding := MethodLexicalScope new
-		addIVar: 'bzzz';
+		addSlotVar: 'bzzz';
 		bindingFor: 'bzzz'.
 	self assert: binding isAssignable.
 	self deny: binding isIdempotent.
@@ -963,14 +971,6 @@ testInstanceVar
 	self assert: (binding alias ~= 'bzzz')
 !
 
-testPseudoVar
-	#('self' 'super' 'true' 'false' 'nil' 'thisContext') do: [ :each |
-		| binding |
-		binding := MethodLexicalScope new bindingFor: each.
-		self deny: binding isAssignable.
-		self assert: binding isIdempotent ]
-!
-
 testTempVar
 	| binding |
 	binding := MethodLexicalScope new

+ 53 - 7
lang/src/Kernel-Classes.js

@@ -1666,11 +1666,11 @@ selector: "copyClass:to:",
 protocol: "copying",
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aClass", "anotherClass"],
-source: "copyClass: aClass to: anotherClass\x0a\x0a\x09anotherClass comment: aClass comment.\x0a\x0a\x09aClass methodDictionary valuesDo: [ :each |\x0a\x09\x09each origin = aClass ifTrue: [\x0a\x09\x09\x09Compiler new install: each source forClass: anotherClass protocol: each protocol ] ].\x0a\x09anotherClass setTraitComposition: aClass traitComposition.\x0a\x0a\x09self basicClass: anotherClass class slots: aClass class instanceVariableNames.\x0a\x0a\x09aClass class methodDictionary valuesDo: [ :each |\x0a\x09\x09each origin = aClass class ifTrue: [\x0a\x09\x09\x09Compiler new install: each source forClass: anotherClass class protocol: each protocol ] ].\x0a\x09anotherClass class setTraitComposition: aClass class traitComposition",
+source: "copyClass: aClass to: anotherClass\x0a\x0a\x09anotherClass comment: aClass comment.\x0a\x0a\x09aClass methodDictionary valuesDo: [ :each |\x0a\x09\x09each origin = aClass ifTrue: [\x0a\x09\x09\x09Compiler new install: each source forClass: anotherClass protocol: each protocol ] ].\x0a\x09anotherClass setTraitComposition: aClass traitComposition.\x0a\x0a\x09self basicClass: anotherClass class slots: aClass class slots copy.\x0a\x0a\x09aClass class methodDictionary valuesDo: [ :each |\x0a\x09\x09each origin = aClass class ifTrue: [\x0a\x09\x09\x09Compiler new install: each source forClass: anotherClass class protocol: each protocol ] ].\x0a\x09anotherClass class setTraitComposition: aClass class traitComposition",
 referencedClasses: ["Compiler"],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["comment:", "comment", "valuesDo:", "methodDictionary", "ifTrue:", "=", "origin", "install:forClass:protocol:", "new", "source", "protocol", "setTraitComposition:", "traitComposition", "basicClass:slots:", "class", "instanceVariableNames"]
+messageSends: ["comment:", "comment", "valuesDo:", "methodDictionary", "ifTrue:", "=", "origin", "install:forClass:protocol:", "new", "source", "protocol", "setTraitComposition:", "traitComposition", "basicClass:slots:", "class", "copy", "slots"]
 }, function ($methodClass){ return function (aClass,anotherClass){
 var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -1733,11 +1733,11 @@ $self._basicClass_slots_([$recv(anotherClass)._class()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx1.sendIdx["class"]=1
 //>>excludeEnd("ctx");
-][0],$recv([$recv(aClass)._class()
+][0],$recv($recv([$recv(aClass)._class()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx1.sendIdx["class"]=2
 //>>excludeEnd("ctx");
-][0])._instanceVariableNames());
+][0])._slots())._copy());
 $recv($recv([$recv(aClass)._class()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx1.sendIdx["class"]=3
@@ -1779,11 +1779,11 @@ selector: "migrateClass:superclass:",
 protocol: "class migration",
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aClass", "anotherClass"],
-source: "migrateClass: aClass superclass: anotherClass\x0a\x09^ self\x0a\x09\x09migrateClassNamed: aClass name\x0a\x09\x09superclass: anotherClass\x0a\x09\x09slots: aClass instanceVariableNames\x0a\x09\x09package: aClass package name",
+source: "migrateClass: aClass superclass: anotherClass\x0a\x09^ self\x0a\x09\x09migrateClassNamed: aClass name\x0a\x09\x09superclass: anotherClass\x0a\x09\x09slots: aClass slots\x0a\x09\x09package: aClass package name",
 referencedClasses: [],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["migrateClassNamed:superclass:slots:package:", "name", "instanceVariableNames", "package"]
+messageSends: ["migrateClassNamed:superclass:slots:package:", "name", "slots", "package"]
 }, function ($methodClass){ return function (aClass,anotherClass){
 var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -1793,7 +1793,7 @@ return $self._migrateClassNamed_superclass_slots_package_([$recv(aClass)._name()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx1.sendIdx["name"]=1
 //>>excludeEnd("ctx");
-][0],anotherClass,$recv(aClass)._instanceVariableNames(),$recv($recv(aClass)._package())._name());
+][0],anotherClass,$recv(aClass)._slots(),$recv($recv(aClass)._package())._name());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"migrateClass:superclass:",{aClass:aClass,anotherClass:anotherClass})});
 //>>excludeEnd("ctx");
@@ -2368,6 +2368,29 @@ return $recv($self._allSlots())._select_("isString");
 }; }),
 $globals.TBehaviorProvider);
 
+$core.addMethod(
+$core.method({
+selector: "allSlotNames",
+protocol: "accessing",
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "allSlotNames\x0a\x09^ self allSlots",
+referencedClasses: [],
+//>>excludeEnd("ide");
+pragmas: [],
+messageSends: ["allSlots"]
+}, function ($methodClass){ return function (){
+var self=this,$self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+return $self._allSlots();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"allSlotNames",{})});
+//>>excludeEnd("ctx");
+}; }),
+$globals.TBehaviorProvider);
+
 $core.addMethod(
 $core.method({
 selector: "allSlots",
@@ -3122,6 +3145,29 @@ return self;
 }; }),
 $globals.TBehaviorProvider);
 
+$core.addMethod(
+$core.method({
+selector: "slotNames",
+protocol: "accessing",
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "slotNames\x0a\x09^ self slots",
+referencedClasses: [],
+//>>excludeEnd("ide");
+pragmas: [],
+messageSends: ["slots"]
+}, function ($methodClass){ return function (){
+var self=this,$self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+return $self._slots();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"slotNames",{})});
+//>>excludeEnd("ctx");
+}; }),
+$globals.TBehaviorProvider);
+
 $core.addMethod(
 $core.method({
 selector: "traitComposition",

+ 10 - 2
lang/src/Kernel-Classes.st

@@ -414,7 +414,7 @@ migrateClass: aClass superclass: anotherClass
 	^ self
 		migrateClassNamed: aClass name
 		superclass: anotherClass
-		slots: aClass instanceVariableNames
+		slots: aClass slots
 		package: aClass package name
 !
 
@@ -508,7 +508,7 @@ copyClass: aClass to: anotherClass
 			Compiler new install: each source forClass: anotherClass protocol: each protocol ] ].
 	anotherClass setTraitComposition: aClass traitComposition.
 
-	self basicClass: anotherClass class slots: aClass class instanceVariableNames.
+	self basicClass: anotherClass class slots: aClass class slots copy.
 
 	aClass class methodDictionary valuesDo: [ :each |
 		each origin = aClass class ifTrue: [
@@ -636,6 +636,10 @@ allInstanceVariableNames
 	^ self allSlots select: #isString
 !
 
+allSlotNames
+	^ self allSlots
+!
+
 allSlots
 	| result |
 	result := self slots copy.
@@ -741,6 +745,10 @@ selectors
 	^ self methodDictionary keys
 !
 
+slotNames
+	^ self slots
+!
+
 traitComposition
 	^ (self basicAt: 'traitComposition')
 		ifNil: [ #() ]

+ 9 - 9
lang/src/Kernel-Tests.js

@@ -2062,11 +2062,11 @@ selector: "testClassMigration",
 protocol: "tests",
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "testClassMigration\x0a\x09| instance oldClass |\x0a\x09\x0a\x09oldClass := builder copyClass: ObjectMock named: 'ObjectMock2'.\x0a\x09instance := (Smalltalk globals at: 'ObjectMock2') new.\x0a\x09\x0a\x09\x22Change the superclass of ObjectMock2\x22\x0a\x09theClass := ObjectMock subclass: #ObjectMock2\x0a\x09\x09instanceVariableNames: ''\x0a\x09\x09package: 'Kernel-Tests'.\x0a\x09\x0a\x09self deny: oldClass == ObjectMock2.\x0a\x09\x0a\x09self assert: ObjectMock2 superclass == ObjectMock.\x0a\x09self assert: ObjectMock2 instanceVariableNames isEmpty.\x0a\x09self assert: ObjectMock2 selectors equals: oldClass selectors.\x0a\x09self assert: ObjectMock2 comment equals: oldClass comment.\x0a\x09self assert: ObjectMock2 package name equals: 'Kernel-Tests'.\x0a\x09self assert: (ObjectMock2 package classes includes: ObjectMock2).\x0a\x09\x0a\x09self deny: instance class == ObjectMock2.\x0a\x09\x0a\x09self assert: (Smalltalk globals at: instance class name) isNil",
+source: "testClassMigration\x0a\x09| instance oldClass |\x0a\x09\x0a\x09oldClass := builder copyClass: ObjectMock named: 'ObjectMock2'.\x0a\x09instance := (Smalltalk globals at: 'ObjectMock2') new.\x0a\x09\x0a\x09\x22Change the superclass of ObjectMock2\x22\x0a\x09theClass := ObjectMock subclass: #ObjectMock2\x0a\x09\x09instanceVariableNames: ''\x0a\x09\x09package: 'Kernel-Tests'.\x0a\x09\x0a\x09self deny: oldClass == ObjectMock2.\x0a\x09\x0a\x09self assert: ObjectMock2 superclass == ObjectMock.\x0a\x09self assert: ObjectMock2 slots isEmpty.\x0a\x09self assert: ObjectMock2 selectors equals: oldClass selectors.\x0a\x09self assert: ObjectMock2 comment equals: oldClass comment.\x0a\x09self assert: ObjectMock2 package name equals: 'Kernel-Tests'.\x0a\x09self assert: (ObjectMock2 package classes includes: ObjectMock2).\x0a\x09\x0a\x09self deny: instance class == ObjectMock2.\x0a\x09\x0a\x09self assert: (Smalltalk globals at: instance class name) isNil",
 referencedClasses: ["ObjectMock", "Smalltalk", "ObjectMock2"],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["copyClass:named:", "new", "at:", "globals", "subclass:instanceVariableNames:package:", "deny:", "==", "assert:", "superclass", "isEmpty", "instanceVariableNames", "assert:equals:", "selectors", "comment", "name", "package", "includes:", "classes", "class", "isNil"]
+messageSends: ["copyClass:named:", "new", "at:", "globals", "subclass:instanceVariableNames:package:", "deny:", "==", "assert:", "superclass", "isEmpty", "slots", "assert:equals:", "selectors", "comment", "name", "package", "includes:", "classes", "class", "isNil"]
 }, function ($methodClass){ return function (){
 var self=this,$self=this;
 var instance,oldClass;
@@ -2102,7 +2102,7 @@ $self.theClass=$recv($globals.ObjectMock)._subclass_instanceVariableNames_packag
 ,$ctx1.sendIdx["assert:"]=1
 //>>excludeEnd("ctx");
 ][0];
-[$self._assert_($recv($recv($globals.ObjectMock2)._instanceVariableNames())._isEmpty())
+[$self._assert_($recv($recv($globals.ObjectMock2)._slots())._isEmpty())
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx1.sendIdx["assert:"]=2
 //>>excludeEnd("ctx");
@@ -2158,11 +2158,11 @@ selector: "testClassMigrationWithClassSlots",
 protocol: "tests",
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "testClassMigrationWithClassSlots\x0a\x09\x0a\x09builder copyClass: ObjectMock named: 'ObjectMock2'.\x0a\x09ObjectMock2 class slots: #(foo  bar).\x0a\x09\x0a\x09\x22Change the superclass of ObjectMock2\x22\x0a\x09theClass := ObjectMock subclass: #ObjectMock2\x0a\x09\x09instanceVariableNames: ''\x0a\x09\x09package: 'Kernel-Tests'.\x0a\x09\x0a\x09self assert: ObjectMock2 class instanceVariableNames equals: #('foo' 'bar')",
+source: "testClassMigrationWithClassSlots\x0a\x09\x0a\x09builder copyClass: ObjectMock named: 'ObjectMock2'.\x0a\x09ObjectMock2 class slots: #(foo  bar).\x0a\x09\x0a\x09\x22Change the superclass of ObjectMock2\x22\x0a\x09theClass := ObjectMock subclass: #ObjectMock2\x0a\x09\x09instanceVariableNames: ''\x0a\x09\x09package: 'Kernel-Tests'.\x0a\x09\x0a\x09self assert: ObjectMock2 class slots equals: #('foo' 'bar')",
 referencedClasses: ["ObjectMock", "ObjectMock2"],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["copyClass:named:", "slots:", "class", "subclass:instanceVariableNames:package:", "assert:equals:", "instanceVariableNames"]
+messageSends: ["copyClass:named:", "slots:", "class", "subclass:instanceVariableNames:package:", "assert:equals:", "slots"]
 }, function ($methodClass){ return function (){
 var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -2175,7 +2175,7 @@ $recv([$recv($globals.ObjectMock2)._class()
 //>>excludeEnd("ctx");
 ][0])._slots_(["foo", "bar"]);
 $self.theClass=$recv($globals.ObjectMock)._subclass_instanceVariableNames_package_("ObjectMock2","","Kernel-Tests");
-$self._assert_equals_($recv($recv($globals.ObjectMock2)._class())._instanceVariableNames(),["foo", "bar"]);
+$self._assert_equals_($recv($recv($globals.ObjectMock2)._class())._slots(),["foo", "bar"]);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"testClassMigrationWithClassSlots",{})});
@@ -2243,11 +2243,11 @@ selector: "testSubclass",
 protocol: "tests",
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "testSubclass\x0a\x09theClass := builder addSubclassOf: ObjectMock named: 'ObjectMock2' slots: #(foo bar) package: 'Kernel-Tests'.\x0a\x09self assert: theClass superclass equals: ObjectMock.\x0a\x09self assert: theClass instanceVariableNames equals: #(foo bar).\x0a\x09self assert: theClass name equals: 'ObjectMock2'.\x0a\x09self assert: (theClass package classes occurrencesOf: theClass) equals: 1.\x0a\x09self assert: theClass package equals: ObjectMock package.\x0a\x09self assert: theClass methodDictionary keys size equals: 0",
+source: "testSubclass\x0a\x09theClass := builder addSubclassOf: ObjectMock named: 'ObjectMock2' slots: #(foo bar) package: 'Kernel-Tests'.\x0a\x09self assert: theClass superclass equals: ObjectMock.\x0a\x09self assert: theClass slots equals: #(foo bar).\x0a\x09self assert: theClass name equals: 'ObjectMock2'.\x0a\x09self assert: (theClass package classes occurrencesOf: theClass) equals: 1.\x0a\x09self assert: theClass package equals: ObjectMock package.\x0a\x09self assert: theClass methodDictionary keys size equals: 0",
 referencedClasses: ["ObjectMock"],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["addSubclassOf:named:slots:package:", "assert:equals:", "superclass", "instanceVariableNames", "name", "occurrencesOf:", "classes", "package", "size", "keys", "methodDictionary"]
+messageSends: ["addSubclassOf:named:slots:package:", "assert:equals:", "superclass", "slots", "name", "occurrencesOf:", "classes", "package", "size", "keys", "methodDictionary"]
 }, function ($methodClass){ return function (){
 var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -2259,7 +2259,7 @@ $self.theClass=$recv($self.builder)._addSubclassOf_named_slots_package_($globals
 ,$ctx1.sendIdx["assert:equals:"]=1
 //>>excludeEnd("ctx");
 ][0];
-[$self._assert_equals_($recv($self.theClass)._instanceVariableNames(),["foo", "bar"])
+[$self._assert_equals_($recv($self.theClass)._slots(),["foo", "bar"])
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx1.sendIdx["assert:equals:"]=2
 //>>excludeEnd("ctx");

+ 3 - 3
lang/src/Kernel-Tests.st

@@ -390,7 +390,7 @@ testClassMigration
 	self deny: oldClass == ObjectMock2.
 	
 	self assert: ObjectMock2 superclass == ObjectMock.
-	self assert: ObjectMock2 instanceVariableNames isEmpty.
+	self assert: ObjectMock2 slots isEmpty.
 	self assert: ObjectMock2 selectors equals: oldClass selectors.
 	self assert: ObjectMock2 comment equals: oldClass comment.
 	self assert: ObjectMock2 package name equals: 'Kernel-Tests'.
@@ -411,7 +411,7 @@ testClassMigrationWithClassSlots
 		instanceVariableNames: ''
 		package: 'Kernel-Tests'.
 	
-	self assert: ObjectMock2 class instanceVariableNames equals: #('foo' 'bar')
+	self assert: ObjectMock2 class slots equals: #('foo' 'bar')
 !
 
 testClassMigrationWithSubclasses
@@ -433,7 +433,7 @@ testClassMigrationWithSubclasses
 testSubclass
 	theClass := builder addSubclassOf: ObjectMock named: 'ObjectMock2' slots: #(foo bar) package: 'Kernel-Tests'.
 	self assert: theClass superclass equals: ObjectMock.
-	self assert: theClass instanceVariableNames equals: #(foo bar).
+	self assert: theClass slots equals: #(foo bar).
 	self assert: theClass name equals: 'ObjectMock2'.
 	self assert: (theClass package classes occurrencesOf: theClass) equals: 1.
 	self assert: theClass package equals: ObjectMock package.

+ 7 - 7
lang/src/Platform-Services.js

@@ -309,34 +309,34 @@ selector: "addInstVarNamed:to:",
 protocol: "compiling",
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aString", "aClass"],
-source: "addInstVarNamed: aString to: aClass\x0a\x09| newInstVars |\x0a\x09newInstVars := aClass instanceVariableNames copyWith: aString.\x0a\x0a\x09aClass isMetaclass\x0a\x09\x09ifTrue: [ self classBuilder\x0a\x09\x09\x09class: aClass slots: newInstVars ]\x0a\x09\x09ifFalse: [ self classBuilder\x0a\x09\x09\x09addSubclassOf: aClass superclass \x0a\x09\x09\x09named: aClass name \x0a\x09\x09\x09slots: newInstVars\x0a\x09\x09\x09package: aClass package name ]",
+source: "addInstVarNamed: aString to: aClass\x0a\x09| newSlots |\x0a\x09newSlots := aClass slots copyWith: aString.\x0a\x0a\x09aClass isMetaclass\x0a\x09\x09ifTrue: [ self classBuilder\x0a\x09\x09\x09class: aClass slots: newSlots ]\x0a\x09\x09ifFalse: [ self classBuilder\x0a\x09\x09\x09addSubclassOf: aClass superclass \x0a\x09\x09\x09named: aClass name \x0a\x09\x09\x09slots: newSlots\x0a\x09\x09\x09package: aClass package name ]",
 referencedClasses: [],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["copyWith:", "instanceVariableNames", "ifTrue:ifFalse:", "isMetaclass", "class:slots:", "classBuilder", "addSubclassOf:named:slots:package:", "superclass", "name", "package"]
+messageSends: ["copyWith:", "slots", "ifTrue:ifFalse:", "isMetaclass", "class:slots:", "classBuilder", "addSubclassOf:named:slots:package:", "superclass", "name", "package"]
 }, function ($methodClass){ return function (aString,aClass){
 var self=this,$self=this;
-var newInstVars;
+var newSlots;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-newInstVars=$recv($recv(aClass)._instanceVariableNames())._copyWith_(aString);
+newSlots=$recv($recv(aClass)._slots())._copyWith_(aString);
 if($core.assert($recv(aClass)._isMetaclass())){
 $recv([$self._classBuilder()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx1.sendIdx["classBuilder"]=1
 //>>excludeEnd("ctx");
-][0])._class_slots_(aClass,newInstVars);
+][0])._class_slots_(aClass,newSlots);
 } else {
 $recv($self._classBuilder())._addSubclassOf_named_slots_package_($recv(aClass)._superclass(),[$recv(aClass)._name()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx1.sendIdx["name"]=1
 //>>excludeEnd("ctx");
-][0],newInstVars,$recv($recv(aClass)._package())._name());
+][0],newSlots,$recv($recv(aClass)._package())._name());
 }
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"addInstVarNamed:to:",{aString:aString,aClass:aClass,newInstVars:newInstVars})});
+}, function($ctx1) {$ctx1.fill(self,"addInstVarNamed:to:",{aString:aString,aClass:aClass,newSlots:newSlots})});
 //>>excludeEnd("ctx");
 }; }),
 $globals.Environment);

+ 4 - 4
lang/src/Platform-Services.st

@@ -223,16 +223,16 @@ setClassCommentOf: aClass to: aString
 !Environment methodsFor: 'compiling'!
 
 addInstVarNamed: aString to: aClass
-	| newInstVars |
-	newInstVars := aClass instanceVariableNames copyWith: aString.
+	| newSlots |
+	newSlots := aClass slots copyWith: aString.
 
 	aClass isMetaclass
 		ifTrue: [ self classBuilder
-			class: aClass slots: newInstVars ]
+			class: aClass slots: newSlots ]
 		ifFalse: [ self classBuilder
 			addSubclassOf: aClass superclass 
 			named: aClass name 
-			slots: newInstVars
+			slots: newSlots
 			package: aClass package name ]
 !