Commit aeb022fd authored by huqi's avatar huqi
Browse files

修复data的check方法保证data数据的getter和setter可用

parent 5a2156ac
Showing with 15 additions and 0 deletions
+15 -0
......@@ -2092,6 +2092,11 @@ MWF.xScript.CMSJSONData = function(data, callback, key, parent, _form){
}
if (!noreset) this[newKey] = newValue;
}else{
if (!Object.getOwnPropertyDescriptor(this, newKey).get){
var o = {};
o[newKey] = {"configurable": true, "enumerable": true, "get": getter.apply(this, [data, callback, newKey, this]),"set": setter.apply(this, [data, callback, newKey, this])};
MWF.defineProperties(this, o);
}
if (overwrite){
data[newKey] = newValue;
if (!noreset) this[newKey] = newValue;
......
......@@ -3499,6 +3499,11 @@ MWF.xScript.JSONData = function(data, callback, key, parent, _form){
}
if (!noreset) this[newKey] = newValue;
}else{
if (!Object.getOwnPropertyDescriptor(this, newKey).get){
var o = {};
o[newKey] = {"configurable": true, "enumerable": true, "get": getter.apply(this, [data, callback, newKey, this]),"set": setter.apply(this, [data, callback, newKey, this])};
MWF.defineProperties(this, o);
}
if (overwrite){
data[newKey] = newValue;
if (!noreset) this[newKey] = newValue;
......
......@@ -2363,6 +2363,11 @@ if (!MWF.xScript.JSONData) {
}
if (!noreset) this[newKey] = newValue;
} else {
if (!Object.getOwnPropertyDescriptor(this, newKey).get){
var o = {};
o[newKey] = {"configurable": true, "enumerable": true, "get": getter.apply(this, [data, callback, newKey, this]),"set": setter.apply(this, [data, callback, newKey, this])};
MWF.defineProperties(this, o);
}
if (overwrite) {
data[newKey] = newValue;
if (!noreset) this[newKey] = newValue;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment