Commit Diff


commit - 859081df55ad5462f45ef463ff2f87d62cfe541a
commit + 255c808b4ba858f42db61dcd0277c8a4540a8324
blob - ec31e3cb6e4750f1740004ffb288b5cfa85ed791
blob + 14ade189ea41aa60e9f03371272234e38df4fb46
--- src/box/lua/console.c
+++ src/box/lua/console.c
@@ -969,9 +969,6 @@ tarantool_lua_console_init(struct lua_State *L)
 	 */
 	lua_setfield(L, -2, "formatter_lua");
 
-	/* Output formatter in Lua mode */
-	lua_serializer_init(L);
-
 	struct session_vtab console_session_vtab = {
 		.push	= console_session_push,
 		.fd	= console_session_fd,
blob - 588a90a4b3f41cb6ae43d97dff8394ba47055aa3
blob + 49fddb9193ffbff12fc8c82c6bac5599a0aabd7f
--- src/box/lua/serialize_lua.c
+++ src/box/lua/serialize_lua.c
@@ -51,9 +51,6 @@ static_assert(DT_IVAL_TO_STRING_BUFSIZE > FPCONV_G_FMT
 	      "Buffer is too small");
 static_assert(DT_IVAL_TO_STRING_BUFSIZE > DT_TO_STRING_BUFSIZE,
 	      "Buffer is too small");
-
-/* Serializer for Lua output mode */
-static struct luaL_serializer *serializer_lua;
 
 enum {
 	NODE_NONE_BIT		= 0,
@@ -1035,35 +1032,4 @@ lua_parse_opts(lua_State *L, lua_dumper_opts_t *opts)
 	if (lua_isnumber(L, -1))
 		opts->indent_lvl = (int)lua_tonumber(L, -1);
 	lua_pop(L, 1);
-}
-
-/**
- * Initialize Lua serializer.
- */
-void
-lua_serializer_init(struct lua_State *L)
-{
-	/*
-	 * We don't export it as a module
-	 * for a while, so the library
-	 * is kept empty.
-	 */
-	static const luaL_Reg lualib[] = {
-		{
-			.name = NULL,
-		},
-	};
-
-	serializer_lua = luaL_newserializer(L, NULL, lualib);
-	serializer_lua->has_compact		= 1;
-	serializer_lua->encode_invalid_numbers	= 1;
-	serializer_lua->encode_load_metatables	= 1;
-	serializer_lua->encode_use_tostring	= 1;
-	serializer_lua->encode_invalid_as_nil	= 1;
-
-	/*
-	 * Keep a reference to this module so it
-	 * won't be unloaded.
-	 */
-	lua_setfield(L, -2, "formatter_lua");
 }
blob - 923e13be9267c6f5f3180e52edff1ef9d0ceb8b2
blob + 24bc79a01f161821966c8330e6d9cf3df9ba8534
--- src/box/lua/serialize_lua.h
+++ src/box/lua/serialize_lua.h
@@ -50,9 +50,6 @@ typedef struct {
 	bool block_mode;
 } lua_dumper_opts_t;
 
-void
-lua_serializer_init(struct lua_State *L);
-
 int
 lua_encode(lua_State *L, struct luaL_serializer *serializer,
 	   lua_dumper_opts_t *opts);