From 49b8c4ccd5e7618ae35541969b1da8a26438a30e Mon Sep 17 00:00:00 2001 From: Kira Date: Mon, 11 Nov 2019 10:36:02 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-1646=20refactor:=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/inject.js | 14 +++++++------- src/core/shortcut.js | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/core/inject.js b/src/core/inject.js index 9236e2f75..afd03e3e7 100644 --- a/src/core/inject.js +++ b/src/core/inject.js @@ -49,7 +49,7 @@ var configFunctions = {}; BI.config = function (type, configFn, options) { - if (BI.initialize) { + if (BI.initialized) { if (constantInjection[type]) { return (constantInjection[type] = configFn(constantInjection[type])); } @@ -64,16 +64,16 @@ if (!configFunctions[type]) { configFunctions[type] = []; BI.prepares.push(function () { - var stack = [], head; - for (var len = configFunctions[type].length, i = len - 1; i >= 0; i--) { - head = configFunctions[type][i]; - stack.push(i); + var stack = [], head, count, index; + for (count = configFunctions[type].length, index = count - 1; index >= 0; index--) { + head = configFunctions[type][index]; + stack.push(index); if (head.options && head.options.prevent) { break; } } - for (var len = stack.length, i = len - 1; i >= 0; i--) { - head = configFunctions[type][stack[i]]; + for (count = stack.length, index = count - 1; index >= 0; index--) { + head = configFunctions[type][stack[index]]; if (constantInjection[type]) { constantInjection[type] = head.fn(constantInjection[type]); continue; diff --git a/src/core/shortcut.js b/src/core/shortcut.js index 0c98efc00..449b4cdff 100644 --- a/src/core/shortcut.js +++ b/src/core/shortcut.js @@ -25,7 +25,7 @@ while (BI.prepares && BI.prepares.length > 0) { BI.prepares.shift()(); } - BI.initialize = true; + BI.initialized = true; var el, w; item || (item = {}); if (BI.isWidget(options)) {