patch 8.2.1845: Vim9: function defined in a block can't use block variables

Problem:    Vim9: function defined in a block can't use variables defined in
            that block.
Solution:   First step: Make a second hashtab that holds all script variables,
            also block-local ones, with more information.
diff --git a/src/evalvars.c b/src/evalvars.c
index 2455046..f325355 100644
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -2882,7 +2882,7 @@
 	}
     }
     hash_clear(ht);
-    ht->ht_used = 0;
+    hash_init(ht);
 }
 
 /*
@@ -3142,30 +3142,10 @@
 	if (flags & ASSIGN_CONST)
 	    di->di_flags |= DI_FLAGS_LOCK;
 
+	// A Vim9 script-local variable is also added to sn_all_vars and
+	// sn_var_vals.
 	if (is_script_local && vim9script)
-	{
-	    scriptitem_T *si = SCRIPT_ITEM(current_sctx.sc_sid);
-
-	    // Store a pointer to the typval_T, so that it can be found by
-	    // index instead of using a hastab lookup.
-	    if (ga_grow(&si->sn_var_vals, 1) == OK)
-	    {
-		svar_T *sv = ((svar_T *)si->sn_var_vals.ga_data)
-						      + si->sn_var_vals.ga_len;
-		sv->sv_name = di->di_key;
-		sv->sv_tv = &di->di_tv;
-		if (type == NULL)
-		    sv->sv_type = typval2type(tv, &si->sn_type_list);
-		else
-		    sv->sv_type = type;
-		sv->sv_const = (flags & ASSIGN_CONST);
-		sv->sv_export = is_export;
-		++si->sn_var_vals.ga_len;
-
-		// let ex_export() know the export worked.
-		is_export = FALSE;
-	    }
-	}
+	    add_vim9_script_var(di, tv, type);
     }
 
     if (copy || tv->v_type == VAR_NUMBER || tv->v_type == VAR_FLOAT)