Mercurial > vim
changeset 28218:300b0ca4e46c v8.2.4635
patch 8.2.4635: tests using null list or dict fail
Commit: https://github.com/vim/vim/commit/501f978288008c2e4e8761858af2e27b14223afd
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Mar 27 16:51:04 2022 +0100
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 27 Mar 2022 18:00:03 +0200 |
parents | 662d2d5db9a6 |
children | 1b6553ab16e5 |
files | src/evalvars.c src/version.c |
diffstat | 2 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/evalvars.c +++ b/src/evalvars.c @@ -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)