Browse Source

kernel: instanceVariableNames => slots.

Herby Vojčík 5 years ago
parent
commit
85c52a6db5
3 changed files with 10 additions and 10 deletions
  1. 5 5
      lang/base/kernel-language.js
  2. 3 3
      lang/src/Kernel-Classes.js
  3. 2 2
      lang/src/Kernel-Classes.st

+ 5 - 5
lang/base/kernel-language.js

@@ -312,7 +312,7 @@ define(function () {
 
         // TODO remove, ["@foo"] backward compatibility
         function installIvarCompat (klass) {
-            var ivars = klass.instanceVariableNames;
+            var ivars = klass.slots;
             ivars.forEach(function (ivar) {
                 Object.defineProperty(klass.fn.prototype, "@" + ivar, {
                     get: function () {
@@ -335,7 +335,7 @@ define(function () {
                     throw new Error("Wrong identifier name: " + name);
             });
 
-            klass.instanceVariableNames = slots;
+            klass.slots = slots;
             installIvarCompat(klass);
         }
 
@@ -346,7 +346,7 @@ define(function () {
             enumerable: true,
             configurable: true,
             get: function () {
-                return this.instanceVariableNames;
+                return this.slots;
             },
             set: function (instanceVariableNames) {
                 setSlots(this, instanceVariableNames);
@@ -380,7 +380,7 @@ define(function () {
                 that.superclass = logicalSuperclass;
                 that.fn = fn || inherits(function () {
                     }, superclass.fn);
-                that.instanceVariableNames = [];
+                that.slots = [];
 
                 that.name = className;
                 that.subclasses = [];
@@ -395,7 +395,7 @@ define(function () {
                 that.superclass = superclass.a$cls;
                 that.fn = inherits(function () {
                 }, that.superclass.fn);
-                that.instanceVariableNames = [];
+                that.slots = [];
 
                 that.instanceClass = new that.fn();
 

+ 3 - 3
lang/src/Kernel-Classes.js

@@ -4,7 +4,7 @@ var $pkg = $core.addPackage("Kernel-Classes");
 $pkg.innerEval = function (expr) { return eval(expr); };
 $pkg.transport = {"type":"amd","amdNamespace":"amber/core"};
 
-$core.addClass("Behavior", $globals.Object, ["organization", "instanceVariableNames", "fn", "superclass"], "Kernel-Classes");
+$core.addClass("Behavior", $globals.Object, ["organization", "slots", "fn", "superclass"], "Kernel-Classes");
 //>>excludeStart("ide", pragmas.excludeIdeData);
 $globals.Behavior.comment="I am the superclass of all class objects.\x0a\x0aIn addition to BehaviorBody, I define superclass/subclass relationships and instantiation.\x0a\x0aI define the protocol for creating instances of a class with `#basicNew` and `#new` (see `boot.js` for class constructors details).\x0a\x0aMy instances know about the subclass/superclass relationships between classes and contain the description that instances are created from.\x0a\x0aI also provide iterating over the class hierarchy.";
 //>>excludeEnd("ide");
@@ -374,12 +374,12 @@ selector: "instanceVariableNames",
 protocol: "accessing",
 fn: function (){
 var self=this,$self=this;
-return $self.instanceVariableNames;
+return $self.slots;
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "instanceVariableNames\x0a\x09^ instanceVariableNames",
+source: "instanceVariableNames\x0a\x09^ slots",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []

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

@@ -1,6 +1,6 @@
 Smalltalk createPackage: 'Kernel-Classes'!
 Object subclass: #Behavior
-	instanceVariableNames: 'organization instanceVariableNames fn superclass'
+	instanceVariableNames: 'organization slots fn superclass'
 	package: 'Kernel-Classes'!
 !Behavior commentStamp!
 I am the superclass of all class objects.
@@ -53,7 +53,7 @@ basicOrganization: aClassOrganizer
 !
 
 instanceVariableNames
-	^ instanceVariableNames
+	^ slots
 !
 
 javascriptConstructor