From c1b23320c3f709087aa4a95dd32693bf3d381e55 Mon Sep 17 00:00:00 2001 From: Jaime Humberto Macias Bustamante Date: Sat, 18 Jul 2026 21:48:23 -0700 Subject: [PATCH] fixed set call with nullable values --- hscript/Property.hx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hscript/Property.hx b/hscript/Property.hx index fcd1355..4ad9f6f 100644 --- a/hscript/Property.hx +++ b/hscript/Property.hx @@ -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;