Browse Source

kernel: remove pkg from updateExisting

Herbert Vojčík 7 years ago
parent
commit
e75026825b
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

@@ -208,7 +208,8 @@ define(['./compatibility' /* TODO remove */], function () {
 
             var traitOrClass = globals.hasOwnProperty(builder.className) && globals[builder.className];
             if (traitOrClass) {
-                builder.updateExisting(traitOrClass, pkg);
+                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);
             }

+ 2 - 4
support/kernel-language.js

@@ -117,8 +117,7 @@ define(['./compatibility' /* TODO remove */], function () {
                     setupMethods(that);
                     return that;
                 },
-                updateExisting: function (trait, pkg) {
-                    if (pkg) trait.pkg = pkg;
+                updateExisting: function (trait) {
                 }
             };
         }
@@ -239,10 +238,9 @@ define(['./compatibility' /* TODO remove */], function () {
             return {
                 className: className,
                 make: klass,
-                updateExisting: function (klass, pkg) {
+                updateExisting: function (klass) {
                     if (klass.superclass == logicalSuperclass && (!fn || fn === klass.fn)) {
                         if (iVarNames) klass.iVarNames = iVarNames;
-                        if (pkg) klass.pkg = pkg;
                     } else throw new Error("Incompatible change of class: " + klass.className);
                 }
             };