aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authord9k <d9k@ya.ru>2018-05-04 15:14:14 +0300
committerd9k <d9k@ya.ru>2018-05-04 15:18:33 +0300
commita5ebacddc49660f97bfe5e97e3bdfd264803372f (patch)
tree6620d7f48c1344fe21182602e33efc7a16d3cbab
parent8f23fce49593deaab5de6c79598389fe86cd6e84 (diff)
downloadvalua-a5ebacddc49660f97bfe5e97e3bdfd264803372f.tar.gz
valua-a5ebacddc49660f97bfe5e97e3bdfd264803372f.tar.bz2
valua-a5ebacddc49660f97bfe5e97e3bdfd264803372f.zip
optional() stackable function+. fixed warnings locally with `luacheck --codes --std=max *.lua --ignore 211/_ENV`
-rw-r--r--valua.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/valua.lua b/valua.lua
index c9589f9..d4d62b9 100644
--- a/valua.lua
+++ b/valua.lua
@@ -54,7 +54,8 @@ function valua:new(obj)
-- __call will run only when the value is validated
self.__call = function(t,value)
local res = true
- local fres, err = nil
+ local err = nil
+ local fres
if value == nil and t.allow_nil then
return res, err