luci-0.10: merge r8018

This commit is contained in:
Jo-Philipp Wich 2011-12-06 11:10:08 +00:00
parent ac68e2aff1
commit 63b1f034f7

View file

@ -761,10 +761,18 @@ end
local function _call(self, ...)
local func = getfenv()[self.name]
assert(func ~= nil,
'Cannot resolve function "' .. self.name .. '". Is it misspelled or local?')
assert(type(func) == "function",
'The symbol "' .. self.name .. '" does not refer to a function but data ' ..
'of type "' .. type(func) .. '".')
if #self.argv > 0 then
return getfenv()[self.name](unpack(self.argv), ...)
return func(unpack(self.argv), ...)
else
return getfenv()[self.name](...)
return func(...)
end
end