fixed set call with nullable values

This commit is contained in:
Jaime Humberto Macias Bustamante
2026-07-18 21:48:23 -07:00
parent 266bb67c93
commit c1b23320c3
+2 -3
View File
@@ -135,7 +135,7 @@ class Property {
var fName:String = setterFunc;
if (!__allowWriteAccess && __allowSetGet) {
if (varExists(fName))
return callAccessor(fName, val);
return callAccessor(fName, true, val);
else
interp.error(ECustom('Method $fName required by property $name is missing'));
} else {
@@ -153,10 +153,9 @@ class Property {
return r = val;
}
private function callAccessor(f:String, ?value:Dynamic):Dynamic {
private function callAccessor(f:String, isWrite:Bool = false, ?value:Dynamic):Dynamic {
var fn = isStatic ? interp.staticVariables.get(f) : interp.variables.get(f);
var rt:Dynamic = null;
var isWrite:Bool = value != null;
if (fn != null && Reflect.isFunction(fn)) {
if (isWrite) __allowWriteAccess = true;
else __allowReadAccess = true;