From 434ded65037b4b26cdac6cb5871fc66a408337fb Mon Sep 17 00:00:00 2001 From: Jaime Humberto Macias Bustamante Date: Sun, 6 Jul 2025 21:50:24 -0700 Subject: [PATCH] "null" value fix CLOSES #9 --- hscript/Interp.hx | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/hscript/Interp.hx b/hscript/Interp.hx index 1362e45..9d2e810 100644 --- a/hscript/Interp.hx +++ b/hscript/Interp.hx @@ -593,9 +593,6 @@ class Interp { return null; id = StringTools.trim(id); - if(id == 'null') - return null; // Weird issue, bruh - if(inCustomClass && id == 'super') { var customClass:IHScriptCustomClassBehaviour = cast scriptObject; var superClass = customClass.hget('superClass'); @@ -612,20 +609,14 @@ class Interp { } } - var r:Dynamic = null; - - if(variables.exists(id)) - r = variables.get(id); - else if(publicVariables.exists(id)) - r = publicVariables.get(id); - else if(staticVariables.exists(id)) - r = staticVariables.get(id); - - if(r != null) { - if(r is Property && allowProperty) - return cast(r, Property).callGetter(id); - else - return r; + for(map in [variables, publicVariables, staticVariables]) { + if(map.exists(id)) { + var r:Null = map.get(id); + if(r != null && r is Property && allowProperty) + return cast(r, Property).callGetter(id); + else + return r; + } } if(customClasses.exists(id))