Ver código fonte

Merge {Methods,BehaviorProviders}Brik.

Herbert Vojčík 7 anos atrás
pai
commit
0b0d9b48a0
2 arquivos alterados com 11 adições e 13 exclusões
  1. 5 7
      support/kernel-fundamentals.js
  2. 6 6
      support/kernel-language.js

+ 5 - 7
support/kernel-fundamentals.js

@@ -181,10 +181,9 @@ define(['./compatibility' /* TODO remove */], function () {
         };
     }
 
-    MethodsBrik.deps = ["behaviorProviders", "selectors", "root", "selectorConversion"];
+    MethodsBrik.deps = ["selectors", "root", "selectorConversion"];
     function MethodsBrik (brikz, st) {
         var registerSelector = brikz.selectors.registerSelector;
-        var updateMethod = brikz.behaviorProviders.updateMethod;
         var SmalltalkObject = brikz.root.Object;
         var coreFns = brikz.root.coreFns;
 
@@ -245,15 +244,13 @@ define(['./compatibility' /* TODO remove */], function () {
             delete traitOrBehavior.localMethods[method.selector];
             updateMethod(method.selector, traitOrBehavior);
         };
-    }
 
-    function BehaviorProvidersBrik (brikz, st) {
         this.setupMethods = function (traitOrBehavior) {
             traitOrBehavior.localMethods = Object.create(null);
             traitOrBehavior.methods = Object.create(null);
         };
 
-        this.updateMethod = function (selector, traitOrBehavior) {
+        function updateMethod (selector, traitOrBehavior) {
             var oldMethod = traitOrBehavior.methods[selector],
                 newMethod = traitOrBehavior.localMethods[selector];
             if (oldMethod == null && newMethod == null) {
@@ -269,7 +266,9 @@ define(['./compatibility' /* TODO remove */], function () {
                 traitOrBehavior.methodRemoved(oldMethod);
             }
             if (st._methodReplaced) st._methodReplaced(newMethod, oldMethod, traitOrBehavior);
-        };
+        }
+
+        this.updateMethod = updateMethod;
     }
 
     function ArraySetBrik (brikz, st) {
@@ -389,7 +388,6 @@ define(['./compatibility' /* TODO remove */], function () {
         brikz.selectorConversion = SelectorConversionBrik;
         brikz.selectors = SelectorsBrik;
         brikz.packages = PackagesBrik;
-        brikz.behaviorProviders = BehaviorProvidersBrik;
         brikz.behaviors = BehaviorsBrik;
         brikz.methods = MethodsBrik;
 

+ 6 - 6
support/kernel-language.js

@@ -59,11 +59,11 @@ define(['./compatibility' /* TODO remove */], function () {
         });
     }
 
-    TraitsBrik.deps = ["behaviors", "behaviorProviders", "composition", "arraySet", "root"];
+    TraitsBrik.deps = ["behaviors", "methods", "composition", "arraySet", "root"];
     function TraitsBrik (brikz, st) {
         var coreFns = brikz.root.coreFns;
         var SmalltalkObject = brikz.root.Object;
-        var setupMethods = brikz.behaviorProviders.setupMethods;
+        var setupMethods = brikz.methods.setupMethods;
         var traitMethodChanged = brikz.composition.traitMethodChanged;
         var buildTraitOrClass = brikz.behaviors.buildTraitOrClass;
         var addElement = brikz.arraySet.addElement;
@@ -126,9 +126,9 @@ define(['./compatibility' /* TODO remove */], function () {
         };
     }
 
-    MethodCompositionBrik.deps = ["behaviorProviders"];
+    MethodCompositionBrik.deps = ["methods"];
     function MethodCompositionBrik (brikz, st) {
-        var updateMethod = brikz.behaviorProviders.updateMethod;
+        var updateMethod = brikz.methods.updateMethod;
 
         function aliased (selector, method) {
             if (method.selector === selector) return method;
@@ -249,14 +249,14 @@ define(['./compatibility' /* TODO remove */], function () {
         this.traitMethodChanged = traitMethodChanged;
     }
 
-    ClassesBrik.deps = ["root", "behaviors", "behaviorProviders", "arraySet", "smalltalkGlobals"];
+    ClassesBrik.deps = ["root", "behaviors", "methods", "arraySet", "smalltalkGlobals"];
     function ClassesBrik (brikz, st) {
         var SmalltalkRoot = brikz.root.Root;
         var coreFns = brikz.root.coreFns;
         var globals = brikz.smalltalkGlobals.globals;
         var SmalltalkObject = brikz.root.Object;
         var buildTraitOrClass = brikz.behaviors.buildTraitOrClass;
-        var setupMethods = brikz.behaviorProviders.setupMethods;
+        var setupMethods = brikz.methods.setupMethods;
         var removeTraitOrClass = brikz.behaviors.removeTraitOrClass;
         var addElement = brikz.arraySet.addElement;
         var removeElement = brikz.arraySet.removeElement;