Browse Source

Remove kernel-level deprecations.

Herby Vojčík 5 years ago
parent
commit
b1f11da0ef

+ 1 - 0
CHANGELOG

@@ -1,6 +1,7 @@
 ? Feb 2019 - Release 0.23.0
 ===================================
 
+* Remove kernel-level deprecations.
 * `imports:` loaded lazily using isReady promise
   * you can have circular `import:` clauses
   * you cannot presume your `import:` dependency is initialized in your own class-level `initialize`

+ 0 - 11
lang/base/boot.js

@@ -57,17 +57,6 @@ define([
                 if (initialized) return;
                 brikz.classes.bootstrapHierarchy();
                 configureWithRuntime(brikz);
-                // TODO deprecation helper; remove
-                Object.defineProperty(st, "packages", {
-                    get: function () {
-                        console.warn("Use of .packages deprecated, use .packageDescriptors");
-                        return st.packageDescriptors;
-                    },
-                    set: function (v) {
-                        console.trace();
-                        throw new Error("No one should be setting st.packages directly on initialized Amber.");
-                    }
-                });
                 return Promise.resolve(brikz.startImage.run())
                     .then(function () {
                         initialized = true;

+ 0 - 11
lang/base/kernel-fundamentals.js

@@ -197,17 +197,6 @@ define(function () {
                 throw new Error("addMethod: Method " + method.selector + " already bound to " + method.owner);
             }
             method.owner = traitOrBehavior;
-            // TODO deprecation helper; remove
-            Object.defineProperty(method, "methodClass", {
-                get: function () {
-                    console.warn("Use of .methodClass deprecated, use .owner");
-                    return method.owner;
-                },
-                set: function (v) {
-                    console.warn("Use of .methodClass= deprecated, use .owner=");
-                    method.owner = v;
-                }
-            });
             registerNewSelectors(method);
             traitOrBehavior.localMethods[method.selector] = method;
             updateMethod(method.selector, traitOrBehavior);

+ 2 - 29
lang/base/kernel-language.js

@@ -109,17 +109,6 @@ define(function () {
                 name: traitName,
                 make: function () {
                     var that = new SmalltalkTrait();
-                    // TODO deprecation helper; remove
-                    Object.defineProperty(that, "className", {
-                        get: function () {
-                            console.warn("Use of .className deprecated, use .name");
-                            return that.name;
-                        },
-                        set: function (v) {
-                            console.warn("Use of .className= deprecated, use .name=");
-                            that.name = v;
-                        }
-                    });
                     that.name = traitName;
                     that.traitUsers = [];
                     setupMethods(that);
@@ -291,8 +280,7 @@ define(function () {
         // Effective superclass of all classes created with `nil subclass: ...`.
         var nilAsClass = this.nilAsClass = {
             fn: SmalltalkRoot,
-            a$cls: {fn: SmalltalkClass},
-            klass: {fn: SmalltalkClass}
+            a$cls: {fn: SmalltalkClass}
         };
 
         SmalltalkMetaclass.prototype.meta = true;
@@ -324,7 +312,7 @@ define(function () {
 
         this.bootstrapHierarchy = function () {
             var nilSubclasses = [globals.ProtoObject];
-            nilAsClass.a$cls = nilAsClass.klass = globals.Class;
+            nilAsClass.a$cls = globals.Class;
             nilSubclasses.forEach(function (each) {
                 each.a$cls.superclass = globals.Class;
                 addSubclass(each.a$cls);
@@ -351,17 +339,6 @@ define(function () {
                     }, superclass.fn);
                 that.iVarNames = iVarNames || [];
 
-                // TODO deprecation helper; remove
-                Object.defineProperty(that, "className", {
-                    get: function () {
-                        console.warn("Use of .className deprecated, use .name");
-                        return that.name;
-                    },
-                    set: function (v) {
-                        console.warn("Use of .className= deprecated, use .name=");
-                        that.name = v;
-                    }
-                });
                 that.name = className;
                 that.subclasses = [];
 
@@ -400,10 +377,6 @@ define(function () {
                 value: klass,
                 enumerable: false, configurable: true, writable: true
             });
-            Object.defineProperty(klass.fn.prototype, "klass", {
-                value: klass,
-                enumerable: false, configurable: true, writable: true
-            });
         }
 
         this.wireKlass = wireKlass;

+ 4 - 4
lang/src/Kernel-Infrastructure.js

@@ -3129,7 +3129,7 @@ var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-delete anObject.klass; delete anObject.a$cls;;
+delete anObject.a$cls;;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"cancelOptOut:",{anObject:anObject},$globals.SmalltalkImage)});
@@ -3137,7 +3137,7 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anObject"],
-source: "cancelOptOut: anObject\x0a\x09\x22A Smalltalk object has a 'a$cls' property.\x0a\x09If this property is shadowed for anObject by optOut:,\x0a\x09the object is treated as plain JS object.\x0a\x09This removes the shadow and anObject is Smalltalk object\x0a\x09again if it was before.\x22\x0a\x09\x0a\x09<inlineJS: 'delete anObject.klass; delete anObject.a$cls;'>",
+source: "cancelOptOut: anObject\x0a\x09\x22A Smalltalk object has a 'a$cls' property.\x0a\x09If this property is shadowed for anObject by optOut:,\x0a\x09the object is treated as plain JS object.\x0a\x09This removes the shadow and anObject is Smalltalk object\x0a\x09again if it was before.\x22\x0a\x09\x0a\x09<inlineJS: 'delete anObject.a$cls;'>",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
@@ -3453,7 +3453,7 @@ var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-anObject.klass = null; anObject.a$cls = null;
+anObject.a$cls = null;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"optOut:",{anObject:anObject},$globals.SmalltalkImage)});
@@ -3461,7 +3461,7 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anObject"],
-source: "optOut: anObject\x0a\x09\x22A Smalltalk object has a 'a$cls' property.\x0a\x09This shadows the property for anObject.\x0a\x09The object is treated as plain JS object following this.\x22\x0a\x09\x0a\x09<inlineJS: 'anObject.klass = null; anObject.a$cls = null'>",
+source: "optOut: anObject\x0a\x09\x22A Smalltalk object has a 'a$cls' property.\x0a\x09This shadows the property for anObject.\x0a\x09The object is treated as plain JS object following this.\x22\x0a\x09\x0a\x09<inlineJS: 'anObject.a$cls = null'>",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []

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

@@ -833,7 +833,7 @@ cancelOptOut: anObject
 	This removes the shadow and anObject is Smalltalk object
 	again if it was before."
 	
-	<inlineJS: 'delete anObject.klass; delete anObject.a$cls;'>
+	<inlineJS: 'delete anObject.a$cls;'>
 !
 
 core
@@ -853,7 +853,7 @@ optOut: anObject
 	This shadows the property for anObject.
 	The object is treated as plain JS object following this."
 	
-	<inlineJS: 'anObject.klass = null; anObject.a$cls = null'>
+	<inlineJS: 'anObject.a$cls = null'>
 !
 
 parse: aString