From 44a9caa205a078b2b64913c3d263eae4731902a1 Mon Sep 17 00:00:00 2001 From: "Zhenfei.Li" Date: Thu, 24 Mar 2022 13:53:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20refactor:=20?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=B8=A5=E6=A0=BC=E6=A8=A1=E5=BC=8F=E4=B8=8B?= =?UTF-8?q?=E7=9A=84=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/input/file.js | 2 +- src/core/0.foundation.js | 7 ++++++- src/core/2.base.js | 14 -------------- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/src/base/single/input/file.js b/src/base/single/input/file.js index 50ec58bdc..802e8472f 100644 --- a/src/base/single/input/file.js +++ b/src/base/single/input/file.js @@ -97,7 +97,7 @@ split = "onabort.onerror.onloadstart.onprogress".split("."), length = split.length, CRLF = "\r\n", - xhr = this.XMLHttpRequest ? new XMLHttpRequest : new ActiveXObject("Microsoft.XMLHTTP"), + xhr = XMLHttpRequest ? new XMLHttpRequest : new ActiveXObject("Microsoft.XMLHTTP"), sendFile; // FireFox 3+, Safari 4 beta (Chrome 2 beta file is buggy and will not work) diff --git a/src/core/0.foundation.js b/src/core/0.foundation.js index 067178cbd..ea69e97a9 100644 --- a/src/core/0.foundation.js +++ b/src/core/0.foundation.js @@ -4,7 +4,7 @@ /** * 初始化BI对象 */ -_global = undefined; +var _global = undefined; if (typeof window !== "undefined") { _global = window; } else if (typeof global !== "undefined") { @@ -14,6 +14,11 @@ if (typeof window !== "undefined") { } else { _global = this; } + +if (_global) { + _global._global = _global; +} + if (_global.BI == null) { _global.BI = {prepares: []}; } diff --git a/src/core/2.base.js b/src/core/2.base.js index 16a4a9f70..4a2a2df68 100644 --- a/src/core/2.base.js +++ b/src/core/2.base.js @@ -3,20 +3,6 @@ * Create By GUY 2014\11\17 * */ -_global = undefined; -if (typeof window !== "undefined") { - _global = window; -} else if (typeof global !== "undefined") { - _global = global; -} else if (typeof self !== "undefined") { - _global = self; -} else { - _global = this; -} -if (!_global.BI) { - _global.BI = {}; -} - !(function (undefined) { var traverse = function (func, context) { return function (value, key, obj) {