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);