[tarantool-patches] [PATCH 1/3] box/console: Don't allow arguments in get_default_output

Cyrill Gorcunov gorcunov at gmail.com
Sat Jul 27 01:17:10 MSK 2019


The function

 | require('console').get_default_output()

requires no arguments. Make it explcicit and print
an error otherwise.

Part-of #3834
---
 src/box/lua/console.lua | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/box/lua/console.lua b/src/box/lua/console.lua
index d4f61865c..9258e7bbb 100644
--- a/src/box/lua/console.lua
+++ b/src/box/lua/console.lua
@@ -115,7 +115,11 @@ local function set_default_output(value)
     default_output_format["opts"] = opts
 end
 
-local function get_default_output()
+local function get_default_output(...)
+    local args = ...
+    if args ~= nil then
+        error("Arguments provided while prohibited")
+    end
     return default_output_format
 end
 
-- 
2.20.1





More information about the Tarantool-patches mailing list