patch 8.2.1824: Vim9: variables at the script level escape their scope
Problem: Vim9: variables at the script level escape their scope.
Solution: When leaving a scope remove variables declared in it.
diff --git a/src/evalvars.c b/src/evalvars.c
index f7ee58d..2455046 100644
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -174,7 +174,6 @@
static char_u *ex_let_one(char_u *arg, typval_T *tv, int copy, int flags, char_u *endchars, char_u *op);
static int do_unlet_var(lval_T *lp, char_u *name_end, exarg_T *eap, int deep, void *cookie);
static int do_lock_var(lval_T *lp, char_u *name_end, exarg_T *eap, int deep, void *cookie);
-static void delete_var(hashtab_T *ht, hashitem_T *hi);
static void list_one_var(dictitem_T *v, char *prefix, int *first);
static void list_one_var_a(char *prefix, char_u *name, int type, char_u *string, int *first);
@@ -2890,7 +2889,7 @@
* Delete a variable from hashtab "ht" at item "hi".
* Clear the variable value and free the dictitem.
*/
- static void
+ void
delete_var(hashtab_T *ht, hashitem_T *hi)
{
dictitem_T *di = HI2DI(hi);