fixed small oversight

This commit is contained in:
Jaime Humberto Macias Bustamante
2026-04-30 11:27:07 -07:00
parent 634d819cc2
commit 2a301ea591
3 changed files with 12 additions and 6 deletions
+2 -2
View File
@@ -175,7 +175,7 @@ class CustomClass implements IHScriptCustomClassBehaviour {
if (f != null && allowProperty && f is Property) {
var prop:Property = cast f;
prop.__allowSetGet = this.__allowSetGet;
var r = prop.callGetter(name);
var r = prop.callGetter();
prop.__allowSetGet = null;
return r;
}
@@ -187,7 +187,7 @@ class CustomClass implements IHScriptCustomClassBehaviour {
if (f != null && f is Property) {
var prop:Property = cast f;
prop.__allowSetGet = this.__allowSetGet;
var r = prop.callSetter(name, val);
var r = prop.callSetter(val);
prop.__allowSetGet = null;
return r;
}
+2 -2
View File
@@ -97,7 +97,7 @@ class CustomClassHandler implements IHScriptCustomConstructor implements IHScrip
if(f is Property && allowProperty) {
var prop:Property = cast f;
prop.__allowSetGet = this.__allowSetGet;
var r = prop.callGetter(name);
var r = prop.callGetter();
prop.__allowSetGet = null;
return r;
}
@@ -109,7 +109,7 @@ class CustomClassHandler implements IHScriptCustomConstructor implements IHScrip
if(f is Property) {
var prop:Property = cast f;
prop.__allowSetGet = this.__allowSetGet;
var r = prop.callSetter(name, val);
var r = prop.callSetter(val);
prop.__allowSetGet = null;
return r;
}
+8 -2
View File
@@ -97,8 +97,11 @@ class Property {
} else
interp.error(ECustom('Method $fName required by property $name is missing'));
} else {
if ((setter == ADefault || setter == ANull) || isVar)
if ((setter == ADefault || setter == ANull) || isVar) {
if(!__callingProperty)
__allowReadAccess = false;
return r;
}
else
interp.error(ECustom('Field $name cannot be accessed because it is not a real variable${interp.isBypassAccessor ? '. Add @:isVar to enable it' : ''}'));
}
@@ -122,8 +125,11 @@ class Property {
else
interp.error(ECustom('Method $fName required by property $name is missing'));
} else {
if ((getter == ADefault || getter == ANull) || isVar)
if ((getter == ADefault || getter == ANull) || isVar) {
if(!__callingProperty)
__allowWriteAccess = false;
return r = val;
}
else
interp.error(ECustom('Field $name cannot be accessed because it is not a real variable${interp.isBypassAccessor ? '. Add @:isVar to enable it' : ''}'));
}