Browse Source

kernel: move installMethod into RuntimeMethodsBrik.

Herby Vojčík 6 năm trước cách đây
mục cha
commit
3dd87ffe47
1 tập tin đã thay đổi với 8 bổ sung5 xóa
  1. 8 5
      support/kernel-runtime.js

+ 8 - 5
support/kernel-runtime.js

@@ -17,10 +17,6 @@ define(function () {
         });
     }
 
-    function installMethod (method, klass) {
-        installJSMethod(klass.fn.prototype, method.jsSelector, method.fn);
-    }
-
     DNUBrik.deps = ["selectors", "selectorConversion", "smalltalkGlobals", "classes"];
     function DNUBrik (brikz, st) {
         var selectors = brikz.selectors.selectors;
@@ -59,10 +55,11 @@ define(function () {
         installNewSelectors(selectors, []);
     }
 
-    RuntimeClassesBrik.deps = ["event", "dnu", "behaviors", "classes"];
+    RuntimeClassesBrik.deps = ["event", "dnu", "behaviors", "classes", "runtimeMethods"];
     function RuntimeClassesBrik (brikz, st) {
         var jsSelectors = brikz.dnu.jsSelectors;
         var installNewSelectors = brikz.dnu.installNewSelectors;
+        var installMethod = brikz.runtimeMethods.installMethod;
         var traitsOrClasses = brikz.behaviors.traitsOrClasses;
         var wireKlass = brikz.classes.wireKlass;
         var emit = brikz.event.emit;
@@ -172,6 +169,12 @@ define(function () {
     function RuntimeMethodsBrik (brikz, st) {
         var emit = brikz.event.emit;
 
+        function installMethod (method, klass) {
+            installJSMethod(klass.fn.prototype, method.jsSelector, method.fn);
+        }
+
+        this.installMethod = installMethod;
+
         emit.behaviorMethodAdded = function (method, klass) {
             installMethod(method, klass);
             propagateMethodChange(klass, method, klass);