From b6a90b108ba345bb08937595aed5dd4e1d18a771 Mon Sep 17 00:00:00 2001 From: TopchetoEU <36534413+TopchetoEU@users.noreply.github.com> Date: Thu, 5 Sep 2024 13:03:36 +0300 Subject: [PATCH] fix: wrong check for var decl collisions --- .../me/topchetoeu/jscript/compilation/scope/FunctionScope.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/me/topchetoeu/jscript/compilation/scope/FunctionScope.java b/src/main/java/me/topchetoeu/jscript/compilation/scope/FunctionScope.java index 550817c..85bb3eb 100644 --- a/src/main/java/me/topchetoeu/jscript/compilation/scope/FunctionScope.java +++ b/src/main/java/me/topchetoeu/jscript/compilation/scope/FunctionScope.java @@ -27,7 +27,7 @@ public class FunctionScope extends Scope { @Override public Variable define(Variable var, Location loc) { checkNotEnded(); - if (locals.has(var.name)) throw alreadyDefinedErr(loc, var.name); + if (variables.has(var.name)) throw alreadyDefinedErr(loc, var.name); if (passtrough) { blacklistNames.add(var.name);