diff options
author | erw7 <erw7.github@gmail.com> | 2021-09-11 11:48:58 +0900 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2022-02-26 14:01:38 +0100 |
commit | b87867e69e94d9784468a126f21c721446f080de (patch) | |
tree | 45f10fdbd731df8711eee3cafa1603a45749de05 /src/nvim/lua/converter.c | |
parent | d0f8f76224f501d919ba6c8a5cd717de76903b34 (diff) | |
download | rneovim-b87867e69e94d9784468a126f21c721446f080de.tar.gz rneovim-b87867e69e94d9784468a126f21c721446f080de.tar.bz2 rneovim-b87867e69e94d9784468a126f21c721446f080de.zip |
feat(lua): add proper support of luv threads
Diffstat (limited to 'src/nvim/lua/converter.c')
-rw-r--r-- | src/nvim/lua/converter.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/nvim/lua/converter.c b/src/nvim/lua/converter.c index 0fbd56ed53..47bc9ab91c 100644 --- a/src/nvim/lua/converter.c +++ b/src/nvim/lua/converter.c @@ -156,7 +156,7 @@ static LuaTableProps nlua_traverse_table(lua_State *const lstate) && ret.string_keys_num == 0)) { ret.type = kObjectTypeArray; if (tsize == 0 && lua_getmetatable(lstate, -1)) { - nlua_pushref(lstate, nlua_empty_dict_ref); + nlua_pushref(lstate, nlua_get_empty_dict_ref(lstate)); if (lua_rawequal(lstate, -2, -1)) { ret.type = kObjectTypeDictionary; } @@ -401,7 +401,7 @@ nlua_pop_typval_table_processing_end: } case LUA_TUSERDATA: { // TODO(bfredl): check mt.__call and convert to function? - nlua_pushref(lstate, nlua_nil_ref); + nlua_pushref(lstate, nlua_get_nil_ref(lstate)); bool is_nil = lua_rawequal(lstate, -2, -1); lua_pop(lstate, 1); if (is_nil) { @@ -445,7 +445,7 @@ static bool typval_conv_special = false; if (typval_conv_special) { \ lua_pushnil(lstate); \ } else { \ - nlua_pushref(lstate, nlua_nil_ref); \ + nlua_pushref(lstate, nlua_get_nil_ref(lstate)); \ } \ } while (0) @@ -495,7 +495,7 @@ static bool typval_conv_special = false; nlua_create_typed_table(lstate, 0, 0, kObjectTypeDictionary); \ } else { \ lua_createtable(lstate, 0, 0); \ - nlua_pushref(lstate, nlua_empty_dict_ref); \ + nlua_pushref(lstate, nlua_get_empty_dict_ref(lstate)); \ lua_setmetatable(lstate, -2); \ } \ } while (0) @@ -734,7 +734,7 @@ void nlua_push_Dictionary(lua_State *lstate, const Dictionary dict, bool special } else { lua_createtable(lstate, 0, (int)dict.size); if (dict.size == 0 && !special) { - nlua_pushref(lstate, nlua_empty_dict_ref); + nlua_pushref(lstate, nlua_get_empty_dict_ref(lstate)); lua_setmetatable(lstate, -2); } } @@ -782,7 +782,7 @@ void nlua_push_Object(lua_State *lstate, const Object obj, bool special) if (special) { lua_pushnil(lstate); } else { - nlua_pushref(lstate, nlua_nil_ref); + nlua_pushref(lstate, nlua_get_nil_ref(lstate)); } break; case kObjectTypeLuaRef: { @@ -1206,7 +1206,7 @@ Object nlua_pop_Object(lua_State *const lstate, bool ref, Error *const err) break; case LUA_TUSERDATA: { - nlua_pushref(lstate, nlua_nil_ref); + nlua_pushref(lstate, nlua_get_nil_ref(lstate)); bool is_nil = lua_rawequal(lstate, -2, -1); lua_pop(lstate, 1); if (is_nil) { |