Tarantool development patches archive
 help / color / mirror / Atom feed
From: Konstantin Osipov <kostja@tarantool.org>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: tml <tarantool-patches@freelists.org>,
	Alexander Turenko <alexander.turenko@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH 3/3] box/console: Test for nil value in args directly
Date: Sun, 28 Jul 2019 21:46:41 +0300	[thread overview]
Message-ID: <20190728184641.GC13676@atlas> (raw)
In-Reply-To: <20190726221712.11191-4-gorcunov@gmail.com>

* Cyrill Gorcunov <gorcunov@gmail.com> [19/07/27 01:21]:

> Instead of allocating a variable for optional args
> testing we should use dot notation instead. Otherwise
> it won't work for trivial test case as

Please remove extra "instead"

> 
> ```
> require('console').set_default_output('lua,block')
> require('decimal').new('1234.5678')
> ```
> 
>  | builtin/box/console.lua:47: expected decimal, number or string as 2 argument
> 
> and program exits.
> 
> Part-of #3834
> ---
>  src/box/lua/console.lua | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/src/box/lua/console.lua b/src/box/lua/console.lua
> index 0c521b44a..64086cf5b 100644
> --- a/src/box/lua/console.lua
> +++ b/src/box/lua/console.lua
> @@ -41,10 +41,9 @@ output_handlers["yaml"] = function(status, opts, ...)
>  end
>  
>  output_handlers["lua"] = function(status, opts, ...)
> -    local data = ...
>      --
>      -- Don't print nil if there is no data
> -    if data == nil then
> +    if not ... then
>          return ""
>      end
>      --

lgtm


-- 
Konstantin Osipov, Moscow, Russia

  reply	other threads:[~2019-07-28 18:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-26 22:17 [tarantool-patches] [PATCH 0/3] box/console: Cleanup and bug fix Cyrill Gorcunov
2019-07-26 22:17 ` [tarantool-patches] [PATCH 1/3] box/console: Don't allow arguments in get_default_output Cyrill Gorcunov
2019-07-28 18:44   ` [tarantool-patches] " Konstantin Osipov
2019-07-28 21:43     ` Cyrill Gorcunov
2019-07-26 22:17 ` [tarantool-patches] [PATCH 2/3] box/console: Drop redundant status parameter from return Cyrill Gorcunov
2019-07-28 18:44   ` [tarantool-patches] " Konstantin Osipov
2019-07-26 22:17 ` [tarantool-patches] [PATCH 3/3] box/console: Test for nil value in args directly Cyrill Gorcunov
2019-07-28 18:46   ` Konstantin Osipov [this message]
2019-07-28 18:47   ` [tarantool-patches] " Konstantin Osipov
2019-07-28 21:42     ` Cyrill Gorcunov
2019-08-02 12:59 ` [tarantool-patches] Re: [PATCH 0/3] box/console: Cleanup and bug fix Kirill Yukhin
2019-08-02 13:26   ` Cyrill Gorcunov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190728184641.GC13676@atlas \
    --to=kostja@tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH 3/3] box/console: Test for nil value in args directly' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox