0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.0111: VAR_SPECIAL is also used for booleans

Problem:    VAR_SPECIAL is also used for booleans.
Solution:   Add VAR_BOOL for better type checking.
This commit is contained in:
Bram Moolenaar
2020-01-11 16:05:23 +01:00
parent e05a89ac63
commit 9b4a15d5db
16 changed files with 87 additions and 54 deletions

View File

@@ -535,6 +535,7 @@ luaV_pushtypval(lua_State *L, typval_T *tv)
case VAR_DICT:
luaV_pushdict(L, tv->vval.v_dict);
break;
case VAR_BOOL:
case VAR_SPECIAL:
if (tv->vval.v_number <= VVAL_TRUE)
lua_pushinteger(L, (int) tv->vval.v_number);
@@ -564,7 +565,7 @@ luaV_totypval(lua_State *L, int pos, typval_T *tv)
switch (lua_type(L, pos))
{
case LUA_TBOOLEAN:
tv->v_type = VAR_SPECIAL;
tv->v_type = VAR_BOOL;
tv->vval.v_number = (varnumber_T) lua_toboolean(L, pos);
break;
case LUA_TNIL: