diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-06-12 16:15:12 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-06-12 17:20:55 +0800 |
commit | 4058f95d9dc9a58ab80f982c91b85ec1363c89c8 (patch) | |
tree | 39ba7df16823bb1ed8d2c5e32796928dc0051635 /src | |
parent | 8d8ac15ed99c8ce12519e6bda43069f2bbb9ddf7 (diff) | |
download | rneovim-4058f95d9dc9a58ab80f982c91b85ec1363c89c8.tar.gz rneovim-4058f95d9dc9a58ab80f982c91b85ec1363c89c8.tar.bz2 rneovim-4058f95d9dc9a58ab80f982c91b85ec1363c89c8.zip |
vim-patch:partial:8.2.3335: Vim9: not enough tests run with Vim9
Problem: Vim9: not enough tests run with Vim9.
Solution: Run a few more tests in Vim9 script and :def function. Fix that
items(), keys() and values9) return zero for a NULL dict.
Make join() return an empty string for a NULL list. Make sort()
return an empty list for a NULL list.
https://github.com/vim/vim/commit/ef98257593a0abf1300d0f70358dc45a70a62580
Skip f_reverse() change for consistency with other functions.
Skip Test_null_list() and Test_null_dict() because of missing patches.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval/typval.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c index 9e697d6144..ec227a6b1a 100644 --- a/src/nvim/eval/typval.c +++ b/src/nvim/eval/typval.c @@ -3019,12 +3019,13 @@ static void tv_dict_list(typval_T *const tv, typval_T *const rettv, const DictLi emsg(_(e_dictreq)); return; } + + tv_list_alloc_ret(rettv, tv_dict_len(tv->vval.v_dict)); if (tv->vval.v_dict == NULL) { + // NULL dict behaves like an empty dict return; } - tv_list_alloc_ret(rettv, tv_dict_len(tv->vval.v_dict)); - TV_DICT_ITER(tv->vval.v_dict, di, { typval_T tv_item = { .v_lock = VAR_UNLOCKED }; |