浏览代码

kernel: selectorsAdded only sends selectors.

Not pairs, as previously.
Herby Vojčík 6 年之前
父节点
当前提交
3a0ad68176
共有 2 个文件被更改,包括 6 次插入8 次删除
  1. 4 6
      support/kernel-fundamentals.js
  2. 2 2
      support/kernel-runtime.js

+ 4 - 6
support/kernel-fundamentals.js

@@ -100,10 +100,9 @@ define(function () {
         var selectors = this.selectors = [];
 
         this.registerSelector = function (stSelector) {
-            if (selectorSet[stSelector]) return null;
-            selectorSet[stSelector] = true;
+            if (selectorSet[stSelector]) return false;
             selectors.push(stSelector);
-            return {st: stSelector};
+            return selectorSet[stSelector] = true;
         };
 
         st.allSelectors = function () {
@@ -227,9 +226,8 @@ define(function () {
             var newSelectors = [];
 
             function selectorInUse (stSelector) {
-                var pair = registerSelector(stSelector);
-                if (pair) {
-                    newSelectors.push(pair);
+                if (registerSelector(stSelector)) {
+                    newSelectors.push(stSelector);
                 }
             }
 

+ 2 - 2
support/kernel-runtime.js

@@ -176,8 +176,8 @@ define(function () {
 
         emit.selectorsAdded = function (newSelectors) {
             var targetClasses = detachedRootClasses();
-            newSelectors.forEach(function (pair) {
-                installNewSelector(pair.st, targetClasses);
+            newSelectors.forEach(function (jsSelector) {
+                installNewSelector(jsSelector, targetClasses);
             });
         };