1
0
Переглянути джерело

Move to use {allS,s}lotNames.

Herby Vojčík 4 роки тому
батько
коміт
89a01ec5b8
2 змінених файлів з 12 додано та 12 видалено
  1. 9 9
      src/Helios-Helpers.js
  2. 3 3
      src/Helios-Helpers.st

+ 9 - 9
src/Helios-Helpers.js

@@ -170,18 +170,18 @@ selector: "doClassify",
 protocol: "private",
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "doClassify\x0a\x09| names selector |\x0a\x09\x0a\x09names := method origin allInstanceVariableNames.\x0a\x09selector := method selector.\x0a\x09\x0a\x09(selector last = ':')\x0a\x09\x09ifTrue: [ \x22selector might be a setter\x22\x0a\x09\x09\x09selector := selector allButLast ].\x0a\x09\x0a\x09(names includes: selector)\x0a\x09\x09ifFalse: [ ^ false ].\x0a\x09\x09\x0a\x09method protocol: 'accessing'.\x0a\x09^ true.",
+source: "doClassify\x0a\x09| names selector |\x0a\x09\x0a\x09names := method origin allSlotNames.\x0a\x09selector := method selector.\x0a\x09\x0a\x09(selector last = ':')\x0a\x09\x09ifTrue: [ \x22selector might be a setter\x22\x0a\x09\x09\x09selector := selector allButLast ].\x0a\x09\x0a\x09(names includes: selector)\x0a\x09\x09ifFalse: [ ^ false ].\x0a\x09\x09\x0a\x09method protocol: 'accessing'.\x0a\x09^ true.",
 referencedClasses: [],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["allInstanceVariableNames", "origin", "selector", "ifTrue:", "=", "last", "allButLast", "ifFalse:", "includes:", "protocol:"]
+messageSends: ["allSlotNames", "origin", "selector", "ifTrue:", "=", "last", "allButLast", "ifFalse:", "includes:", "protocol:"]
 }, function ($methodClass){ return function (){
 var self=this,$self=this;
 var names,selector;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-names=$recv($recv($self.method)._origin())._allInstanceVariableNames();
+names=$recv($recv($self.method)._origin())._allSlotNames();
 selector=$recv($self.method)._selector();
 if($core.assert($recv($recv(selector)._last()).__eq(":"))){
 selector=$recv(selector)._allButLast();
@@ -1058,11 +1058,11 @@ selector: "accessorsForObject",
 protocol: "double-dispatch",
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "accessorsForObject\x0a\x09| sources |\x0a\x09\x0a\x09sources := OrderedCollection new.\x0a\x09output targetClass instanceVariableNames sorted do: [ :each | \x0a\x09\x09sources \x0a\x09\x09\x09add: (self getterFor: each);\x0a\x09\x09\x09add: (self setterFor: each) ].\x0a\x09output sourceCodes: sources",
+source: "accessorsForObject\x0a\x09| sources |\x0a\x09\x0a\x09sources := OrderedCollection new.\x0a\x09output targetClass slotNames sorted do: [ :each | \x0a\x09\x09sources \x0a\x09\x09\x09add: (self getterFor: each);\x0a\x09\x09\x09add: (self setterFor: each) ].\x0a\x09output sourceCodes: sources",
 referencedClasses: ["OrderedCollection"],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["new", "do:", "sorted", "instanceVariableNames", "targetClass", "add:", "getterFor:", "setterFor:", "sourceCodes:"]
+messageSends: ["new", "do:", "sorted", "slotNames", "targetClass", "add:", "getterFor:", "setterFor:", "sourceCodes:"]
 }, function ($methodClass){ return function (){
 var self=this,$self=this;
 var sources;
@@ -1071,7 +1071,7 @@ return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1;
 sources=$recv($globals.OrderedCollection)._new();
-$recv($recv($recv($recv($self.output)._targetClass())._instanceVariableNames())._sorted())._do_((function(each){
+$recv($recv($recv($recv($self.output)._targetClass())._slotNames())._sorted())._do_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
@@ -1270,11 +1270,11 @@ selector: "generateInitializeCodeForObject",
 protocol: "private",
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "generateInitializeCodeForObject\x09\x0a\x09^ String streamContents: [ :str || instVars size |\x0a\x09\x09instVars := output targetClass instanceVariableNames sorted.\x0a\x09\x09size := instVars size.\x0a\x09\x09str << 'initialize'.\x0a\x09\x09str cr tab << 'super initialize.';cr.\x0a\x09\x09str cr tab.\x0a\x09\x09instVars withIndexDo: [ :name :index |\x0a\x09\x09\x09index ~= 1 ifTrue: [ str cr tab ].\x0a\x09\x09\x09str << name << ' := nil'.\x0a\x09\x09\x09index ~= size ifTrue: [ str << '.' ] ] ].",
+source: "generateInitializeCodeForObject\x09\x0a\x09^ String streamContents: [ :str || instVars size |\x0a\x09\x09instVars := output targetClass slotNames sorted.\x0a\x09\x09size := instVars size.\x0a\x09\x09str << 'initialize'.\x0a\x09\x09str cr tab << 'super initialize.';cr.\x0a\x09\x09str cr tab.\x0a\x09\x09instVars withIndexDo: [ :name :index |\x0a\x09\x09\x09index ~= 1 ifTrue: [ str cr tab ].\x0a\x09\x09\x09str << name << ' := nil'.\x0a\x09\x09\x09index ~= size ifTrue: [ str << '.' ] ] ].",
 referencedClasses: ["String"],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["streamContents:", "sorted", "instanceVariableNames", "targetClass", "size", "<<", "tab", "cr", "withIndexDo:", "ifTrue:", "~="]
+messageSends: ["streamContents:", "sorted", "slotNames", "targetClass", "size", "<<", "tab", "cr", "withIndexDo:", "ifTrue:", "~="]
 }, function ($methodClass){ return function (){
 var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -1286,7 +1286,7 @@ var instVars,size;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-instVars=$recv($recv($recv($self.output)._targetClass())._instanceVariableNames())._sorted();
+instVars=$recv($recv($recv($self.output)._targetClass())._slotNames())._sorted();
 size=$recv(instVars)._size();
 [$recv(str).__lt_lt("initialize")
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);

+ 3 - 3
src/Helios-Helpers.st

@@ -54,7 +54,7 @@ I am a classifier checking the method selector matches an instance variable name
 doClassify
 	| names selector |
 	
-	names := method origin allInstanceVariableNames.
+	names := method origin allSlotNames.
 	selector := method selector.
 	
 	(selector last = ':')
@@ -319,7 +319,7 @@ accessorsForObject
 	| sources |
 	
 	sources := OrderedCollection new.
-	output targetClass instanceVariableNames sorted do: [ :each | 
+	output targetClass slotNames sorted do: [ :each | 
 		sources 
 			add: (self getterFor: each);
 			add: (self setterFor: each) ].
@@ -383,7 +383,7 @@ initializeProtocolForObject
 
 generateInitializeCodeForObject	
 	^ String streamContents: [ :str || instVars size |
-		instVars := output targetClass instanceVariableNames sorted.
+		instVars := output targetClass slotNames sorted.
 		size := instVars size.
 		str << 'initialize'.
 		str cr tab << 'super initialize.';cr.