From 15703a5b8264fb4f438a8028445f1750e48a9eaf Mon Sep 17 00:00:00 2001 From: Ignacio BurgueƱo Date: Wed, 12 Mar 2014 05:50:43 -0700 Subject: Fixes packing/unpacking with nil values Related to #1 --- valua.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/valua.lua b/valua.lua index e280af5..19d2251 100644 --- a/valua.lua +++ b/valua.lua @@ -36,7 +36,8 @@ function valua:new(obj) --saves a function named _ with its args in a funcs table, to be used later when validating return function(...) local args = {...} - local f = function(value) return valua['_'..k](value,unpack(args)) end + local n = select("#", ...) + local f = function(value) return valua['_'..k](value, unpack(args, 1, n)) end tinsert(t.funcs,f) return t end -- cgit v1.2.3-70-g09d2