Browse Source

kernel: Remove smart code.

Herbert Vojčík 7 years ago
parent
commit
cb00d460aa
2 changed files with 27 additions and 32 deletions
  1. 20 23
      support/kernel-language.js
  2. 7 9
      support/kernel-runtime.js

+ 20 - 23
support/kernel-language.js

@@ -57,7 +57,6 @@ define(['./compatibility'], function () {
             value: method,
             enumerable: false, configurable: true, writable: true
         });
-        return defineMethod;
     }
 
     TraitsBrik.deps = ["behaviors", "composition", "root"];
@@ -74,20 +73,19 @@ define(['./compatibility'], function () {
 
         SmalltalkTrait.prototype.trait = true;
 
-        defineMethod
-        (SmalltalkTrait, "toString", function () {
+        defineMethod(SmalltalkTrait, "toString", function () {
             return 'Smalltalk Trait ' + this.className;
-        })
-        (SmalltalkTrait, "added", function () {
+        });
+        defineMethod(SmalltalkTrait, "added", function () {
             if (st._traitAdded) st._traitAdded(this);
-        })
-        (SmalltalkTrait, "removed", function () {
+        });
+        defineMethod(SmalltalkTrait, "removed", function () {
             if (st._traitRemoved) st._traitRemoved(this);
-        })
-        (SmalltalkTrait, "methodAdded", function (method) {
+        });
+        defineMethod(SmalltalkTrait, "methodAdded", function (method) {
             if (st._traitMethodAdded) st._traitMethodAdded(method, this);
-        })
-        (SmalltalkTrait, "methodRemoved", function (method) {
+        });
+        defineMethod(SmalltalkTrait, "methodRemoved", function (method) {
             if (st._traitMethodRemoved) st._traitMethodRemoved(method, this);
         });
 
@@ -147,25 +145,24 @@ define(['./compatibility'], function () {
 
         SmalltalkMetaclass.prototype.meta = true;
 
-        defineMethod
-        (SmalltalkClass, "toString", function () {
+        defineMethod(SmalltalkClass, "toString", function () {
             return 'Smalltalk ' + this.className;
-        })
-        (SmalltalkMetaclass, "toString", function () {
+        });
+        defineMethod(SmalltalkMetaclass, "toString", function () {
             return 'Smalltalk Metaclass ' + this.instanceClass.className;
-        })
-        (SmalltalkClass, "added", function () {
+        });
+        defineMethod(SmalltalkClass, "added", function () {
             addSubclass(this);
             if (st._classAdded) st._classAdded(this);
-        })
-        (SmalltalkClass, "removed", function () {
+        });
+        defineMethod(SmalltalkClass, "removed", function () {
             if (st._classRemoved) st._classRemoved(this);
             removeSubclass(this);
-        })
-        (SmalltalkBehavior, "methodAdded", function (method) {
+        });
+        defineMethod(SmalltalkBehavior, "methodAdded", function (method) {
             if (st._methodAdded) st._methodAdded(method, this);
-        })
-        (SmalltalkBehavior, "methodRemoved", function (method) {
+        });
+        defineMethod(SmalltalkBehavior, "methodRemoved", function (method) {
             if (st._methodRemoved) st._methodRemoved(method, this);
         });
 

+ 7 - 9
support/kernel-runtime.js

@@ -8,7 +8,6 @@ define(function () {
             value: method,
             enumerable: false, configurable: true, writable: true
         });
-        return defineMethod;
     }
 
     DNUBrik.deps = ["selectors", "messageSend", "manipulation", "classes"];
@@ -276,8 +275,7 @@ define(function () {
         SmalltalkMethodContext.prototype.selector = null;
         SmalltalkMethodContext.prototype.lookupClass = null;
 
-        defineMethod
-        (SmalltalkMethodContext, "fill", function (receiver, selector, locals, lookupClass) {
+        defineMethod(SmalltalkMethodContext, "fill", function (receiver, selector, locals, lookupClass) {
             this.receiver = receiver;
             this.selector = selector;
             this.locals = locals || {};
@@ -285,21 +283,21 @@ define(function () {
             if (this.homeContext) {
                 this.homeContext.evaluatedSelector = selector;
             }
-        })
-        (SmalltalkMethodContext, "fillBlock", function (locals, ctx, index) {
+        });
+        defineMethod(SmalltalkMethodContext, "fillBlock", function (locals, ctx, index) {
             this.locals = locals || {};
             this.outerContext = ctx;
             this.index = index || 0;
-        })
-        (SmalltalkMethodContext, "init", function () {
+        });
+        defineMethod(SmalltalkMethodContext, "init", function () {
             var home = this.homeContext;
             if (home) {
                 home.init();
             }
 
             this.setup(this);
-        })
-        (SmalltalkMethodContext, "method", function () {
+        });
+        defineMethod(SmalltalkMethodContext, "method", function () {
             var method;
             var lookup = this.lookupClass || this.receiver.klass;
             while (!method && lookup) {