patch 8.2.4635: tests using null list or dict fail

Problem:    Tests using null list or dict fail.
Solution:   Only use the new rules for Vim9 script.
This commit is contained in:
Bram Moolenaar
2022-03-27 16:51:04 +01:00
parent ec15b1cfdc
commit 501f978288
2 changed files with 6 additions and 2 deletions

View File

@ -2822,7 +2822,8 @@ eval_variable(
if (ht != &globvarht)
{
if (tv->v_type == VAR_DICT && tv->vval.v_dict == NULL
&& type != NULL && type != &t_dict_empty)
&& ((type != NULL && type != &t_dict_empty)
|| !in_vim9script()))
{
tv->vval.v_dict = dict_alloc();
if (tv->vval.v_dict != NULL)
@ -2832,7 +2833,8 @@ eval_variable(
}
}
else if (tv->v_type == VAR_LIST && tv->vval.v_list == NULL
&& type != NULL && type != &t_list_empty)
&& ((type != NULL && type != &t_list_empty)
|| !in_vim9script()))
{
tv->vval.v_list = list_alloc();
if (tv->vval.v_list != NULL)

View File

@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4635,
/**/
4634,
/**/