diff options
author | ZyX <kp-pav@yandex.ru> | 2016-04-04 04:53:07 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2016-04-18 02:48:20 +0300 |
commit | bda0165514a582978c2da672b528562df78a2d1a (patch) | |
tree | 0077fb7bb71acb3c1de99324cd6f4f7af153dbd5 /src/nvim/eval.c | |
parent | c4f1b5a9383c00e0a23fdfdca096c569f05e8a1c (diff) | |
download | rneovim-bda0165514a582978c2da672b528562df78a2d1a.tar.gz rneovim-bda0165514a582978c2da672b528562df78a2d1a.tar.bz2 rneovim-bda0165514a582978c2da672b528562df78a2d1a.zip |
eval/encode: Make sure that encoder can encode NULL variables
Adds two undocumented v: variables: _null_list and _null_dict because I do not
know a reproducible way to get such lists (though I think I heard about this)
and dictionaries (do not remember hearing about them). NULL strings are obtained
using $XXX_UNEXISTENT_VAR_XXX.
Fixes crash in json_encode($XXX_UNEXISTENT_VAR_XXX). Other added tests worked
fine before this commit.
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 204c0fb1ef..aaad9fab34 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -379,6 +379,8 @@ static struct vimvar { VV(VV_FALSE, "false", VAR_SPECIAL, VV_RO), VV(VV_TRUE, "true", VAR_SPECIAL, VV_RO), VV(VV_NULL, "null", VAR_SPECIAL, VV_RO), + VV(VV__NULL_LIST, "_null_list", VAR_LIST, VV_RO), + VV(VV__NULL_DICT, "_null_dict", VAR_DICT, VV_RO), }; #undef VV |