Browse Source

kernel: Set .pkg directly, not in setupBehavior.

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

+ 1 - 5
support/kernel-fundamentals.js

@@ -212,11 +212,7 @@ define(['./compatibility'], function () {
 
         var classes = [];
 
-        this.setupBehavior = function (behaviorBody, pkg) {
-            if (pkg) {
-                behaviorBody.pkg = pkg;
-            }
-
+        this.setupBehavior = function (behaviorBody) {
             setupClassOrganization(behaviorBody);
             Object.defineProperty(behaviorBody, "methods", {
                 value: Object.create(null),

+ 4 - 2
support/kernel-language.js

@@ -92,7 +92,8 @@ define(['./compatibility'], function () {
                 make: function (pkg) {
                     var that = new SmalltalkTrait();
                     that.className = className;
-                    setupBehavior(that, pkg);
+                    that.pkg = pkg;
+                    setupBehavior(that);
                     return that;
                 },
                 updateExisting: function (trait, pkg) {
@@ -195,9 +196,10 @@ define(['./compatibility'], function () {
             that.iVarNames = spec.iVarNames || [];
 
             that.className = spec.className;
+            that.pkg = spec.pkg;
             that.subclasses = [];
 
-            setupBehavior(that, spec.pkg);
+            setupBehavior(that);
             return that;
         }