Przeglądaj źródła

kernel: Small sanity refactor.

Herbert Vojčík 7 lat temu
rodzic
commit
aecd273c80
1 zmienionych plików z 9 dodań i 8 usunięć
  1. 9 8
      support/kernel-language.js

+ 9 - 8
support/kernel-language.js

@@ -186,31 +186,32 @@ define(['./compatibility'], function () {
             if (!spec.superclass) {
             if (!spec.superclass) {
                 spec.superclass = nilAsClass;
                 spec.superclass = nilAsClass;
             }
             }
-
             var meta = metaclass(spec);
             var meta = metaclass(spec);
             var that = meta.instanceClass;
             var that = meta.instanceClass;
 
 
             that.superclass = setSuperClass;
             that.superclass = setSuperClass;
-
             that.fn = spec.fn || inherits(function () {
             that.fn = spec.fn || inherits(function () {
                 }, spec.superclass.fn);
                 }, spec.superclass.fn);
             that.iVarNames = spec.iVarNames || [];
             that.iVarNames = spec.iVarNames || [];
+
+            that.className = spec.className;
             that.subclasses = [];
             that.subclasses = [];
 
 
             setupBehavior(that, spec.pkg);
             setupBehavior(that, spec.pkg);
-
-            that.className = spec.className;
-            meta.superclass = spec.superclass.klass;
             return that;
             return that;
         }
         }
 
 
         function metaclass (spec) {
         function metaclass (spec) {
             var that = new SmalltalkMetaclass();
             var that = new SmalltalkMetaclass();
+
+            that.superclass = spec.superclass.klass;
             that.fn = inherits(function () {
             that.fn = inherits(function () {
-            }, spec.superclass.klass.fn);
-            wireKlass(that);
-            that.instanceClass = new that.fn();
+            }, that.superclass.fn);
             that.iVarNames = [];
             that.iVarNames = [];
+
+            that.instanceClass = new that.fn();
+
+            wireKlass(that);
             setupBehavior(that);
             setupBehavior(that);
             return that;
             return that;
         }
         }