Browse Source

无JIRA fix: 吸取经验,防止别人乱改塞undefined之类的,加个判断

research/test
dailer 1 year ago
parent
commit
40f90200c9
  1. 19
      packages/fineui/src/core/constant/writable.var.js

19
packages/fineui/src/core/constant/writable.var.js

@ -14,7 +14,7 @@ export const setEventResponseTime = v => {
PropertyDescriptors["EVENT_RESPONSE_TIME"] = {
enumerable: true,
configurable: true,
get: function () {
get: function() {
return EVENT_RESPONSE_TIME;
},
set: setEventResponseTime,
@ -27,7 +27,7 @@ export const setPixUnit = v => {
PropertyDescriptors["pixUnit"] = {
enumerable: true,
configurable: true,
get: function () {
get: function() {
return pixUnit;
},
set: setPixUnit,
@ -40,7 +40,7 @@ export const setPixRatio = v => {
PropertyDescriptors["pixRatio"] = {
enumerable: true,
configurable: true,
get: function () {
get: function() {
return pixRatio;
},
set: setPixRatio,
@ -48,12 +48,15 @@ PropertyDescriptors["pixRatio"] = {
export let StartOfWeek = 1;
export const setStartOfWeek = v => {
if (![0, 1].includes(v)) {
throw new Error("setStartOfWeek must be 0 or 1");
}
StartOfWeek = v;
};
PropertyDescriptors["StartOfWeek"] = {
enumerable: true,
configurable: true,
get: function () {
get: function() {
return StartOfWeek;
},
set: setStartOfWeek,
@ -66,7 +69,7 @@ export const setBlankSplitChar = v => {
PropertyDescriptors["BlankSplitChar"] = {
enumerable: true,
configurable: true,
get: function () {
get: function() {
return BlankSplitChar;
},
set: setBlankSplitChar,
@ -93,7 +96,7 @@ export const setPixFormat = v => {
PropertyDescriptors["pixFormat"] = {
enumerable: true,
configurable: true,
get: function () {
get: function() {
return pixFormat;
},
set: setPixFormat,
@ -118,7 +121,7 @@ export let setToPix = v => {
PropertyDescriptors["toPix"] = {
enumerable: true,
configurable: true,
get: function () {
get: function() {
return toPix;
},
set: setToPix,
@ -135,7 +138,7 @@ export const setEventBlur = v => {
PropertyDescriptors["EVENT_BLUR"] = {
enumerable: true,
configurable: true,
get: function () {
get: function() {
return EVENT_BLUR;
},
set: setEventBlur,

Loading…
Cancel
Save