patch 7.4.1154
Problem: No support for JSON.
Solution: Add jsonencode() and jsondecode(). Also add v:false, v:true,
v:null and v:none.
diff --git a/src/if_lua.c b/src/if_lua.c
index 46f881a..1c8512f 100644
--- a/src/if_lua.c
+++ b/src/if_lua.c
@@ -499,6 +499,12 @@
case VAR_DICT:
luaV_pushdict(L, tv->vval.v_dict);
break;
+ case VAR_SPECIAL:
+ if (tv->vval.v_number <= VVAL_TRUE)
+ lua_pushinteger(L, (int) tv->vval.v_number);
+ else
+ lua_pushnil(L);
+ break;
default:
lua_pushnil(L);
}
@@ -510,7 +516,7 @@
{
switch(lua_type(L, pos)) {
case LUA_TBOOLEAN:
- tv->v_type = VAR_NUMBER;
+ tv->v_type = VAR_SPECIAL;
tv->vval.v_number = (varnumber_T) lua_toboolean(L, pos);
break;
case LUA_TSTRING: