2
0
Prechádzať zdrojové kódy

kernel: Rename rootAsClass to nilAsClass.

Herbert Vojčík 8 rokov pred
rodič
commit
f08ab71a4d
2 zmenil súbory, kde vykonal 10 pridanie a 8 odobranie
  1. 8 6
      support/boot.js
  2. 2 2
      support/kernel-runtime.js

+ 8 - 6
support/boot.js

@@ -95,7 +95,8 @@ define(['require', './brikz', './compatibility'], function (require, Brikz) {
         });
 
         // Hidden root class of the system.
-        this.rootAsClass = {fn: SmalltalkRoot};
+        // Effective superclass of all classes created with `nil subclass: ...`.
+        this.nilAsClass = {fn: SmalltalkRoot};
 
         this.__init__ = function () {
             var globals = brikz.smalltalkGlobals.globals;
@@ -236,9 +237,9 @@ define(['require', './brikz', './compatibility'], function (require, Brikz) {
         var addOrganizationElement = brikz.organize.addOrganizationElement;
         var removeOrganizationElement = brikz.organize.removeOrganizationElement;
         var globals = brikz.smalltalkGlobals.globals;
-        var rootAsClass = brikz.root.rootAsClass;
+        var nilAsClass = brikz.root.nilAsClass;
         var SmalltalkObject = brikz.root.Object;
-        rootAsClass.klass = {fn: SmalltalkClass};
+        nilAsClass.klass = {fn: SmalltalkClass};
 
         function SmalltalkBehavior() {
         }
@@ -268,7 +269,7 @@ define(['require', './brikz', './compatibility'], function (require, Brikz) {
             addCoupledClass("Class", globals.Behavior, "Kernel-Classes", SmalltalkClass);
 
             // Manually bootstrap the metaclass hierarchy
-            globals.ProtoObject.klass.superclass = rootAsClass.klass = globals.Class;
+            globals.ProtoObject.klass.superclass = nilAsClass.klass = globals.Class;
             addSubclass(globals.ProtoObject.klass);
         };
         this.__init__.once = true;
@@ -285,7 +286,7 @@ define(['require', './brikz', './compatibility'], function (require, Brikz) {
         function klass(spec) {
             var setSuperClass = spec.superclass;
             if (!spec.superclass) {
-                spec.superclass = rootAsClass;
+                spec.superclass = nilAsClass;
             }
 
             var meta = metaclass(spec);
@@ -700,7 +701,8 @@ define(['require', './brikz', './compatibility'], function (require, Brikz) {
     return {
         api: api,
         nil: brikz.root.nil,
-        dnu: brikz.root.rootAsClass,
+        dnu/* TODO deprecate */: brikz.root.nilAsClass,
+        nilAsClass: brikz.root.nilAsClass,
         globals: brikz.smalltalkGlobals.globals,
         asReceiver: brikz.asReceiver.asReceiver
     };

+ 2 - 2
support/kernel-runtime.js

@@ -6,14 +6,14 @@ define(function () {
         var selectorsBrik = brikz.selectors;
         var messageNotUnderstood = brikz.messageSend.messageNotUnderstood;
         var installJSMethod = brikz.manipulation.installJSMethod;
-        var RootProto = brikz.root.rootAsClass.fn.prototype;
+        var nilAsClass = brikz.root.nilAsClass;
 
         /* Method not implemented handlers */
 
         function makeDnuHandler(pair, targetClasses) {
             var jsSelector = pair.js;
             var fn = createHandler(pair.st);
-            installJSMethod(RootProto, jsSelector, fn);
+            installJSMethod(nilAsClass.fn.prototype, jsSelector, fn);
             targetClasses.forEach(function (target) {
                 installJSMethod(target.fn.prototype, jsSelector, fn);
             });