Browse Source

kernel: Move pkg out of make.

Herbert Vojčík 7 years ago
parent
commit
f07bdb606b
2 changed files with 4 additions and 5 deletions
  1. 2 1
      support/kernel-fundamentals.js
  2. 2 4
      support/kernel-language.js

+ 2 - 1
support/kernel-fundamentals.js

@@ -204,7 +204,8 @@ define(['./compatibility' /* TODO remove */], function () {
                 if (traitOrClass.pkg !== pkg) throw new Error("Incompatible cross-package update of trait or class: " + traitOrClass.className);
                 builder.updateExisting(traitOrClass);
             } else {
-                traitOrClass = builder.make(pkg);
+                traitOrClass = builder.make();
+                traitOrClass.pkg = pkg;
             }
 
             addTraitOrClass(traitOrClass);

+ 2 - 4
support/kernel-language.js

@@ -109,10 +109,9 @@ define(['./compatibility' /* TODO remove */], function () {
         function traitBuilder (className) {
             return {
                 className: className,
-                make: function (pkg) {
+                make: function () {
                     var that = new SmalltalkTrait();
                     that.className = className;
-                    that.pkg = pkg;
                     that.traitUsers = [];
                     setupMethods(that);
                     return that;
@@ -204,7 +203,7 @@ define(['./compatibility' /* TODO remove */], function () {
                 logicalSuperclass = null;
             }
 
-            function klass (pkg) {
+            function klass () {
                 var that = metaclass().instanceClass;
 
                 that.superclass = logicalSuperclass;
@@ -213,7 +212,6 @@ define(['./compatibility' /* TODO remove */], function () {
                 that.iVarNames = iVarNames || [];
 
                 that.className = className;
-                that.pkg = pkg;
                 that.subclasses = [];
 
                 setupMethods(that);