From 3ef9f62df5b1811fce9643be65dc57def9f84f24 Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 22 Jul 2021 18:06:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=94=99=E8=AF=AF=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/combination/loader.js | 4 ++-- src/core/2.base.js | 2 +- src/core/4.widget.js | 2 +- src/core/5.shortcut.js | 2 +- src/core/controller/controller.layer.js | 2 +- src/core/listener/listener.show.js | 2 +- src/core/wrapper/layout/adapt/absolute.leftrightvertical.js | 6 +++--- src/core/wrapper/layout/adapt/adapt.leftrightvertical.js | 6 +++--- .../wrapper/layout/flex/flex.leftrightvertical.center.js | 2 +- src/core/wrapper/layout/layout.border.js | 2 +- src/core/wrapper/layout/layout.card.js | 6 +++--- src/core/wrapper/layout/layout.division.js | 4 ++-- src/core/wrapper/layout/layout.grid.js | 2 +- src/core/wrapper/layout/layout.inline.js | 2 +- src/core/wrapper/layout/layout.table.js | 4 ++-- src/core/wrapper/layout/layout.tape.js | 4 ++-- src/core/wrapper/layout/layout.td.js | 2 +- src/core/wrapper/layout/layout.window.js | 4 ++-- src/core/wrapper/layout/middle/middle.center.js | 2 +- src/core/wrapper/layout/middle/middle.float.center.js | 2 +- src/core/wrapper/layout/middle/middle.horizontal.js | 2 +- src/core/wrapper/layout/middle/middle.vertical.js | 2 +- src/data/pool/pool.buffer.js | 4 ++-- 23 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/base/combination/loader.js b/src/base/combination/loader.js index f4593d6ce..310c606b3 100644 --- a/src/base/combination/loader.js +++ b/src/base/combination/loader.js @@ -169,7 +169,7 @@ BI.Loader = BI.inherit(BI.Widget, { if (arguments.length === 0 && (BI.isFunction(o.itemsCreator))) { o.itemsCreator.apply(this, [{times: 1}, function () { if (arguments.length === 0) { - throw new Error("arguments can not be null!!!"); + throw new Error("参数不能为空"); } self.populate.apply(self, arguments); o.onLoaded(); @@ -257,4 +257,4 @@ BI.Loader = BI.inherit(BI.Widget, { } }); BI.Loader.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.loader", BI.Loader); \ No newline at end of file +BI.shortcut("bi.loader", BI.Loader); diff --git a/src/core/2.base.js b/src/core/2.base.js index e5188249c..c9e7b1699 100644 --- a/src/core/2.base.js +++ b/src/core/2.base.js @@ -75,7 +75,7 @@ if (!_global.BI) { createWidgets: function (items, options, context) { if (!BI.isArray(items)) { - throw new Error("cannot create Widgets"); + throw new Error("items必须是数组", items); } if (BI.isWidget(options)) { context = options; diff --git a/src/core/4.widget.js b/src/core/4.widget.js index 447aa9c75..69cf7e29a 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -449,7 +449,7 @@ } name = name || widget.getName() || BI.uniqueId("widget"); if (this._children[name]) { - throw new Error("name has already been existed"); + throw new Error("组件:组件名已存在,不能进行添加"); } widget._setParent && widget._setParent(this); widget.on(BI.Events.DESTROY, function () { diff --git a/src/core/5.shortcut.js b/src/core/5.shortcut.js index 330228b2c..b23ab983f 100644 --- a/src/core/5.shortcut.js +++ b/src/core/5.shortcut.js @@ -88,7 +88,7 @@ if (BI.isWidget(item.el)) { return item.el; } - throw new Error("组件创建:无法根据item创建组件", item); + throw new Error("组件:无法根据item创建组件", item); }; BI._lazyCreateWidget = BI._lazyCreateWidget || function (item, options, context) { diff --git a/src/core/controller/controller.layer.js b/src/core/controller/controller.layer.js index af245b133..d8bb9d2d0 100644 --- a/src/core/controller/controller.layer.js +++ b/src/core/controller/controller.layer.js @@ -124,7 +124,7 @@ BI.LayerController = BI.inherit(BI.Controller, { add: function (name, layer, layout) { if (this.has(name)) { - throw new Error("name is already exist"); + throw new Error("不能创建同名的Layer"); } layout.setVisible(false); this.layerManager[name] = layer; diff --git a/src/core/listener/listener.show.js b/src/core/listener/listener.show.js index 85c7309c3..af2236578 100644 --- a/src/core/listener/listener.show.js +++ b/src/core/listener/listener.show.js @@ -27,7 +27,7 @@ BI.ShowListener = BI.inherit(BI.OB, { v = v || o.eventObj.getValue(); v = BI.isArray(v) ? (v.length > 1 ? v.toString() : v[0]) : v; if (BI.isNull(v)) { - throw new Error("value cannot be null"); + throw new Error("不能为null"); } var cardName = o.cardNameCreator(v); if (!o.cardLayout.isCardExisted(cardName)) { diff --git a/src/core/wrapper/layout/adapt/absolute.leftrightvertical.js b/src/core/wrapper/layout/adapt/absolute.leftrightvertical.js index a9af9ce1a..1ac9c37b3 100644 --- a/src/core/wrapper/layout/adapt/absolute.leftrightvertical.js +++ b/src/core/wrapper/layout/adapt/absolute.leftrightvertical.js @@ -85,7 +85,7 @@ BI.AbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { addItem: function () { // do nothing - throw new Error("cannot be added"); + throw new Error("不能添加子组件"); }, populate: function (items) { @@ -137,11 +137,11 @@ BI.AbsoluteRightVerticalAdaptLayout = BI.inherit(BI.Layout, { addItem: function () { // do nothing - throw new Error("cannot be added"); + throw new Error("不能添加子组件"); }, populate: function (items) { this.layout.populate(items); } }); -BI.shortcut("bi.absolute_right_vertical_adapt", BI.AbsoluteRightVerticalAdaptLayout); \ No newline at end of file +BI.shortcut("bi.absolute_right_vertical_adapt", BI.AbsoluteRightVerticalAdaptLayout); diff --git a/src/core/wrapper/layout/adapt/adapt.leftrightvertical.js b/src/core/wrapper/layout/adapt/adapt.leftrightvertical.js index 26a121795..b2dabf32a 100644 --- a/src/core/wrapper/layout/adapt/adapt.leftrightvertical.js +++ b/src/core/wrapper/layout/adapt/adapt.leftrightvertical.js @@ -81,7 +81,7 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { addItem: function () { // do nothing - throw new Error("cannot be added"); + throw new Error("不能添加子组件"); }, populate: function (items) { @@ -134,7 +134,7 @@ BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, { addItem: function () { // do nothing - throw new Error("cannot be added"); + throw new Error("不能添加子组件"); }, populate: function (items) { @@ -186,7 +186,7 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, { addItem: function () { // do nothing - throw new Error("cannot be added"); + throw new Error("不能添加子组件"); }, populate: function (items) { diff --git a/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js b/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js index e0a5bdd13..dec32ca13 100644 --- a/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js +++ b/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js @@ -75,7 +75,7 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { addItem: function () { // do nothing - throw new Error("cannot be added"); + throw new Error("不能添加子组件"); }, populate: function (items) { diff --git a/src/core/wrapper/layout/layout.border.js b/src/core/wrapper/layout/layout.border.js index a6a412a51..47907c572 100644 --- a/src/core/wrapper/layout/layout.border.js +++ b/src/core/wrapper/layout/layout.border.js @@ -22,7 +22,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, { addItem: function (item) { // do nothing - throw new Error("cannot be added"); + throw new Error("不能添加子组件"); }, stroke: function (regions) { diff --git a/src/core/wrapper/layout/layout.card.js b/src/core/wrapper/layout/layout.card.js index f0133de6e..65fa9fcf6 100644 --- a/src/core/wrapper/layout/layout.card.js +++ b/src/core/wrapper/layout/layout.card.js @@ -70,7 +70,7 @@ BI.CardLayout = BI.inherit(BI.Layout, { getCardByName: function (cardName) { if (!this.isCardExisted(cardName)) { - throw new Error("cardName is not exist"); + throw new Error("cardName不存在", cardName); } return this._children[this._getChildName(cardName)]; }, @@ -87,7 +87,7 @@ BI.CardLayout = BI.inherit(BI.Layout, { deleteCardByName: function (cardName) { if (!this.isCardExisted(cardName)) { - throw new Error("cardName is not exist"); + throw new Error("cardName不存在", cardName); } var child = this._children[this._getChildName(cardName)]; @@ -97,7 +97,7 @@ BI.CardLayout = BI.inherit(BI.Layout, { addCardByName: function (cardName, cardItem) { if (this.isCardExisted(cardName)) { - throw new Error("cardName is already exist"); + throw new Error("cardName 已存在", cardName); } var widget = BI._lazyCreateWidget(cardItem, this); widget.element.css({ diff --git a/src/core/wrapper/layout/layout.division.js b/src/core/wrapper/layout/layout.division.js index 7d2912317..1aac78bc8 100644 --- a/src/core/wrapper/layout/layout.division.js +++ b/src/core/wrapper/layout/layout.division.js @@ -47,7 +47,7 @@ BI.DivisionLayout = BI.inherit(BI.Layout, { addItem: function (item) { // do nothing - throw new Error("cannot be added"); + throw new Error("不能添加子组件"); }, stroke: function (items) { @@ -112,7 +112,7 @@ BI.DivisionLayout = BI.inherit(BI.Layout, { var totalW = 0; for (var j = 0; j < columns; j++) { if (!map[i][j]) { - throw new Error("item be required"); + throw new Error("item(" + i + "" + j + ") 必须", map); } if (!this.hasWidget(this._getChildName(i + "_" + j))) { var w = BI._lazyCreateWidget(map[i][j]); diff --git a/src/core/wrapper/layout/layout.grid.js b/src/core/wrapper/layout/layout.grid.js index 49f47bea6..a787c449b 100644 --- a/src/core/wrapper/layout/layout.grid.js +++ b/src/core/wrapper/layout/layout.grid.js @@ -41,7 +41,7 @@ BI.GridLayout = BI.inherit(BI.Layout, { addItem: function () { // do nothing - throw new Error("cannot be added"); + throw new Error("不能添加子组件"); }, stroke: function (items) { diff --git a/src/core/wrapper/layout/layout.inline.js b/src/core/wrapper/layout/layout.inline.js index e8830b9c1..5fb598699 100644 --- a/src/core/wrapper/layout/layout.inline.js +++ b/src/core/wrapper/layout/layout.inline.js @@ -99,7 +99,7 @@ BI.InlineLayout = BI.inherit(BI.Layout, { }, addItem: function (item) { - throw new Error("不能添加元素"); + throw new Error("不能添加子组件"); }, populate: function (items) { diff --git a/src/core/wrapper/layout/layout.table.js b/src/core/wrapper/layout/layout.table.js index d665c5429..faec5d7fa 100644 --- a/src/core/wrapper/layout/layout.table.js +++ b/src/core/wrapper/layout/layout.table.js @@ -88,7 +88,7 @@ BI.TableLayout = BI.inherit(BI.Layout, { }, arr[j])); right += o.columnSize[j] + (o.columnSize[j] < 1 ? 0 : o.hgap); } else { - throw new Error("item with fill can only be one"); + throw new Error("构造错误", arr); } } if (i >= 0 && i < arr.length) { @@ -123,7 +123,7 @@ BI.TableLayout = BI.inherit(BI.Layout, { addItem: function (arr) { if (!BI.isArray(arr)) { - throw new Error("item must be array"); + throw new Error("必须是数组", arr); } return BI.TableLayout.superclass.addItem.apply(this, arguments); }, diff --git a/src/core/wrapper/layout/layout.tape.js b/src/core/wrapper/layout/layout.tape.js index 3a9430383..7c5a85b2f 100644 --- a/src/core/wrapper/layout/layout.tape.js +++ b/src/core/wrapper/layout/layout.tape.js @@ -28,7 +28,7 @@ BI.HTapeLayout = BI.inherit(BI.Layout, { }, addItem: function (item) { // do nothing - throw new Error("cannot be added"); + throw new Error("不能添加子组件"); }, stroke: function (items) { @@ -168,7 +168,7 @@ BI.VTapeLayout = BI.inherit(BI.Layout, { addItem: function (item) { // do nothing - throw new Error("cannot be added"); + throw new Error("不能添加子组件"); }, stroke: function (items) { diff --git a/src/core/wrapper/layout/layout.td.js b/src/core/wrapper/layout/layout.td.js index e191015b4..fe2df2f70 100644 --- a/src/core/wrapper/layout/layout.td.js +++ b/src/core/wrapper/layout/layout.td.js @@ -163,7 +163,7 @@ BI.TdLayout = BI.inherit(BI.Layout, { addItem: function (arr) { if (!BI.isArray(arr)) { - throw new Error("item must be array"); + throw new Error("必须是数组", arr); } return BI.TdLayout.superclass.addItem.apply(this, arguments); }, diff --git a/src/core/wrapper/layout/layout.window.js b/src/core/wrapper/layout/layout.window.js index 98b5386ce..d7037f923 100644 --- a/src/core/wrapper/layout/layout.window.js +++ b/src/core/wrapper/layout/layout.window.js @@ -31,7 +31,7 @@ BI.WindowLayout = BI.inherit(BI.Layout, { addItem: function (item) { // do nothing - throw new Error("cannot be added"); + throw new Error("不能添加子组件"); }, stroke: function (items) { @@ -83,7 +83,7 @@ BI.WindowLayout = BI.inherit(BI.Layout, { for (var i = 0; i < o.rows; i++) { for (var j = 0; j < o.columns; j++) { if (!o.items[i][j]) { - throw new Error("item be required"); + throw new Error("构造错误", o.items); } if (!this.hasWidget(this._getChildName(i + "_" + j))) { var w = BI._lazyCreateWidget(o.items[i][j]); diff --git a/src/core/wrapper/layout/middle/middle.center.js b/src/core/wrapper/layout/middle/middle.center.js index f1a27125a..73af27053 100644 --- a/src/core/wrapper/layout/middle/middle.center.js +++ b/src/core/wrapper/layout/middle/middle.center.js @@ -62,7 +62,7 @@ BI.CenterLayout = BI.inherit(BI.Layout, { addItem: function (item) { // do nothing - throw new Error("cannot be added"); + throw new Error("不能添加子组件"); }, update: function (opt) { diff --git a/src/core/wrapper/layout/middle/middle.float.center.js b/src/core/wrapper/layout/middle/middle.float.center.js index b4e6bf090..f5b2de702 100644 --- a/src/core/wrapper/layout/middle/middle.float.center.js +++ b/src/core/wrapper/layout/middle/middle.float.center.js @@ -61,7 +61,7 @@ BI.FloatCenterLayout = BI.inherit(BI.Layout, { addItem: function (item) { // do nothing - throw new Error("cannot be added"); + throw new Error("不能添加子组件"); }, update: function (opt) { diff --git a/src/core/wrapper/layout/middle/middle.horizontal.js b/src/core/wrapper/layout/middle/middle.horizontal.js index 3cdc7c5cd..bf802e315 100644 --- a/src/core/wrapper/layout/middle/middle.horizontal.js +++ b/src/core/wrapper/layout/middle/middle.horizontal.js @@ -60,7 +60,7 @@ BI.HorizontalCenterLayout = BI.inherit(BI.Layout, { addItem: function (item) { // do nothing - throw new Error("cannot be added"); + throw new Error("不能添加子组件"); }, update: function (opt) { diff --git a/src/core/wrapper/layout/middle/middle.vertical.js b/src/core/wrapper/layout/middle/middle.vertical.js index a7040cbea..df4ca51ff 100644 --- a/src/core/wrapper/layout/middle/middle.vertical.js +++ b/src/core/wrapper/layout/middle/middle.vertical.js @@ -61,7 +61,7 @@ BI.VerticalCenterLayout = BI.inherit(BI.Layout, { addItem: function (item) { // do nothing - throw new Error("cannot be added"); + throw new Error("不能添加子组件"); }, update: function (opt) { diff --git a/src/data/pool/pool.buffer.js b/src/data/pool/pool.buffer.js index 4310f740e..9e85ba6f6 100644 --- a/src/data/pool/pool.buffer.js +++ b/src/data/pool/pool.buffer.js @@ -10,7 +10,7 @@ BI.BufferPool = { put: function (name, cache) { if (BI.isNotNull(Buffer[name])) { - throw new Error("Buffer Pool has the key already!"); + throw new Error("key值:[" + name + "] 已存在!", Buffer); } Buffer[name] = cache; }, @@ -19,4 +19,4 @@ return Buffer[name]; } }; -})(); \ No newline at end of file +})();